Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
ef0159f
chore: use Pydantic to generate OpenAPI schema
stainless-app[bot] Nov 14, 2025
d1a3652
fix(openapi): restore embedded request wrappers
stainless-app[bot] Nov 17, 2025
0ff751c
codegen metadata
stainless-app[bot] Nov 17, 2025
eaa165c
feat: Wire through parallel_tool_calls to Responses API
stainless-app[bot] Nov 18, 2025
e5041ce
fix(client): correctly specify Accept header with */* instead of empty
stainless-app[bot] Nov 19, 2025
7539880
fix: Pydantic validation error with list-type metadata in vector sear…
stainless-app[bot] Nov 19, 2025
dff3ad7
codegen metadata
stainless-app[bot] Dec 1, 2025
40e2322
feat: Add metadata field to request and response
stainless-app[bot] Dec 1, 2025
a1bf3a4
feat(api): deprecate `toolgroup` and `tool_runtime` apis
stainless-app[bot] Dec 1, 2025
79287a7
feat: Implement FastAPI router system
stainless-app[bot] Dec 3, 2025
4b368be
fix(client): fix issue with duplicate definitions in Go
stainless-app[bot] Dec 3, 2025
de0c9d9
chore(internal): codegen related update
stainless-app[bot] Dec 6, 2025
fe02071
chore: elide duplicate aliases
stainless-app[bot] Dec 6, 2025
69a2283
fix(mcp): correct code tool API endpoint
stainless-app[bot] Dec 6, 2025
185cff3
fix: rename param to avoid collision
stainless-app[bot] Dec 6, 2025
c64b27d
feat: convert Benchmarks API to use FastAPI router
stainless-app[bot] Dec 10, 2025
d10a918
feat(api): add readonly connectors API
stainless-app[bot] Dec 11, 2025
45eda95
feat: Implement include parameter specifically for adding logprobs in…
stainless-app[bot] Dec 11, 2025
97fd8b2
feat(encoder): support bracket encoding form-data object members
stainless-app[bot] Dec 12, 2025
703cd5b
codegen metadata
stainless-app[bot] Dec 14, 2025
cb5dfe0
release: 0.4.0-alpha.2
stainless-app[bot] Dec 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.4.0-alpha.1"
".": "0.4.0-alpha.2"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 96
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/llamastack%2Fllama-stack-client-602ce64aa309cc15fa09388d99c9f298795686fc37605237cbc03c39d29aabf6.yml
openapi_spec_hash: fc6995247b2555e8660bc9291eb10415
config_hash: e8a35d9d37cb4774b4b0fe1b167dc156
configured_endpoints: 103
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/llamastack%2Fllama-stack-client-2ab91951d2e9eb5826722654cbd60469dd4c97d61001fd3447f1b76a8a968a05.yml
openapi_spec_hash: 74a8bcd7a79e69299b452d63e20ddf46
config_hash: 39578cfdeb4a10121f2cb3fa3e4d5e20
34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,39 @@
# Changelog

## 0.4.0-alpha.2 (2025-12-14)

Full Changelog: [v0.4.0-alpha.1...v0.4.0-alpha.2](https://github.com/llamastack/llama-stack-client-go/compare/v0.4.0-alpha.1...v0.4.0-alpha.2)

### Features

* Add metadata field to request and response ([40e2322](https://github.com/llamastack/llama-stack-client-go/commit/40e232274eb4ce4a02927891c3d076b75f05b4ce))
* **api:** add readonly connectors API ([d10a918](https://github.com/llamastack/llama-stack-client-go/commit/d10a918772ceeb8059340d7e7e0905f837f83131))
* **api:** deprecate `toolgroup` and `tool_runtime` apis ([a1bf3a4](https://github.com/llamastack/llama-stack-client-go/commit/a1bf3a4f18acf63730208b92808c1a05ef9abcfa))
* convert Benchmarks API to use FastAPI router ([c64b27d](https://github.com/llamastack/llama-stack-client-go/commit/c64b27d4c45cc0d956a3abf86fa65c209e858795))
* **encoder:** support bracket encoding form-data object members ([97fd8b2](https://github.com/llamastack/llama-stack-client-go/commit/97fd8b246e8a9de6952c9ddcfd31f5832d9c79bb))
* Implement FastAPI router system ([79287a7](https://github.com/llamastack/llama-stack-client-go/commit/79287a753e70992d4c2fb272b347d6d718193278))
* Implement include parameter specifically for adding logprobs in the output message ([45eda95](https://github.com/llamastack/llama-stack-client-go/commit/45eda95f3ed6b647f02037c3d08f9447e82b7bbc))
* Wire through parallel_tool_calls to Responses API ([eaa165c](https://github.com/llamastack/llama-stack-client-go/commit/eaa165c2c627190f21a30fdb54b738b0a76711f3))


### Bug Fixes

* **client:** correctly specify Accept header with */* instead of empty ([e5041ce](https://github.com/llamastack/llama-stack-client-go/commit/e5041ce562316eb7caafd32cb55269c754581d7e))
* **client:** fix issue with duplicate definitions in Go ([4b368be](https://github.com/llamastack/llama-stack-client-go/commit/4b368be02d6b4b13207b2f406eb85211ad911317))
* **mcp:** correct code tool API endpoint ([69a2283](https://github.com/llamastack/llama-stack-client-go/commit/69a22835be10196d477118fce60dedf59e2e032c))
* **openapi:** restore embedded request wrappers ([d1a3652](https://github.com/llamastack/llama-stack-client-go/commit/d1a36526f794bbcf096f9a725fd328420fff3bb4))
* Pydantic validation error with list-type metadata in vector search ([#3797](https://github.com/llamastack/llama-stack-client-go/issues/3797)) ([7539880](https://github.com/llamastack/llama-stack-client-go/commit/75398807b92fb7566e679a69a949f0859810a5c4))
* rename param to avoid collision ([185cff3](https://github.com/llamastack/llama-stack-client-go/commit/185cff3098fb3f18b0f88849236c464d356f9f80))


### Chores

* add copyright header as pre-commit hook ([#22](https://github.com/llamastack/llama-stack-client-go/issues/22)) ([6d87900](https://github.com/llamastack/llama-stack-client-go/commit/6d8790031ca42588b65c6e56f559a61b4e909852))
* elide duplicate aliases ([fe02071](https://github.com/llamastack/llama-stack-client-go/commit/fe02071f3ecded66d669bd7f365fecfe3c932273))
* **internal:** codegen related update ([de0c9d9](https://github.com/llamastack/llama-stack-client-go/commit/de0c9d9740c1ce66108f4da34d7e781cf6bc7f4a))
* run precommit on pull request as well ([#23](https://github.com/llamastack/llama-stack-client-go/issues/23)) ([6c50f0c](https://github.com/llamastack/llama-stack-client-go/commit/6c50f0c5a6e4c091c2f91c8f42625eab1d010683))
* use Pydantic to generate OpenAPI schema ([ef0159f](https://github.com/llamastack/llama-stack-client-go/commit/ef0159fc37971d1fbcbaff773f81d2d68fe44516))

## 0.4.0-alpha.1 (2025-11-14)

Full Changelog: [v0.1.0-alpha.1...v0.4.0-alpha.1](https://github.com/llamastack/llama-stack-client-go/compare/v0.1.0-alpha.1...v0.4.0-alpha.1)
Expand Down
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Or to pin the version:
<!-- x-release-please-start-version -->

```sh
go get -u 'github.com/llamastack/[email protected].1'
go get -u 'github.com/llamastack/[email protected].2'
```

<!-- x-release-please-end -->
Expand All @@ -53,13 +53,11 @@ import (

func main() {
client := llamastackclient.NewClient()
response, err := client.Models.Register(context.TODO(), llamastackclient.ModelRegisterParams{
ModelID: "model_id",
})
models, err := client.Models.List(context.TODO())
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Identifier)
fmt.Printf("%+v\n", models)
}

```
Expand Down Expand Up @@ -302,6 +300,7 @@ _, err := client.Chat.Completions.New(context.TODO(), llamastackclient.ChatCompl
Content: llamastackclient.ChatCompletionNewParamsMessageUserContentUnion{
OfString: llamastackclient.String("string"),
},
Role: "user",
},
}},
Model: "model",
Expand Down Expand Up @@ -338,6 +337,7 @@ client.Chat.Completions.New(
Content: llamastackclient.ChatCompletionNewParamsMessageUserContentUnion{
OfString: llamastackclient.String("string"),
},
Role: "user",
},
}},
Model: "model",
Expand Down Expand Up @@ -404,6 +404,7 @@ client.Chat.Completions.New(
Content: llamastackclient.ChatCompletionNewParamsMessageUserContentUnion{
OfString: llamastackclient.String("string"),
},
Role: "user",
},
}},
Model: "model",
Expand All @@ -428,6 +429,7 @@ completion, err := client.Chat.Completions.New(
Content: llamastackclient.ChatCompletionNewParamsMessageUserContentUnion{
OfString: llamastackclient.String("string"),
},
Role: "user",
},
}},
Model: "model",
Expand Down
7 changes: 0 additions & 7 deletions aliases.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,6 @@ package llamastackclient

import (
"github.com/llamastack/llama-stack-client-go/internal/apierror"
"github.com/llamastack/llama-stack-client-go/packages/param"
)

// aliased to make [param.APIUnion] private when embedding
type paramUnion = param.APIUnion

// aliased to make [param.APIObject] private when embedding
type paramObj = param.APIObject

type Error = apierror.Error
136 changes: 40 additions & 96 deletions alphabenchmark.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

import (
"context"
"encoding/json"
"errors"
"fmt"
"net/http"
Expand All @@ -21,7 +20,6 @@
"github.com/llamastack/llama-stack-client-go/option"
"github.com/llamastack/llama-stack-client-go/packages/param"
"github.com/llamastack/llama-stack-client-go/packages/respjson"
"github.com/llamastack/llama-stack-client-go/shared/constant"
)

// AlphaBenchmarkService contains methods and other services that help with
Expand Down Expand Up @@ -73,34 +71,54 @@
// Deprecated: deprecated
func (r *AlphaBenchmarkService) Register(ctx context.Context, body AlphaBenchmarkRegisterParams, opts ...option.RequestOption) (err error) {
opts = slices.Concat(r.Options, opts)
opts = append([]option.RequestOption{option.WithHeader("Accept", "")}, opts...)
opts = append([]option.RequestOption{option.WithHeader("Accept", "*/*")}, opts...)
path := "v1alpha/eval/benchmarks"
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, nil, opts...)
return
}

// Unregister a benchmark.
//
// Deprecated: deprecated
func (r *AlphaBenchmarkService) Unregister(ctx context.Context, benchmarkID string, opts ...option.RequestOption) (err error) {
opts = slices.Concat(r.Options, opts)
opts = append([]option.RequestOption{option.WithHeader("Accept", "*/*")}, opts...)
if benchmarkID == "" {
err = errors.New("missing required benchmark_id parameter")
return
}
path := fmt.Sprintf("v1alpha/eval/benchmarks/%s", benchmarkID)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, nil, opts...)
return
}

// A benchmark resource for evaluating model performance.
type Benchmark struct {
// Identifier of the dataset to use for the benchmark evaluation
DatasetID string `json:"dataset_id,required"`
// Identifier of the dataset to use for the benchmark evaluation.
DatasetID string `json:"dataset_id,required"`
// Unique identifier for this resource in llama stack
Identifier string `json:"identifier,required"`
// Metadata for this evaluation task
Metadata map[string]BenchmarkMetadataUnion `json:"metadata,required"`
ProviderID string `json:"provider_id,required"`
// List of scoring function identifiers to apply during evaluation
// ID of the provider that owns this resource
ProviderID string `json:"provider_id,required"`
// List of scoring function identifiers to apply during evaluation.
ScoringFunctions []string `json:"scoring_functions,required"`
// The resource type, always benchmark
Type constant.Benchmark `json:"type,required"`
ProviderResourceID string `json:"provider_resource_id"`
// Metadata for this evaluation task.
Metadata map[string]any `json:"metadata"`
// Unique identifier for this resource in the provider
ProviderResourceID string `json:"provider_resource_id,nullable"`
// The resource type, always benchmark.
//
// Any of "benchmark".
Type BenchmarkType `json:"type"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
DatasetID respjson.Field
Identifier respjson.Field
Metadata respjson.Field
ProviderID respjson.Field
ScoringFunctions respjson.Field
Type respjson.Field
Metadata respjson.Field
ProviderResourceID respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
raw string
} `json:"-"`
Expand All @@ -112,59 +130,16 @@
return apijson.UnmarshalRoot(data, r)
}

// BenchmarkMetadataUnion contains all possible properties and values from [bool],
// [float64], [string], [[]any].
//
// Use the methods beginning with 'As' to cast the union to one of its variants.
//
// If the underlying value is not a json object, one of the following properties
// will be valid: OfBool OfFloat OfString OfAnyArray]
type BenchmarkMetadataUnion struct {
// This field will be present if the value is a [bool] instead of an object.
OfBool bool `json:",inline"`
// This field will be present if the value is a [float64] instead of an object.
OfFloat float64 `json:",inline"`
// This field will be present if the value is a [string] instead of an object.
OfString string `json:",inline"`
// This field will be present if the value is a [[]any] instead of an object.
OfAnyArray []any `json:",inline"`
JSON struct {
OfBool respjson.Field
OfFloat respjson.Field
OfString respjson.Field
OfAnyArray respjson.Field
raw string
} `json:"-"`
}

func (u BenchmarkMetadataUnion) AsBool() (v bool) {
apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v)
return
}

func (u BenchmarkMetadataUnion) AsFloat() (v float64) {
apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v)
return
}

func (u BenchmarkMetadataUnion) AsString() (v string) {
apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v)
return
}

func (u BenchmarkMetadataUnion) AsAnyArray() (v []any) {
apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v)
return
}

// Returns the unmodified JSON received from the API
func (u BenchmarkMetadataUnion) RawJSON() string { return u.JSON.raw }
// The resource type, always benchmark.
type BenchmarkType string

func (r *BenchmarkMetadataUnion) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}
const (
BenchmarkTypeBenchmark BenchmarkType = "benchmark"
)

// Response containing a list of benchmark objects.
type ListBenchmarksResponse struct {
// List of benchmark objects.
Data []Benchmark `json:"data,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Expand Down Expand Up @@ -192,8 +167,8 @@
// The ID of the provider to use for the benchmark.
ProviderID param.Opt[string] `json:"provider_id,omitzero"`
// The metadata to use for the benchmark.
Metadata map[string]AlphaBenchmarkRegisterParamsMetadataUnion `json:"metadata,omitzero"`
Metadata map[string]any `json:"metadata,omitzero"`
paramObj

Check failure on line 171 in alphabenchmark.go

View workflow job for this annotation

GitHub Actions / lint

undefined: paramObj

Check failure on line 171 in alphabenchmark.go

View workflow job for this annotation

GitHub Actions / test

undefined: paramObj
}

func (r AlphaBenchmarkRegisterParams) MarshalJSON() (data []byte, err error) {
Expand All @@ -203,34 +178,3 @@
func (r *AlphaBenchmarkRegisterParams) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}

// Only one field can be non-zero.
//
// Use [param.IsOmitted] to confirm if a field is set.
type AlphaBenchmarkRegisterParamsMetadataUnion struct {
OfBool param.Opt[bool] `json:",omitzero,inline"`
OfFloat param.Opt[float64] `json:",omitzero,inline"`
OfString param.Opt[string] `json:",omitzero,inline"`
OfAnyArray []any `json:",omitzero,inline"`
paramUnion
}

func (u AlphaBenchmarkRegisterParamsMetadataUnion) MarshalJSON() ([]byte, error) {
return param.MarshalUnion(u, u.OfBool, u.OfFloat, u.OfString, u.OfAnyArray)
}
func (u *AlphaBenchmarkRegisterParamsMetadataUnion) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, u)
}

func (u *AlphaBenchmarkRegisterParamsMetadataUnion) asAny() any {
if !param.IsOmitted(u.OfBool) {
return &u.OfBool.Value
} else if !param.IsOmitted(u.OfFloat) {
return &u.OfFloat.Value
} else if !param.IsOmitted(u.OfString) {
return &u.OfString.Value
} else if !param.IsOmitted(u.OfAnyArray) {
return &u.OfAnyArray
}
return nil
}
27 changes: 23 additions & 4 deletions alphabenchmark_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,8 @@ func TestAlphaBenchmarkRegisterWithOptionalParams(t *testing.T) {
BenchmarkID: "benchmark_id",
DatasetID: "dataset_id",
ScoringFunctions: []string{"string"},
Metadata: map[string]llamastackclient.AlphaBenchmarkRegisterParamsMetadataUnion{
"foo": {
OfBool: llamastackclient.Bool(true),
},
Metadata: map[string]any{
"foo": "bar",
},
ProviderBenchmarkID: llamastackclient.String("provider_benchmark_id"),
ProviderID: llamastackclient.String("provider_id"),
Expand All @@ -92,3 +90,24 @@ func TestAlphaBenchmarkRegisterWithOptionalParams(t *testing.T) {
t.Fatalf("err should be nil: %s", err.Error())
}
}

func TestAlphaBenchmarkUnregister(t *testing.T) {
baseURL := "http://localhost:4010"
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
baseURL = envURL
}
if !testutil.CheckTestServer(t, baseURL) {
return
}
client := llamastackclient.NewClient(
option.WithBaseURL(baseURL),
)
err := client.Alpha.Benchmarks.Unregister(context.TODO(), "benchmark_id")
if err != nil {
var apierr *llamastackclient.Error
if errors.As(err, &apierr) {
t.Log(string(apierr.DumpRequest(true)))
}
t.Fatalf("err should be nil: %s", err.Error())
}
}
Loading