Skip to content
Open
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.1.0-alpha.1"
".": "0.1.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: 106
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/llamastack%2Fllama-stack-client-4f6633567c1a079df49d0cf58f37251a4bb0ee2f2a496ac83c9fee26eb325f9c.yml
openapi_spec_hash: af5b3d3bbecf48f15c90b982ccac852e
config_hash: ddcbd66d7ac80290da208232a746e30f
configured_endpoints: 107
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/llamastack%2Fllama-stack-client-f252873ea1e1f38fd207331ef2621c511154d5be3f4076e59cc15754fc58eee4.yml
openapi_spec_hash: 10cbb4337a06a9fdd7d08612dd6044c3
config_hash: 374d9711288576877a9fabb34e4da7b9
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
# Changelog

## 0.1.0-alpha.2 (2025-09-06)

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

### Features

* **api:** fix completion response breakage perhaps? ([3e9c39f](https://github.com/llamastack/llama-stack-client-go/commit/3e9c39f1bf837daf2487ec2c465a9522e6b5befe))
* **api:** manual updates ([9de5708](https://github.com/llamastack/llama-stack-client-go/commit/9de5708ab28e06c58731c3ac57c3e4c4fbc12aca))
* **api:** query_metrics, batches, changes ([06e03be](https://github.com/llamastack/llama-stack-client-go/commit/06e03be805d93736fcf4f848c5f9888e2871c911))
* **api:** some updates to query metrics ([8243d43](https://github.com/llamastack/llama-stack-client-go/commit/8243d43dfa43bb9ec92d1edbed36f114240a265e))


### Bug Fixes

* **client:** fix circular dependencies and offset pagination ([0b95836](https://github.com/llamastack/llama-stack-client-go/commit/0b95836016ca0d089d3f7c07456ff5f55989011f))
* close body before retrying ([66adbea](https://github.com/llamastack/llama-stack-client-go/commit/66adbea266032b1198c76c8f590808d61a3d145a))
* **internal:** unmarshal correctly when there are multiple discriminators ([d76c69c](https://github.com/llamastack/llama-stack-client-go/commit/d76c69c30d1402e13178448691d8202e6f2b5d82))


### Chores

* **internal:** codegen related update ([a3cccf1](https://github.com/llamastack/llama-stack-client-go/commit/a3cccf10d30121514bb6b07a6416c589a1881763))

## 0.1.0-alpha.1 (2025-08-21)

Full Changelog: [v0.0.1-alpha.0...v0.1.0-alpha.1](https://github.com/llamastack/llama-stack-client-go/compare/v0.0.1-alpha.0...v0.1.0-alpha.1)
Expand Down
30 changes: 17 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# Llama Stack Client Go API Library

<!-- x-release-please-start-version -->

<a href="https://pkg.go.dev/github.com/llamastack/llama-stack-client-go"><img src="https://pkg.go.dev/badge/github.com/llamastack/llama-stack-client-go.svg" alt="Go Reference"></a>

<!-- x-release-please-end -->

The Llama Stack Client Go library provides convenient access to the [Llama Stack Client REST API](https://llama-stack.readthedocs.io/en/latest/)
from applications written in Go.

Expand All @@ -24,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 Down Expand Up @@ -293,9 +297,9 @@ To handle errors, we recommend that you use the `errors.As` pattern:

```go
_, err := client.Inference.ChatCompletion(context.TODO(), llamastackclient.InferenceChatCompletionParams{
Messages: []shared.MessageUnionParam{{
OfUser: &shared.UserMessageParam{
Content: shared.InterleavedContentUnionParam{
Messages: []llamastackclient.MessageUnionParam{{
OfUser: &llamastackclient.UserMessageParam{
Content: llamastackclient.InterleavedContentUnionParam{
OfString: llamastackclient.String("string"),
},
},
Expand Down Expand Up @@ -329,9 +333,9 @@ defer cancel()
client.Inference.ChatCompletion(
ctx,
llamastackclient.InferenceChatCompletionParams{
Messages: []shared.MessageUnionParam{{
OfUser: &shared.UserMessageParam{
Content: shared.InterleavedContentUnionParam{
Messages: []llamastackclient.MessageUnionParam{{
OfUser: &llamastackclient.UserMessageParam{
Content: llamastackclient.InterleavedContentUnionParam{
OfString: llamastackclient.String("string"),
},
},
Expand Down Expand Up @@ -395,9 +399,9 @@ client := llamastackclient.NewClient(
client.Inference.ChatCompletion(
context.TODO(),
llamastackclient.InferenceChatCompletionParams{
Messages: []shared.MessageUnionParam{{
OfUser: &shared.UserMessageParam{
Content: shared.InterleavedContentUnionParam{
Messages: []llamastackclient.MessageUnionParam{{
OfUser: &llamastackclient.UserMessageParam{
Content: llamastackclient.InterleavedContentUnionParam{
OfString: llamastackclient.String("string"),
},
},
Expand All @@ -419,9 +423,9 @@ var response *http.Response
chatCompletionResponse, err := client.Inference.ChatCompletion(
context.TODO(),
llamastackclient.InferenceChatCompletionParams{
Messages: []shared.MessageUnionParam{{
OfUser: &shared.UserMessageParam{
Content: shared.InterleavedContentUnionParam{
Messages: []llamastackclient.MessageUnionParam{{
OfUser: &llamastackclient.UserMessageParam{
Content: llamastackclient.InterleavedContentUnionParam{
OfString: llamastackclient.String("string"),
},
},
Expand Down
17 changes: 8 additions & 9 deletions agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
"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"
"github.com/llamastack/llama-stack-client-go/shared/constant"
)

Expand Down Expand Up @@ -90,7 +89,7 @@ func (r *AgentService) Delete(ctx context.Context, agentID string, opts ...optio
// An inference step in an agent turn.
type InferenceStep struct {
// The response from the LLM.
ModelResponse shared.CompletionMessage `json:"model_response,required"`
ModelResponse CompletionMessage `json:"model_response,required"`
// The ID of the step.
StepID string `json:"step_id,required"`
// Type of the step in an agent turn.
Expand Down Expand Up @@ -123,7 +122,7 @@ func (r *InferenceStep) UnmarshalJSON(data []byte) error {
// A memory retrieval step in an agent turn.
type MemoryRetrievalStep struct {
// The context retrieved from the vector databases.
InsertedContext shared.InterleavedContentUnion `json:"inserted_context,required"`
InsertedContext InterleavedContentUnion `json:"inserted_context,required"`
// The ID of the step.
StepID string `json:"step_id,required"`
// Type of the step in an agent turn.
Expand Down Expand Up @@ -169,7 +168,7 @@ type ShieldCallStep struct {
// The time the step started.
StartedAt time.Time `json:"started_at" format:"date-time"`
// The violation from the shield call.
Violation shared.SafetyViolation `json:"violation"`
Violation SafetyViolation `json:"violation"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
StepID respjson.Field
Expand All @@ -196,7 +195,7 @@ type ToolExecutionStep struct {
// Type of the step in an agent turn.
StepType constant.ToolExecution `json:"step_type,required"`
// The tool calls to execute.
ToolCalls []shared.ToolCall `json:"tool_calls,required"`
ToolCalls []ToolCall `json:"tool_calls,required"`
// The tool responses from the tool calls.
ToolResponses []ToolResponse `json:"tool_responses,required"`
// The ID of the turn.
Expand Down Expand Up @@ -230,7 +229,7 @@ type ToolResponse struct {
// Unique identifier for the tool call this response is for
CallID string `json:"call_id,required"`
// The response content from the tool
Content shared.InterleavedContentUnion `json:"content,required"`
Content InterleavedContentUnion `json:"content,required"`
// Name of the tool that was invoked
ToolName ToolResponseToolName `json:"tool_name,required"`
// (Optional) Additional metadata about the tool response
Expand Down Expand Up @@ -330,7 +329,7 @@ type ToolResponseParam struct {
// Unique identifier for the tool call this response is for
CallID string `json:"call_id,required"`
// The response content from the tool
Content shared.InterleavedContentUnionParam `json:"content,omitzero,required"`
Content InterleavedContentUnionParam `json:"content,omitzero,required"`
// Name of the tool that was invoked
ToolName ToolResponseToolName `json:"tool_name,omitzero,required"`
// (Optional) Additional metadata about the tool response
Expand Down Expand Up @@ -398,7 +397,7 @@ func (r *AgentNewResponse) UnmarshalJSON(data []byte) error {
// An agent instance with configuration and metadata.
type AgentGetResponse struct {
// Configuration settings for the agent
AgentConfig shared.AgentConfig `json:"agent_config,required"`
AgentConfig AgentConfig `json:"agent_config,required"`
// Unique identifier for the agent
AgentID string `json:"agent_id,required"`
// Timestamp when the agent was created
Expand Down Expand Up @@ -497,7 +496,7 @@ func (r *AgentListResponseDataUnion) UnmarshalJSON(data []byte) error {

type AgentNewParams struct {
// The configuration for the agent.
AgentConfig shared.AgentConfigParam `json:"agent_config,omitzero,required"`
AgentConfig AgentConfigParam `json:"agent_config,omitzero,required"`
paramObj
}

Expand Down
31 changes: 15 additions & 16 deletions agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"github.com/llamastack/llama-stack-client-go"
"github.com/llamastack/llama-stack-client-go/internal/testutil"
"github.com/llamastack/llama-stack-client-go/option"
"github.com/llamastack/llama-stack-client-go/shared"
)

func TestAgentNewWithOptionalParams(t *testing.T) {
Expand All @@ -26,23 +25,23 @@ func TestAgentNewWithOptionalParams(t *testing.T) {
option.WithBaseURL(baseURL),
)
_, err := client.Agents.New(context.TODO(), llamastackclient.AgentNewParams{
AgentConfig: shared.AgentConfigParam{
AgentConfig: llamastackclient.AgentConfigParam{
Instructions: "instructions",
Model: "model",
ClientTools: []shared.SharedToolDefParam{{
ClientTools: []llamastackclient.ToolDefParam{{
Name: "name",
Description: llamastackclient.String("description"),
Metadata: map[string]shared.SharedToolDefMetadataUnionParam{
Metadata: map[string]llamastackclient.ToolDefMetadataUnionParam{
"foo": {
OfBool: llamastackclient.Bool(true),
},
},
Parameters: []shared.SharedToolDefParameterParam{{
Parameters: []llamastackclient.ToolDefParameterParam{{
Description: "description",
Name: "name",
ParameterType: "parameter_type",
Required: true,
Default: shared.SharedToolDefParameterDefaultUnionParam{
Default: llamastackclient.ToolDefParameterDefaultUnionParam{
OfBool: llamastackclient.Bool(true),
},
}},
Expand All @@ -52,31 +51,31 @@ func TestAgentNewWithOptionalParams(t *testing.T) {
MaxInferIters: llamastackclient.Int(0),
Name: llamastackclient.String("name"),
OutputShields: []string{"string"},
ResponseFormat: shared.ResponseFormatUnionParam{
OfJsonSchema: &shared.ResponseFormatJsonSchemaParam{
JsonSchema: map[string]shared.ResponseFormatJsonSchemaJsonSchemaUnionParam{
ResponseFormat: llamastackclient.ResponseFormatUnionParam{
OfJsonSchema: &llamastackclient.ResponseFormatJsonSchemaParam{
JsonSchema: map[string]llamastackclient.ResponseFormatJsonSchemaJsonSchemaUnionParam{
"foo": {
OfBool: llamastackclient.Bool(true),
},
},
},
},
SamplingParams: shared.SamplingParams{
Strategy: shared.SamplingParamsStrategyUnion{
OfGreedy: &shared.SamplingParamsStrategyGreedy{},
SamplingParams: llamastackclient.SamplingParams{
Strategy: llamastackclient.SamplingParamsStrategyUnion{
OfGreedy: &llamastackclient.SamplingParamsStrategyGreedy{},
},
MaxTokens: llamastackclient.Int(0),
RepetitionPenalty: llamastackclient.Float(0),
Stop: []string{"string"},
},
ToolChoice: shared.AgentConfigToolChoiceAuto,
ToolConfig: shared.AgentConfigToolConfigParam{
ToolChoice: llamastackclient.AgentConfigToolChoiceAuto,
ToolConfig: llamastackclient.AgentConfigToolConfigParam{
SystemMessageBehavior: "append",
ToolChoice: "auto",
ToolPromptFormat: "json",
},
ToolPromptFormat: shared.AgentConfigToolPromptFormatJson,
Toolgroups: []shared.AgentConfigToolgroupUnionParam{{
ToolPromptFormat: llamastackclient.AgentConfigToolPromptFormatJson,
Toolgroups: []llamastackclient.AgentConfigToolgroupUnionParam{{
OfString: llamastackclient.String("string"),
}},
},
Expand Down
11 changes: 5 additions & 6 deletions agentstep.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
"github.com/llamastack/llama-stack-client-go/internal/requestconfig"
"github.com/llamastack/llama-stack-client-go/option"
"github.com/llamastack/llama-stack-client-go/packages/respjson"
"github.com/llamastack/llama-stack-client-go/shared"
)

// AgentStepService contains methods and other services that help with interacting
Expand Down Expand Up @@ -86,21 +85,21 @@ func (r *AgentStepGetResponse) UnmarshalJSON(data []byte) error {
// Use the methods beginning with 'As' to cast the union to one of its variants.
type AgentStepGetResponseStepUnion struct {
// This field is from variant [InferenceStep].
ModelResponse shared.CompletionMessage `json:"model_response"`
StepID string `json:"step_id"`
ModelResponse CompletionMessage `json:"model_response"`
StepID string `json:"step_id"`
// Any of "inference", "tool_execution", "shield_call", "memory_retrieval".
StepType string `json:"step_type"`
TurnID string `json:"turn_id"`
CompletedAt time.Time `json:"completed_at"`
StartedAt time.Time `json:"started_at"`
// This field is from variant [ToolExecutionStep].
ToolCalls []shared.ToolCall `json:"tool_calls"`
ToolCalls []ToolCall `json:"tool_calls"`
// This field is from variant [ToolExecutionStep].
ToolResponses []ToolResponse `json:"tool_responses"`
// This field is from variant [ShieldCallStep].
Violation shared.SafetyViolation `json:"violation"`
Violation SafetyViolation `json:"violation"`
// This field is from variant [MemoryRetrievalStep].
InsertedContext shared.InterleavedContentUnion `json:"inserted_context"`
InsertedContext InterleavedContentUnion `json:"inserted_context"`
// This field is from variant [MemoryRetrievalStep].
VectorDBIDs string `json:"vector_db_ids"`
JSON struct {
Expand Down
Loading