shared

package
v0.1.0-alpha.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 22, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentConfig

type AgentConfig struct {
	// The system instructions for the agent
	Instructions string `json:"instructions,required"`
	// The model identifier to use for the agent
	Model       string          `json:"model,required"`
	ClientTools []SharedToolDef `json:"client_tools"`
	// Optional flag indicating whether session data has to be persisted
	EnableSessionPersistence bool     `json:"enable_session_persistence"`
	InputShields             []string `json:"input_shields"`
	MaxInferIters            int64    `json:"max_infer_iters"`
	// Optional name for the agent, used in telemetry and identification
	Name          string   `json:"name"`
	OutputShields []string `json:"output_shields"`
	// Optional response format configuration
	ResponseFormat ResponseFormatUnion `json:"response_format"`
	// Sampling parameters.
	SamplingParams SamplingParamsResp `json:"sampling_params"`
	// Whether tool use is required or automatic. This is a hint to the model which may
	// not be followed. It depends on the Instruction Following capabilities of the
	// model.
	//
	// Any of "auto", "required", "none".
	//
	// Deprecated: deprecated
	ToolChoice AgentConfigToolChoice `json:"tool_choice"`
	// Configuration for tool use.
	ToolConfig AgentConfigToolConfig `json:"tool_config"`
	// Prompt format for calling custom / zero shot tools.
	//
	// Any of "json", "function_tag", "python_list".
	//
	// Deprecated: deprecated
	ToolPromptFormat AgentConfigToolPromptFormat `json:"tool_prompt_format"`
	Toolgroups       []AgentConfigToolgroupUnion `json:"toolgroups"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Instructions             respjson.Field
		Model                    respjson.Field
		ClientTools              respjson.Field
		EnableSessionPersistence respjson.Field
		InputShields             respjson.Field
		MaxInferIters            respjson.Field
		Name                     respjson.Field
		OutputShields            respjson.Field
		ResponseFormat           respjson.Field
		SamplingParams           respjson.Field
		ToolChoice               respjson.Field
		ToolConfig               respjson.Field
		ToolPromptFormat         respjson.Field
		Toolgroups               respjson.Field
		ExtraFields              map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Configuration for an agent.

func (AgentConfig) RawJSON

func (r AgentConfig) RawJSON() string

Returns the unmodified JSON received from the API

func (AgentConfig) ToParam

func (r AgentConfig) ToParam() AgentConfigParam

ToParam converts this AgentConfig to a AgentConfigParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with AgentConfigParam.Overrides()

func (*AgentConfig) UnmarshalJSON

func (r *AgentConfig) UnmarshalJSON(data []byte) error

type AgentConfigParam

type AgentConfigParam struct {
	// The system instructions for the agent
	Instructions string `json:"instructions,required"`
	// The model identifier to use for the agent
	Model string `json:"model,required"`
	// Optional flag indicating whether session data has to be persisted
	EnableSessionPersistence param.Opt[bool]  `json:"enable_session_persistence,omitzero"`
	MaxInferIters            param.Opt[int64] `json:"max_infer_iters,omitzero"`
	// Optional name for the agent, used in telemetry and identification
	Name          param.Opt[string]    `json:"name,omitzero"`
	ClientTools   []SharedToolDefParam `json:"client_tools,omitzero"`
	InputShields  []string             `json:"input_shields,omitzero"`
	OutputShields []string             `json:"output_shields,omitzero"`
	// Optional response format configuration
	ResponseFormat ResponseFormatUnionParam `json:"response_format,omitzero"`
	// Sampling parameters.
	SamplingParams SamplingParams `json:"sampling_params,omitzero"`
	// Whether tool use is required or automatic. This is a hint to the model which may
	// not be followed. It depends on the Instruction Following capabilities of the
	// model.
	//
	// Any of "auto", "required", "none".
	//
	// Deprecated: deprecated
	ToolChoice AgentConfigToolChoice `json:"tool_choice,omitzero"`
	// Configuration for tool use.
	ToolConfig AgentConfigToolConfigParam `json:"tool_config,omitzero"`
	// Prompt format for calling custom / zero shot tools.
	//
	// Any of "json", "function_tag", "python_list".
	//
	// Deprecated: deprecated
	ToolPromptFormat AgentConfigToolPromptFormat      `json:"tool_prompt_format,omitzero"`
	Toolgroups       []AgentConfigToolgroupUnionParam `json:"toolgroups,omitzero"`
	// contains filtered or unexported fields
}

Configuration for an agent.

The properties Instructions, Model are required.

func (AgentConfigParam) MarshalJSON

func (r AgentConfigParam) MarshalJSON() (data []byte, err error)

func (*AgentConfigParam) UnmarshalJSON

func (r *AgentConfigParam) UnmarshalJSON(data []byte) error

type AgentConfigToolChoice

type AgentConfigToolChoice string

Whether tool use is required or automatic. This is a hint to the model which may not be followed. It depends on the Instruction Following capabilities of the model.

const (
	AgentConfigToolChoiceAuto     AgentConfigToolChoice = "auto"
	AgentConfigToolChoiceRequired AgentConfigToolChoice = "required"
	AgentConfigToolChoiceNone     AgentConfigToolChoice = "none"
)

type AgentConfigToolConfig

type AgentConfigToolConfig struct {
	// (Optional) Config for how to override the default system prompt. -
	// `SystemMessageBehavior.append`: Appends the provided system message to the
	// default system prompt. - `SystemMessageBehavior.replace`: Replaces the default
	// system prompt with the provided system message. The system message can include
	// the string '{{function_definitions}}' to indicate where the function definitions
	// should be inserted.
	//
	// Any of "append", "replace".
	SystemMessageBehavior string `json:"system_message_behavior"`
	// (Optional) Whether tool use is automatic, required, or none. Can also specify a
	// tool name to use a specific tool. Defaults to ToolChoice.auto.
	ToolChoice string `json:"tool_choice"`
	// (Optional) Instructs the model how to format tool calls. By default, Llama Stack
	// will attempt to use a format that is best adapted to the model. -
	// `ToolPromptFormat.json`: The tool calls are formatted as a JSON object. -
	// `ToolPromptFormat.function_tag`: The tool calls are enclosed in a
	// <function=function_name> tag. - `ToolPromptFormat.python_list`: The tool calls
	// are output as Python syntax -- a list of function calls.
	//
	// Any of "json", "function_tag", "python_list".
	ToolPromptFormat string `json:"tool_prompt_format"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		SystemMessageBehavior respjson.Field
		ToolChoice            respjson.Field
		ToolPromptFormat      respjson.Field
		ExtraFields           map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Configuration for tool use.

func (AgentConfigToolConfig) RawJSON

func (r AgentConfigToolConfig) RawJSON() string

Returns the unmodified JSON received from the API

func (*AgentConfigToolConfig) UnmarshalJSON

func (r *AgentConfigToolConfig) UnmarshalJSON(data []byte) error

type AgentConfigToolConfigParam

type AgentConfigToolConfigParam struct {
	// (Optional) Config for how to override the default system prompt. -
	// `SystemMessageBehavior.append`: Appends the provided system message to the
	// default system prompt. - `SystemMessageBehavior.replace`: Replaces the default
	// system prompt with the provided system message. The system message can include
	// the string '{{function_definitions}}' to indicate where the function definitions
	// should be inserted.
	//
	// Any of "append", "replace".
	SystemMessageBehavior string `json:"system_message_behavior,omitzero"`
	// (Optional) Whether tool use is automatic, required, or none. Can also specify a
	// tool name to use a specific tool. Defaults to ToolChoice.auto.
	ToolChoice string `json:"tool_choice,omitzero"`
	// (Optional) Instructs the model how to format tool calls. By default, Llama Stack
	// will attempt to use a format that is best adapted to the model. -
	// `ToolPromptFormat.json`: The tool calls are formatted as a JSON object. -
	// `ToolPromptFormat.function_tag`: The tool calls are enclosed in a
	// <function=function_name> tag. - `ToolPromptFormat.python_list`: The tool calls
	// are output as Python syntax -- a list of function calls.
	//
	// Any of "json", "function_tag", "python_list".
	ToolPromptFormat string `json:"tool_prompt_format,omitzero"`
	// contains filtered or unexported fields
}

Configuration for tool use.

func (AgentConfigToolConfigParam) MarshalJSON

func (r AgentConfigToolConfigParam) MarshalJSON() (data []byte, err error)

func (*AgentConfigToolConfigParam) UnmarshalJSON

func (r *AgentConfigToolConfigParam) UnmarshalJSON(data []byte) error

type AgentConfigToolPromptFormat

type AgentConfigToolPromptFormat string

Prompt format for calling custom / zero shot tools.

const (
	AgentConfigToolPromptFormatJson        AgentConfigToolPromptFormat = "json"
	AgentConfigToolPromptFormatFunctionTag AgentConfigToolPromptFormat = "function_tag"
	AgentConfigToolPromptFormatPythonList  AgentConfigToolPromptFormat = "python_list"
)

type AgentConfigToolgroupAgentToolGroupWithArgs

type AgentConfigToolgroupAgentToolGroupWithArgs struct {
	Args map[string]AgentConfigToolgroupAgentToolGroupWithArgsArgUnion `json:"args,required"`
	Name string                                                        `json:"name,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Args        respjson.Field
		Name        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AgentConfigToolgroupAgentToolGroupWithArgs) RawJSON

Returns the unmodified JSON received from the API

func (*AgentConfigToolgroupAgentToolGroupWithArgs) UnmarshalJSON

func (r *AgentConfigToolgroupAgentToolGroupWithArgs) UnmarshalJSON(data []byte) error

type AgentConfigToolgroupAgentToolGroupWithArgsArgUnion

type AgentConfigToolgroupAgentToolGroupWithArgsArgUnion 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
		// contains filtered or unexported fields
	} `json:"-"`
}

AgentConfigToolgroupAgentToolGroupWithArgsArgUnion 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]

func (AgentConfigToolgroupAgentToolGroupWithArgsArgUnion) AsAnyArray

func (AgentConfigToolgroupAgentToolGroupWithArgsArgUnion) AsBool

func (AgentConfigToolgroupAgentToolGroupWithArgsArgUnion) AsFloat

func (AgentConfigToolgroupAgentToolGroupWithArgsArgUnion) AsString

func (AgentConfigToolgroupAgentToolGroupWithArgsArgUnion) RawJSON

Returns the unmodified JSON received from the API

func (*AgentConfigToolgroupAgentToolGroupWithArgsArgUnion) UnmarshalJSON

type AgentConfigToolgroupAgentToolGroupWithArgsArgUnionParam

type AgentConfigToolgroupAgentToolGroupWithArgsArgUnionParam 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"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (AgentConfigToolgroupAgentToolGroupWithArgsArgUnionParam) MarshalJSON

func (*AgentConfigToolgroupAgentToolGroupWithArgsArgUnionParam) UnmarshalJSON

type AgentConfigToolgroupAgentToolGroupWithArgsParam

type AgentConfigToolgroupAgentToolGroupWithArgsParam struct {
	Args map[string]AgentConfigToolgroupAgentToolGroupWithArgsArgUnionParam `json:"args,omitzero,required"`
	Name string                                                             `json:"name,required"`
	// contains filtered or unexported fields
}

The properties Args, Name are required.

func (AgentConfigToolgroupAgentToolGroupWithArgsParam) MarshalJSON

func (r AgentConfigToolgroupAgentToolGroupWithArgsParam) MarshalJSON() (data []byte, err error)

func (*AgentConfigToolgroupAgentToolGroupWithArgsParam) UnmarshalJSON

type AgentConfigToolgroupUnion

type AgentConfigToolgroupUnion struct {
	// This field will be present if the value is a [string] instead of an object.
	OfString string `json:",inline"`
	// This field is from variant [AgentConfigToolgroupAgentToolGroupWithArgs].
	Args map[string]AgentConfigToolgroupAgentToolGroupWithArgsArgUnion `json:"args"`
	// This field is from variant [AgentConfigToolgroupAgentToolGroupWithArgs].
	Name string `json:"name"`
	JSON struct {
		OfString respjson.Field
		Args     respjson.Field
		Name     respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

AgentConfigToolgroupUnion contains all possible properties and values from [string], AgentConfigToolgroupAgentToolGroupWithArgs.

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: OfString]

func (AgentConfigToolgroupUnion) AsAgentToolGroupWithArgs

func (AgentConfigToolgroupUnion) AsString

func (u AgentConfigToolgroupUnion) AsString() (v string)

func (AgentConfigToolgroupUnion) RawJSON

func (u AgentConfigToolgroupUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (*AgentConfigToolgroupUnion) UnmarshalJSON

func (r *AgentConfigToolgroupUnion) UnmarshalJSON(data []byte) error

type AgentConfigToolgroupUnionParam

type AgentConfigToolgroupUnionParam struct {
	OfString                 param.Opt[string]                                `json:",omitzero,inline"`
	OfAgentToolGroupWithArgs *AgentConfigToolgroupAgentToolGroupWithArgsParam `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (AgentConfigToolgroupUnionParam) MarshalJSON

func (u AgentConfigToolgroupUnionParam) MarshalJSON() ([]byte, error)

func (*AgentConfigToolgroupUnionParam) UnmarshalJSON

func (u *AgentConfigToolgroupUnionParam) UnmarshalJSON(data []byte) error

type BatchCompletion

type BatchCompletion struct {
	// List of completion responses, one for each input in the batch
	Batch []SharedCompletionResponse `json:"batch,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Batch       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Response from a batch completion request.

func (BatchCompletion) RawJSON

func (r BatchCompletion) RawJSON() string

Returns the unmodified JSON received from the API

func (*BatchCompletion) UnmarshalJSON

func (r *BatchCompletion) UnmarshalJSON(data []byte) error

type ChatCompletionResponse

type ChatCompletionResponse struct {
	// The complete response message
	CompletionMessage CompletionMessage `json:"completion_message,required"`
	// Optional log probabilities for generated tokens
	Logprobs []ChatCompletionResponseLogprob `json:"logprobs"`
	// (Optional) List of metrics associated with the API response
	Metrics []ChatCompletionResponseMetric `json:"metrics"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CompletionMessage respjson.Field
		Logprobs          respjson.Field
		Metrics           respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Response from a chat completion request.

func (ChatCompletionResponse) RawJSON

func (r ChatCompletionResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*ChatCompletionResponse) UnmarshalJSON

func (r *ChatCompletionResponse) UnmarshalJSON(data []byte) error

type ChatCompletionResponseLogprob

type ChatCompletionResponseLogprob struct {
	// Dictionary mapping tokens to their log probabilities
	LogprobsByToken map[string]float64 `json:"logprobs_by_token,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		LogprobsByToken respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Log probabilities for generated tokens.

func (ChatCompletionResponseLogprob) RawJSON

Returns the unmodified JSON received from the API

func (*ChatCompletionResponseLogprob) UnmarshalJSON

func (r *ChatCompletionResponseLogprob) UnmarshalJSON(data []byte) error

type ChatCompletionResponseMetric

type ChatCompletionResponseMetric struct {
	// The name of the metric
	Metric string `json:"metric,required"`
	// The numeric value of the metric
	Value float64 `json:"value,required"`
	// (Optional) The unit of measurement for the metric value
	Unit string `json:"unit"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Metric      respjson.Field
		Value       respjson.Field
		Unit        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A metric value included in API responses.

func (ChatCompletionResponseMetric) RawJSON

Returns the unmodified JSON received from the API

func (*ChatCompletionResponseMetric) UnmarshalJSON

func (r *ChatCompletionResponseMetric) UnmarshalJSON(data []byte) error

type CompletionMessage

type CompletionMessage struct {
	// The content of the model's response
	Content InterleavedContentUnion `json:"content,required"`
	// Must be "assistant" to identify this as the model's response
	Role constant.Assistant `json:"role,required"`
	// Reason why the model stopped generating. Options are: -
	// `StopReason.end_of_turn`: The model finished generating the entire response. -
	// `StopReason.end_of_message`: The model finished generating but generated a
	// partial response -- usually, a tool call. The user may call the tool and
	// continue the conversation with the tool's response. -
	// `StopReason.out_of_tokens`: The model ran out of token budget.
	//
	// Any of "end_of_turn", "end_of_message", "out_of_tokens".
	StopReason CompletionMessageStopReason `json:"stop_reason,required"`
	// List of tool calls. Each tool call is a ToolCall object.
	ToolCalls []ToolCall `json:"tool_calls"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Content     respjson.Field
		Role        respjson.Field
		StopReason  respjson.Field
		ToolCalls   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A message containing the model's (assistant) response in a chat conversation.

func (CompletionMessage) RawJSON

func (r CompletionMessage) RawJSON() string

Returns the unmodified JSON received from the API

func (CompletionMessage) ToParam

ToParam converts this CompletionMessage to a CompletionMessageParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with CompletionMessageParam.Overrides()

func (*CompletionMessage) UnmarshalJSON

func (r *CompletionMessage) UnmarshalJSON(data []byte) error

type CompletionMessageParam

type CompletionMessageParam struct {
	// The content of the model's response
	Content InterleavedContentUnionParam `json:"content,omitzero,required"`
	// Reason why the model stopped generating. Options are: -
	// `StopReason.end_of_turn`: The model finished generating the entire response. -
	// `StopReason.end_of_message`: The model finished generating but generated a
	// partial response -- usually, a tool call. The user may call the tool and
	// continue the conversation with the tool's response. -
	// `StopReason.out_of_tokens`: The model ran out of token budget.
	//
	// Any of "end_of_turn", "end_of_message", "out_of_tokens".
	StopReason CompletionMessageStopReason `json:"stop_reason,omitzero,required"`
	// List of tool calls. Each tool call is a ToolCall object.
	ToolCalls []ToolCallParam `json:"tool_calls,omitzero"`
	// Must be "assistant" to identify this as the model's response
	//
	// This field can be elided, and will marshal its zero value as "assistant".
	Role constant.Assistant `json:"role,required"`
	// contains filtered or unexported fields
}

A message containing the model's (assistant) response in a chat conversation.

The properties Content, Role, StopReason are required.

func (CompletionMessageParam) MarshalJSON

func (r CompletionMessageParam) MarshalJSON() (data []byte, err error)

func (*CompletionMessageParam) UnmarshalJSON

func (r *CompletionMessageParam) UnmarshalJSON(data []byte) error

type CompletionMessageStopReason

type CompletionMessageStopReason string

Reason why the model stopped generating. Options are: - `StopReason.end_of_turn`: The model finished generating the entire response. - `StopReason.end_of_message`: The model finished generating but generated a partial response -- usually, a tool call. The user may call the tool and continue the conversation with the tool's response. - `StopReason.out_of_tokens`: The model ran out of token budget.

const (
	CompletionMessageStopReasonEndOfTurn    CompletionMessageStopReason = "end_of_turn"
	CompletionMessageStopReasonEndOfMessage CompletionMessageStopReason = "end_of_message"
	CompletionMessageStopReasonOutOfTokens  CompletionMessageStopReason = "out_of_tokens"
)

type ContentDeltaImage

type ContentDeltaImage struct {
	// The incremental image data as bytes
	Image string `json:"image,required"`
	// Discriminator type of the delta. Always "image"
	Type constant.Image `json:"type,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Image       respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

An image content delta for streaming responses.

func (ContentDeltaImage) RawJSON

func (r ContentDeltaImage) RawJSON() string

Returns the unmodified JSON received from the API

func (*ContentDeltaImage) UnmarshalJSON

func (r *ContentDeltaImage) UnmarshalJSON(data []byte) error

type ContentDeltaText

type ContentDeltaText struct {
	// The incremental text content
	Text string `json:"text,required"`
	// Discriminator type of the delta. Always "text"
	Type constant.Text `json:"type,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Text        respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A text content delta for streaming responses.

func (ContentDeltaText) RawJSON

func (r ContentDeltaText) RawJSON() string

Returns the unmodified JSON received from the API

func (*ContentDeltaText) UnmarshalJSON

func (r *ContentDeltaText) UnmarshalJSON(data []byte) error

type ContentDeltaToolCall

type ContentDeltaToolCall struct {
	// Current parsing status of the tool call
	//
	// Any of "started", "in_progress", "failed", "succeeded".
	ParseStatus string `json:"parse_status,required"`
	// Either an in-progress tool call string or the final parsed tool call
	ToolCall ToolCallOrStringUnion `json:"tool_call,required"`
	// Discriminator type of the delta. Always "tool_call"
	Type constant.ToolCall `json:"type,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ParseStatus respjson.Field
		ToolCall    respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A tool call content delta for streaming responses.

func (ContentDeltaToolCall) RawJSON

func (r ContentDeltaToolCall) RawJSON() string

Returns the unmodified JSON received from the API

func (*ContentDeltaToolCall) UnmarshalJSON

func (r *ContentDeltaToolCall) UnmarshalJSON(data []byte) error

type ContentDeltaUnion

type ContentDeltaUnion struct {
	// This field is from variant [ContentDeltaText].
	Text string `json:"text"`
	// Any of "text", "image", "tool_call".
	Type string `json:"type"`
	// This field is from variant [ContentDeltaImage].
	Image string `json:"image"`
	// This field is from variant [ContentDeltaToolCall].
	ParseStatus string `json:"parse_status"`
	// This field is from variant [ContentDeltaToolCall].
	ToolCall ToolCallOrStringUnion `json:"tool_call"`
	JSON     struct {
		Text        respjson.Field
		Type        respjson.Field
		Image       respjson.Field
		ParseStatus respjson.Field
		ToolCall    respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

ContentDeltaUnion contains all possible properties and values from ContentDeltaText, ContentDeltaImage, ContentDeltaToolCall.

Use the ContentDeltaUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (ContentDeltaUnion) AsAny

func (u ContentDeltaUnion) AsAny() anyContentDelta

Use the following switch statement to find the correct variant

switch variant := ContentDeltaUnion.AsAny().(type) {
case shared.ContentDeltaText:
case shared.ContentDeltaImage:
case shared.ContentDeltaToolCall:
default:
  fmt.Errorf("no variant present")
}

func (ContentDeltaUnion) AsImage

func (u ContentDeltaUnion) AsImage() (v ContentDeltaImage)

func (ContentDeltaUnion) AsText

func (u ContentDeltaUnion) AsText() (v ContentDeltaText)

func (ContentDeltaUnion) AsToolCall

func (u ContentDeltaUnion) AsToolCall() (v ContentDeltaToolCall)

func (ContentDeltaUnion) RawJSON

func (u ContentDeltaUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (*ContentDeltaUnion) UnmarshalJSON

func (r *ContentDeltaUnion) UnmarshalJSON(data []byte) error

type DocumentContentImageContentItemImageParam

type DocumentContentImageContentItemImageParam struct {
	// base64 encoded image data as string
	Data param.Opt[string] `json:"data,omitzero"`
	// A URL of the image or data URL in the format of data:image/{type};base64,{data}.
	// Note that URL could have length limits.
	URL DocumentContentImageContentItemImageURLParam `json:"url,omitzero"`
	// contains filtered or unexported fields
}

Image as a base64 encoded string or an URL

func (DocumentContentImageContentItemImageParam) MarshalJSON

func (r DocumentContentImageContentItemImageParam) MarshalJSON() (data []byte, err error)

func (*DocumentContentImageContentItemImageParam) UnmarshalJSON

func (r *DocumentContentImageContentItemImageParam) UnmarshalJSON(data []byte) error

type DocumentContentImageContentItemImageURLParam

type DocumentContentImageContentItemImageURLParam struct {
	// The URL string pointing to the resource
	Uri string `json:"uri,required"`
	// contains filtered or unexported fields
}

A URL of the image or data URL in the format of data:image/{type};base64,{data}. Note that URL could have length limits.

The property Uri is required.

func (DocumentContentImageContentItemImageURLParam) MarshalJSON

func (r DocumentContentImageContentItemImageURLParam) MarshalJSON() (data []byte, err error)

func (*DocumentContentImageContentItemImageURLParam) UnmarshalJSON

func (r *DocumentContentImageContentItemImageURLParam) UnmarshalJSON(data []byte) error

type DocumentContentImageContentItemParam

type DocumentContentImageContentItemParam struct {
	// Image as a base64 encoded string or an URL
	Image DocumentContentImageContentItemImageParam `json:"image,omitzero,required"`
	// Discriminator type of the content item. Always "image"
	//
	// This field can be elided, and will marshal its zero value as "image".
	Type constant.Image `json:"type,required"`
	// contains filtered or unexported fields
}

A image content item

The properties Image, Type are required.

func (DocumentContentImageContentItemParam) MarshalJSON

func (r DocumentContentImageContentItemParam) MarshalJSON() (data []byte, err error)

func (*DocumentContentImageContentItemParam) UnmarshalJSON

func (r *DocumentContentImageContentItemParam) UnmarshalJSON(data []byte) error

type DocumentContentTextContentItemParam

type DocumentContentTextContentItemParam struct {
	// Text content
	Text string `json:"text,required"`
	// Discriminator type of the content item. Always "text"
	//
	// This field can be elided, and will marshal its zero value as "text".
	Type constant.Text `json:"type,required"`
	// contains filtered or unexported fields
}

A text content item

The properties Text, Type are required.

func (DocumentContentTextContentItemParam) MarshalJSON

func (r DocumentContentTextContentItemParam) MarshalJSON() (data []byte, err error)

func (*DocumentContentTextContentItemParam) UnmarshalJSON

func (r *DocumentContentTextContentItemParam) UnmarshalJSON(data []byte) error

type DocumentContentURLParam

type DocumentContentURLParam struct {
	// The URL string pointing to the resource
	Uri string `json:"uri,required"`
	// contains filtered or unexported fields
}

A URL reference to external content.

The property Uri is required.

func (DocumentContentURLParam) MarshalJSON

func (r DocumentContentURLParam) MarshalJSON() (data []byte, err error)

func (*DocumentContentURLParam) UnmarshalJSON

func (r *DocumentContentURLParam) UnmarshalJSON(data []byte) error

type DocumentContentUnionParam

type DocumentContentUnionParam struct {
	OfString                      param.Opt[string]                     `json:",omitzero,inline"`
	OfImageContentItem            *DocumentContentImageContentItemParam `json:",omitzero,inline"`
	OfTextContentItem             *DocumentContentTextContentItemParam  `json:",omitzero,inline"`
	OfInterleavedContentItemArray []InterleavedContentItemUnionParam    `json:",omitzero,inline"`
	OfURL                         *DocumentContentURLParam              `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (DocumentContentUnionParam) GetImage

Returns a pointer to the underlying variant's property, if present.

func (DocumentContentUnionParam) GetText

func (u DocumentContentUnionParam) GetText() *string

Returns a pointer to the underlying variant's property, if present.

func (DocumentContentUnionParam) GetType

func (u DocumentContentUnionParam) GetType() *string

Returns a pointer to the underlying variant's property, if present.

func (DocumentContentUnionParam) GetUri

func (u DocumentContentUnionParam) GetUri() *string

Returns a pointer to the underlying variant's property, if present.

func (DocumentContentUnionParam) MarshalJSON

func (u DocumentContentUnionParam) MarshalJSON() ([]byte, error)

func (*DocumentContentUnionParam) UnmarshalJSON

func (u *DocumentContentUnionParam) UnmarshalJSON(data []byte) error

type DocumentMetadataUnionParam

type DocumentMetadataUnionParam 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"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (DocumentMetadataUnionParam) MarshalJSON

func (u DocumentMetadataUnionParam) MarshalJSON() ([]byte, error)

func (*DocumentMetadataUnionParam) UnmarshalJSON

func (u *DocumentMetadataUnionParam) UnmarshalJSON(data []byte) error

type DocumentParam

type DocumentParam struct {
	// The content of the document.
	Content DocumentContentUnionParam `json:"content,omitzero,required"`
	// The unique identifier for the document.
	DocumentID string `json:"document_id,required"`
	// Additional metadata for the document.
	Metadata map[string]DocumentMetadataUnionParam `json:"metadata,omitzero,required"`
	// The MIME type of the document.
	MimeType param.Opt[string] `json:"mime_type,omitzero"`
	// contains filtered or unexported fields
}

A document to be used for document ingestion in the RAG Tool.

The properties Content, DocumentID, Metadata are required.

func (DocumentParam) MarshalJSON

func (r DocumentParam) MarshalJSON() (data []byte, err error)

func (*DocumentParam) UnmarshalJSON

func (r *DocumentParam) UnmarshalJSON(data []byte) error

type InterleavedContentImageContentItem

type InterleavedContentImageContentItem struct {
	// Image as a base64 encoded string or an URL
	Image InterleavedContentImageContentItemImage `json:"image,required"`
	// Discriminator type of the content item. Always "image"
	Type constant.Image `json:"type,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Image       respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A image content item

func (InterleavedContentImageContentItem) RawJSON

Returns the unmodified JSON received from the API

func (*InterleavedContentImageContentItem) UnmarshalJSON

func (r *InterleavedContentImageContentItem) UnmarshalJSON(data []byte) error

type InterleavedContentImageContentItemImage

type InterleavedContentImageContentItemImage struct {
	// base64 encoded image data as string
	Data string `json:"data"`
	// A URL of the image or data URL in the format of data:image/{type};base64,{data}.
	// Note that URL could have length limits.
	URL InterleavedContentImageContentItemImageURL `json:"url"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		URL         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Image as a base64 encoded string or an URL

func (InterleavedContentImageContentItemImage) RawJSON

Returns the unmodified JSON received from the API

func (*InterleavedContentImageContentItemImage) UnmarshalJSON

func (r *InterleavedContentImageContentItemImage) UnmarshalJSON(data []byte) error

type InterleavedContentImageContentItemImageParam

type InterleavedContentImageContentItemImageParam struct {
	// base64 encoded image data as string
	Data param.Opt[string] `json:"data,omitzero"`
	// A URL of the image or data URL in the format of data:image/{type};base64,{data}.
	// Note that URL could have length limits.
	URL InterleavedContentImageContentItemImageURLParam `json:"url,omitzero"`
	// contains filtered or unexported fields
}

Image as a base64 encoded string or an URL

func (InterleavedContentImageContentItemImageParam) MarshalJSON

func (r InterleavedContentImageContentItemImageParam) MarshalJSON() (data []byte, err error)

func (*InterleavedContentImageContentItemImageParam) UnmarshalJSON

func (r *InterleavedContentImageContentItemImageParam) UnmarshalJSON(data []byte) error

type InterleavedContentImageContentItemImageURL

type InterleavedContentImageContentItemImageURL struct {
	// The URL string pointing to the resource
	Uri string `json:"uri,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Uri         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A URL of the image or data URL in the format of data:image/{type};base64,{data}. Note that URL could have length limits.

func (InterleavedContentImageContentItemImageURL) RawJSON

Returns the unmodified JSON received from the API

func (*InterleavedContentImageContentItemImageURL) UnmarshalJSON

func (r *InterleavedContentImageContentItemImageURL) UnmarshalJSON(data []byte) error

type InterleavedContentImageContentItemImageURLParam

type InterleavedContentImageContentItemImageURLParam struct {
	// The URL string pointing to the resource
	Uri string `json:"uri,required"`
	// contains filtered or unexported fields
}

A URL of the image or data URL in the format of data:image/{type};base64,{data}. Note that URL could have length limits.

The property Uri is required.

func (InterleavedContentImageContentItemImageURLParam) MarshalJSON

func (r InterleavedContentImageContentItemImageURLParam) MarshalJSON() (data []byte, err error)

func (*InterleavedContentImageContentItemImageURLParam) UnmarshalJSON

type InterleavedContentImageContentItemParam

type InterleavedContentImageContentItemParam struct {
	// Image as a base64 encoded string or an URL
	Image InterleavedContentImageContentItemImageParam `json:"image,omitzero,required"`
	// Discriminator type of the content item. Always "image"
	//
	// This field can be elided, and will marshal its zero value as "image".
	Type constant.Image `json:"type,required"`
	// contains filtered or unexported fields
}

A image content item

The properties Image, Type are required.

func (InterleavedContentImageContentItemParam) MarshalJSON

func (r InterleavedContentImageContentItemParam) MarshalJSON() (data []byte, err error)

func (*InterleavedContentImageContentItemParam) UnmarshalJSON

func (r *InterleavedContentImageContentItemParam) UnmarshalJSON(data []byte) error

type InterleavedContentItemImage

type InterleavedContentItemImage struct {
	// Image as a base64 encoded string or an URL
	Image InterleavedContentItemImageImage `json:"image,required"`
	// Discriminator type of the content item. Always "image"
	Type constant.Image `json:"type,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Image       respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A image content item

func (InterleavedContentItemImage) RawJSON

func (r InterleavedContentItemImage) RawJSON() string

Returns the unmodified JSON received from the API

func (*InterleavedContentItemImage) UnmarshalJSON

func (r *InterleavedContentItemImage) UnmarshalJSON(data []byte) error

type InterleavedContentItemImageImage

type InterleavedContentItemImageImage struct {
	// base64 encoded image data as string
	Data string `json:"data"`
	// A URL of the image or data URL in the format of data:image/{type};base64,{data}.
	// Note that URL could have length limits.
	URL InterleavedContentItemImageImageURL `json:"url"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		URL         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Image as a base64 encoded string or an URL

func (InterleavedContentItemImageImage) RawJSON

Returns the unmodified JSON received from the API

func (*InterleavedContentItemImageImage) UnmarshalJSON

func (r *InterleavedContentItemImageImage) UnmarshalJSON(data []byte) error

type InterleavedContentItemImageImageParam

type InterleavedContentItemImageImageParam struct {
	// base64 encoded image data as string
	Data param.Opt[string] `json:"data,omitzero"`
	// A URL of the image or data URL in the format of data:image/{type};base64,{data}.
	// Note that URL could have length limits.
	URL InterleavedContentItemImageImageURLParam `json:"url,omitzero"`
	// contains filtered or unexported fields
}

Image as a base64 encoded string or an URL

func (InterleavedContentItemImageImageParam) MarshalJSON

func (r InterleavedContentItemImageImageParam) MarshalJSON() (data []byte, err error)

func (*InterleavedContentItemImageImageParam) UnmarshalJSON

func (r *InterleavedContentItemImageImageParam) UnmarshalJSON(data []byte) error

type InterleavedContentItemImageImageURL

type InterleavedContentItemImageImageURL struct {
	// The URL string pointing to the resource
	Uri string `json:"uri,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Uri         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A URL of the image or data URL in the format of data:image/{type};base64,{data}. Note that URL could have length limits.

func (InterleavedContentItemImageImageURL) RawJSON

Returns the unmodified JSON received from the API

func (*InterleavedContentItemImageImageURL) UnmarshalJSON

func (r *InterleavedContentItemImageImageURL) UnmarshalJSON(data []byte) error

type InterleavedContentItemImageImageURLParam

type InterleavedContentItemImageImageURLParam struct {
	// The URL string pointing to the resource
	Uri string `json:"uri,required"`
	// contains filtered or unexported fields
}

A URL of the image or data URL in the format of data:image/{type};base64,{data}. Note that URL could have length limits.

The property Uri is required.

func (InterleavedContentItemImageImageURLParam) MarshalJSON

func (r InterleavedContentItemImageImageURLParam) MarshalJSON() (data []byte, err error)

func (*InterleavedContentItemImageImageURLParam) UnmarshalJSON

func (r *InterleavedContentItemImageImageURLParam) UnmarshalJSON(data []byte) error

type InterleavedContentItemImageParam

type InterleavedContentItemImageParam struct {
	// Image as a base64 encoded string or an URL
	Image InterleavedContentItemImageImageParam `json:"image,omitzero,required"`
	// Discriminator type of the content item. Always "image"
	//
	// This field can be elided, and will marshal its zero value as "image".
	Type constant.Image `json:"type,required"`
	// contains filtered or unexported fields
}

A image content item

The properties Image, Type are required.

func (InterleavedContentItemImageParam) MarshalJSON

func (r InterleavedContentItemImageParam) MarshalJSON() (data []byte, err error)

func (*InterleavedContentItemImageParam) UnmarshalJSON

func (r *InterleavedContentItemImageParam) UnmarshalJSON(data []byte) error

type InterleavedContentItemText

type InterleavedContentItemText struct {
	// Text content
	Text string `json:"text,required"`
	// Discriminator type of the content item. Always "text"
	Type constant.Text `json:"type,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Text        respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A text content item

func (InterleavedContentItemText) RawJSON

func (r InterleavedContentItemText) RawJSON() string

Returns the unmodified JSON received from the API

func (*InterleavedContentItemText) UnmarshalJSON

func (r *InterleavedContentItemText) UnmarshalJSON(data []byte) error

type InterleavedContentItemTextParam

type InterleavedContentItemTextParam struct {
	// Text content
	Text string `json:"text,required"`
	// Discriminator type of the content item. Always "text"
	//
	// This field can be elided, and will marshal its zero value as "text".
	Type constant.Text `json:"type,required"`
	// contains filtered or unexported fields
}

A text content item

The properties Text, Type are required.

func (InterleavedContentItemTextParam) MarshalJSON

func (r InterleavedContentItemTextParam) MarshalJSON() (data []byte, err error)

func (*InterleavedContentItemTextParam) UnmarshalJSON

func (r *InterleavedContentItemTextParam) UnmarshalJSON(data []byte) error

type InterleavedContentItemUnion

type InterleavedContentItemUnion struct {
	// This field is from variant [InterleavedContentItemImage].
	Image InterleavedContentItemImageImage `json:"image"`
	// Any of "image", "text".
	Type string `json:"type"`
	// This field is from variant [InterleavedContentItemText].
	Text string `json:"text"`
	JSON struct {
		Image respjson.Field
		Type  respjson.Field
		Text  respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

InterleavedContentItemUnion contains all possible properties and values from InterleavedContentItemImage, InterleavedContentItemText.

Use the InterleavedContentItemUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (InterleavedContentItemUnion) AsAny

func (u InterleavedContentItemUnion) AsAny() anyInterleavedContentItem

Use the following switch statement to find the correct variant

switch variant := InterleavedContentItemUnion.AsAny().(type) {
case shared.InterleavedContentItemImage:
case shared.InterleavedContentItemText:
default:
  fmt.Errorf("no variant present")
}

func (InterleavedContentItemUnion) AsImage

func (InterleavedContentItemUnion) AsText

func (InterleavedContentItemUnion) RawJSON

func (u InterleavedContentItemUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (InterleavedContentItemUnion) ToParam

ToParam converts this InterleavedContentItemUnion to a InterleavedContentItemUnionParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with InterleavedContentItemUnionParam.Overrides()

func (*InterleavedContentItemUnion) UnmarshalJSON

func (r *InterleavedContentItemUnion) UnmarshalJSON(data []byte) error

type InterleavedContentItemUnionParam

type InterleavedContentItemUnionParam struct {
	OfImage *InterleavedContentItemImageParam `json:",omitzero,inline"`
	OfText  *InterleavedContentItemTextParam  `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func InterleavedContentItemParamOfText

func InterleavedContentItemParamOfText(text string) InterleavedContentItemUnionParam

func (InterleavedContentItemUnionParam) GetImage

Returns a pointer to the underlying variant's property, if present.

func (InterleavedContentItemUnionParam) GetText

Returns a pointer to the underlying variant's property, if present.

func (InterleavedContentItemUnionParam) GetType

Returns a pointer to the underlying variant's property, if present.

func (InterleavedContentItemUnionParam) MarshalJSON

func (u InterleavedContentItemUnionParam) MarshalJSON() ([]byte, error)

func (*InterleavedContentItemUnionParam) UnmarshalJSON

func (u *InterleavedContentItemUnionParam) UnmarshalJSON(data []byte) error

type InterleavedContentTextContentItem

type InterleavedContentTextContentItem struct {
	// Text content
	Text string `json:"text,required"`
	// Discriminator type of the content item. Always "text"
	Type constant.Text `json:"type,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Text        respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A text content item

func (InterleavedContentTextContentItem) RawJSON

Returns the unmodified JSON received from the API

func (*InterleavedContentTextContentItem) UnmarshalJSON

func (r *InterleavedContentTextContentItem) UnmarshalJSON(data []byte) error

type InterleavedContentTextContentItemParam

type InterleavedContentTextContentItemParam struct {
	// Text content
	Text string `json:"text,required"`
	// Discriminator type of the content item. Always "text"
	//
	// This field can be elided, and will marshal its zero value as "text".
	Type constant.Text `json:"type,required"`
	// contains filtered or unexported fields
}

A text content item

The properties Text, Type are required.

func (InterleavedContentTextContentItemParam) MarshalJSON

func (r InterleavedContentTextContentItemParam) MarshalJSON() (data []byte, err error)

func (*InterleavedContentTextContentItemParam) UnmarshalJSON

func (r *InterleavedContentTextContentItemParam) UnmarshalJSON(data []byte) error

type InterleavedContentUnion

type InterleavedContentUnion struct {
	// 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 [[]InterleavedContentItemUnion]
	// instead of an object.
	OfInterleavedContentItemArray []InterleavedContentItemUnion `json:",inline"`
	// This field is from variant [InterleavedContentImageContentItem].
	Image InterleavedContentImageContentItemImage `json:"image"`
	Type  string                                  `json:"type"`
	// This field is from variant [InterleavedContentTextContentItem].
	Text string `json:"text"`
	JSON struct {
		OfString                      respjson.Field
		OfInterleavedContentItemArray respjson.Field
		Image                         respjson.Field
		Type                          respjson.Field
		Text                          respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

InterleavedContentUnion contains all possible properties and values from [string], InterleavedContentImageContentItem, InterleavedContentTextContentItem, [[]InterleavedContentItemUnion].

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: OfString OfInterleavedContentItemArray]

func (InterleavedContentUnion) AsImageContentItem

func (InterleavedContentUnion) AsInterleavedContentItemArray

func (u InterleavedContentUnion) AsInterleavedContentItemArray() (v []InterleavedContentItemUnion)

func (InterleavedContentUnion) AsString

func (u InterleavedContentUnion) AsString() (v string)

func (InterleavedContentUnion) AsTextContentItem

func (InterleavedContentUnion) RawJSON

func (u InterleavedContentUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (InterleavedContentUnion) ToParam

ToParam converts this InterleavedContentUnion to a InterleavedContentUnionParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with InterleavedContentUnionParam.Overrides()

func (*InterleavedContentUnion) UnmarshalJSON

func (r *InterleavedContentUnion) UnmarshalJSON(data []byte) error

type InterleavedContentUnionParam

type InterleavedContentUnionParam struct {
	OfString                      param.Opt[string]                        `json:",omitzero,inline"`
	OfImageContentItem            *InterleavedContentImageContentItemParam `json:",omitzero,inline"`
	OfTextContentItem             *InterleavedContentTextContentItemParam  `json:",omitzero,inline"`
	OfInterleavedContentItemArray []InterleavedContentItemUnionParam       `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func InterleavedContentParamOfTextContentItem

func InterleavedContentParamOfTextContentItem(text string) InterleavedContentUnionParam

func (InterleavedContentUnionParam) GetImage

Returns a pointer to the underlying variant's property, if present.

func (InterleavedContentUnionParam) GetText

func (u InterleavedContentUnionParam) GetText() *string

Returns a pointer to the underlying variant's property, if present.

func (InterleavedContentUnionParam) GetType

func (u InterleavedContentUnionParam) GetType() *string

Returns a pointer to the underlying variant's property, if present.

func (InterleavedContentUnionParam) MarshalJSON

func (u InterleavedContentUnionParam) MarshalJSON() ([]byte, error)

func (*InterleavedContentUnionParam) UnmarshalJSON

func (u *InterleavedContentUnionParam) UnmarshalJSON(data []byte) error

type MessageUnionParam

type MessageUnionParam struct {
	OfUser      *UserMessageParam         `json:",omitzero,inline"`
	OfSystem    *SystemMessageParam       `json:",omitzero,inline"`
	OfTool      *ToolResponseMessageParam `json:",omitzero,inline"`
	OfAssistant *CompletionMessageParam   `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (MessageUnionParam) GetCallID

func (u MessageUnionParam) GetCallID() *string

Returns a pointer to the underlying variant's property, if present.

func (MessageUnionParam) GetContent

Returns a pointer to the underlying variant's Content property, if present.

func (MessageUnionParam) GetContext

Returns a pointer to the underlying variant's property, if present.

func (MessageUnionParam) GetRole

func (u MessageUnionParam) GetRole() *string

Returns a pointer to the underlying variant's property, if present.

func (MessageUnionParam) GetStopReason

func (u MessageUnionParam) GetStopReason() *string

Returns a pointer to the underlying variant's property, if present.

func (MessageUnionParam) GetToolCalls

func (u MessageUnionParam) GetToolCalls() []ToolCallParam

Returns a pointer to the underlying variant's property, if present.

func (MessageUnionParam) MarshalJSON

func (u MessageUnionParam) MarshalJSON() ([]byte, error)

func (*MessageUnionParam) UnmarshalJSON

func (u *MessageUnionParam) UnmarshalJSON(data []byte) error

type QueryConfigMode

type QueryConfigMode string

Search mode for retrieval—either "vector", "keyword", or "hybrid". Default "vector".

const (
	QueryConfigModeVector  QueryConfigMode = "vector"
	QueryConfigModeKeyword QueryConfigMode = "keyword"
	QueryConfigModeHybrid  QueryConfigMode = "hybrid"
)

type QueryConfigParam

type QueryConfigParam struct {
	// Template for formatting each retrieved chunk in the context. Available
	// placeholders: {index} (1-based chunk ordinal), {chunk.content} (chunk content
	// string), {metadata} (chunk metadata dict). Default: "Result {index}\nContent:
	// {chunk.content}\nMetadata: {metadata}\n"
	ChunkTemplate string `json:"chunk_template,required"`
	// Maximum number of chunks to retrieve.
	MaxChunks int64 `json:"max_chunks,required"`
	// Maximum number of tokens in the context.
	MaxTokensInContext int64 `json:"max_tokens_in_context,required"`
	// Configuration for the query generator.
	QueryGeneratorConfig QueryGeneratorConfigUnionParam `json:"query_generator_config,omitzero,required"`
	// Search mode for retrieval—either "vector", "keyword", or "hybrid". Default
	// "vector".
	//
	// Any of "vector", "keyword", "hybrid".
	Mode QueryConfigMode `json:"mode,omitzero"`
	// Configuration for the ranker to use in hybrid search. Defaults to RRF ranker.
	Ranker QueryConfigRankerUnionParam `json:"ranker,omitzero"`
	// contains filtered or unexported fields
}

Configuration for the RAG query generation.

The properties ChunkTemplate, MaxChunks, MaxTokensInContext, QueryGeneratorConfig are required.

func (QueryConfigParam) MarshalJSON

func (r QueryConfigParam) MarshalJSON() (data []byte, err error)

func (*QueryConfigParam) UnmarshalJSON

func (r *QueryConfigParam) UnmarshalJSON(data []byte) error

type QueryConfigRankerRrfParam

type QueryConfigRankerRrfParam struct {
	// The impact factor for RRF scoring. Higher values give more weight to
	// higher-ranked results. Must be greater than 0
	ImpactFactor float64 `json:"impact_factor,required"`
	// The type of ranker, always "rrf"
	//
	// This field can be elided, and will marshal its zero value as "rrf".
	Type constant.Rrf `json:"type,required"`
	// contains filtered or unexported fields
}

Reciprocal Rank Fusion (RRF) ranker configuration.

The properties ImpactFactor, Type are required.

func (QueryConfigRankerRrfParam) MarshalJSON

func (r QueryConfigRankerRrfParam) MarshalJSON() (data []byte, err error)

func (*QueryConfigRankerRrfParam) UnmarshalJSON

func (r *QueryConfigRankerRrfParam) UnmarshalJSON(data []byte) error

type QueryConfigRankerUnionParam

type QueryConfigRankerUnionParam struct {
	OfRrf      *QueryConfigRankerRrfParam      `json:",omitzero,inline"`
	OfWeighted *QueryConfigRankerWeightedParam `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (QueryConfigRankerUnionParam) GetAlpha

func (u QueryConfigRankerUnionParam) GetAlpha() *float64

Returns a pointer to the underlying variant's property, if present.

func (QueryConfigRankerUnionParam) GetImpactFactor

func (u QueryConfigRankerUnionParam) GetImpactFactor() *float64

Returns a pointer to the underlying variant's property, if present.

func (QueryConfigRankerUnionParam) GetType

func (u QueryConfigRankerUnionParam) GetType() *string

Returns a pointer to the underlying variant's property, if present.

func (QueryConfigRankerUnionParam) MarshalJSON

func (u QueryConfigRankerUnionParam) MarshalJSON() ([]byte, error)

func (*QueryConfigRankerUnionParam) UnmarshalJSON

func (u *QueryConfigRankerUnionParam) UnmarshalJSON(data []byte) error

type QueryConfigRankerWeightedParam

type QueryConfigRankerWeightedParam struct {
	// Weight factor between 0 and 1. 0 means only use keyword scores, 1 means only use
	// vector scores, values in between blend both scores.
	Alpha float64 `json:"alpha,required"`
	// The type of ranker, always "weighted"
	//
	// This field can be elided, and will marshal its zero value as "weighted".
	Type constant.Weighted `json:"type,required"`
	// contains filtered or unexported fields
}

Weighted ranker configuration that combines vector and keyword scores.

The properties Alpha, Type are required.

func (QueryConfigRankerWeightedParam) MarshalJSON

func (r QueryConfigRankerWeightedParam) MarshalJSON() (data []byte, err error)

func (*QueryConfigRankerWeightedParam) UnmarshalJSON

func (r *QueryConfigRankerWeightedParam) UnmarshalJSON(data []byte) error

type QueryGeneratorConfigDefaultParam

type QueryGeneratorConfigDefaultParam struct {
	// String separator used to join query terms
	Separator string `json:"separator,required"`
	// Type of query generator, always 'default'
	//
	// This field can be elided, and will marshal its zero value as "default".
	Type constant.Default `json:"type,required"`
	// contains filtered or unexported fields
}

Configuration for the default RAG query generator.

The properties Separator, Type are required.

func (QueryGeneratorConfigDefaultParam) MarshalJSON

func (r QueryGeneratorConfigDefaultParam) MarshalJSON() (data []byte, err error)

func (*QueryGeneratorConfigDefaultParam) UnmarshalJSON

func (r *QueryGeneratorConfigDefaultParam) UnmarshalJSON(data []byte) error

type QueryGeneratorConfigLlmParam

type QueryGeneratorConfigLlmParam struct {
	// Name of the language model to use for query generation
	Model string `json:"model,required"`
	// Template string for formatting the query generation prompt
	Template string `json:"template,required"`
	// Type of query generator, always 'llm'
	//
	// This field can be elided, and will marshal its zero value as "llm".
	Type constant.Llm `json:"type,required"`
	// contains filtered or unexported fields
}

Configuration for the LLM-based RAG query generator.

The properties Model, Template, Type are required.

func (QueryGeneratorConfigLlmParam) MarshalJSON

func (r QueryGeneratorConfigLlmParam) MarshalJSON() (data []byte, err error)

func (*QueryGeneratorConfigLlmParam) UnmarshalJSON

func (r *QueryGeneratorConfigLlmParam) UnmarshalJSON(data []byte) error

type QueryGeneratorConfigUnionParam

type QueryGeneratorConfigUnionParam struct {
	OfDefault *QueryGeneratorConfigDefaultParam `json:",omitzero,inline"`
	OfLlm     *QueryGeneratorConfigLlmParam     `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func QueryGeneratorConfigParamOfDefault

func QueryGeneratorConfigParamOfDefault(separator string) QueryGeneratorConfigUnionParam

func QueryGeneratorConfigParamOfLlm

func QueryGeneratorConfigParamOfLlm(model string, template string) QueryGeneratorConfigUnionParam

func (QueryGeneratorConfigUnionParam) GetModel

func (u QueryGeneratorConfigUnionParam) GetModel() *string

Returns a pointer to the underlying variant's property, if present.

func (QueryGeneratorConfigUnionParam) GetSeparator

func (u QueryGeneratorConfigUnionParam) GetSeparator() *string

Returns a pointer to the underlying variant's property, if present.

func (QueryGeneratorConfigUnionParam) GetTemplate

func (u QueryGeneratorConfigUnionParam) GetTemplate() *string

Returns a pointer to the underlying variant's property, if present.

func (QueryGeneratorConfigUnionParam) GetType

Returns a pointer to the underlying variant's property, if present.

func (QueryGeneratorConfigUnionParam) MarshalJSON

func (u QueryGeneratorConfigUnionParam) MarshalJSON() ([]byte, error)

func (*QueryGeneratorConfigUnionParam) UnmarshalJSON

func (u *QueryGeneratorConfigUnionParam) UnmarshalJSON(data []byte) error

type QueryResult

type QueryResult struct {
	// Additional metadata about the query result
	Metadata map[string]QueryResultMetadataUnion `json:"metadata,required"`
	// (Optional) The retrieved content from the query
	Content InterleavedContentUnion `json:"content"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Metadata    respjson.Field
		Content     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Result of a RAG query containing retrieved content and metadata.

func (QueryResult) RawJSON

func (r QueryResult) RawJSON() string

Returns the unmodified JSON received from the API

func (*QueryResult) UnmarshalJSON

func (r *QueryResult) UnmarshalJSON(data []byte) error

type QueryResultMetadataUnion

type QueryResultMetadataUnion 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
		// contains filtered or unexported fields
	} `json:"-"`
}

QueryResultMetadataUnion 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]

func (QueryResultMetadataUnion) AsAnyArray

func (u QueryResultMetadataUnion) AsAnyArray() (v []any)

func (QueryResultMetadataUnion) AsBool

func (u QueryResultMetadataUnion) AsBool() (v bool)

func (QueryResultMetadataUnion) AsFloat

func (u QueryResultMetadataUnion) AsFloat() (v float64)

func (QueryResultMetadataUnion) AsString

func (u QueryResultMetadataUnion) AsString() (v string)

func (QueryResultMetadataUnion) RawJSON

func (u QueryResultMetadataUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (*QueryResultMetadataUnion) UnmarshalJSON

func (r *QueryResultMetadataUnion) UnmarshalJSON(data []byte) error

type ResponseFormatGrammar

type ResponseFormatGrammar struct {
	// The BNF grammar specification the response should conform to
	Bnf map[string]ResponseFormatGrammarBnfUnion `json:"bnf,required"`
	// Must be "grammar" to identify this format type
	Type constant.Grammar `json:"type,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Bnf         respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Configuration for grammar-guided response generation.

func (ResponseFormatGrammar) RawJSON

func (r ResponseFormatGrammar) RawJSON() string

Returns the unmodified JSON received from the API

func (*ResponseFormatGrammar) UnmarshalJSON

func (r *ResponseFormatGrammar) UnmarshalJSON(data []byte) error

type ResponseFormatGrammarBnfUnion

type ResponseFormatGrammarBnfUnion 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
		// contains filtered or unexported fields
	} `json:"-"`
}

ResponseFormatGrammarBnfUnion 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]

func (ResponseFormatGrammarBnfUnion) AsAnyArray

func (u ResponseFormatGrammarBnfUnion) AsAnyArray() (v []any)

func (ResponseFormatGrammarBnfUnion) AsBool

func (u ResponseFormatGrammarBnfUnion) AsBool() (v bool)

func (ResponseFormatGrammarBnfUnion) AsFloat

func (u ResponseFormatGrammarBnfUnion) AsFloat() (v float64)

func (ResponseFormatGrammarBnfUnion) AsString

func (u ResponseFormatGrammarBnfUnion) AsString() (v string)

func (ResponseFormatGrammarBnfUnion) RawJSON

Returns the unmodified JSON received from the API

func (*ResponseFormatGrammarBnfUnion) UnmarshalJSON

func (r *ResponseFormatGrammarBnfUnion) UnmarshalJSON(data []byte) error

type ResponseFormatGrammarBnfUnionParam

type ResponseFormatGrammarBnfUnionParam 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"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (ResponseFormatGrammarBnfUnionParam) MarshalJSON

func (u ResponseFormatGrammarBnfUnionParam) MarshalJSON() ([]byte, error)

func (*ResponseFormatGrammarBnfUnionParam) UnmarshalJSON

func (u *ResponseFormatGrammarBnfUnionParam) UnmarshalJSON(data []byte) error

type ResponseFormatGrammarParam

type ResponseFormatGrammarParam struct {
	// The BNF grammar specification the response should conform to
	Bnf map[string]ResponseFormatGrammarBnfUnionParam `json:"bnf,omitzero,required"`
	// Must be "grammar" to identify this format type
	//
	// This field can be elided, and will marshal its zero value as "grammar".
	Type constant.Grammar `json:"type,required"`
	// contains filtered or unexported fields
}

Configuration for grammar-guided response generation.

The properties Bnf, Type are required.

func (ResponseFormatGrammarParam) MarshalJSON

func (r ResponseFormatGrammarParam) MarshalJSON() (data []byte, err error)

func (*ResponseFormatGrammarParam) UnmarshalJSON

func (r *ResponseFormatGrammarParam) UnmarshalJSON(data []byte) error

type ResponseFormatJsonSchema

type ResponseFormatJsonSchema struct {
	// The JSON schema the response should conform to. In a Python SDK, this is often a
	// `pydantic` model.
	JsonSchema map[string]ResponseFormatJsonSchemaJsonSchemaUnion `json:"json_schema,required"`
	// Must be "json_schema" to identify this format type
	Type constant.JsonSchema `json:"type,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		JsonSchema  respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Configuration for JSON schema-guided response generation.

func (ResponseFormatJsonSchema) RawJSON

func (r ResponseFormatJsonSchema) RawJSON() string

Returns the unmodified JSON received from the API

func (*ResponseFormatJsonSchema) UnmarshalJSON

func (r *ResponseFormatJsonSchema) UnmarshalJSON(data []byte) error

type ResponseFormatJsonSchemaJsonSchemaUnion

type ResponseFormatJsonSchemaJsonSchemaUnion 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
		// contains filtered or unexported fields
	} `json:"-"`
}

ResponseFormatJsonSchemaJsonSchemaUnion 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]

func (ResponseFormatJsonSchemaJsonSchemaUnion) AsAnyArray

func (u ResponseFormatJsonSchemaJsonSchemaUnion) AsAnyArray() (v []any)

func (ResponseFormatJsonSchemaJsonSchemaUnion) AsBool

func (ResponseFormatJsonSchemaJsonSchemaUnion) AsFloat

func (ResponseFormatJsonSchemaJsonSchemaUnion) AsString

func (ResponseFormatJsonSchemaJsonSchemaUnion) RawJSON

Returns the unmodified JSON received from the API

func (*ResponseFormatJsonSchemaJsonSchemaUnion) UnmarshalJSON

func (r *ResponseFormatJsonSchemaJsonSchemaUnion) UnmarshalJSON(data []byte) error

type ResponseFormatJsonSchemaJsonSchemaUnionParam

type ResponseFormatJsonSchemaJsonSchemaUnionParam 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"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (ResponseFormatJsonSchemaJsonSchemaUnionParam) MarshalJSON

func (*ResponseFormatJsonSchemaJsonSchemaUnionParam) UnmarshalJSON

func (u *ResponseFormatJsonSchemaJsonSchemaUnionParam) UnmarshalJSON(data []byte) error

type ResponseFormatJsonSchemaParam

type ResponseFormatJsonSchemaParam struct {
	// The JSON schema the response should conform to. In a Python SDK, this is often a
	// `pydantic` model.
	JsonSchema map[string]ResponseFormatJsonSchemaJsonSchemaUnionParam `json:"json_schema,omitzero,required"`
	// Must be "json_schema" to identify this format type
	//
	// This field can be elided, and will marshal its zero value as "json_schema".
	Type constant.JsonSchema `json:"type,required"`
	// contains filtered or unexported fields
}

Configuration for JSON schema-guided response generation.

The properties JsonSchema, Type are required.

func (ResponseFormatJsonSchemaParam) MarshalJSON

func (r ResponseFormatJsonSchemaParam) MarshalJSON() (data []byte, err error)

func (*ResponseFormatJsonSchemaParam) UnmarshalJSON

func (r *ResponseFormatJsonSchemaParam) UnmarshalJSON(data []byte) error

type ResponseFormatUnion

type ResponseFormatUnion struct {
	// This field is from variant [ResponseFormatJsonSchema].
	JsonSchema map[string]ResponseFormatJsonSchemaJsonSchemaUnion `json:"json_schema"`
	// Any of "json_schema", "grammar".
	Type string `json:"type"`
	// This field is from variant [ResponseFormatGrammar].
	Bnf  map[string]ResponseFormatGrammarBnfUnion `json:"bnf"`
	JSON struct {
		JsonSchema respjson.Field
		Type       respjson.Field
		Bnf        respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

ResponseFormatUnion contains all possible properties and values from ResponseFormatJsonSchema, ResponseFormatGrammar.

Use the ResponseFormatUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (ResponseFormatUnion) AsAny

func (u ResponseFormatUnion) AsAny() anyResponseFormat

Use the following switch statement to find the correct variant

switch variant := ResponseFormatUnion.AsAny().(type) {
case shared.ResponseFormatJsonSchema:
case shared.ResponseFormatGrammar:
default:
  fmt.Errorf("no variant present")
}

func (ResponseFormatUnion) AsGrammar

func (u ResponseFormatUnion) AsGrammar() (v ResponseFormatGrammar)

func (ResponseFormatUnion) AsJsonSchema

func (u ResponseFormatUnion) AsJsonSchema() (v ResponseFormatJsonSchema)

func (ResponseFormatUnion) RawJSON

func (u ResponseFormatUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (ResponseFormatUnion) ToParam

ToParam converts this ResponseFormatUnion to a ResponseFormatUnionParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with ResponseFormatUnionParam.Overrides()

func (*ResponseFormatUnion) UnmarshalJSON

func (r *ResponseFormatUnion) UnmarshalJSON(data []byte) error

type ResponseFormatUnionParam

type ResponseFormatUnionParam struct {
	OfJsonSchema *ResponseFormatJsonSchemaParam `json:",omitzero,inline"`
	OfGrammar    *ResponseFormatGrammarParam    `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (ResponseFormatUnionParam) GetBnf

Returns a pointer to the underlying variant's property, if present.

func (ResponseFormatUnionParam) GetJsonSchema

Returns a pointer to the underlying variant's property, if present.

func (ResponseFormatUnionParam) GetType

func (u ResponseFormatUnionParam) GetType() *string

Returns a pointer to the underlying variant's property, if present.

func (ResponseFormatUnionParam) MarshalJSON

func (u ResponseFormatUnionParam) MarshalJSON() ([]byte, error)

func (*ResponseFormatUnionParam) UnmarshalJSON

func (u *ResponseFormatUnionParam) UnmarshalJSON(data []byte) error

type ReturnType

type ReturnType struct {
	// Any of "string", "number", "boolean", "array", "object", "json", "union",
	// "chat_completion_input", "completion_input", "agent_turn_input".
	Type ReturnTypeType `json:"type,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ReturnType) RawJSON

func (r ReturnType) RawJSON() string

Returns the unmodified JSON received from the API

func (ReturnType) ToParam

func (r ReturnType) ToParam() ReturnTypeParam

ToParam converts this ReturnType to a ReturnTypeParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with ReturnTypeParam.Overrides()

func (*ReturnType) UnmarshalJSON

func (r *ReturnType) UnmarshalJSON(data []byte) error

type ReturnTypeParam

type ReturnTypeParam struct {
	// Any of "string", "number", "boolean", "array", "object", "json", "union",
	// "chat_completion_input", "completion_input", "agent_turn_input".
	Type ReturnTypeType `json:"type,omitzero,required"`
	// contains filtered or unexported fields
}

The property Type is required.

func (ReturnTypeParam) MarshalJSON

func (r ReturnTypeParam) MarshalJSON() (data []byte, err error)

func (*ReturnTypeParam) UnmarshalJSON

func (r *ReturnTypeParam) UnmarshalJSON(data []byte) error

type ReturnTypeType

type ReturnTypeType string
const (
	ReturnTypeTypeString              ReturnTypeType = "string"
	ReturnTypeTypeNumber              ReturnTypeType = "number"
	ReturnTypeTypeBoolean             ReturnTypeType = "boolean"
	ReturnTypeTypeArray               ReturnTypeType = "array"
	ReturnTypeTypeObject              ReturnTypeType = "object"
	ReturnTypeTypeJson                ReturnTypeType = "json"
	ReturnTypeTypeUnion               ReturnTypeType = "union"
	ReturnTypeTypeChatCompletionInput ReturnTypeType = "chat_completion_input"
	ReturnTypeTypeCompletionInput     ReturnTypeType = "completion_input"
	ReturnTypeTypeAgentTurnInput      ReturnTypeType = "agent_turn_input"
)

type SafetyViolation

type SafetyViolation struct {
	// Additional metadata including specific violation codes for debugging and
	// telemetry
	Metadata map[string]SafetyViolationMetadataUnion `json:"metadata,required"`
	// Severity level of the violation
	//
	// Any of "info", "warn", "error".
	ViolationLevel SafetyViolationViolationLevel `json:"violation_level,required"`
	// (Optional) Message to convey to the user about the violation
	UserMessage string `json:"user_message"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Metadata       respjson.Field
		ViolationLevel respjson.Field
		UserMessage    respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Details of a safety violation detected by content moderation.

func (SafetyViolation) RawJSON

func (r SafetyViolation) RawJSON() string

Returns the unmodified JSON received from the API

func (*SafetyViolation) UnmarshalJSON

func (r *SafetyViolation) UnmarshalJSON(data []byte) error

type SafetyViolationMetadataUnion

type SafetyViolationMetadataUnion 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
		// contains filtered or unexported fields
	} `json:"-"`
}

SafetyViolationMetadataUnion 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]

func (SafetyViolationMetadataUnion) AsAnyArray

func (u SafetyViolationMetadataUnion) AsAnyArray() (v []any)

func (SafetyViolationMetadataUnion) AsBool

func (u SafetyViolationMetadataUnion) AsBool() (v bool)

func (SafetyViolationMetadataUnion) AsFloat

func (u SafetyViolationMetadataUnion) AsFloat() (v float64)

func (SafetyViolationMetadataUnion) AsString

func (u SafetyViolationMetadataUnion) AsString() (v string)

func (SafetyViolationMetadataUnion) RawJSON

Returns the unmodified JSON received from the API

func (*SafetyViolationMetadataUnion) UnmarshalJSON

func (r *SafetyViolationMetadataUnion) UnmarshalJSON(data []byte) error

type SafetyViolationViolationLevel

type SafetyViolationViolationLevel string

Severity level of the violation

const (
	SafetyViolationViolationLevelInfo  SafetyViolationViolationLevel = "info"
	SafetyViolationViolationLevelWarn  SafetyViolationViolationLevel = "warn"
	SafetyViolationViolationLevelError SafetyViolationViolationLevel = "error"
)

type SamplingParams

type SamplingParams struct {
	// The sampling strategy.
	Strategy SamplingParamsStrategyUnion `json:"strategy,omitzero,required"`
	// The maximum number of tokens that can be generated in the completion. The token
	// count of your prompt plus max_tokens cannot exceed the model's context length.
	MaxTokens param.Opt[int64] `json:"max_tokens,omitzero"`
	// Number between -2.0 and 2.0. Positive values penalize new tokens based on
	// whether they appear in the text so far, increasing the model's likelihood to
	// talk about new topics.
	RepetitionPenalty param.Opt[float64] `json:"repetition_penalty,omitzero"`
	// Up to 4 sequences where the API will stop generating further tokens. The
	// returned text will not contain the stop sequence.
	Stop []string `json:"stop,omitzero"`
	// contains filtered or unexported fields
}

Sampling parameters.

The property Strategy is required.

func (SamplingParams) MarshalJSON

func (r SamplingParams) MarshalJSON() (data []byte, err error)

func (*SamplingParams) UnmarshalJSON

func (r *SamplingParams) UnmarshalJSON(data []byte) error

type SamplingParamsResp

type SamplingParamsResp struct {
	// The sampling strategy.
	Strategy SamplingParamsStrategyUnionResp `json:"strategy,required"`
	// The maximum number of tokens that can be generated in the completion. The token
	// count of your prompt plus max_tokens cannot exceed the model's context length.
	MaxTokens int64 `json:"max_tokens"`
	// Number between -2.0 and 2.0. Positive values penalize new tokens based on
	// whether they appear in the text so far, increasing the model's likelihood to
	// talk about new topics.
	RepetitionPenalty float64 `json:"repetition_penalty"`
	// Up to 4 sequences where the API will stop generating further tokens. The
	// returned text will not contain the stop sequence.
	Stop []string `json:"stop"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Strategy          respjson.Field
		MaxTokens         respjson.Field
		RepetitionPenalty respjson.Field
		Stop              respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Sampling parameters.

func (SamplingParamsResp) RawJSON

func (r SamplingParamsResp) RawJSON() string

Returns the unmodified JSON received from the API

func (SamplingParamsResp) ToParam

func (r SamplingParamsResp) ToParam() SamplingParams

ToParam converts this SamplingParamsResp to a SamplingParams.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with SamplingParams.Overrides()

func (*SamplingParamsResp) UnmarshalJSON

func (r *SamplingParamsResp) UnmarshalJSON(data []byte) error

type SamplingParamsStrategyGreedy

type SamplingParamsStrategyGreedy struct {
	// Must be "greedy" to identify this sampling strategy
	Type constant.Greedy `json:"type,required"`
	// contains filtered or unexported fields
}

Greedy sampling strategy that selects the highest probability token at each step.

This struct has a constant value, construct it with NewSamplingParamsStrategyGreedy.

func NewSamplingParamsStrategyGreedy

func NewSamplingParamsStrategyGreedy() SamplingParamsStrategyGreedy

func (SamplingParamsStrategyGreedy) MarshalJSON

func (r SamplingParamsStrategyGreedy) MarshalJSON() (data []byte, err error)

func (*SamplingParamsStrategyGreedy) UnmarshalJSON

func (r *SamplingParamsStrategyGreedy) UnmarshalJSON(data []byte) error

type SamplingParamsStrategyGreedyResp

type SamplingParamsStrategyGreedyResp struct {
	// Must be "greedy" to identify this sampling strategy
	Type constant.Greedy `json:"type,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Greedy sampling strategy that selects the highest probability token at each step.

func (SamplingParamsStrategyGreedyResp) RawJSON

Returns the unmodified JSON received from the API

func (*SamplingParamsStrategyGreedyResp) UnmarshalJSON

func (r *SamplingParamsStrategyGreedyResp) UnmarshalJSON(data []byte) error

type SamplingParamsStrategyTopK

type SamplingParamsStrategyTopK struct {
	// Number of top tokens to consider for sampling. Must be at least 1
	TopK int64 `json:"top_k,required"`
	// Must be "top_k" to identify this sampling strategy
	//
	// This field can be elided, and will marshal its zero value as "top_k".
	Type constant.TopK `json:"type,required"`
	// contains filtered or unexported fields
}

Top-k sampling strategy that restricts sampling to the k most likely tokens.

The properties TopK, Type are required.

func (SamplingParamsStrategyTopK) MarshalJSON

func (r SamplingParamsStrategyTopK) MarshalJSON() (data []byte, err error)

func (*SamplingParamsStrategyTopK) UnmarshalJSON

func (r *SamplingParamsStrategyTopK) UnmarshalJSON(data []byte) error

type SamplingParamsStrategyTopKResp

type SamplingParamsStrategyTopKResp struct {
	// Number of top tokens to consider for sampling. Must be at least 1
	TopK int64 `json:"top_k,required"`
	// Must be "top_k" to identify this sampling strategy
	Type constant.TopK `json:"type,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		TopK        respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Top-k sampling strategy that restricts sampling to the k most likely tokens.

func (SamplingParamsStrategyTopKResp) RawJSON

Returns the unmodified JSON received from the API

func (*SamplingParamsStrategyTopKResp) UnmarshalJSON

func (r *SamplingParamsStrategyTopKResp) UnmarshalJSON(data []byte) error

type SamplingParamsStrategyTopP

type SamplingParamsStrategyTopP struct {
	// Controls randomness in sampling. Higher values increase randomness
	Temperature param.Opt[float64] `json:"temperature,omitzero"`
	// Cumulative probability threshold for nucleus sampling. Defaults to 0.95
	TopP param.Opt[float64] `json:"top_p,omitzero"`
	// Must be "top_p" to identify this sampling strategy
	//
	// This field can be elided, and will marshal its zero value as "top_p".
	Type constant.TopP `json:"type,required"`
	// contains filtered or unexported fields
}

Top-p (nucleus) sampling strategy that samples from the smallest set of tokens with cumulative probability >= p.

The property Type is required.

func (SamplingParamsStrategyTopP) MarshalJSON

func (r SamplingParamsStrategyTopP) MarshalJSON() (data []byte, err error)

func (*SamplingParamsStrategyTopP) UnmarshalJSON

func (r *SamplingParamsStrategyTopP) UnmarshalJSON(data []byte) error

type SamplingParamsStrategyTopPResp

type SamplingParamsStrategyTopPResp struct {
	// Must be "top_p" to identify this sampling strategy
	Type constant.TopP `json:"type,required"`
	// Controls randomness in sampling. Higher values increase randomness
	Temperature float64 `json:"temperature"`
	// Cumulative probability threshold for nucleus sampling. Defaults to 0.95
	TopP float64 `json:"top_p"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		Temperature respjson.Field
		TopP        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Top-p (nucleus) sampling strategy that samples from the smallest set of tokens with cumulative probability >= p.

func (SamplingParamsStrategyTopPResp) RawJSON

Returns the unmodified JSON received from the API

func (*SamplingParamsStrategyTopPResp) UnmarshalJSON

func (r *SamplingParamsStrategyTopPResp) UnmarshalJSON(data []byte) error

type SamplingParamsStrategyUnion

type SamplingParamsStrategyUnion struct {
	OfGreedy *SamplingParamsStrategyGreedy `json:",omitzero,inline"`
	OfTopP   *SamplingParamsStrategyTopP   `json:",omitzero,inline"`
	OfTopK   *SamplingParamsStrategyTopK   `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (SamplingParamsStrategyUnion) GetTemperature

func (u SamplingParamsStrategyUnion) GetTemperature() *float64

Returns a pointer to the underlying variant's property, if present.

func (SamplingParamsStrategyUnion) GetTopK

func (u SamplingParamsStrategyUnion) GetTopK() *int64

Returns a pointer to the underlying variant's property, if present.

func (SamplingParamsStrategyUnion) GetTopP

func (u SamplingParamsStrategyUnion) GetTopP() *float64

Returns a pointer to the underlying variant's property, if present.

func (SamplingParamsStrategyUnion) GetType

func (u SamplingParamsStrategyUnion) GetType() *string

Returns a pointer to the underlying variant's property, if present.

func (SamplingParamsStrategyUnion) MarshalJSON

func (u SamplingParamsStrategyUnion) MarshalJSON() ([]byte, error)

func (*SamplingParamsStrategyUnion) UnmarshalJSON

func (u *SamplingParamsStrategyUnion) UnmarshalJSON(data []byte) error

type SamplingParamsStrategyUnionResp

type SamplingParamsStrategyUnionResp struct {
	// Any of "greedy", "top_p", "top_k".
	Type string `json:"type"`
	// This field is from variant [SamplingParamsStrategyTopPResp].
	Temperature float64 `json:"temperature"`
	// This field is from variant [SamplingParamsStrategyTopPResp].
	TopP float64 `json:"top_p"`
	// This field is from variant [SamplingParamsStrategyTopKResp].
	TopK int64 `json:"top_k"`
	JSON struct {
		Type        respjson.Field
		Temperature respjson.Field
		TopP        respjson.Field
		TopK        respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

SamplingParamsStrategyUnionResp contains all possible properties and values from SamplingParamsStrategyGreedyResp, SamplingParamsStrategyTopPResp, SamplingParamsStrategyTopKResp.

Use the SamplingParamsStrategyUnionResp.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (SamplingParamsStrategyUnionResp) AsAny

func (u SamplingParamsStrategyUnionResp) AsAny() anySamplingParamsStrategyResp

Use the following switch statement to find the correct variant

switch variant := SamplingParamsStrategyUnionResp.AsAny().(type) {
case shared.SamplingParamsStrategyGreedyResp:
case shared.SamplingParamsStrategyTopPResp:
case shared.SamplingParamsStrategyTopKResp:
default:
  fmt.Errorf("no variant present")
}

func (SamplingParamsStrategyUnionResp) AsGreedy

func (SamplingParamsStrategyUnionResp) AsTopK

func (SamplingParamsStrategyUnionResp) AsTopP

func (SamplingParamsStrategyUnionResp) RawJSON

Returns the unmodified JSON received from the API

func (*SamplingParamsStrategyUnionResp) UnmarshalJSON

func (r *SamplingParamsStrategyUnionResp) UnmarshalJSON(data []byte) error

type ScoringResult

type ScoringResult struct {
	// Map of metric name to aggregated value
	AggregatedResults map[string]ScoringResultAggregatedResultUnion `json:"aggregated_results,required"`
	// The scoring result for each row. Each row is a map of column name to value.
	ScoreRows []map[string]ScoringResultScoreRowUnion `json:"score_rows,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AggregatedResults respjson.Field
		ScoreRows         respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A scoring result for a single row.

func (ScoringResult) RawJSON

func (r ScoringResult) RawJSON() string

Returns the unmodified JSON received from the API

func (*ScoringResult) UnmarshalJSON

func (r *ScoringResult) UnmarshalJSON(data []byte) error

type ScoringResultAggregatedResultUnion

type ScoringResultAggregatedResultUnion 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
		// contains filtered or unexported fields
	} `json:"-"`
}

ScoringResultAggregatedResultUnion 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]

func (ScoringResultAggregatedResultUnion) AsAnyArray

func (u ScoringResultAggregatedResultUnion) AsAnyArray() (v []any)

func (ScoringResultAggregatedResultUnion) AsBool

func (ScoringResultAggregatedResultUnion) AsFloat

func (ScoringResultAggregatedResultUnion) AsString

func (u ScoringResultAggregatedResultUnion) AsString() (v string)

func (ScoringResultAggregatedResultUnion) RawJSON

Returns the unmodified JSON received from the API

func (*ScoringResultAggregatedResultUnion) UnmarshalJSON

func (r *ScoringResultAggregatedResultUnion) UnmarshalJSON(data []byte) error

type ScoringResultScoreRowUnion

type ScoringResultScoreRowUnion 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
		// contains filtered or unexported fields
	} `json:"-"`
}

ScoringResultScoreRowUnion 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]

func (ScoringResultScoreRowUnion) AsAnyArray

func (u ScoringResultScoreRowUnion) AsAnyArray() (v []any)

func (ScoringResultScoreRowUnion) AsBool

func (u ScoringResultScoreRowUnion) AsBool() (v bool)

func (ScoringResultScoreRowUnion) AsFloat

func (u ScoringResultScoreRowUnion) AsFloat() (v float64)

func (ScoringResultScoreRowUnion) AsString

func (u ScoringResultScoreRowUnion) AsString() (v string)

func (ScoringResultScoreRowUnion) RawJSON

func (u ScoringResultScoreRowUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (*ScoringResultScoreRowUnion) UnmarshalJSON

func (r *ScoringResultScoreRowUnion) UnmarshalJSON(data []byte) error

type SharedCompletionResponse

type SharedCompletionResponse struct {
	// The generated completion text
	Content string `json:"content,required"`
	// Reason why generation stopped
	//
	// Any of "end_of_turn", "end_of_message", "out_of_tokens".
	StopReason SharedCompletionResponseStopReason `json:"stop_reason,required"`
	// Optional log probabilities for generated tokens
	Logprobs []SharedCompletionResponseLogprob `json:"logprobs"`
	// (Optional) List of metrics associated with the API response
	Metrics []SharedCompletionResponseMetric `json:"metrics"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Content     respjson.Field
		StopReason  respjson.Field
		Logprobs    respjson.Field
		Metrics     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Response from a completion request.

func (SharedCompletionResponse) RawJSON

func (r SharedCompletionResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*SharedCompletionResponse) UnmarshalJSON

func (r *SharedCompletionResponse) UnmarshalJSON(data []byte) error

type SharedCompletionResponseLogprob

type SharedCompletionResponseLogprob struct {
	// Dictionary mapping tokens to their log probabilities
	LogprobsByToken map[string]float64 `json:"logprobs_by_token,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		LogprobsByToken respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Log probabilities for generated tokens.

func (SharedCompletionResponseLogprob) RawJSON

Returns the unmodified JSON received from the API

func (*SharedCompletionResponseLogprob) UnmarshalJSON

func (r *SharedCompletionResponseLogprob) UnmarshalJSON(data []byte) error

type SharedCompletionResponseMetric

type SharedCompletionResponseMetric struct {
	// The name of the metric
	Metric string `json:"metric,required"`
	// The numeric value of the metric
	Value float64 `json:"value,required"`
	// (Optional) The unit of measurement for the metric value
	Unit string `json:"unit"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Metric      respjson.Field
		Value       respjson.Field
		Unit        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A metric value included in API responses.

func (SharedCompletionResponseMetric) RawJSON

Returns the unmodified JSON received from the API

func (*SharedCompletionResponseMetric) UnmarshalJSON

func (r *SharedCompletionResponseMetric) UnmarshalJSON(data []byte) error

type SharedCompletionResponseStopReason

type SharedCompletionResponseStopReason string

Reason why generation stopped

const (
	SharedCompletionResponseStopReasonEndOfTurn    SharedCompletionResponseStopReason = "end_of_turn"
	SharedCompletionResponseStopReasonEndOfMessage SharedCompletionResponseStopReason = "end_of_message"
	SharedCompletionResponseStopReasonOutOfTokens  SharedCompletionResponseStopReason = "out_of_tokens"
)

type SharedToolDef

type SharedToolDef struct {
	// Name of the tool
	Name string `json:"name,required"`
	// (Optional) Human-readable description of what the tool does
	Description string `json:"description"`
	// (Optional) Additional metadata about the tool
	Metadata map[string]SharedToolDefMetadataUnion `json:"metadata"`
	// (Optional) List of parameters this tool accepts
	Parameters []SharedToolDefParameter `json:"parameters"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Name        respjson.Field
		Description respjson.Field
		Metadata    respjson.Field
		Parameters  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Tool definition used in runtime contexts.

func (SharedToolDef) RawJSON

func (r SharedToolDef) RawJSON() string

Returns the unmodified JSON received from the API

func (SharedToolDef) ToParam

func (r SharedToolDef) ToParam() SharedToolDefParam

ToParam converts this SharedToolDef to a SharedToolDefParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with SharedToolDefParam.Overrides()

func (*SharedToolDef) UnmarshalJSON

func (r *SharedToolDef) UnmarshalJSON(data []byte) error

type SharedToolDefMetadataUnion

type SharedToolDefMetadataUnion 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
		// contains filtered or unexported fields
	} `json:"-"`
}

SharedToolDefMetadataUnion 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]

func (SharedToolDefMetadataUnion) AsAnyArray

func (u SharedToolDefMetadataUnion) AsAnyArray() (v []any)

func (SharedToolDefMetadataUnion) AsBool

func (u SharedToolDefMetadataUnion) AsBool() (v bool)

func (SharedToolDefMetadataUnion) AsFloat

func (u SharedToolDefMetadataUnion) AsFloat() (v float64)

func (SharedToolDefMetadataUnion) AsString

func (u SharedToolDefMetadataUnion) AsString() (v string)

func (SharedToolDefMetadataUnion) RawJSON

func (u SharedToolDefMetadataUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (*SharedToolDefMetadataUnion) UnmarshalJSON

func (r *SharedToolDefMetadataUnion) UnmarshalJSON(data []byte) error

type SharedToolDefMetadataUnionParam

type SharedToolDefMetadataUnionParam 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"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (SharedToolDefMetadataUnionParam) MarshalJSON

func (u SharedToolDefMetadataUnionParam) MarshalJSON() ([]byte, error)

func (*SharedToolDefMetadataUnionParam) UnmarshalJSON

func (u *SharedToolDefMetadataUnionParam) UnmarshalJSON(data []byte) error

type SharedToolDefParam

type SharedToolDefParam struct {
	// Name of the tool
	Name string `json:"name,required"`
	// (Optional) Human-readable description of what the tool does
	Description param.Opt[string] `json:"description,omitzero"`
	// (Optional) Additional metadata about the tool
	Metadata map[string]SharedToolDefMetadataUnionParam `json:"metadata,omitzero"`
	// (Optional) List of parameters this tool accepts
	Parameters []SharedToolDefParameterParam `json:"parameters,omitzero"`
	// contains filtered or unexported fields
}

Tool definition used in runtime contexts.

The property Name is required.

func (SharedToolDefParam) MarshalJSON

func (r SharedToolDefParam) MarshalJSON() (data []byte, err error)

func (*SharedToolDefParam) UnmarshalJSON

func (r *SharedToolDefParam) UnmarshalJSON(data []byte) error

type SharedToolDefParameter

type SharedToolDefParameter struct {
	// Human-readable description of what the parameter does
	Description string `json:"description,required"`
	// Name of the parameter
	Name string `json:"name,required"`
	// Type of the parameter (e.g., string, integer)
	ParameterType string `json:"parameter_type,required"`
	// Whether this parameter is required for tool invocation
	Required bool `json:"required,required"`
	// (Optional) Default value for the parameter if not provided
	Default SharedToolDefParameterDefaultUnion `json:"default,nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Description   respjson.Field
		Name          respjson.Field
		ParameterType respjson.Field
		Required      respjson.Field
		Default       respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Parameter definition for a tool.

func (SharedToolDefParameter) RawJSON

func (r SharedToolDefParameter) RawJSON() string

Returns the unmodified JSON received from the API

func (*SharedToolDefParameter) UnmarshalJSON

func (r *SharedToolDefParameter) UnmarshalJSON(data []byte) error

type SharedToolDefParameterDefaultUnion

type SharedToolDefParameterDefaultUnion 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
		// contains filtered or unexported fields
	} `json:"-"`
}

SharedToolDefParameterDefaultUnion 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]

func (SharedToolDefParameterDefaultUnion) AsAnyArray

func (u SharedToolDefParameterDefaultUnion) AsAnyArray() (v []any)

func (SharedToolDefParameterDefaultUnion) AsBool

func (SharedToolDefParameterDefaultUnion) AsFloat

func (SharedToolDefParameterDefaultUnion) AsString

func (u SharedToolDefParameterDefaultUnion) AsString() (v string)

func (SharedToolDefParameterDefaultUnion) RawJSON

Returns the unmodified JSON received from the API

func (*SharedToolDefParameterDefaultUnion) UnmarshalJSON

func (r *SharedToolDefParameterDefaultUnion) UnmarshalJSON(data []byte) error

type SharedToolDefParameterDefaultUnionParam

type SharedToolDefParameterDefaultUnionParam 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"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (SharedToolDefParameterDefaultUnionParam) MarshalJSON

func (u SharedToolDefParameterDefaultUnionParam) MarshalJSON() ([]byte, error)

func (*SharedToolDefParameterDefaultUnionParam) UnmarshalJSON

func (u *SharedToolDefParameterDefaultUnionParam) UnmarshalJSON(data []byte) error

type SharedToolDefParameterParam

type SharedToolDefParameterParam struct {
	// Human-readable description of what the parameter does
	Description string `json:"description,required"`
	// Name of the parameter
	Name string `json:"name,required"`
	// Type of the parameter (e.g., string, integer)
	ParameterType string `json:"parameter_type,required"`
	// Whether this parameter is required for tool invocation
	Required bool `json:"required,required"`
	// (Optional) Default value for the parameter if not provided
	Default SharedToolDefParameterDefaultUnionParam `json:"default,omitzero"`
	// contains filtered or unexported fields
}

Parameter definition for a tool.

The properties Description, Name, ParameterType, Required are required.

func (SharedToolDefParameterParam) MarshalJSON

func (r SharedToolDefParameterParam) MarshalJSON() (data []byte, err error)

func (*SharedToolDefParameterParam) UnmarshalJSON

func (r *SharedToolDefParameterParam) UnmarshalJSON(data []byte) error

type SystemMessageParam

type SystemMessageParam struct {
	// The content of the "system prompt". If multiple system messages are provided,
	// they are concatenated. The underlying Llama Stack code may also add other system
	// messages (for example, for formatting tool definitions).
	Content InterleavedContentUnionParam `json:"content,omitzero,required"`
	// Must be "system" to identify this as a system message
	//
	// This field can be elided, and will marshal its zero value as "system".
	Role constant.System `json:"role,required"`
	// contains filtered or unexported fields
}

A system message providing instructions or context to the model.

The properties Content, Role are required.

func (SystemMessageParam) MarshalJSON

func (r SystemMessageParam) MarshalJSON() (data []byte, err error)

func (*SystemMessageParam) UnmarshalJSON

func (r *SystemMessageParam) UnmarshalJSON(data []byte) error

type ToolCall

type ToolCall struct {
	Arguments     ToolCallArgumentsUnion `json:"arguments,required"`
	CallID        string                 `json:"call_id,required"`
	ToolName      ToolCallToolName       `json:"tool_name,required"`
	ArgumentsJson string                 `json:"arguments_json"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Arguments     respjson.Field
		CallID        respjson.Field
		ToolName      respjson.Field
		ArgumentsJson respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ToolCall) RawJSON

func (r ToolCall) RawJSON() string

Returns the unmodified JSON received from the API

func (ToolCall) ToParam

func (r ToolCall) ToParam() ToolCallParam

ToParam converts this ToolCall to a ToolCallParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with ToolCallParam.Overrides()

func (*ToolCall) UnmarshalJSON

func (r *ToolCall) UnmarshalJSON(data []byte) error

type ToolCallArgumentsMapItemArrayItemUnion

type ToolCallArgumentsMapItemArrayItemUnion struct {
	// 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 [float64] instead of an object.
	OfFloat float64 `json:",inline"`
	// This field will be present if the value is a [bool] instead of an object.
	OfBool bool `json:",inline"`
	JSON   struct {
		OfString respjson.Field
		OfFloat  respjson.Field
		OfBool   respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

ToolCallArgumentsMapItemArrayItemUnion contains all possible properties and values from [string], [float64], [bool].

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: OfString OfFloat OfBool]

func (ToolCallArgumentsMapItemArrayItemUnion) AsBool

func (ToolCallArgumentsMapItemArrayItemUnion) AsFloat

func (ToolCallArgumentsMapItemArrayItemUnion) AsString

func (ToolCallArgumentsMapItemArrayItemUnion) RawJSON

Returns the unmodified JSON received from the API

func (*ToolCallArgumentsMapItemArrayItemUnion) UnmarshalJSON

func (r *ToolCallArgumentsMapItemArrayItemUnion) UnmarshalJSON(data []byte) error

type ToolCallArgumentsMapItemArrayItemUnionParam

type ToolCallArgumentsMapItemArrayItemUnionParam struct {
	OfString param.Opt[string]  `json:",omitzero,inline"`
	OfFloat  param.Opt[float64] `json:",omitzero,inline"`
	OfBool   param.Opt[bool]    `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (ToolCallArgumentsMapItemArrayItemUnionParam) MarshalJSON

func (*ToolCallArgumentsMapItemArrayItemUnionParam) UnmarshalJSON

func (u *ToolCallArgumentsMapItemArrayItemUnionParam) UnmarshalJSON(data []byte) error

type ToolCallArgumentsMapItemMapItemUnion

type ToolCallArgumentsMapItemMapItemUnion struct {
	// 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 [float64] instead of an object.
	OfFloat float64 `json:",inline"`
	// This field will be present if the value is a [bool] instead of an object.
	OfBool bool `json:",inline"`
	JSON   struct {
		OfString respjson.Field
		OfFloat  respjson.Field
		OfBool   respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

ToolCallArgumentsMapItemMapItemUnion contains all possible properties and values from [string], [float64], [bool].

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: OfString OfFloat OfBool]

func (ToolCallArgumentsMapItemMapItemUnion) AsBool

func (ToolCallArgumentsMapItemMapItemUnion) AsFloat

func (ToolCallArgumentsMapItemMapItemUnion) AsString

func (ToolCallArgumentsMapItemMapItemUnion) RawJSON

Returns the unmodified JSON received from the API

func (*ToolCallArgumentsMapItemMapItemUnion) UnmarshalJSON

func (r *ToolCallArgumentsMapItemMapItemUnion) UnmarshalJSON(data []byte) error

type ToolCallArgumentsMapItemMapItemUnionParam

type ToolCallArgumentsMapItemMapItemUnionParam struct {
	OfString param.Opt[string]  `json:",omitzero,inline"`
	OfFloat  param.Opt[float64] `json:",omitzero,inline"`
	OfBool   param.Opt[bool]    `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (ToolCallArgumentsMapItemMapItemUnionParam) MarshalJSON

func (*ToolCallArgumentsMapItemMapItemUnionParam) UnmarshalJSON

func (u *ToolCallArgumentsMapItemMapItemUnionParam) UnmarshalJSON(data []byte) error

type ToolCallArgumentsMapItemUnion

type ToolCallArgumentsMapItemUnion struct {
	// 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 [float64] instead of an object.
	OfFloat float64 `json:",inline"`
	// 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
	// [[]ToolCallArgumentsMapItemArrayItemUnion] instead of an object.
	OfToolCallArgumentsMapItemArray []ToolCallArgumentsMapItemArrayItemUnion `json:",inline"`
	JSON                            struct {
		OfString                        respjson.Field
		OfFloat                         respjson.Field
		OfBool                          respjson.Field
		OfToolCallArgumentsMapItemArray respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

ToolCallArgumentsMapItemUnion contains all possible properties and values from [string], [float64], [bool], [[]ToolCallArgumentsMapItemArrayItemUnion], [map[string]ToolCallArgumentsMapItemMapItemUnion].

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: OfString OfFloat OfBool OfToolCallArgumentsMapItemArray]

func (ToolCallArgumentsMapItemUnion) AsBool

func (u ToolCallArgumentsMapItemUnion) AsBool() (v bool)

func (ToolCallArgumentsMapItemUnion) AsFloat

func (u ToolCallArgumentsMapItemUnion) AsFloat() (v float64)

func (ToolCallArgumentsMapItemUnion) AsString

func (u ToolCallArgumentsMapItemUnion) AsString() (v string)

func (ToolCallArgumentsMapItemUnion) AsToolCallArgumentsMapItemArray

func (u ToolCallArgumentsMapItemUnion) AsToolCallArgumentsMapItemArray() (v []ToolCallArgumentsMapItemArrayItemUnion)

func (ToolCallArgumentsMapItemUnion) AsToolCallArgumentsMapItemMapMap

func (u ToolCallArgumentsMapItemUnion) AsToolCallArgumentsMapItemMapMap() (v map[string]ToolCallArgumentsMapItemMapItemUnion)

func (ToolCallArgumentsMapItemUnion) RawJSON

Returns the unmodified JSON received from the API

func (*ToolCallArgumentsMapItemUnion) UnmarshalJSON

func (r *ToolCallArgumentsMapItemUnion) UnmarshalJSON(data []byte) error

type ToolCallArgumentsMapItemUnionParam

type ToolCallArgumentsMapItemUnionParam struct {
	OfString                         param.Opt[string]                                    `json:",omitzero,inline"`
	OfFloat                          param.Opt[float64]                                   `json:",omitzero,inline"`
	OfBool                           param.Opt[bool]                                      `json:",omitzero,inline"`
	OfToolCallArgumentsMapItemArray  []ToolCallArgumentsMapItemArrayItemUnionParam        `json:",omitzero,inline"`
	OfToolCallArgumentsMapItemMapMap map[string]ToolCallArgumentsMapItemMapItemUnionParam `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (ToolCallArgumentsMapItemUnionParam) MarshalJSON

func (u ToolCallArgumentsMapItemUnionParam) MarshalJSON() ([]byte, error)

func (*ToolCallArgumentsMapItemUnionParam) UnmarshalJSON

func (u *ToolCallArgumentsMapItemUnionParam) UnmarshalJSON(data []byte) error

type ToolCallArgumentsUnion

type ToolCallArgumentsUnion struct {
	// 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 [float64] instead of an object.
	OfFloat float64 `json:",inline"`
	// 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
	// [[]ToolCallArgumentsMapItemArrayItemUnion] instead of an object.
	OfToolCallArgumentsMapItemArray []ToolCallArgumentsMapItemArrayItemUnion `json:",inline"`
	JSON                            struct {
		OfString                        respjson.Field
		OfFloat                         respjson.Field
		OfBool                          respjson.Field
		OfToolCallArgumentsMapItemArray respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

ToolCallArgumentsUnion contains all possible properties and values from [string], [map[string]ToolCallArgumentsMapItemUnion].

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: OfString OfFloat OfBool OfToolCallArgumentsMapItemArray]

func (ToolCallArgumentsUnion) AsString

func (u ToolCallArgumentsUnion) AsString() (v string)

func (ToolCallArgumentsUnion) AsToolCallArgumentsMapMap

func (u ToolCallArgumentsUnion) AsToolCallArgumentsMapMap() (v map[string]ToolCallArgumentsMapItemUnion)

func (ToolCallArgumentsUnion) RawJSON

func (u ToolCallArgumentsUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (*ToolCallArgumentsUnion) UnmarshalJSON

func (r *ToolCallArgumentsUnion) UnmarshalJSON(data []byte) error

type ToolCallArgumentsUnionParam

type ToolCallArgumentsUnionParam struct {
	OfString                  param.Opt[string]                             `json:",omitzero,inline"`
	OfToolCallArgumentsMapMap map[string]ToolCallArgumentsMapItemUnionParam `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (ToolCallArgumentsUnionParam) MarshalJSON

func (u ToolCallArgumentsUnionParam) MarshalJSON() ([]byte, error)

func (*ToolCallArgumentsUnionParam) UnmarshalJSON

func (u *ToolCallArgumentsUnionParam) UnmarshalJSON(data []byte) error

type ToolCallOrStringUnion

type ToolCallOrStringUnion struct {
	// This field will be present if the value is a [string] instead of an object.
	OfString string `json:",inline"`
	// This field is from variant [ToolCall].
	Arguments ToolCallArgumentsUnion `json:"arguments"`
	// This field is from variant [ToolCall].
	CallID string `json:"call_id"`
	// This field is from variant [ToolCall].
	ToolName ToolCallToolName `json:"tool_name"`
	// This field is from variant [ToolCall].
	ArgumentsJson string `json:"arguments_json"`
	JSON          struct {
		OfString      respjson.Field
		Arguments     respjson.Field
		CallID        respjson.Field
		ToolName      respjson.Field
		ArgumentsJson respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

ToolCallOrStringUnion contains all possible properties and values from [string], ToolCall.

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: OfString]

func (ToolCallOrStringUnion) AsString

func (u ToolCallOrStringUnion) AsString() (v string)

func (ToolCallOrStringUnion) AsToolCall

func (u ToolCallOrStringUnion) AsToolCall() (v ToolCall)

func (ToolCallOrStringUnion) RawJSON

func (u ToolCallOrStringUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (*ToolCallOrStringUnion) UnmarshalJSON

func (r *ToolCallOrStringUnion) UnmarshalJSON(data []byte) error

type ToolCallParam

type ToolCallParam struct {
	Arguments     ToolCallArgumentsUnionParam `json:"arguments,omitzero,required"`
	CallID        string                      `json:"call_id,required"`
	ToolName      ToolCallToolName            `json:"tool_name,omitzero,required"`
	ArgumentsJson param.Opt[string]           `json:"arguments_json,omitzero"`
	// contains filtered or unexported fields
}

The properties Arguments, CallID, ToolName are required.

func (ToolCallParam) MarshalJSON

func (r ToolCallParam) MarshalJSON() (data []byte, err error)

func (*ToolCallParam) UnmarshalJSON

func (r *ToolCallParam) UnmarshalJSON(data []byte) error

type ToolCallToolName

type ToolCallToolName string
const (
	ToolCallToolNameBraveSearch     ToolCallToolName = "brave_search"
	ToolCallToolNameWolframAlpha    ToolCallToolName = "wolfram_alpha"
	ToolCallToolNamePhotogen        ToolCallToolName = "photogen"
	ToolCallToolNameCodeInterpreter ToolCallToolName = "code_interpreter"
)

type ToolParamDefinition

type ToolParamDefinition struct {
	ParamType   string                          `json:"param_type,required"`
	Description param.Opt[string]               `json:"description,omitzero"`
	Required    param.Opt[bool]                 `json:"required,omitzero"`
	Default     ToolParamDefinitionDefaultUnion `json:"default,omitzero"`
	// contains filtered or unexported fields
}

The property ParamType is required.

func (ToolParamDefinition) MarshalJSON

func (r ToolParamDefinition) MarshalJSON() (data []byte, err error)

func (*ToolParamDefinition) UnmarshalJSON

func (r *ToolParamDefinition) UnmarshalJSON(data []byte) error

type ToolParamDefinitionDefaultUnion

type ToolParamDefinitionDefaultUnion 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"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (ToolParamDefinitionDefaultUnion) MarshalJSON

func (u ToolParamDefinitionDefaultUnion) MarshalJSON() ([]byte, error)

func (*ToolParamDefinitionDefaultUnion) UnmarshalJSON

func (u *ToolParamDefinitionDefaultUnion) UnmarshalJSON(data []byte) error

type ToolResponseMessage

type ToolResponseMessage struct {
	// Unique identifier for the tool call this response is for
	CallID string `json:"call_id,required"`
	// The response content from the tool
	Content InterleavedContentUnion `json:"content,required"`
	// Must be "tool" to identify this as a tool response
	Role constant.Tool `json:"role,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CallID      respjson.Field
		Content     respjson.Field
		Role        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A message representing the result of a tool invocation.

func (ToolResponseMessage) RawJSON

func (r ToolResponseMessage) RawJSON() string

Returns the unmodified JSON received from the API

func (ToolResponseMessage) ToParam

ToParam converts this ToolResponseMessage to a ToolResponseMessageParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with ToolResponseMessageParam.Overrides()

func (*ToolResponseMessage) UnmarshalJSON

func (r *ToolResponseMessage) UnmarshalJSON(data []byte) error

type ToolResponseMessageParam

type ToolResponseMessageParam struct {
	// Unique identifier for the tool call this response is for
	CallID string `json:"call_id,required"`
	// The response content from the tool
	Content InterleavedContentUnionParam `json:"content,omitzero,required"`
	// Must be "tool" to identify this as a tool response
	//
	// This field can be elided, and will marshal its zero value as "tool".
	Role constant.Tool `json:"role,required"`
	// contains filtered or unexported fields
}

A message representing the result of a tool invocation.

The properties CallID, Content, Role are required.

func (ToolResponseMessageParam) MarshalJSON

func (r ToolResponseMessageParam) MarshalJSON() (data []byte, err error)

func (*ToolResponseMessageParam) UnmarshalJSON

func (r *ToolResponseMessageParam) UnmarshalJSON(data []byte) error

type UserMessage

type UserMessage struct {
	// The content of the message, which can include text and other media
	Content InterleavedContentUnion `json:"content,required"`
	// Must be "user" to identify this as a user message
	Role constant.User `json:"role,required"`
	// (Optional) This field is used internally by Llama Stack to pass RAG context.
	// This field may be removed in the API in the future.
	Context InterleavedContentUnion `json:"context"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Content     respjson.Field
		Role        respjson.Field
		Context     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A message from the user in a chat conversation.

func (UserMessage) RawJSON

func (r UserMessage) RawJSON() string

Returns the unmodified JSON received from the API

func (UserMessage) ToParam

func (r UserMessage) ToParam() UserMessageParam

ToParam converts this UserMessage to a UserMessageParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with UserMessageParam.Overrides()

func (*UserMessage) UnmarshalJSON

func (r *UserMessage) UnmarshalJSON(data []byte) error

type UserMessageParam

type UserMessageParam struct {
	// The content of the message, which can include text and other media
	Content InterleavedContentUnionParam `json:"content,omitzero,required"`
	// (Optional) This field is used internally by Llama Stack to pass RAG context.
	// This field may be removed in the API in the future.
	Context InterleavedContentUnionParam `json:"context,omitzero"`
	// Must be "user" to identify this as a user message
	//
	// This field can be elided, and will marshal its zero value as "user".
	Role constant.User `json:"role,required"`
	// contains filtered or unexported fields
}

A message from the user in a chat conversation.

The properties Content, Role are required.

func (UserMessageParam) MarshalJSON

func (r UserMessageParam) MarshalJSON() (data []byte, err error)

func (*UserMessageParam) UnmarshalJSON

func (r *UserMessageParam) UnmarshalJSON(data []byte) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL