Documentation
¶
Index ¶
- func Bool(b bool) param.Opt[bool]
- func BoolPtr(v bool) *bool
- func DefaultClientOptions() []option.RequestOption
- func Float(f float64) param.Opt[float64]
- func FloatPtr(v float64) *float64
- func Int(i int64) param.Opt[int64]
- func IntPtr(v int64) *int64
- func NewFile(rdr io.Reader, filename string, contentType string) file
- func Opt[T comparable](v T) param.Opt[T]
- func Ptr[T any](v T) *T
- func String(s string) param.Opt[string]
- func StringPtr(v string) *string
- func Time(t time.Time) param.Opt[time.Time]
- func TimePtr(v time.Time) *time.Time
- type AlgorithmConfigLoRaParam
- type AlgorithmConfigQatParam
- type AlgorithmConfigUnionParam
- func (u AlgorithmConfigUnionParam) GetAlpha() *int64
- func (u AlgorithmConfigUnionParam) GetApplyLoraToMlp() *bool
- func (u AlgorithmConfigUnionParam) GetApplyLoraToOutput() *bool
- func (u AlgorithmConfigUnionParam) GetGroupSize() *int64
- func (u AlgorithmConfigUnionParam) GetLoraAttnModules() []string
- func (u AlgorithmConfigUnionParam) GetQuantizeBase() *bool
- func (u AlgorithmConfigUnionParam) GetQuantizerName() *string
- func (u AlgorithmConfigUnionParam) GetRank() *int64
- func (u AlgorithmConfigUnionParam) GetType() *string
- func (u AlgorithmConfigUnionParam) GetUseDora() *bool
- func (u AlgorithmConfigUnionParam) MarshalJSON() ([]byte, error)
- func (u *AlgorithmConfigUnionParam) UnmarshalJSON(data []byte) error
- type AlphaBenchmarkRegisterParams
- type AlphaBenchmarkRegisterParamsMetadataUnion
- type AlphaBenchmarkService
- func (r *AlphaBenchmarkService) Get(ctx context.Context, benchmarkID string, opts ...option.RequestOption) (res *Benchmark, err error)
- func (r *AlphaBenchmarkService) List(ctx context.Context, opts ...option.RequestOption) (res *[]Benchmark, err error)
- func (r *AlphaBenchmarkService) Register(ctx context.Context, body AlphaBenchmarkRegisterParams, ...) (err error)deprecated
- type AlphaEvalEvaluateRowsAlphaParams
- type AlphaEvalEvaluateRowsAlphaParamsInputRowUnion
- type AlphaEvalEvaluateRowsParams
- type AlphaEvalEvaluateRowsParamsInputRowUnion
- type AlphaEvalJobCancelParams
- type AlphaEvalJobGetParams
- type AlphaEvalJobService
- func (r *AlphaEvalJobService) Cancel(ctx context.Context, jobID string, body AlphaEvalJobCancelParams, ...) (err error)
- func (r *AlphaEvalJobService) Get(ctx context.Context, jobID string, query AlphaEvalJobGetParams, ...) (res *EvaluateResponse, err error)
- func (r *AlphaEvalJobService) Status(ctx context.Context, jobID string, query AlphaEvalJobStatusParams, ...) (res *Job, err error)
- type AlphaEvalJobStatusParams
- type AlphaEvalRunEvalAlphaParams
- type AlphaEvalRunEvalParams
- type AlphaEvalService
- func (r *AlphaEvalService) EvaluateRows(ctx context.Context, benchmarkID string, body AlphaEvalEvaluateRowsParams, ...) (res *EvaluateResponse, err error)
- func (r *AlphaEvalService) EvaluateRowsAlpha(ctx context.Context, benchmarkID string, body AlphaEvalEvaluateRowsAlphaParams, ...) (res *EvaluateResponse, err error)
- func (r *AlphaEvalService) RunEval(ctx context.Context, benchmarkID string, body AlphaEvalRunEvalParams, ...) (res *Job, err error)
- func (r *AlphaEvalService) RunEvalAlpha(ctx context.Context, benchmarkID string, body AlphaEvalRunEvalAlphaParams, ...) (res *Job, err error)
- type AlphaInferenceRerankParams
- type AlphaInferenceRerankParamsItemOpenAIChatCompletionContentPartImageParam
- type AlphaInferenceRerankParamsItemOpenAIChatCompletionContentPartImageParamImageURL
- type AlphaInferenceRerankParamsItemOpenAIChatCompletionContentPartTextParam
- type AlphaInferenceRerankParamsItemUnion
- func (u AlphaInferenceRerankParamsItemUnion) GetImageURL() ...
- func (u AlphaInferenceRerankParamsItemUnion) GetText() *string
- func (u AlphaInferenceRerankParamsItemUnion) GetType() *string
- func (u AlphaInferenceRerankParamsItemUnion) MarshalJSON() ([]byte, error)
- func (u *AlphaInferenceRerankParamsItemUnion) UnmarshalJSON(data []byte) error
- type AlphaInferenceRerankParamsQueryOpenAIChatCompletionContentPartImageParam
- type AlphaInferenceRerankParamsQueryOpenAIChatCompletionContentPartImageParamImageURL
- type AlphaInferenceRerankParamsQueryOpenAIChatCompletionContentPartTextParam
- type AlphaInferenceRerankParamsQueryUnion
- func (u AlphaInferenceRerankParamsQueryUnion) GetImageURL() ...
- func (u AlphaInferenceRerankParamsQueryUnion) GetText() *string
- func (u AlphaInferenceRerankParamsQueryUnion) GetType() *string
- func (u AlphaInferenceRerankParamsQueryUnion) MarshalJSON() ([]byte, error)
- func (u *AlphaInferenceRerankParamsQueryUnion) UnmarshalJSON(data []byte) error
- type AlphaInferenceRerankResponse
- type AlphaInferenceRerankResponseEnvelope
- type AlphaInferenceService
- type AlphaPostTrainingJobArtifactsParams
- type AlphaPostTrainingJobArtifactsResponse
- type AlphaPostTrainingJobArtifactsResponseCheckpoint
- type AlphaPostTrainingJobArtifactsResponseCheckpointTrainingMetrics
- type AlphaPostTrainingJobCancelParams
- type AlphaPostTrainingJobService
- func (r *AlphaPostTrainingJobService) Artifacts(ctx context.Context, query AlphaPostTrainingJobArtifactsParams, ...) (res *AlphaPostTrainingJobArtifactsResponse, err error)
- func (r *AlphaPostTrainingJobService) Cancel(ctx context.Context, body AlphaPostTrainingJobCancelParams, ...) (err error)
- func (r *AlphaPostTrainingJobService) List(ctx context.Context, opts ...option.RequestOption) (res *[]ListPostTrainingJobsResponseData, err error)
- func (r *AlphaPostTrainingJobService) Status(ctx context.Context, query AlphaPostTrainingJobStatusParams, ...) (res *AlphaPostTrainingJobStatusResponse, err error)
- type AlphaPostTrainingJobStatusParams
- type AlphaPostTrainingJobStatusResponse
- type AlphaPostTrainingJobStatusResponseCheckpoint
- type AlphaPostTrainingJobStatusResponseCheckpointTrainingMetrics
- type AlphaPostTrainingJobStatusResponseResourcesAllocatedUnion
- func (u AlphaPostTrainingJobStatusResponseResourcesAllocatedUnion) AsAnyArray() (v []any)
- func (u AlphaPostTrainingJobStatusResponseResourcesAllocatedUnion) AsBool() (v bool)
- func (u AlphaPostTrainingJobStatusResponseResourcesAllocatedUnion) AsFloat() (v float64)
- func (u AlphaPostTrainingJobStatusResponseResourcesAllocatedUnion) AsString() (v string)
- func (u AlphaPostTrainingJobStatusResponseResourcesAllocatedUnion) RawJSON() string
- func (r *AlphaPostTrainingJobStatusResponseResourcesAllocatedUnion) UnmarshalJSON(data []byte) error
- type AlphaPostTrainingJobStatusResponseStatus
- type AlphaPostTrainingPreferenceOptimizeParams
- type AlphaPostTrainingPreferenceOptimizeParamsAlgorithmConfig
- type AlphaPostTrainingPreferenceOptimizeParamsHyperparamSearchConfigUnion
- type AlphaPostTrainingPreferenceOptimizeParamsLoggerConfigUnion
- type AlphaPostTrainingPreferenceOptimizeParamsTrainingConfig
- type AlphaPostTrainingPreferenceOptimizeParamsTrainingConfigDataConfig
- type AlphaPostTrainingPreferenceOptimizeParamsTrainingConfigEfficiencyConfig
- type AlphaPostTrainingPreferenceOptimizeParamsTrainingConfigOptimizerConfig
- type AlphaPostTrainingService
- func (r *AlphaPostTrainingService) PreferenceOptimize(ctx context.Context, body AlphaPostTrainingPreferenceOptimizeParams, ...) (res *PostTrainingJob, err error)
- func (r *AlphaPostTrainingService) SupervisedFineTune(ctx context.Context, body AlphaPostTrainingSupervisedFineTuneParams, ...) (res *PostTrainingJob, err error)
- type AlphaPostTrainingSupervisedFineTuneParams
- type AlphaPostTrainingSupervisedFineTuneParamsHyperparamSearchConfigUnion
- type AlphaPostTrainingSupervisedFineTuneParamsLoggerConfigUnion
- type AlphaPostTrainingSupervisedFineTuneParamsTrainingConfig
- type AlphaPostTrainingSupervisedFineTuneParamsTrainingConfigDataConfig
- type AlphaPostTrainingSupervisedFineTuneParamsTrainingConfigEfficiencyConfig
- type AlphaPostTrainingSupervisedFineTuneParamsTrainingConfigOptimizerConfig
- type AlphaService
- type Benchmark
- type BenchmarkConfigEvalCandidateParam
- type BenchmarkConfigParam
- type BenchmarkMetadataUnion
- func (u BenchmarkMetadataUnion) AsAnyArray() (v []any)
- func (u BenchmarkMetadataUnion) AsBool() (v bool)
- func (u BenchmarkMetadataUnion) AsFloat() (v float64)
- func (u BenchmarkMetadataUnion) AsString() (v string)
- func (u BenchmarkMetadataUnion) RawJSON() string
- func (r *BenchmarkMetadataUnion) UnmarshalJSON(data []byte) error
- type BetaDatasetAppendrowsParams
- type BetaDatasetAppendrowsParamsRowUnion
- type BetaDatasetGetResponse
- type BetaDatasetGetResponseMetadataUnion
- func (u BetaDatasetGetResponseMetadataUnion) AsAnyArray() (v []any)
- func (u BetaDatasetGetResponseMetadataUnion) AsBool() (v bool)
- func (u BetaDatasetGetResponseMetadataUnion) AsFloat() (v float64)
- func (u BetaDatasetGetResponseMetadataUnion) AsString() (v string)
- func (u BetaDatasetGetResponseMetadataUnion) RawJSON() string
- func (r *BetaDatasetGetResponseMetadataUnion) UnmarshalJSON(data []byte) error
- type BetaDatasetGetResponsePurpose
- type BetaDatasetGetResponseSourceRows
- type BetaDatasetGetResponseSourceRowsRowUnion
- func (u BetaDatasetGetResponseSourceRowsRowUnion) AsAnyArray() (v []any)
- func (u BetaDatasetGetResponseSourceRowsRowUnion) AsBool() (v bool)
- func (u BetaDatasetGetResponseSourceRowsRowUnion) AsFloat() (v float64)
- func (u BetaDatasetGetResponseSourceRowsRowUnion) AsString() (v string)
- func (u BetaDatasetGetResponseSourceRowsRowUnion) RawJSON() string
- func (r *BetaDatasetGetResponseSourceRowsRowUnion) UnmarshalJSON(data []byte) error
- type BetaDatasetGetResponseSourceUnion
- func (u BetaDatasetGetResponseSourceUnion) AsAny() anyBetaDatasetGetResponseSource
- func (u BetaDatasetGetResponseSourceUnion) AsRows() (v BetaDatasetGetResponseSourceRows)
- func (u BetaDatasetGetResponseSourceUnion) AsUri() (v BetaDatasetGetResponseSourceUri)
- func (u BetaDatasetGetResponseSourceUnion) RawJSON() string
- func (r *BetaDatasetGetResponseSourceUnion) UnmarshalJSON(data []byte) error
- type BetaDatasetGetResponseSourceUri
- type BetaDatasetIterrowsParams
- type BetaDatasetIterrowsResponse
- type BetaDatasetIterrowsResponseDataUnion
- func (u BetaDatasetIterrowsResponseDataUnion) AsAnyArray() (v []any)
- func (u BetaDatasetIterrowsResponseDataUnion) AsBool() (v bool)
- func (u BetaDatasetIterrowsResponseDataUnion) AsFloat() (v float64)
- func (u BetaDatasetIterrowsResponseDataUnion) AsString() (v string)
- func (u BetaDatasetIterrowsResponseDataUnion) RawJSON() string
- func (r *BetaDatasetIterrowsResponseDataUnion) UnmarshalJSON(data []byte) error
- type BetaDatasetRegisterParams
- type BetaDatasetRegisterParamsMetadataUnion
- type BetaDatasetRegisterParamsPurpose
- type BetaDatasetRegisterParamsSourceRows
- type BetaDatasetRegisterParamsSourceRowsRowUnion
- type BetaDatasetRegisterParamsSourceUnion
- func (u BetaDatasetRegisterParamsSourceUnion) GetRows() []map[string]BetaDatasetRegisterParamsSourceRowsRowUnion
- func (u BetaDatasetRegisterParamsSourceUnion) GetType() *string
- func (u BetaDatasetRegisterParamsSourceUnion) GetUri() *string
- func (u BetaDatasetRegisterParamsSourceUnion) MarshalJSON() ([]byte, error)
- func (u *BetaDatasetRegisterParamsSourceUnion) UnmarshalJSON(data []byte) error
- type BetaDatasetRegisterParamsSourceUri
- type BetaDatasetRegisterResponse
- type BetaDatasetRegisterResponseMetadataUnion
- func (u BetaDatasetRegisterResponseMetadataUnion) AsAnyArray() (v []any)
- func (u BetaDatasetRegisterResponseMetadataUnion) AsBool() (v bool)
- func (u BetaDatasetRegisterResponseMetadataUnion) AsFloat() (v float64)
- func (u BetaDatasetRegisterResponseMetadataUnion) AsString() (v string)
- func (u BetaDatasetRegisterResponseMetadataUnion) RawJSON() string
- func (r *BetaDatasetRegisterResponseMetadataUnion) UnmarshalJSON(data []byte) error
- type BetaDatasetRegisterResponsePurpose
- type BetaDatasetRegisterResponseSourceRows
- type BetaDatasetRegisterResponseSourceRowsRowUnion
- func (u BetaDatasetRegisterResponseSourceRowsRowUnion) AsAnyArray() (v []any)
- func (u BetaDatasetRegisterResponseSourceRowsRowUnion) AsBool() (v bool)
- func (u BetaDatasetRegisterResponseSourceRowsRowUnion) AsFloat() (v float64)
- func (u BetaDatasetRegisterResponseSourceRowsRowUnion) AsString() (v string)
- func (u BetaDatasetRegisterResponseSourceRowsRowUnion) RawJSON() string
- func (r *BetaDatasetRegisterResponseSourceRowsRowUnion) UnmarshalJSON(data []byte) error
- type BetaDatasetRegisterResponseSourceUnion
- func (u BetaDatasetRegisterResponseSourceUnion) AsAny() anyBetaDatasetRegisterResponseSource
- func (u BetaDatasetRegisterResponseSourceUnion) AsRows() (v BetaDatasetRegisterResponseSourceRows)
- func (u BetaDatasetRegisterResponseSourceUnion) AsUri() (v BetaDatasetRegisterResponseSourceUri)
- func (u BetaDatasetRegisterResponseSourceUnion) RawJSON() string
- func (r *BetaDatasetRegisterResponseSourceUnion) UnmarshalJSON(data []byte) error
- type BetaDatasetRegisterResponseSourceUri
- type BetaDatasetService
- func (r *BetaDatasetService) Appendrows(ctx context.Context, datasetID string, body BetaDatasetAppendrowsParams, ...) (err error)
- func (r *BetaDatasetService) Get(ctx context.Context, datasetID string, opts ...option.RequestOption) (res *BetaDatasetGetResponse, err error)
- func (r *BetaDatasetService) Iterrows(ctx context.Context, datasetID string, query BetaDatasetIterrowsParams, ...) (res *BetaDatasetIterrowsResponse, err error)
- func (r *BetaDatasetService) List(ctx context.Context, opts ...option.RequestOption) (res *[]ListDatasetsResponseData, err error)
- func (r *BetaDatasetService) Register(ctx context.Context, body BetaDatasetRegisterParams, ...) (res *BetaDatasetRegisterResponse, err error)deprecated
- func (r *BetaDatasetService) Unregister(ctx context.Context, datasetID string, opts ...option.RequestOption) (err error)deprecated
- type BetaService
- type ChatCompletionChunk
- type ChatCompletionChunkChoice
- type ChatCompletionChunkChoiceDelta
- type ChatCompletionChunkChoiceDeltaToolCall
- type ChatCompletionChunkChoiceDeltaToolCallFunction
- type ChatCompletionChunkChoiceLogprobs
- type ChatCompletionChunkChoiceLogprobsContent
- type ChatCompletionChunkChoiceLogprobsContentTopLogprob
- type ChatCompletionChunkChoiceLogprobsRefusal
- type ChatCompletionChunkChoiceLogprobsRefusalTopLogprob
- type ChatCompletionChunkUsage
- type ChatCompletionChunkUsageCompletionTokensDetails
- type ChatCompletionChunkUsagePromptTokensDetails
- type ChatCompletionGetResponse
- type ChatCompletionGetResponseChoice
- type ChatCompletionGetResponseChoiceLogprobs
- type ChatCompletionGetResponseChoiceLogprobsContent
- type ChatCompletionGetResponseChoiceLogprobsContentTopLogprob
- type ChatCompletionGetResponseChoiceLogprobsRefusal
- type ChatCompletionGetResponseChoiceLogprobsRefusalTopLogprob
- type ChatCompletionGetResponseChoiceMessageAssistant
- type ChatCompletionGetResponseChoiceMessageAssistantContentArrayItem
- type ChatCompletionGetResponseChoiceMessageAssistantContentUnion
- func (u ChatCompletionGetResponseChoiceMessageAssistantContentUnion) AsChatCompletionGetResponseChoiceMessageAssistantContentArray() (v []ChatCompletionGetResponseChoiceMessageAssistantContentArrayItem)
- func (u ChatCompletionGetResponseChoiceMessageAssistantContentUnion) AsString() (v string)
- func (u ChatCompletionGetResponseChoiceMessageAssistantContentUnion) RawJSON() string
- func (r *ChatCompletionGetResponseChoiceMessageAssistantContentUnion) UnmarshalJSON(data []byte) error
- type ChatCompletionGetResponseChoiceMessageAssistantToolCall
- type ChatCompletionGetResponseChoiceMessageAssistantToolCallFunction
- type ChatCompletionGetResponseChoiceMessageDeveloper
- type ChatCompletionGetResponseChoiceMessageDeveloperContentArrayItem
- type ChatCompletionGetResponseChoiceMessageDeveloperContentUnion
- func (u ChatCompletionGetResponseChoiceMessageDeveloperContentUnion) AsChatCompletionGetResponseChoiceMessageDeveloperContentArray() (v []ChatCompletionGetResponseChoiceMessageDeveloperContentArrayItem)
- func (u ChatCompletionGetResponseChoiceMessageDeveloperContentUnion) AsString() (v string)
- func (u ChatCompletionGetResponseChoiceMessageDeveloperContentUnion) RawJSON() string
- func (r *ChatCompletionGetResponseChoiceMessageDeveloperContentUnion) UnmarshalJSON(data []byte) error
- type ChatCompletionGetResponseChoiceMessageSystem
- type ChatCompletionGetResponseChoiceMessageSystemContentArrayItem
- type ChatCompletionGetResponseChoiceMessageSystemContentUnion
- func (u ChatCompletionGetResponseChoiceMessageSystemContentUnion) AsChatCompletionGetResponseChoiceMessageSystemContentArray() (v []ChatCompletionGetResponseChoiceMessageSystemContentArrayItem)
- func (u ChatCompletionGetResponseChoiceMessageSystemContentUnion) AsString() (v string)
- func (u ChatCompletionGetResponseChoiceMessageSystemContentUnion) RawJSON() string
- func (r *ChatCompletionGetResponseChoiceMessageSystemContentUnion) UnmarshalJSON(data []byte) error
- type ChatCompletionGetResponseChoiceMessageTool
- type ChatCompletionGetResponseChoiceMessageToolContentArrayItem
- type ChatCompletionGetResponseChoiceMessageToolContentUnion
- func (u ChatCompletionGetResponseChoiceMessageToolContentUnion) AsChatCompletionGetResponseChoiceMessageToolContentArray() (v []ChatCompletionGetResponseChoiceMessageToolContentArrayItem)
- func (u ChatCompletionGetResponseChoiceMessageToolContentUnion) AsString() (v string)
- func (u ChatCompletionGetResponseChoiceMessageToolContentUnion) RawJSON() string
- func (r *ChatCompletionGetResponseChoiceMessageToolContentUnion) UnmarshalJSON(data []byte) error
- type ChatCompletionGetResponseChoiceMessageUnion
- func (u ChatCompletionGetResponseChoiceMessageUnion) AsAny() anyChatCompletionGetResponseChoiceMessage
- func (u ChatCompletionGetResponseChoiceMessageUnion) AsAssistant() (v ChatCompletionGetResponseChoiceMessageAssistant)
- func (u ChatCompletionGetResponseChoiceMessageUnion) AsDeveloper() (v ChatCompletionGetResponseChoiceMessageDeveloper)
- func (u ChatCompletionGetResponseChoiceMessageUnion) AsSystem() (v ChatCompletionGetResponseChoiceMessageSystem)
- func (u ChatCompletionGetResponseChoiceMessageUnion) AsTool() (v ChatCompletionGetResponseChoiceMessageTool)
- func (u ChatCompletionGetResponseChoiceMessageUnion) AsUser() (v ChatCompletionGetResponseChoiceMessageUser)
- func (u ChatCompletionGetResponseChoiceMessageUnion) RawJSON() string
- func (r *ChatCompletionGetResponseChoiceMessageUnion) UnmarshalJSON(data []byte) error
- type ChatCompletionGetResponseChoiceMessageUnionContent
- type ChatCompletionGetResponseChoiceMessageUser
- type ChatCompletionGetResponseChoiceMessageUserContentArrayItemFile
- type ChatCompletionGetResponseChoiceMessageUserContentArrayItemFileFile
- type ChatCompletionGetResponseChoiceMessageUserContentArrayItemImageURL
- type ChatCompletionGetResponseChoiceMessageUserContentArrayItemImageURLImageURL
- type ChatCompletionGetResponseChoiceMessageUserContentArrayItemText
- type ChatCompletionGetResponseChoiceMessageUserContentArrayItemUnion
- func (u ChatCompletionGetResponseChoiceMessageUserContentArrayItemUnion) AsAny() anyChatCompletionGetResponseChoiceMessageUserContentArrayItem
- func (u ChatCompletionGetResponseChoiceMessageUserContentArrayItemUnion) AsFile() (v ChatCompletionGetResponseChoiceMessageUserContentArrayItemFile)
- func (u ChatCompletionGetResponseChoiceMessageUserContentArrayItemUnion) AsImageURL() (v ChatCompletionGetResponseChoiceMessageUserContentArrayItemImageURL)
- func (u ChatCompletionGetResponseChoiceMessageUserContentArrayItemUnion) AsText() (v ChatCompletionGetResponseChoiceMessageUserContentArrayItemText)
- func (u ChatCompletionGetResponseChoiceMessageUserContentArrayItemUnion) RawJSON() string
- func (r *ChatCompletionGetResponseChoiceMessageUserContentArrayItemUnion) UnmarshalJSON(data []byte) error
- type ChatCompletionGetResponseChoiceMessageUserContentUnion
- func (u ChatCompletionGetResponseChoiceMessageUserContentUnion) AsChatCompletionGetResponseChoiceMessageUserContentArray() (v []ChatCompletionGetResponseChoiceMessageUserContentArrayItemUnion)
- func (u ChatCompletionGetResponseChoiceMessageUserContentUnion) AsString() (v string)
- func (u ChatCompletionGetResponseChoiceMessageUserContentUnion) RawJSON() string
- func (r *ChatCompletionGetResponseChoiceMessageUserContentUnion) UnmarshalJSON(data []byte) error
- type ChatCompletionGetResponseInputMessageAssistant
- type ChatCompletionGetResponseInputMessageAssistantContentArrayItem
- type ChatCompletionGetResponseInputMessageAssistantContentUnion
- func (u ChatCompletionGetResponseInputMessageAssistantContentUnion) AsChatCompletionGetResponseInputMessageAssistantContentArray() (v []ChatCompletionGetResponseInputMessageAssistantContentArrayItem)
- func (u ChatCompletionGetResponseInputMessageAssistantContentUnion) AsString() (v string)
- func (u ChatCompletionGetResponseInputMessageAssistantContentUnion) RawJSON() string
- func (r *ChatCompletionGetResponseInputMessageAssistantContentUnion) UnmarshalJSON(data []byte) error
- type ChatCompletionGetResponseInputMessageAssistantToolCall
- type ChatCompletionGetResponseInputMessageAssistantToolCallFunction
- type ChatCompletionGetResponseInputMessageDeveloper
- type ChatCompletionGetResponseInputMessageDeveloperContentArrayItem
- type ChatCompletionGetResponseInputMessageDeveloperContentUnion
- func (u ChatCompletionGetResponseInputMessageDeveloperContentUnion) AsChatCompletionGetResponseInputMessageDeveloperContentArray() (v []ChatCompletionGetResponseInputMessageDeveloperContentArrayItem)
- func (u ChatCompletionGetResponseInputMessageDeveloperContentUnion) AsString() (v string)
- func (u ChatCompletionGetResponseInputMessageDeveloperContentUnion) RawJSON() string
- func (r *ChatCompletionGetResponseInputMessageDeveloperContentUnion) UnmarshalJSON(data []byte) error
- type ChatCompletionGetResponseInputMessageSystem
- type ChatCompletionGetResponseInputMessageSystemContentArrayItem
- type ChatCompletionGetResponseInputMessageSystemContentUnion
- func (u ChatCompletionGetResponseInputMessageSystemContentUnion) AsChatCompletionGetResponseInputMessageSystemContentArray() (v []ChatCompletionGetResponseInputMessageSystemContentArrayItem)
- func (u ChatCompletionGetResponseInputMessageSystemContentUnion) AsString() (v string)
- func (u ChatCompletionGetResponseInputMessageSystemContentUnion) RawJSON() string
- func (r *ChatCompletionGetResponseInputMessageSystemContentUnion) UnmarshalJSON(data []byte) error
- type ChatCompletionGetResponseInputMessageTool
- type ChatCompletionGetResponseInputMessageToolContentArrayItem
- type ChatCompletionGetResponseInputMessageToolContentUnion
- func (u ChatCompletionGetResponseInputMessageToolContentUnion) AsChatCompletionGetResponseInputMessageToolContentArray() (v []ChatCompletionGetResponseInputMessageToolContentArrayItem)
- func (u ChatCompletionGetResponseInputMessageToolContentUnion) AsString() (v string)
- func (u ChatCompletionGetResponseInputMessageToolContentUnion) RawJSON() string
- func (r *ChatCompletionGetResponseInputMessageToolContentUnion) UnmarshalJSON(data []byte) error
- type ChatCompletionGetResponseInputMessageUnion
- func (u ChatCompletionGetResponseInputMessageUnion) AsAny() anyChatCompletionGetResponseInputMessage
- func (u ChatCompletionGetResponseInputMessageUnion) AsAssistant() (v ChatCompletionGetResponseInputMessageAssistant)
- func (u ChatCompletionGetResponseInputMessageUnion) AsDeveloper() (v ChatCompletionGetResponseInputMessageDeveloper)
- func (u ChatCompletionGetResponseInputMessageUnion) AsSystem() (v ChatCompletionGetResponseInputMessageSystem)
- func (u ChatCompletionGetResponseInputMessageUnion) AsTool() (v ChatCompletionGetResponseInputMessageTool)
- func (u ChatCompletionGetResponseInputMessageUnion) AsUser() (v ChatCompletionGetResponseInputMessageUser)
- func (u ChatCompletionGetResponseInputMessageUnion) RawJSON() string
- func (r *ChatCompletionGetResponseInputMessageUnion) UnmarshalJSON(data []byte) error
- type ChatCompletionGetResponseInputMessageUnionContent
- type ChatCompletionGetResponseInputMessageUser
- type ChatCompletionGetResponseInputMessageUserContentArrayItemFile
- type ChatCompletionGetResponseInputMessageUserContentArrayItemFileFile
- type ChatCompletionGetResponseInputMessageUserContentArrayItemImageURL
- type ChatCompletionGetResponseInputMessageUserContentArrayItemImageURLImageURL
- type ChatCompletionGetResponseInputMessageUserContentArrayItemText
- type ChatCompletionGetResponseInputMessageUserContentArrayItemUnion
- func (u ChatCompletionGetResponseInputMessageUserContentArrayItemUnion) AsAny() anyChatCompletionGetResponseInputMessageUserContentArrayItem
- func (u ChatCompletionGetResponseInputMessageUserContentArrayItemUnion) AsFile() (v ChatCompletionGetResponseInputMessageUserContentArrayItemFile)
- func (u ChatCompletionGetResponseInputMessageUserContentArrayItemUnion) AsImageURL() (v ChatCompletionGetResponseInputMessageUserContentArrayItemImageURL)
- func (u ChatCompletionGetResponseInputMessageUserContentArrayItemUnion) AsText() (v ChatCompletionGetResponseInputMessageUserContentArrayItemText)
- func (u ChatCompletionGetResponseInputMessageUserContentArrayItemUnion) RawJSON() string
- func (r *ChatCompletionGetResponseInputMessageUserContentArrayItemUnion) UnmarshalJSON(data []byte) error
- type ChatCompletionGetResponseInputMessageUserContentUnion
- func (u ChatCompletionGetResponseInputMessageUserContentUnion) AsChatCompletionGetResponseInputMessageUserContentArray() (v []ChatCompletionGetResponseInputMessageUserContentArrayItemUnion)
- func (u ChatCompletionGetResponseInputMessageUserContentUnion) AsString() (v string)
- func (u ChatCompletionGetResponseInputMessageUserContentUnion) RawJSON() string
- func (r *ChatCompletionGetResponseInputMessageUserContentUnion) UnmarshalJSON(data []byte) error
- type ChatCompletionGetResponseUsage
- type ChatCompletionGetResponseUsageCompletionTokensDetails
- type ChatCompletionGetResponseUsagePromptTokensDetails
- type ChatCompletionListParams
- type ChatCompletionListParamsOrder
- type ChatCompletionListResponse
- type ChatCompletionListResponseChoice
- type ChatCompletionListResponseChoiceLogprobs
- type ChatCompletionListResponseChoiceLogprobsContent
- type ChatCompletionListResponseChoiceLogprobsContentTopLogprob
- type ChatCompletionListResponseChoiceLogprobsRefusal
- type ChatCompletionListResponseChoiceLogprobsRefusalTopLogprob
- type ChatCompletionListResponseChoiceMessageAssistant
- type ChatCompletionListResponseChoiceMessageAssistantContentArrayItem
- type ChatCompletionListResponseChoiceMessageAssistantContentUnion
- func (u ChatCompletionListResponseChoiceMessageAssistantContentUnion) AsChatCompletionListResponseChoiceMessageAssistantContentArray() (v []ChatCompletionListResponseChoiceMessageAssistantContentArrayItem)
- func (u ChatCompletionListResponseChoiceMessageAssistantContentUnion) AsString() (v string)
- func (u ChatCompletionListResponseChoiceMessageAssistantContentUnion) RawJSON() string
- func (r *ChatCompletionListResponseChoiceMessageAssistantContentUnion) UnmarshalJSON(data []byte) error
- type ChatCompletionListResponseChoiceMessageAssistantToolCall
- type ChatCompletionListResponseChoiceMessageAssistantToolCallFunction
- type ChatCompletionListResponseChoiceMessageDeveloper
- type ChatCompletionListResponseChoiceMessageDeveloperContentArrayItem
- type ChatCompletionListResponseChoiceMessageDeveloperContentUnion
- func (u ChatCompletionListResponseChoiceMessageDeveloperContentUnion) AsChatCompletionListResponseChoiceMessageDeveloperContentArray() (v []ChatCompletionListResponseChoiceMessageDeveloperContentArrayItem)
- func (u ChatCompletionListResponseChoiceMessageDeveloperContentUnion) AsString() (v string)
- func (u ChatCompletionListResponseChoiceMessageDeveloperContentUnion) RawJSON() string
- func (r *ChatCompletionListResponseChoiceMessageDeveloperContentUnion) UnmarshalJSON(data []byte) error
- type ChatCompletionListResponseChoiceMessageSystem
- type ChatCompletionListResponseChoiceMessageSystemContentArrayItem
- type ChatCompletionListResponseChoiceMessageSystemContentUnion
- func (u ChatCompletionListResponseChoiceMessageSystemContentUnion) AsChatCompletionListResponseChoiceMessageSystemContentArray() (v []ChatCompletionListResponseChoiceMessageSystemContentArrayItem)
- func (u ChatCompletionListResponseChoiceMessageSystemContentUnion) AsString() (v string)
- func (u ChatCompletionListResponseChoiceMessageSystemContentUnion) RawJSON() string
- func (r *ChatCompletionListResponseChoiceMessageSystemContentUnion) UnmarshalJSON(data []byte) error
- type ChatCompletionListResponseChoiceMessageTool
- type ChatCompletionListResponseChoiceMessageToolContentArrayItem
- type ChatCompletionListResponseChoiceMessageToolContentUnion
- func (u ChatCompletionListResponseChoiceMessageToolContentUnion) AsChatCompletionListResponseChoiceMessageToolContentArray() (v []ChatCompletionListResponseChoiceMessageToolContentArrayItem)
- func (u ChatCompletionListResponseChoiceMessageToolContentUnion) AsString() (v string)
- func (u ChatCompletionListResponseChoiceMessageToolContentUnion) RawJSON() string
- func (r *ChatCompletionListResponseChoiceMessageToolContentUnion) UnmarshalJSON(data []byte) error
- type ChatCompletionListResponseChoiceMessageUnion
- func (u ChatCompletionListResponseChoiceMessageUnion) AsAny() anyChatCompletionListResponseChoiceMessage
- func (u ChatCompletionListResponseChoiceMessageUnion) AsAssistant() (v ChatCompletionListResponseChoiceMessageAssistant)
- func (u ChatCompletionListResponseChoiceMessageUnion) AsDeveloper() (v ChatCompletionListResponseChoiceMessageDeveloper)
- func (u ChatCompletionListResponseChoiceMessageUnion) AsSystem() (v ChatCompletionListResponseChoiceMessageSystem)
- func (u ChatCompletionListResponseChoiceMessageUnion) AsTool() (v ChatCompletionListResponseChoiceMessageTool)
- func (u ChatCompletionListResponseChoiceMessageUnion) AsUser() (v ChatCompletionListResponseChoiceMessageUser)
- func (u ChatCompletionListResponseChoiceMessageUnion) RawJSON() string
- func (r *ChatCompletionListResponseChoiceMessageUnion) UnmarshalJSON(data []byte) error
- type ChatCompletionListResponseChoiceMessageUnionContent
- type ChatCompletionListResponseChoiceMessageUser
- type ChatCompletionListResponseChoiceMessageUserContentArrayItemFile
- type ChatCompletionListResponseChoiceMessageUserContentArrayItemFileFile
- type ChatCompletionListResponseChoiceMessageUserContentArrayItemImageURL
- type ChatCompletionListResponseChoiceMessageUserContentArrayItemImageURLImageURL
- type ChatCompletionListResponseChoiceMessageUserContentArrayItemText
- type ChatCompletionListResponseChoiceMessageUserContentArrayItemUnion
- func (u ChatCompletionListResponseChoiceMessageUserContentArrayItemUnion) AsAny() anyChatCompletionListResponseChoiceMessageUserContentArrayItem
- func (u ChatCompletionListResponseChoiceMessageUserContentArrayItemUnion) AsFile() (v ChatCompletionListResponseChoiceMessageUserContentArrayItemFile)
- func (u ChatCompletionListResponseChoiceMessageUserContentArrayItemUnion) AsImageURL() (v ChatCompletionListResponseChoiceMessageUserContentArrayItemImageURL)
- func (u ChatCompletionListResponseChoiceMessageUserContentArrayItemUnion) AsText() (v ChatCompletionListResponseChoiceMessageUserContentArrayItemText)
- func (u ChatCompletionListResponseChoiceMessageUserContentArrayItemUnion) RawJSON() string
- func (r *ChatCompletionListResponseChoiceMessageUserContentArrayItemUnion) UnmarshalJSON(data []byte) error
- type ChatCompletionListResponseChoiceMessageUserContentUnion
- func (u ChatCompletionListResponseChoiceMessageUserContentUnion) AsChatCompletionListResponseChoiceMessageUserContentArray() (v []ChatCompletionListResponseChoiceMessageUserContentArrayItemUnion)
- func (u ChatCompletionListResponseChoiceMessageUserContentUnion) AsString() (v string)
- func (u ChatCompletionListResponseChoiceMessageUserContentUnion) RawJSON() string
- func (r *ChatCompletionListResponseChoiceMessageUserContentUnion) UnmarshalJSON(data []byte) error
- type ChatCompletionListResponseInputMessageAssistant
- type ChatCompletionListResponseInputMessageAssistantContentArrayItem
- type ChatCompletionListResponseInputMessageAssistantContentUnion
- func (u ChatCompletionListResponseInputMessageAssistantContentUnion) AsChatCompletionListResponseInputMessageAssistantContentArray() (v []ChatCompletionListResponseInputMessageAssistantContentArrayItem)
- func (u ChatCompletionListResponseInputMessageAssistantContentUnion) AsString() (v string)
- func (u ChatCompletionListResponseInputMessageAssistantContentUnion) RawJSON() string
- func (r *ChatCompletionListResponseInputMessageAssistantContentUnion) UnmarshalJSON(data []byte) error
- type ChatCompletionListResponseInputMessageAssistantToolCall
- type ChatCompletionListResponseInputMessageAssistantToolCallFunction
- type ChatCompletionListResponseInputMessageDeveloper
- type ChatCompletionListResponseInputMessageDeveloperContentArrayItem
- type ChatCompletionListResponseInputMessageDeveloperContentUnion
- func (u ChatCompletionListResponseInputMessageDeveloperContentUnion) AsChatCompletionListResponseInputMessageDeveloperContentArray() (v []ChatCompletionListResponseInputMessageDeveloperContentArrayItem)
- func (u ChatCompletionListResponseInputMessageDeveloperContentUnion) AsString() (v string)
- func (u ChatCompletionListResponseInputMessageDeveloperContentUnion) RawJSON() string
- func (r *ChatCompletionListResponseInputMessageDeveloperContentUnion) UnmarshalJSON(data []byte) error
- type ChatCompletionListResponseInputMessageSystem
- type ChatCompletionListResponseInputMessageSystemContentArrayItem
- type ChatCompletionListResponseInputMessageSystemContentUnion
- func (u ChatCompletionListResponseInputMessageSystemContentUnion) AsChatCompletionListResponseInputMessageSystemContentArray() (v []ChatCompletionListResponseInputMessageSystemContentArrayItem)
- func (u ChatCompletionListResponseInputMessageSystemContentUnion) AsString() (v string)
- func (u ChatCompletionListResponseInputMessageSystemContentUnion) RawJSON() string
- func (r *ChatCompletionListResponseInputMessageSystemContentUnion) UnmarshalJSON(data []byte) error
- type ChatCompletionListResponseInputMessageTool
- type ChatCompletionListResponseInputMessageToolContentArrayItem
- type ChatCompletionListResponseInputMessageToolContentUnion
- func (u ChatCompletionListResponseInputMessageToolContentUnion) AsChatCompletionListResponseInputMessageToolContentArray() (v []ChatCompletionListResponseInputMessageToolContentArrayItem)
- func (u ChatCompletionListResponseInputMessageToolContentUnion) AsString() (v string)
- func (u ChatCompletionListResponseInputMessageToolContentUnion) RawJSON() string
- func (r *ChatCompletionListResponseInputMessageToolContentUnion) UnmarshalJSON(data []byte) error
- type ChatCompletionListResponseInputMessageUnion
- func (u ChatCompletionListResponseInputMessageUnion) AsAny() anyChatCompletionListResponseInputMessage
- func (u ChatCompletionListResponseInputMessageUnion) AsAssistant() (v ChatCompletionListResponseInputMessageAssistant)
- func (u ChatCompletionListResponseInputMessageUnion) AsDeveloper() (v ChatCompletionListResponseInputMessageDeveloper)
- func (u ChatCompletionListResponseInputMessageUnion) AsSystem() (v ChatCompletionListResponseInputMessageSystem)
- func (u ChatCompletionListResponseInputMessageUnion) AsTool() (v ChatCompletionListResponseInputMessageTool)
- func (u ChatCompletionListResponseInputMessageUnion) AsUser() (v ChatCompletionListResponseInputMessageUser)
- func (u ChatCompletionListResponseInputMessageUnion) RawJSON() string
- func (r *ChatCompletionListResponseInputMessageUnion) UnmarshalJSON(data []byte) error
- type ChatCompletionListResponseInputMessageUnionContent
- type ChatCompletionListResponseInputMessageUser
- type ChatCompletionListResponseInputMessageUserContentArrayItemFile
- type ChatCompletionListResponseInputMessageUserContentArrayItemFileFile
- type ChatCompletionListResponseInputMessageUserContentArrayItemImageURL
- type ChatCompletionListResponseInputMessageUserContentArrayItemImageURLImageURL
- type ChatCompletionListResponseInputMessageUserContentArrayItemText
- type ChatCompletionListResponseInputMessageUserContentArrayItemUnion
- func (u ChatCompletionListResponseInputMessageUserContentArrayItemUnion) AsAny() anyChatCompletionListResponseInputMessageUserContentArrayItem
- func (u ChatCompletionListResponseInputMessageUserContentArrayItemUnion) AsFile() (v ChatCompletionListResponseInputMessageUserContentArrayItemFile)
- func (u ChatCompletionListResponseInputMessageUserContentArrayItemUnion) AsImageURL() (v ChatCompletionListResponseInputMessageUserContentArrayItemImageURL)
- func (u ChatCompletionListResponseInputMessageUserContentArrayItemUnion) AsText() (v ChatCompletionListResponseInputMessageUserContentArrayItemText)
- func (u ChatCompletionListResponseInputMessageUserContentArrayItemUnion) RawJSON() string
- func (r *ChatCompletionListResponseInputMessageUserContentArrayItemUnion) UnmarshalJSON(data []byte) error
- type ChatCompletionListResponseInputMessageUserContentUnion
- func (u ChatCompletionListResponseInputMessageUserContentUnion) AsChatCompletionListResponseInputMessageUserContentArray() (v []ChatCompletionListResponseInputMessageUserContentArrayItemUnion)
- func (u ChatCompletionListResponseInputMessageUserContentUnion) AsString() (v string)
- func (u ChatCompletionListResponseInputMessageUserContentUnion) RawJSON() string
- func (r *ChatCompletionListResponseInputMessageUserContentUnion) UnmarshalJSON(data []byte) error
- type ChatCompletionListResponseUsage
- type ChatCompletionListResponseUsageCompletionTokensDetails
- type ChatCompletionListResponseUsagePromptTokensDetails
- type ChatCompletionNewParams
- type ChatCompletionNewParamsFunctionCallMapItemUnion
- type ChatCompletionNewParamsFunctionCallUnion
- type ChatCompletionNewParamsFunctionUnion
- type ChatCompletionNewParamsMessageAssistant
- type ChatCompletionNewParamsMessageAssistantContentArrayItem
- type ChatCompletionNewParamsMessageAssistantContentUnion
- type ChatCompletionNewParamsMessageAssistantToolCall
- type ChatCompletionNewParamsMessageAssistantToolCallFunction
- type ChatCompletionNewParamsMessageDeveloper
- type ChatCompletionNewParamsMessageDeveloperContentArrayItem
- type ChatCompletionNewParamsMessageDeveloperContentUnion
- type ChatCompletionNewParamsMessageSystem
- type ChatCompletionNewParamsMessageSystemContentArrayItem
- type ChatCompletionNewParamsMessageSystemContentUnion
- type ChatCompletionNewParamsMessageTool
- type ChatCompletionNewParamsMessageToolContentArrayItem
- type ChatCompletionNewParamsMessageToolContentUnion
- type ChatCompletionNewParamsMessageUnion
- func (u ChatCompletionNewParamsMessageUnion) GetContent() (res chatCompletionNewParamsMessageUnionContent)
- func (u ChatCompletionNewParamsMessageUnion) GetName() *string
- func (u ChatCompletionNewParamsMessageUnion) GetRole() *string
- func (u ChatCompletionNewParamsMessageUnion) GetToolCallID() *string
- func (u ChatCompletionNewParamsMessageUnion) GetToolCalls() []ChatCompletionNewParamsMessageAssistantToolCall
- func (u ChatCompletionNewParamsMessageUnion) MarshalJSON() ([]byte, error)
- func (u *ChatCompletionNewParamsMessageUnion) UnmarshalJSON(data []byte) error
- type ChatCompletionNewParamsMessageUser
- type ChatCompletionNewParamsMessageUserContentArrayItemFile
- type ChatCompletionNewParamsMessageUserContentArrayItemFileFile
- type ChatCompletionNewParamsMessageUserContentArrayItemImageURL
- type ChatCompletionNewParamsMessageUserContentArrayItemImageURLImageURL
- type ChatCompletionNewParamsMessageUserContentArrayItemText
- type ChatCompletionNewParamsMessageUserContentArrayItemUnion
- func (u ChatCompletionNewParamsMessageUserContentArrayItemUnion) GetFile() *ChatCompletionNewParamsMessageUserContentArrayItemFileFile
- func (u ChatCompletionNewParamsMessageUserContentArrayItemUnion) GetImageURL() *ChatCompletionNewParamsMessageUserContentArrayItemImageURLImageURL
- func (u ChatCompletionNewParamsMessageUserContentArrayItemUnion) GetText() *string
- func (u ChatCompletionNewParamsMessageUserContentArrayItemUnion) GetType() *string
- func (u ChatCompletionNewParamsMessageUserContentArrayItemUnion) MarshalJSON() ([]byte, error)
- func (u *ChatCompletionNewParamsMessageUserContentArrayItemUnion) UnmarshalJSON(data []byte) error
- type ChatCompletionNewParamsMessageUserContentUnion
- type ChatCompletionNewParamsResponseFormatJsonObject
- type ChatCompletionNewParamsResponseFormatJsonSchema
- type ChatCompletionNewParamsResponseFormatJsonSchemaJsonSchema
- type ChatCompletionNewParamsResponseFormatJsonSchemaJsonSchemaSchemaUnion
- type ChatCompletionNewParamsResponseFormatText
- type ChatCompletionNewParamsResponseFormatUnion
- func (u ChatCompletionNewParamsResponseFormatUnion) GetJsonSchema() *ChatCompletionNewParamsResponseFormatJsonSchemaJsonSchema
- func (u ChatCompletionNewParamsResponseFormatUnion) GetType() *string
- func (u ChatCompletionNewParamsResponseFormatUnion) MarshalJSON() ([]byte, error)
- func (u *ChatCompletionNewParamsResponseFormatUnion) UnmarshalJSON(data []byte) error
- type ChatCompletionNewParamsStopUnion
- type ChatCompletionNewParamsStreamOptionUnion
- type ChatCompletionNewParamsToolChoiceMapItemUnion
- type ChatCompletionNewParamsToolChoiceUnion
- type ChatCompletionNewParamsToolUnion
- type ChatCompletionNewResponseOpenAIChatCompletion
- type ChatCompletionNewResponseOpenAIChatCompletionChoice
- type ChatCompletionNewResponseOpenAIChatCompletionChoiceLogprobs
- type ChatCompletionNewResponseOpenAIChatCompletionChoiceLogprobsContent
- type ChatCompletionNewResponseOpenAIChatCompletionChoiceLogprobsContentTopLogprob
- type ChatCompletionNewResponseOpenAIChatCompletionChoiceLogprobsRefusal
- type ChatCompletionNewResponseOpenAIChatCompletionChoiceLogprobsRefusalTopLogprob
- type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistant
- type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistantContentArrayItem
- type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistantContentUnion
- func (u ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistantContentUnion) AsChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistantContentArray() (...)
- func (u ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistantContentUnion) AsString() (v string)
- func (u ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistantContentUnion) RawJSON() string
- func (r *ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistantContentUnion) UnmarshalJSON(data []byte) error
- type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistantToolCall
- type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistantToolCallFunction
- type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageDeveloper
- type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageDeveloperContentArrayItem
- type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageDeveloperContentUnion
- func (u ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageDeveloperContentUnion) AsChatCompletionNewResponseOpenAIChatCompletionChoiceMessageDeveloperContentArray() (...)
- func (u ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageDeveloperContentUnion) AsString() (v string)
- func (u ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageDeveloperContentUnion) RawJSON() string
- func (r *ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageDeveloperContentUnion) UnmarshalJSON(data []byte) error
- type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageSystem
- type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageSystemContentArrayItem
- type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageSystemContentUnion
- func (u ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageSystemContentUnion) AsChatCompletionNewResponseOpenAIChatCompletionChoiceMessageSystemContentArray() (...)
- func (u ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageSystemContentUnion) AsString() (v string)
- func (u ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageSystemContentUnion) RawJSON() string
- func (r *ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageSystemContentUnion) UnmarshalJSON(data []byte) error
- type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageTool
- type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageToolContentArrayItem
- type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageToolContentUnion
- func (u ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageToolContentUnion) AsChatCompletionNewResponseOpenAIChatCompletionChoiceMessageToolContentArray() (...)
- func (u ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageToolContentUnion) AsString() (v string)
- func (u ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageToolContentUnion) RawJSON() string
- func (r *ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageToolContentUnion) UnmarshalJSON(data []byte) error
- type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUnion
- func (u ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUnion) AsAny() anyChatCompletionNewResponseOpenAIChatCompletionChoiceMessage
- func (u ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUnion) AsAssistant() (v ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistant)
- func (u ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUnion) AsDeveloper() (v ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageDeveloper)
- func (u ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUnion) AsSystem() (v ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageSystem)
- func (u ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUnion) AsTool() (v ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageTool)
- func (u ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUnion) AsUser() (v ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUser)
- func (u ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUnion) RawJSON() string
- func (r *ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUnion) UnmarshalJSON(data []byte) error
- type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUnionContent
- type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUser
- type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemFile
- type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemFileFile
- type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemImageURL
- type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemImageURLImageURL
- type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemText
- type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemUnion
- func (u ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemUnion) AsAny() ...
- func (u ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemUnion) AsFile() (...)
- func (u ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemUnion) AsImageURL() (...)
- func (u ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemUnion) AsText() (...)
- func (u ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemUnion) RawJSON() string
- func (r *ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemUnion) UnmarshalJSON(data []byte) error
- type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentUnion
- func (u ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentUnion) AsChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArray() (...)
- func (u ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentUnion) AsString() (v string)
- func (u ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentUnion) RawJSON() string
- func (r *ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentUnion) UnmarshalJSON(data []byte) error
- type ChatCompletionNewResponseOpenAIChatCompletionUsage
- type ChatCompletionNewResponseOpenAIChatCompletionUsageCompletionTokensDetails
- type ChatCompletionNewResponseOpenAIChatCompletionUsagePromptTokensDetails
- type ChatCompletionNewResponseUnion
- func (u ChatCompletionNewResponseUnion) AsOpenAIChatCompletion() (v ChatCompletionNewResponseOpenAIChatCompletion)
- func (u ChatCompletionNewResponseUnion) AsOpenAIChatCompletionChunk() (v ChatCompletionChunk)
- func (u ChatCompletionNewResponseUnion) RawJSON() string
- func (r *ChatCompletionNewResponseUnion) UnmarshalJSON(data []byte) error
- type ChatCompletionNewResponseUnionChoices
- type ChatCompletionNewResponseUnionUsage
- type ChatCompletionNewResponseUnionUsageCompletionTokensDetails
- type ChatCompletionNewResponseUnionUsagePromptTokensDetails
- type ChatCompletionService
- func (r *ChatCompletionService) Get(ctx context.Context, completionID string, opts ...option.RequestOption) (res *ChatCompletionGetResponse, err error)
- func (r *ChatCompletionService) List(ctx context.Context, query ChatCompletionListParams, ...) (res *pagination.OpenAICursorPage[ChatCompletionListResponse], err error)
- func (r *ChatCompletionService) ListAutoPaging(ctx context.Context, query ChatCompletionListParams, ...) *pagination.OpenAICursorPageAutoPager[ChatCompletionListResponse]
- func (r *ChatCompletionService) New(ctx context.Context, body ChatCompletionNewParams, ...) (res *ChatCompletionNewResponseUnion, err error)
- func (r *ChatCompletionService) NewStreaming(ctx context.Context, body ChatCompletionNewParams, ...) (stream *ssestream.Stream[ChatCompletionChunk])
- type ChatService
- type Client
- func (r *Client) Delete(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, ...) error
- func (r *Client) Get(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Patch(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Post(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Put(ctx context.Context, path string, params any, res any, ...) error
- type CompletionNewParams
- type CompletionNewParamsPromptUnion
- type CompletionNewParamsStopUnion
- type CompletionNewParamsStreamOptionUnion
- type CompletionNewResponse
- type CompletionNewResponseChoice
- type CompletionNewResponseChoiceLogprobs
- type CompletionNewResponseChoiceLogprobsContent
- type CompletionNewResponseChoiceLogprobsContentTopLogprob
- type CompletionNewResponseChoiceLogprobsRefusal
- type CompletionNewResponseChoiceLogprobsRefusalTopLogprob
- type CompletionService
- func (r *CompletionService) New(ctx context.Context, body CompletionNewParams, opts ...option.RequestOption) (res *CompletionNewResponse, err error)
- func (r *CompletionService) NewStreaming(ctx context.Context, body CompletionNewParams, opts ...option.RequestOption) (stream *ssestream.Stream[CompletionNewResponse])
- type ConversationDeleteResponse
- type ConversationItemGetParams
- type ConversationItemGetResponseFileSearchCall
- type ConversationItemGetResponseFileSearchCallResult
- type ConversationItemGetResponseFileSearchCallResultAttributeUnion
- func (u ConversationItemGetResponseFileSearchCallResultAttributeUnion) AsAnyArray() (v []any)
- func (u ConversationItemGetResponseFileSearchCallResultAttributeUnion) AsBool() (v bool)
- func (u ConversationItemGetResponseFileSearchCallResultAttributeUnion) AsFloat() (v float64)
- func (u ConversationItemGetResponseFileSearchCallResultAttributeUnion) AsString() (v string)
- func (u ConversationItemGetResponseFileSearchCallResultAttributeUnion) RawJSON() string
- func (r *ConversationItemGetResponseFileSearchCallResultAttributeUnion) UnmarshalJSON(data []byte) error
- type ConversationItemGetResponseFunctionCall
- type ConversationItemGetResponseFunctionCallOutput
- type ConversationItemGetResponseMcpApprovalRequest
- type ConversationItemGetResponseMcpApprovalResponse
- type ConversationItemGetResponseMcpCall
- type ConversationItemGetResponseMcpListTools
- type ConversationItemGetResponseMcpListToolsTool
- type ConversationItemGetResponseMcpListToolsToolInputSchemaUnion
- func (u ConversationItemGetResponseMcpListToolsToolInputSchemaUnion) AsAnyArray() (v []any)
- func (u ConversationItemGetResponseMcpListToolsToolInputSchemaUnion) AsBool() (v bool)
- func (u ConversationItemGetResponseMcpListToolsToolInputSchemaUnion) AsFloat() (v float64)
- func (u ConversationItemGetResponseMcpListToolsToolInputSchemaUnion) AsString() (v string)
- func (u ConversationItemGetResponseMcpListToolsToolInputSchemaUnion) RawJSON() string
- func (r *ConversationItemGetResponseMcpListToolsToolInputSchemaUnion) UnmarshalJSON(data []byte) error
- type ConversationItemGetResponseMessage
- type ConversationItemGetResponseMessageContentArrayItemDetail
- type ConversationItemGetResponseMessageContentArrayItemInputFile
- type ConversationItemGetResponseMessageContentArrayItemInputImage
- type ConversationItemGetResponseMessageContentArrayItemInputImageDetail
- type ConversationItemGetResponseMessageContentArrayItemInputText
- type ConversationItemGetResponseMessageContentArrayItemUnion
- func (u ConversationItemGetResponseMessageContentArrayItemUnion) AsAny() anyConversationItemGetResponseMessageContentArrayItem
- func (u ConversationItemGetResponseMessageContentArrayItemUnion) AsInputFile() (v ConversationItemGetResponseMessageContentArrayItemInputFile)
- func (u ConversationItemGetResponseMessageContentArrayItemUnion) AsInputImage() (v ConversationItemGetResponseMessageContentArrayItemInputImage)
- func (u ConversationItemGetResponseMessageContentArrayItemUnion) AsInputText() (v ConversationItemGetResponseMessageContentArrayItemInputText)
- func (u ConversationItemGetResponseMessageContentArrayItemUnion) RawJSON() string
- func (r *ConversationItemGetResponseMessageContentArrayItemUnion) UnmarshalJSON(data []byte) error
- type ConversationItemGetResponseMessageContentUnion
- func (u ConversationItemGetResponseMessageContentUnion) AsConversationItemGetResponseMessageContentArray() (v []ConversationItemGetResponseMessageContentArrayItemUnion)
- func (u ConversationItemGetResponseMessageContentUnion) AsString() (v string)
- func (u ConversationItemGetResponseMessageContentUnion) AsVariant2() (v []ConversationItemGetResponseMessageContentArrayItemUnion)
- func (u ConversationItemGetResponseMessageContentUnion) RawJSON() string
- func (r *ConversationItemGetResponseMessageContentUnion) UnmarshalJSON(data []byte) error
- type ConversationItemGetResponseMessageRole
- type ConversationItemGetResponseRole
- type ConversationItemGetResponseUnion
- func (u ConversationItemGetResponseUnion) AsAny() anyConversationItemGetResponse
- func (u ConversationItemGetResponseUnion) AsFileSearchCall() (v ConversationItemGetResponseFileSearchCall)
- func (u ConversationItemGetResponseUnion) AsFunctionCall() (v ConversationItemGetResponseFunctionCall)
- func (u ConversationItemGetResponseUnion) AsFunctionCallOutput() (v ConversationItemGetResponseFunctionCallOutput)
- func (u ConversationItemGetResponseUnion) AsMcpApprovalRequest() (v ConversationItemGetResponseMcpApprovalRequest)
- func (u ConversationItemGetResponseUnion) AsMcpApprovalResponse() (v ConversationItemGetResponseMcpApprovalResponse)
- func (u ConversationItemGetResponseUnion) AsMcpCall() (v ConversationItemGetResponseMcpCall)
- func (u ConversationItemGetResponseUnion) AsMcpListTools() (v ConversationItemGetResponseMcpListTools)
- func (u ConversationItemGetResponseUnion) AsMessage() (v ConversationItemGetResponseMessage)
- func (u ConversationItemGetResponseUnion) AsWebSearchCall() (v ConversationItemGetResponseWebSearchCall)
- func (u ConversationItemGetResponseUnion) RawJSON() string
- func (r *ConversationItemGetResponseUnion) UnmarshalJSON(data []byte) error
- type ConversationItemGetResponseWebSearchCall
- type ConversationItemListParams
- type ConversationItemListParamsOrder
- type ConversationItemListResponseFileSearchCall
- type ConversationItemListResponseFileSearchCallResult
- type ConversationItemListResponseFileSearchCallResultAttributeUnion
- func (u ConversationItemListResponseFileSearchCallResultAttributeUnion) AsAnyArray() (v []any)
- func (u ConversationItemListResponseFileSearchCallResultAttributeUnion) AsBool() (v bool)
- func (u ConversationItemListResponseFileSearchCallResultAttributeUnion) AsFloat() (v float64)
- func (u ConversationItemListResponseFileSearchCallResultAttributeUnion) AsString() (v string)
- func (u ConversationItemListResponseFileSearchCallResultAttributeUnion) RawJSON() string
- func (r *ConversationItemListResponseFileSearchCallResultAttributeUnion) UnmarshalJSON(data []byte) error
- type ConversationItemListResponseFunctionCall
- type ConversationItemListResponseFunctionCallOutput
- type ConversationItemListResponseMcpApprovalRequest
- type ConversationItemListResponseMcpApprovalResponse
- type ConversationItemListResponseMcpCall
- type ConversationItemListResponseMcpListTools
- type ConversationItemListResponseMcpListToolsTool
- type ConversationItemListResponseMcpListToolsToolInputSchemaUnion
- func (u ConversationItemListResponseMcpListToolsToolInputSchemaUnion) AsAnyArray() (v []any)
- func (u ConversationItemListResponseMcpListToolsToolInputSchemaUnion) AsBool() (v bool)
- func (u ConversationItemListResponseMcpListToolsToolInputSchemaUnion) AsFloat() (v float64)
- func (u ConversationItemListResponseMcpListToolsToolInputSchemaUnion) AsString() (v string)
- func (u ConversationItemListResponseMcpListToolsToolInputSchemaUnion) RawJSON() string
- func (r *ConversationItemListResponseMcpListToolsToolInputSchemaUnion) UnmarshalJSON(data []byte) error
- type ConversationItemListResponseMessage
- type ConversationItemListResponseMessageContentArrayItemDetail
- type ConversationItemListResponseMessageContentArrayItemInputFile
- type ConversationItemListResponseMessageContentArrayItemInputImage
- type ConversationItemListResponseMessageContentArrayItemInputImageDetail
- type ConversationItemListResponseMessageContentArrayItemInputText
- type ConversationItemListResponseMessageContentArrayItemUnion
- func (u ConversationItemListResponseMessageContentArrayItemUnion) AsAny() anyConversationItemListResponseMessageContentArrayItem
- func (u ConversationItemListResponseMessageContentArrayItemUnion) AsInputFile() (v ConversationItemListResponseMessageContentArrayItemInputFile)
- func (u ConversationItemListResponseMessageContentArrayItemUnion) AsInputImage() (v ConversationItemListResponseMessageContentArrayItemInputImage)
- func (u ConversationItemListResponseMessageContentArrayItemUnion) AsInputText() (v ConversationItemListResponseMessageContentArrayItemInputText)
- func (u ConversationItemListResponseMessageContentArrayItemUnion) RawJSON() string
- func (r *ConversationItemListResponseMessageContentArrayItemUnion) UnmarshalJSON(data []byte) error
- type ConversationItemListResponseMessageContentUnion
- func (u ConversationItemListResponseMessageContentUnion) AsConversationItemListResponseMessageContentArray() (v []ConversationItemListResponseMessageContentArrayItemUnion)
- func (u ConversationItemListResponseMessageContentUnion) AsString() (v string)
- func (u ConversationItemListResponseMessageContentUnion) AsVariant2() (v []ConversationItemListResponseMessageContentArrayItemUnion)
- func (u ConversationItemListResponseMessageContentUnion) RawJSON() string
- func (r *ConversationItemListResponseMessageContentUnion) UnmarshalJSON(data []byte) error
- type ConversationItemListResponseMessageRole
- type ConversationItemListResponseRole
- type ConversationItemListResponseUnion
- func (u ConversationItemListResponseUnion) AsAny() anyConversationItemListResponse
- func (u ConversationItemListResponseUnion) AsFileSearchCall() (v ConversationItemListResponseFileSearchCall)
- func (u ConversationItemListResponseUnion) AsFunctionCall() (v ConversationItemListResponseFunctionCall)
- func (u ConversationItemListResponseUnion) AsFunctionCallOutput() (v ConversationItemListResponseFunctionCallOutput)
- func (u ConversationItemListResponseUnion) AsMcpApprovalRequest() (v ConversationItemListResponseMcpApprovalRequest)
- func (u ConversationItemListResponseUnion) AsMcpApprovalResponse() (v ConversationItemListResponseMcpApprovalResponse)
- func (u ConversationItemListResponseUnion) AsMcpCall() (v ConversationItemListResponseMcpCall)
- func (u ConversationItemListResponseUnion) AsMcpListTools() (v ConversationItemListResponseMcpListTools)
- func (u ConversationItemListResponseUnion) AsMessage() (v ConversationItemListResponseMessage)
- func (u ConversationItemListResponseUnion) AsWebSearchCall() (v ConversationItemListResponseWebSearchCall)
- func (u ConversationItemListResponseUnion) RawJSON() string
- func (r *ConversationItemListResponseUnion) UnmarshalJSON(data []byte) error
- type ConversationItemListResponseWebSearchCall
- type ConversationItemNewParams
- type ConversationItemNewParamsItemFileSearchCall
- type ConversationItemNewParamsItemFileSearchCallResult
- type ConversationItemNewParamsItemFileSearchCallResultAttributeUnion
- type ConversationItemNewParamsItemFunctionCall
- type ConversationItemNewParamsItemFunctionCallOutput
- type ConversationItemNewParamsItemMcpApprovalRequest
- type ConversationItemNewParamsItemMcpApprovalResponse
- type ConversationItemNewParamsItemMcpCall
- type ConversationItemNewParamsItemMcpListTools
- type ConversationItemNewParamsItemMcpListToolsTool
- type ConversationItemNewParamsItemMcpListToolsToolInputSchemaUnion
- type ConversationItemNewParamsItemMessage
- type ConversationItemNewParamsItemMessageContentArrayItemInputFile
- type ConversationItemNewParamsItemMessageContentArrayItemInputImage
- type ConversationItemNewParamsItemMessageContentArrayItemInputImageDetail
- type ConversationItemNewParamsItemMessageContentArrayItemInputText
- type ConversationItemNewParamsItemMessageContentArrayItemUnion
- func (u ConversationItemNewParamsItemMessageContentArrayItemUnion) GetDetail() *string
- func (u ConversationItemNewParamsItemMessageContentArrayItemUnion) GetFileData() *string
- func (u ConversationItemNewParamsItemMessageContentArrayItemUnion) GetFileID() *string
- func (u ConversationItemNewParamsItemMessageContentArrayItemUnion) GetFileURL() *string
- func (u ConversationItemNewParamsItemMessageContentArrayItemUnion) GetFilename() *string
- func (u ConversationItemNewParamsItemMessageContentArrayItemUnion) GetImageURL() *string
- func (u ConversationItemNewParamsItemMessageContentArrayItemUnion) GetText() *string
- func (u ConversationItemNewParamsItemMessageContentArrayItemUnion) GetType() *string
- func (u ConversationItemNewParamsItemMessageContentArrayItemUnion) MarshalJSON() ([]byte, error)
- func (u *ConversationItemNewParamsItemMessageContentArrayItemUnion) UnmarshalJSON(data []byte) error
- type ConversationItemNewParamsItemMessageContentUnion
- type ConversationItemNewParamsItemMessageRole
- type ConversationItemNewParamsItemUnion
- func (u ConversationItemNewParamsItemUnion) GetApprovalRequestID() *string
- func (u ConversationItemNewParamsItemUnion) GetApprove() *bool
- func (u ConversationItemNewParamsItemUnion) GetArguments() *string
- func (u ConversationItemNewParamsItemUnion) GetCallID() *string
- func (u ConversationItemNewParamsItemUnion) GetContent() *ConversationItemNewParamsItemMessageContentUnion
- func (u ConversationItemNewParamsItemUnion) GetError() *string
- func (u ConversationItemNewParamsItemUnion) GetID() *string
- func (u ConversationItemNewParamsItemUnion) GetName() *string
- func (u ConversationItemNewParamsItemUnion) GetOutput() *string
- func (u ConversationItemNewParamsItemUnion) GetQueries() []string
- func (u ConversationItemNewParamsItemUnion) GetReason() *string
- func (u ConversationItemNewParamsItemUnion) GetResults() []ConversationItemNewParamsItemFileSearchCallResult
- func (u ConversationItemNewParamsItemUnion) GetRole() *string
- func (u ConversationItemNewParamsItemUnion) GetServerLabel() *string
- func (u ConversationItemNewParamsItemUnion) GetStatus() *string
- func (u ConversationItemNewParamsItemUnion) GetTools() []ConversationItemNewParamsItemMcpListToolsTool
- func (u ConversationItemNewParamsItemUnion) GetType() *string
- func (u ConversationItemNewParamsItemUnion) MarshalJSON() ([]byte, error)
- func (u *ConversationItemNewParamsItemUnion) UnmarshalJSON(data []byte) error
- type ConversationItemNewParamsItemWebSearchCall
- type ConversationItemNewResponse
- type ConversationItemNewResponseDataFileSearchCall
- type ConversationItemNewResponseDataFileSearchCallResult
- type ConversationItemNewResponseDataFileSearchCallResultAttributeUnion
- func (u ConversationItemNewResponseDataFileSearchCallResultAttributeUnion) AsAnyArray() (v []any)
- func (u ConversationItemNewResponseDataFileSearchCallResultAttributeUnion) AsBool() (v bool)
- func (u ConversationItemNewResponseDataFileSearchCallResultAttributeUnion) AsFloat() (v float64)
- func (u ConversationItemNewResponseDataFileSearchCallResultAttributeUnion) AsString() (v string)
- func (u ConversationItemNewResponseDataFileSearchCallResultAttributeUnion) RawJSON() string
- func (r *ConversationItemNewResponseDataFileSearchCallResultAttributeUnion) UnmarshalJSON(data []byte) error
- type ConversationItemNewResponseDataFunctionCall
- type ConversationItemNewResponseDataFunctionCallOutput
- type ConversationItemNewResponseDataMcpApprovalRequest
- type ConversationItemNewResponseDataMcpApprovalResponse
- type ConversationItemNewResponseDataMcpCall
- type ConversationItemNewResponseDataMcpListTools
- type ConversationItemNewResponseDataMcpListToolsTool
- type ConversationItemNewResponseDataMcpListToolsToolInputSchemaUnion
- func (u ConversationItemNewResponseDataMcpListToolsToolInputSchemaUnion) AsAnyArray() (v []any)
- func (u ConversationItemNewResponseDataMcpListToolsToolInputSchemaUnion) AsBool() (v bool)
- func (u ConversationItemNewResponseDataMcpListToolsToolInputSchemaUnion) AsFloat() (v float64)
- func (u ConversationItemNewResponseDataMcpListToolsToolInputSchemaUnion) AsString() (v string)
- func (u ConversationItemNewResponseDataMcpListToolsToolInputSchemaUnion) RawJSON() string
- func (r *ConversationItemNewResponseDataMcpListToolsToolInputSchemaUnion) UnmarshalJSON(data []byte) error
- type ConversationItemNewResponseDataMessage
- type ConversationItemNewResponseDataMessageContentArrayItemDetail
- type ConversationItemNewResponseDataMessageContentArrayItemInputFile
- type ConversationItemNewResponseDataMessageContentArrayItemInputImage
- type ConversationItemNewResponseDataMessageContentArrayItemInputImageDetail
- type ConversationItemNewResponseDataMessageContentArrayItemInputText
- type ConversationItemNewResponseDataMessageContentArrayItemUnion
- func (u ConversationItemNewResponseDataMessageContentArrayItemUnion) AsAny() anyConversationItemNewResponseDataMessageContentArrayItem
- func (u ConversationItemNewResponseDataMessageContentArrayItemUnion) AsInputFile() (v ConversationItemNewResponseDataMessageContentArrayItemInputFile)
- func (u ConversationItemNewResponseDataMessageContentArrayItemUnion) AsInputImage() (v ConversationItemNewResponseDataMessageContentArrayItemInputImage)
- func (u ConversationItemNewResponseDataMessageContentArrayItemUnion) AsInputText() (v ConversationItemNewResponseDataMessageContentArrayItemInputText)
- func (u ConversationItemNewResponseDataMessageContentArrayItemUnion) RawJSON() string
- func (r *ConversationItemNewResponseDataMessageContentArrayItemUnion) UnmarshalJSON(data []byte) error
- type ConversationItemNewResponseDataMessageContentUnion
- func (u ConversationItemNewResponseDataMessageContentUnion) AsConversationItemNewResponseDataMessageContentArray() (v []ConversationItemNewResponseDataMessageContentArrayItemUnion)
- func (u ConversationItemNewResponseDataMessageContentUnion) AsString() (v string)
- func (u ConversationItemNewResponseDataMessageContentUnion) AsVariant2() (v []ConversationItemNewResponseDataMessageContentArrayItemUnion)
- func (u ConversationItemNewResponseDataMessageContentUnion) RawJSON() string
- func (r *ConversationItemNewResponseDataMessageContentUnion) UnmarshalJSON(data []byte) error
- type ConversationItemNewResponseDataMessageRole
- type ConversationItemNewResponseDataRole
- type ConversationItemNewResponseDataUnion
- func (u ConversationItemNewResponseDataUnion) AsAny() anyConversationItemNewResponseData
- func (u ConversationItemNewResponseDataUnion) AsFileSearchCall() (v ConversationItemNewResponseDataFileSearchCall)
- func (u ConversationItemNewResponseDataUnion) AsFunctionCall() (v ConversationItemNewResponseDataFunctionCall)
- func (u ConversationItemNewResponseDataUnion) AsFunctionCallOutput() (v ConversationItemNewResponseDataFunctionCallOutput)
- func (u ConversationItemNewResponseDataUnion) AsMcpApprovalRequest() (v ConversationItemNewResponseDataMcpApprovalRequest)
- func (u ConversationItemNewResponseDataUnion) AsMcpApprovalResponse() (v ConversationItemNewResponseDataMcpApprovalResponse)
- func (u ConversationItemNewResponseDataUnion) AsMcpCall() (v ConversationItemNewResponseDataMcpCall)
- func (u ConversationItemNewResponseDataUnion) AsMcpListTools() (v ConversationItemNewResponseDataMcpListTools)
- func (u ConversationItemNewResponseDataUnion) AsMessage() (v ConversationItemNewResponseDataMessage)
- func (u ConversationItemNewResponseDataUnion) AsWebSearchCall() (v ConversationItemNewResponseDataWebSearchCall)
- func (u ConversationItemNewResponseDataUnion) RawJSON() string
- func (r *ConversationItemNewResponseDataUnion) UnmarshalJSON(data []byte) error
- type ConversationItemNewResponseDataWebSearchCall
- type ConversationItemService
- func (r *ConversationItemService) Get(ctx context.Context, itemID string, query ConversationItemGetParams, ...) (res *ConversationItemGetResponseUnion, err error)
- func (r *ConversationItemService) List(ctx context.Context, conversationID string, query ConversationItemListParams, ...) (res *pagination.OpenAICursorPage[ConversationItemListResponseUnion], err error)
- func (r *ConversationItemService) ListAutoPaging(ctx context.Context, conversationID string, query ConversationItemListParams, ...) *pagination.OpenAICursorPageAutoPager[ConversationItemListResponseUnion]
- func (r *ConversationItemService) New(ctx context.Context, conversationID string, body ConversationItemNewParams, ...) (res *ConversationItemNewResponse, err error)
- type ConversationNewParams
- type ConversationNewParamsItemFileSearchCall
- type ConversationNewParamsItemFileSearchCallResult
- type ConversationNewParamsItemFileSearchCallResultAttributeUnion
- type ConversationNewParamsItemFunctionCall
- type ConversationNewParamsItemFunctionCallOutput
- type ConversationNewParamsItemMcpApprovalRequest
- type ConversationNewParamsItemMcpApprovalResponse
- type ConversationNewParamsItemMcpCall
- type ConversationNewParamsItemMcpListTools
- type ConversationNewParamsItemMcpListToolsTool
- type ConversationNewParamsItemMcpListToolsToolInputSchemaUnion
- type ConversationNewParamsItemMessage
- type ConversationNewParamsItemMessageContentArrayItemInputFile
- type ConversationNewParamsItemMessageContentArrayItemInputImage
- type ConversationNewParamsItemMessageContentArrayItemInputImageDetail
- type ConversationNewParamsItemMessageContentArrayItemInputText
- type ConversationNewParamsItemMessageContentArrayItemUnion
- func (u ConversationNewParamsItemMessageContentArrayItemUnion) GetDetail() *string
- func (u ConversationNewParamsItemMessageContentArrayItemUnion) GetFileData() *string
- func (u ConversationNewParamsItemMessageContentArrayItemUnion) GetFileID() *string
- func (u ConversationNewParamsItemMessageContentArrayItemUnion) GetFileURL() *string
- func (u ConversationNewParamsItemMessageContentArrayItemUnion) GetFilename() *string
- func (u ConversationNewParamsItemMessageContentArrayItemUnion) GetImageURL() *string
- func (u ConversationNewParamsItemMessageContentArrayItemUnion) GetText() *string
- func (u ConversationNewParamsItemMessageContentArrayItemUnion) GetType() *string
- func (u ConversationNewParamsItemMessageContentArrayItemUnion) MarshalJSON() ([]byte, error)
- func (u *ConversationNewParamsItemMessageContentArrayItemUnion) UnmarshalJSON(data []byte) error
- type ConversationNewParamsItemMessageContentUnion
- type ConversationNewParamsItemMessageRole
- type ConversationNewParamsItemUnion
- func (u ConversationNewParamsItemUnion) GetApprovalRequestID() *string
- func (u ConversationNewParamsItemUnion) GetApprove() *bool
- func (u ConversationNewParamsItemUnion) GetArguments() *string
- func (u ConversationNewParamsItemUnion) GetCallID() *string
- func (u ConversationNewParamsItemUnion) GetContent() *ConversationNewParamsItemMessageContentUnion
- func (u ConversationNewParamsItemUnion) GetError() *string
- func (u ConversationNewParamsItemUnion) GetID() *string
- func (u ConversationNewParamsItemUnion) GetName() *string
- func (u ConversationNewParamsItemUnion) GetOutput() *string
- func (u ConversationNewParamsItemUnion) GetQueries() []string
- func (u ConversationNewParamsItemUnion) GetReason() *string
- func (u ConversationNewParamsItemUnion) GetResults() []ConversationNewParamsItemFileSearchCallResult
- func (u ConversationNewParamsItemUnion) GetRole() *string
- func (u ConversationNewParamsItemUnion) GetServerLabel() *string
- func (u ConversationNewParamsItemUnion) GetStatus() *string
- func (u ConversationNewParamsItemUnion) GetTools() []ConversationNewParamsItemMcpListToolsTool
- func (u ConversationNewParamsItemUnion) GetType() *string
- func (u ConversationNewParamsItemUnion) MarshalJSON() ([]byte, error)
- func (u *ConversationNewParamsItemUnion) UnmarshalJSON(data []byte) error
- type ConversationNewParamsItemWebSearchCall
- type ConversationObject
- type ConversationService
- func (r *ConversationService) Delete(ctx context.Context, conversationID string, opts ...option.RequestOption) (res *ConversationDeleteResponse, err error)
- func (r *ConversationService) Get(ctx context.Context, conversationID string, opts ...option.RequestOption) (res *ConversationObject, err error)
- func (r *ConversationService) New(ctx context.Context, body ConversationNewParams, opts ...option.RequestOption) (res *ConversationObject, err error)
- func (r *ConversationService) Update(ctx context.Context, conversationID string, body ConversationUpdateParams, ...) (res *ConversationObject, err error)
- type ConversationUpdateParams
- type CreateEmbeddingsResponse
- type CreateEmbeddingsResponseData
- type CreateEmbeddingsResponseDataEmbeddingUnion
- func (u CreateEmbeddingsResponseDataEmbeddingUnion) AsFloatArray() (v []float64)
- func (u CreateEmbeddingsResponseDataEmbeddingUnion) AsString() (v string)
- func (u CreateEmbeddingsResponseDataEmbeddingUnion) RawJSON() string
- func (r *CreateEmbeddingsResponseDataEmbeddingUnion) UnmarshalJSON(data []byte) error
- type CreateEmbeddingsResponseUsage
- type CreateResponse
- type CreateResponseResult
- type CreateResponseResultMetadataUnion
- func (u CreateResponseResultMetadataUnion) AsAnyArray() (v []any)
- func (u CreateResponseResultMetadataUnion) AsBool() (v bool)
- func (u CreateResponseResultMetadataUnion) AsFloat() (v float64)
- func (u CreateResponseResultMetadataUnion) AsString() (v string)
- func (u CreateResponseResultMetadataUnion) RawJSON() string
- func (r *CreateResponseResultMetadataUnion) UnmarshalJSON(data []byte) error
- type DeleteFileResponse
- type EmbeddingNewParams
- type EmbeddingNewParamsInputUnion
- type EmbeddingService
- type Error
- type EvaluateResponse
- type EvaluateResponseGenerationUnion
- func (u EvaluateResponseGenerationUnion) AsAnyArray() (v []any)
- func (u EvaluateResponseGenerationUnion) AsBool() (v bool)
- func (u EvaluateResponseGenerationUnion) AsFloat() (v float64)
- func (u EvaluateResponseGenerationUnion) AsString() (v string)
- func (u EvaluateResponseGenerationUnion) RawJSON() string
- func (r *EvaluateResponseGenerationUnion) UnmarshalJSON(data []byte) error
- type File
- type FileContentResponse
- type FileListParams
- type FileListParamsOrder
- type FileListParamsPurpose
- type FileNewParams
- type FileNewParamsExpiresAfter
- type FileNewParamsPurpose
- type FilePurpose
- type FileService
- func (r *FileService) Content(ctx context.Context, fileID string, opts ...option.RequestOption) (res *FileContentResponse, err error)
- func (r *FileService) Delete(ctx context.Context, fileID string, opts ...option.RequestOption) (res *DeleteFileResponse, err error)
- func (r *FileService) Get(ctx context.Context, fileID string, opts ...option.RequestOption) (res *File, err error)
- func (r *FileService) List(ctx context.Context, query FileListParams, opts ...option.RequestOption) (res *pagination.OpenAICursorPage[File], err error)
- func (r *FileService) ListAutoPaging(ctx context.Context, query FileListParams, opts ...option.RequestOption) *pagination.OpenAICursorPageAutoPager[File]
- func (r *FileService) New(ctx context.Context, body FileNewParams, opts ...option.RequestOption) (res *File, err error)
- type HealthInfo
- type HealthInfoStatus
- type InspectService
- type InterleavedContentImageContentItem
- type InterleavedContentImageContentItemImage
- type InterleavedContentImageContentItemImageParam
- type InterleavedContentImageContentItemImageURL
- type InterleavedContentImageContentItemImageURLParam
- type InterleavedContentImageContentItemParam
- type InterleavedContentItemImage
- type InterleavedContentItemImageImage
- type InterleavedContentItemImageImageParam
- type InterleavedContentItemImageImageURL
- type InterleavedContentItemImageImageURLParam
- type InterleavedContentItemImageParam
- type InterleavedContentItemText
- type InterleavedContentItemTextParam
- type InterleavedContentItemUnion
- func (u InterleavedContentItemUnion) AsAny() anyInterleavedContentItem
- func (u InterleavedContentItemUnion) AsImage() (v InterleavedContentItemImage)
- func (u InterleavedContentItemUnion) AsText() (v InterleavedContentItemText)
- func (u InterleavedContentItemUnion) RawJSON() string
- func (r InterleavedContentItemUnion) ToParam() InterleavedContentItemUnionParam
- func (r *InterleavedContentItemUnion) UnmarshalJSON(data []byte) error
- type InterleavedContentItemUnionParam
- func (u InterleavedContentItemUnionParam) GetImage() *InterleavedContentItemImageImageParam
- func (u InterleavedContentItemUnionParam) GetText() *string
- func (u InterleavedContentItemUnionParam) GetType() *string
- func (u InterleavedContentItemUnionParam) MarshalJSON() ([]byte, error)
- func (u *InterleavedContentItemUnionParam) UnmarshalJSON(data []byte) error
- type InterleavedContentTextContentItem
- type InterleavedContentTextContentItemParam
- type InterleavedContentUnion
- func (u InterleavedContentUnion) AsImageContentItem() (v InterleavedContentImageContentItem)
- func (u InterleavedContentUnion) AsInterleavedContentItemArray() (v []InterleavedContentItemUnion)
- func (u InterleavedContentUnion) AsString() (v string)
- func (u InterleavedContentUnion) AsTextContentItem() (v InterleavedContentTextContentItem)
- func (u InterleavedContentUnion) RawJSON() string
- func (r InterleavedContentUnion) ToParam() InterleavedContentUnionParam
- func (r *InterleavedContentUnion) UnmarshalJSON(data []byte) error
- type InterleavedContentUnionParam
- func (u InterleavedContentUnionParam) GetImage() *InterleavedContentImageContentItemImageParam
- func (u InterleavedContentUnionParam) GetText() *string
- func (u InterleavedContentUnionParam) GetType() *string
- func (u InterleavedContentUnionParam) MarshalJSON() ([]byte, error)
- func (u *InterleavedContentUnionParam) UnmarshalJSON(data []byte) error
- type Job
- type JobStatus
- type ListBenchmarksResponse
- type ListDatasetsResponse
- type ListDatasetsResponseData
- type ListDatasetsResponseDataMetadataUnion
- func (u ListDatasetsResponseDataMetadataUnion) AsAnyArray() (v []any)
- func (u ListDatasetsResponseDataMetadataUnion) AsBool() (v bool)
- func (u ListDatasetsResponseDataMetadataUnion) AsFloat() (v float64)
- func (u ListDatasetsResponseDataMetadataUnion) AsString() (v string)
- func (u ListDatasetsResponseDataMetadataUnion) RawJSON() string
- func (r *ListDatasetsResponseDataMetadataUnion) UnmarshalJSON(data []byte) error
- type ListDatasetsResponseDataSourceRows
- type ListDatasetsResponseDataSourceRowsRowUnion
- func (u ListDatasetsResponseDataSourceRowsRowUnion) AsAnyArray() (v []any)
- func (u ListDatasetsResponseDataSourceRowsRowUnion) AsBool() (v bool)
- func (u ListDatasetsResponseDataSourceRowsRowUnion) AsFloat() (v float64)
- func (u ListDatasetsResponseDataSourceRowsRowUnion) AsString() (v string)
- func (u ListDatasetsResponseDataSourceRowsRowUnion) RawJSON() string
- func (r *ListDatasetsResponseDataSourceRowsRowUnion) UnmarshalJSON(data []byte) error
- type ListDatasetsResponseDataSourceUnion
- func (u ListDatasetsResponseDataSourceUnion) AsAny() anyListDatasetsResponseDataSource
- func (u ListDatasetsResponseDataSourceUnion) AsRows() (v ListDatasetsResponseDataSourceRows)
- func (u ListDatasetsResponseDataSourceUnion) AsUri() (v ListDatasetsResponseDataSourceUri)
- func (u ListDatasetsResponseDataSourceUnion) RawJSON() string
- func (r *ListDatasetsResponseDataSourceUnion) UnmarshalJSON(data []byte) error
- type ListDatasetsResponseDataSourceUri
- type ListFilesResponse
- type ListModelsResponse
- type ListPostTrainingJobsResponse
- type ListPostTrainingJobsResponseData
- type ListPromptsResponse
- type ListProvidersResponse
- type ListRoutesResponse
- type ListScoringFunctionsResponse
- type ListShieldsResponse
- type ListToolGroupsResponse
- type ListVectorStoreFilesInBatchResponse
- type ListVectorStoresResponse
- type Model
- type ModelCustomMetadataUnion
- func (u ModelCustomMetadataUnion) AsAnyArray() (v []any)
- func (u ModelCustomMetadataUnion) AsBool() (v bool)
- func (u ModelCustomMetadataUnion) AsFloat() (v float64)
- func (u ModelCustomMetadataUnion) AsString() (v string)
- func (u ModelCustomMetadataUnion) RawJSON() string
- func (r *ModelCustomMetadataUnion) UnmarshalJSON(data []byte) error
- type ModelGetResponse
- type ModelGetResponseMetadataUnion
- func (u ModelGetResponseMetadataUnion) AsAnyArray() (v []any)
- func (u ModelGetResponseMetadataUnion) AsBool() (v bool)
- func (u ModelGetResponseMetadataUnion) AsFloat() (v float64)
- func (u ModelGetResponseMetadataUnion) AsString() (v string)
- func (u ModelGetResponseMetadataUnion) RawJSON() string
- func (r *ModelGetResponseMetadataUnion) UnmarshalJSON(data []byte) error
- type ModelGetResponseModelType
- type ModelOpenAIService
- type ModelRegisterParams
- type ModelRegisterParamsMetadataUnion
- type ModelRegisterParamsModelType
- type ModelRegisterResponse
- type ModelRegisterResponseMetadataUnion
- func (u ModelRegisterResponseMetadataUnion) AsAnyArray() (v []any)
- func (u ModelRegisterResponseMetadataUnion) AsBool() (v bool)
- func (u ModelRegisterResponseMetadataUnion) AsFloat() (v float64)
- func (u ModelRegisterResponseMetadataUnion) AsString() (v string)
- func (u ModelRegisterResponseMetadataUnion) RawJSON() string
- func (r *ModelRegisterResponseMetadataUnion) UnmarshalJSON(data []byte) error
- type ModelRegisterResponseModelType
- type ModelService
- func (r *ModelService) Get(ctx context.Context, modelID string, opts ...option.RequestOption) (res *ModelGetResponse, err error)
- func (r *ModelService) List(ctx context.Context, opts ...option.RequestOption) (res *[]Model, err error)
- func (r *ModelService) Register(ctx context.Context, body ModelRegisterParams, opts ...option.RequestOption) (res *ModelRegisterResponse, err error)deprecated
- func (r *ModelService) Unregister(ctx context.Context, modelID string, opts ...option.RequestOption) (err error)deprecated
- type ModerationNewParams
- type ModerationNewParamsInputUnion
- type ModerationService
- type PostTrainingJob
- type Prompt
- type PromptGetParams
- type PromptNewParams
- type PromptService
- func (r *PromptService) Delete(ctx context.Context, promptID string, opts ...option.RequestOption) (err error)
- func (r *PromptService) Get(ctx context.Context, promptID string, query PromptGetParams, ...) (res *Prompt, err error)
- func (r *PromptService) List(ctx context.Context, opts ...option.RequestOption) (res *[]Prompt, err error)
- func (r *PromptService) New(ctx context.Context, body PromptNewParams, opts ...option.RequestOption) (res *Prompt, err error)
- func (r *PromptService) SetDefaultVersion(ctx context.Context, promptID string, body PromptSetDefaultVersionParams, ...) (res *Prompt, err error)
- func (r *PromptService) Update(ctx context.Context, promptID string, body PromptUpdateParams, ...) (res *Prompt, err error)
- type PromptSetDefaultVersionParams
- type PromptUpdateParams
- type PromptVersionService
- type ProviderInfo
- type ProviderInfoConfigUnion
- func (u ProviderInfoConfigUnion) AsAnyArray() (v []any)
- func (u ProviderInfoConfigUnion) AsBool() (v bool)
- func (u ProviderInfoConfigUnion) AsFloat() (v float64)
- func (u ProviderInfoConfigUnion) AsString() (v string)
- func (u ProviderInfoConfigUnion) RawJSON() string
- func (r *ProviderInfoConfigUnion) UnmarshalJSON(data []byte) error
- type ProviderInfoHealthUnion
- func (u ProviderInfoHealthUnion) AsAnyArray() (v []any)
- func (u ProviderInfoHealthUnion) AsBool() (v bool)
- func (u ProviderInfoHealthUnion) AsFloat() (v float64)
- func (u ProviderInfoHealthUnion) AsString() (v string)
- func (u ProviderInfoHealthUnion) RawJSON() string
- func (r *ProviderInfoHealthUnion) UnmarshalJSON(data []byte) error
- type ProviderService
- type QueryChunksResponse
- type QueryChunksResponseChunk
- type QueryChunksResponseChunkChunkMetadata
- type QueryChunksResponseChunkMetadataUnion
- func (u QueryChunksResponseChunkMetadataUnion) AsAnyArray() (v []any)
- func (u QueryChunksResponseChunkMetadataUnion) AsBool() (v bool)
- func (u QueryChunksResponseChunkMetadataUnion) AsFloat() (v float64)
- func (u QueryChunksResponseChunkMetadataUnion) AsString() (v string)
- func (u QueryChunksResponseChunkMetadataUnion) RawJSON() string
- func (r *QueryChunksResponseChunkMetadataUnion) UnmarshalJSON(data []byte) error
- type ResponseDeleteResponse
- type ResponseInputItemListParams
- type ResponseInputItemListParamsOrder
- type ResponseInputItemListResponse
- type ResponseInputItemListResponseDataOpenAIResponseInputFunctionToolCallOutput
- type ResponseInputItemListResponseDataOpenAIResponseMcpApprovalRequest
- type ResponseInputItemListResponseDataOpenAIResponseMcpApprovalResponse
- type ResponseInputItemListResponseDataOpenAIResponseMessage
- type ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemDetail
- type ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemInputFile
- type ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemInputImage
- type ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemInputImageDetail
- type ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemInputText
- type ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemUnion
- func (u ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemUnion) AsAny() anyResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItem
- func (u ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemUnion) AsInputFile() (...)
- func (u ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemUnion) AsInputImage() (...)
- func (u ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemUnion) AsInputText() (...)
- func (u ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemUnion) RawJSON() string
- func (r *ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemUnion) UnmarshalJSON(data []byte) error
- type ResponseInputItemListResponseDataOpenAIResponseMessageContentUnion
- func (u ResponseInputItemListResponseDataOpenAIResponseMessageContentUnion) AsResponseInputItemListResponseDataOpenAIResponseMessageContentArray() (...)
- func (u ResponseInputItemListResponseDataOpenAIResponseMessageContentUnion) AsString() (v string)
- func (u ResponseInputItemListResponseDataOpenAIResponseMessageContentUnion) AsVariant2() (...)
- func (u ResponseInputItemListResponseDataOpenAIResponseMessageContentUnion) RawJSON() string
- func (r *ResponseInputItemListResponseDataOpenAIResponseMessageContentUnion) UnmarshalJSON(data []byte) error
- type ResponseInputItemListResponseDataOpenAIResponseMessageRole
- type ResponseInputItemListResponseDataOpenAIResponseOutputMessageFileSearchToolCall
- type ResponseInputItemListResponseDataOpenAIResponseOutputMessageFileSearchToolCallResult
- type ResponseInputItemListResponseDataOpenAIResponseOutputMessageFileSearchToolCallResultAttributeUnion
- func (u ResponseInputItemListResponseDataOpenAIResponseOutputMessageFileSearchToolCallResultAttributeUnion) AsAnyArray() (v []any)
- func (u ResponseInputItemListResponseDataOpenAIResponseOutputMessageFileSearchToolCallResultAttributeUnion) AsBool() (v bool)
- func (u ResponseInputItemListResponseDataOpenAIResponseOutputMessageFileSearchToolCallResultAttributeUnion) AsFloat() (v float64)
- func (u ResponseInputItemListResponseDataOpenAIResponseOutputMessageFileSearchToolCallResultAttributeUnion) AsString() (v string)
- func (u ResponseInputItemListResponseDataOpenAIResponseOutputMessageFileSearchToolCallResultAttributeUnion) RawJSON() string
- func (r *ResponseInputItemListResponseDataOpenAIResponseOutputMessageFileSearchToolCallResultAttributeUnion) UnmarshalJSON(data []byte) error
- type ResponseInputItemListResponseDataOpenAIResponseOutputMessageFunctionToolCall
- type ResponseInputItemListResponseDataOpenAIResponseOutputMessageMcpCall
- type ResponseInputItemListResponseDataOpenAIResponseOutputMessageMcpListTools
- type ResponseInputItemListResponseDataOpenAIResponseOutputMessageMcpListToolsTool
- type ResponseInputItemListResponseDataOpenAIResponseOutputMessageMcpListToolsToolInputSchemaUnion
- func (u ResponseInputItemListResponseDataOpenAIResponseOutputMessageMcpListToolsToolInputSchemaUnion) AsAnyArray() (v []any)
- func (u ResponseInputItemListResponseDataOpenAIResponseOutputMessageMcpListToolsToolInputSchemaUnion) AsBool() (v bool)
- func (u ResponseInputItemListResponseDataOpenAIResponseOutputMessageMcpListToolsToolInputSchemaUnion) AsFloat() (v float64)
- func (u ResponseInputItemListResponseDataOpenAIResponseOutputMessageMcpListToolsToolInputSchemaUnion) AsString() (v string)
- func (u ResponseInputItemListResponseDataOpenAIResponseOutputMessageMcpListToolsToolInputSchemaUnion) RawJSON() string
- func (r *ResponseInputItemListResponseDataOpenAIResponseOutputMessageMcpListToolsToolInputSchemaUnion) UnmarshalJSON(data []byte) error
- type ResponseInputItemListResponseDataOpenAIResponseOutputMessageWebSearchToolCall
- type ResponseInputItemListResponseDataRole
- type ResponseInputItemListResponseDataUnion
- func (u ResponseInputItemListResponseDataUnion) AsOpenAIResponseInputFunctionToolCallOutput() (v ResponseInputItemListResponseDataOpenAIResponseInputFunctionToolCallOutput)
- func (u ResponseInputItemListResponseDataUnion) AsOpenAIResponseMcpApprovalRequest() (v ResponseInputItemListResponseDataOpenAIResponseMcpApprovalRequest)
- func (u ResponseInputItemListResponseDataUnion) AsOpenAIResponseMcpApprovalResponse() (v ResponseInputItemListResponseDataOpenAIResponseMcpApprovalResponse)
- func (u ResponseInputItemListResponseDataUnion) AsOpenAIResponseMessage() (v ResponseInputItemListResponseDataOpenAIResponseMessage)
- func (u ResponseInputItemListResponseDataUnion) AsOpenAIResponseOutputMessageFileSearchToolCall() (...)
- func (u ResponseInputItemListResponseDataUnion) AsOpenAIResponseOutputMessageFunctionToolCall() (v ResponseInputItemListResponseDataOpenAIResponseOutputMessageFunctionToolCall)
- func (u ResponseInputItemListResponseDataUnion) AsOpenAIResponseOutputMessageMcpCall() (v ResponseInputItemListResponseDataOpenAIResponseOutputMessageMcpCall)
- func (u ResponseInputItemListResponseDataUnion) AsOpenAIResponseOutputMessageMcpListTools() (v ResponseInputItemListResponseDataOpenAIResponseOutputMessageMcpListTools)
- func (u ResponseInputItemListResponseDataUnion) AsOpenAIResponseOutputMessageWebSearchToolCall() (...)
- func (u ResponseInputItemListResponseDataUnion) AsResponseInputItemListResponseDataOpenAIResponseMessage() (v ResponseInputItemListResponseDataOpenAIResponseMessage)
- func (u ResponseInputItemListResponseDataUnion) RawJSON() string
- func (r *ResponseInputItemListResponseDataUnion) UnmarshalJSON(data []byte) error
- type ResponseInputItemService
- type ResponseListParams
- type ResponseListParamsOrder
- type ResponseListResponse
- type ResponseListResponseError
- type ResponseListResponseInputOpenAIResponseInputFunctionToolCallOutput
- type ResponseListResponseInputOpenAIResponseMcpApprovalRequest
- type ResponseListResponseInputOpenAIResponseMcpApprovalResponse
- type ResponseListResponseInputOpenAIResponseMessage
- type ResponseListResponseInputOpenAIResponseMessageContentArrayItemDetail
- type ResponseListResponseInputOpenAIResponseMessageContentArrayItemInputFile
- type ResponseListResponseInputOpenAIResponseMessageContentArrayItemInputImage
- type ResponseListResponseInputOpenAIResponseMessageContentArrayItemInputImageDetail
- type ResponseListResponseInputOpenAIResponseMessageContentArrayItemInputText
- type ResponseListResponseInputOpenAIResponseMessageContentArrayItemUnion
- func (u ResponseListResponseInputOpenAIResponseMessageContentArrayItemUnion) AsAny() anyResponseListResponseInputOpenAIResponseMessageContentArrayItem
- func (u ResponseListResponseInputOpenAIResponseMessageContentArrayItemUnion) AsInputFile() (v ResponseListResponseInputOpenAIResponseMessageContentArrayItemInputFile)
- func (u ResponseListResponseInputOpenAIResponseMessageContentArrayItemUnion) AsInputImage() (v ResponseListResponseInputOpenAIResponseMessageContentArrayItemInputImage)
- func (u ResponseListResponseInputOpenAIResponseMessageContentArrayItemUnion) AsInputText() (v ResponseListResponseInputOpenAIResponseMessageContentArrayItemInputText)
- func (u ResponseListResponseInputOpenAIResponseMessageContentArrayItemUnion) RawJSON() string
- func (r *ResponseListResponseInputOpenAIResponseMessageContentArrayItemUnion) UnmarshalJSON(data []byte) error
- type ResponseListResponseInputOpenAIResponseMessageContentUnion
- func (u ResponseListResponseInputOpenAIResponseMessageContentUnion) AsResponseListResponseInputOpenAIResponseMessageContentArray() (v []ResponseListResponseInputOpenAIResponseMessageContentArrayItemUnion)
- func (u ResponseListResponseInputOpenAIResponseMessageContentUnion) AsString() (v string)
- func (u ResponseListResponseInputOpenAIResponseMessageContentUnion) AsVariant2() (v []ResponseListResponseInputOpenAIResponseMessageContentArrayItemUnion)
- func (u ResponseListResponseInputOpenAIResponseMessageContentUnion) RawJSON() string
- func (r *ResponseListResponseInputOpenAIResponseMessageContentUnion) UnmarshalJSON(data []byte) error
- type ResponseListResponseInputOpenAIResponseMessageRole
- type ResponseListResponseInputOpenAIResponseOutputMessageFileSearchToolCall
- type ResponseListResponseInputOpenAIResponseOutputMessageFileSearchToolCallResult
- type ResponseListResponseInputOpenAIResponseOutputMessageFileSearchToolCallResultAttributeUnion
- func (u ResponseListResponseInputOpenAIResponseOutputMessageFileSearchToolCallResultAttributeUnion) AsAnyArray() (v []any)
- func (u ResponseListResponseInputOpenAIResponseOutputMessageFileSearchToolCallResultAttributeUnion) AsBool() (v bool)
- func (u ResponseListResponseInputOpenAIResponseOutputMessageFileSearchToolCallResultAttributeUnion) AsFloat() (v float64)
- func (u ResponseListResponseInputOpenAIResponseOutputMessageFileSearchToolCallResultAttributeUnion) AsString() (v string)
- func (u ResponseListResponseInputOpenAIResponseOutputMessageFileSearchToolCallResultAttributeUnion) RawJSON() string
- func (r *ResponseListResponseInputOpenAIResponseOutputMessageFileSearchToolCallResultAttributeUnion) UnmarshalJSON(data []byte) error
- type ResponseListResponseInputOpenAIResponseOutputMessageFunctionToolCall
- type ResponseListResponseInputOpenAIResponseOutputMessageMcpCall
- type ResponseListResponseInputOpenAIResponseOutputMessageMcpListTools
- type ResponseListResponseInputOpenAIResponseOutputMessageMcpListToolsTool
- type ResponseListResponseInputOpenAIResponseOutputMessageMcpListToolsToolInputSchemaUnion
- func (u ResponseListResponseInputOpenAIResponseOutputMessageMcpListToolsToolInputSchemaUnion) AsAnyArray() (v []any)
- func (u ResponseListResponseInputOpenAIResponseOutputMessageMcpListToolsToolInputSchemaUnion) AsBool() (v bool)
- func (u ResponseListResponseInputOpenAIResponseOutputMessageMcpListToolsToolInputSchemaUnion) AsFloat() (v float64)
- func (u ResponseListResponseInputOpenAIResponseOutputMessageMcpListToolsToolInputSchemaUnion) AsString() (v string)
- func (u ResponseListResponseInputOpenAIResponseOutputMessageMcpListToolsToolInputSchemaUnion) RawJSON() string
- func (r *ResponseListResponseInputOpenAIResponseOutputMessageMcpListToolsToolInputSchemaUnion) UnmarshalJSON(data []byte) error
- type ResponseListResponseInputOpenAIResponseOutputMessageWebSearchToolCall
- type ResponseListResponseInputRole
- type ResponseListResponseInputUnion
- func (u ResponseListResponseInputUnion) AsOpenAIResponseInputFunctionToolCallOutput() (v ResponseListResponseInputOpenAIResponseInputFunctionToolCallOutput)
- func (u ResponseListResponseInputUnion) AsOpenAIResponseMcpApprovalRequest() (v ResponseListResponseInputOpenAIResponseMcpApprovalRequest)
- func (u ResponseListResponseInputUnion) AsOpenAIResponseMcpApprovalResponse() (v ResponseListResponseInputOpenAIResponseMcpApprovalResponse)
- func (u ResponseListResponseInputUnion) AsOpenAIResponseMessage() (v ResponseListResponseInputOpenAIResponseMessage)
- func (u ResponseListResponseInputUnion) AsOpenAIResponseOutputMessageFileSearchToolCall() (v ResponseListResponseInputOpenAIResponseOutputMessageFileSearchToolCall)
- func (u ResponseListResponseInputUnion) AsOpenAIResponseOutputMessageFunctionToolCall() (v ResponseListResponseInputOpenAIResponseOutputMessageFunctionToolCall)
- func (u ResponseListResponseInputUnion) AsOpenAIResponseOutputMessageMcpCall() (v ResponseListResponseInputOpenAIResponseOutputMessageMcpCall)
- func (u ResponseListResponseInputUnion) AsOpenAIResponseOutputMessageMcpListTools() (v ResponseListResponseInputOpenAIResponseOutputMessageMcpListTools)
- func (u ResponseListResponseInputUnion) AsOpenAIResponseOutputMessageWebSearchToolCall() (v ResponseListResponseInputOpenAIResponseOutputMessageWebSearchToolCall)
- func (u ResponseListResponseInputUnion) AsResponseListResponseInputOpenAIResponseMessage() (v ResponseListResponseInputOpenAIResponseMessage)
- func (u ResponseListResponseInputUnion) RawJSON() string
- func (r *ResponseListResponseInputUnion) UnmarshalJSON(data []byte) error
- type ResponseListResponseOutputFileSearchCall
- type ResponseListResponseOutputFileSearchCallResult
- type ResponseListResponseOutputFileSearchCallResultAttributeUnion
- func (u ResponseListResponseOutputFileSearchCallResultAttributeUnion) AsAnyArray() (v []any)
- func (u ResponseListResponseOutputFileSearchCallResultAttributeUnion) AsBool() (v bool)
- func (u ResponseListResponseOutputFileSearchCallResultAttributeUnion) AsFloat() (v float64)
- func (u ResponseListResponseOutputFileSearchCallResultAttributeUnion) AsString() (v string)
- func (u ResponseListResponseOutputFileSearchCallResultAttributeUnion) RawJSON() string
- func (r *ResponseListResponseOutputFileSearchCallResultAttributeUnion) UnmarshalJSON(data []byte) error
- type ResponseListResponseOutputFunctionCall
- type ResponseListResponseOutputMcpApprovalRequest
- type ResponseListResponseOutputMcpCall
- type ResponseListResponseOutputMcpListTools
- type ResponseListResponseOutputMcpListToolsTool
- type ResponseListResponseOutputMcpListToolsToolInputSchemaUnion
- func (u ResponseListResponseOutputMcpListToolsToolInputSchemaUnion) AsAnyArray() (v []any)
- func (u ResponseListResponseOutputMcpListToolsToolInputSchemaUnion) AsBool() (v bool)
- func (u ResponseListResponseOutputMcpListToolsToolInputSchemaUnion) AsFloat() (v float64)
- func (u ResponseListResponseOutputMcpListToolsToolInputSchemaUnion) AsString() (v string)
- func (u ResponseListResponseOutputMcpListToolsToolInputSchemaUnion) RawJSON() string
- func (r *ResponseListResponseOutputMcpListToolsToolInputSchemaUnion) UnmarshalJSON(data []byte) error
- type ResponseListResponseOutputMessage
- type ResponseListResponseOutputMessageContentArrayItemDetail
- type ResponseListResponseOutputMessageContentArrayItemInputFile
- type ResponseListResponseOutputMessageContentArrayItemInputImage
- type ResponseListResponseOutputMessageContentArrayItemInputImageDetail
- type ResponseListResponseOutputMessageContentArrayItemInputText
- type ResponseListResponseOutputMessageContentArrayItemUnion
- func (u ResponseListResponseOutputMessageContentArrayItemUnion) AsAny() anyResponseListResponseOutputMessageContentArrayItem
- func (u ResponseListResponseOutputMessageContentArrayItemUnion) AsInputFile() (v ResponseListResponseOutputMessageContentArrayItemInputFile)
- func (u ResponseListResponseOutputMessageContentArrayItemUnion) AsInputImage() (v ResponseListResponseOutputMessageContentArrayItemInputImage)
- func (u ResponseListResponseOutputMessageContentArrayItemUnion) AsInputText() (v ResponseListResponseOutputMessageContentArrayItemInputText)
- func (u ResponseListResponseOutputMessageContentArrayItemUnion) RawJSON() string
- func (r *ResponseListResponseOutputMessageContentArrayItemUnion) UnmarshalJSON(data []byte) error
- type ResponseListResponseOutputMessageContentUnion
- func (u ResponseListResponseOutputMessageContentUnion) AsResponseListResponseOutputMessageContentArray() (v []ResponseListResponseOutputMessageContentArrayItemUnion)
- func (u ResponseListResponseOutputMessageContentUnion) AsString() (v string)
- func (u ResponseListResponseOutputMessageContentUnion) AsVariant2() (v []ResponseListResponseOutputMessageContentArrayItemUnion)
- func (u ResponseListResponseOutputMessageContentUnion) RawJSON() string
- func (r *ResponseListResponseOutputMessageContentUnion) UnmarshalJSON(data []byte) error
- type ResponseListResponseOutputMessageRole
- type ResponseListResponseOutputRole
- type ResponseListResponseOutputUnion
- func (u ResponseListResponseOutputUnion) AsAny() anyResponseListResponseOutput
- func (u ResponseListResponseOutputUnion) AsFileSearchCall() (v ResponseListResponseOutputFileSearchCall)
- func (u ResponseListResponseOutputUnion) AsFunctionCall() (v ResponseListResponseOutputFunctionCall)
- func (u ResponseListResponseOutputUnion) AsMcpApprovalRequest() (v ResponseListResponseOutputMcpApprovalRequest)
- func (u ResponseListResponseOutputUnion) AsMcpCall() (v ResponseListResponseOutputMcpCall)
- func (u ResponseListResponseOutputUnion) AsMcpListTools() (v ResponseListResponseOutputMcpListTools)
- func (u ResponseListResponseOutputUnion) AsMessage() (v ResponseListResponseOutputMessage)
- func (u ResponseListResponseOutputUnion) AsWebSearchCall() (v ResponseListResponseOutputWebSearchCall)
- func (u ResponseListResponseOutputUnion) RawJSON() string
- func (r *ResponseListResponseOutputUnion) UnmarshalJSON(data []byte) error
- type ResponseListResponseOutputWebSearchCall
- type ResponseListResponsePrompt
- type ResponseListResponsePromptVariableDetail
- type ResponseListResponsePromptVariableInputFile
- type ResponseListResponsePromptVariableInputImage
- type ResponseListResponsePromptVariableInputImageDetail
- type ResponseListResponsePromptVariableInputText
- type ResponseListResponsePromptVariableUnion
- func (u ResponseListResponsePromptVariableUnion) AsAny() anyResponseListResponsePromptVariable
- func (u ResponseListResponsePromptVariableUnion) AsInputFile() (v ResponseListResponsePromptVariableInputFile)
- func (u ResponseListResponsePromptVariableUnion) AsInputImage() (v ResponseListResponsePromptVariableInputImage)
- func (u ResponseListResponsePromptVariableUnion) AsInputText() (v ResponseListResponsePromptVariableInputText)
- func (u ResponseListResponsePromptVariableUnion) RawJSON() string
- func (r *ResponseListResponsePromptVariableUnion) UnmarshalJSON(data []byte) error
- type ResponseListResponseText
- type ResponseListResponseTextFormat
- type ResponseListResponseTextFormatSchemaUnion
- func (u ResponseListResponseTextFormatSchemaUnion) AsAnyArray() (v []any)
- func (u ResponseListResponseTextFormatSchemaUnion) AsBool() (v bool)
- func (u ResponseListResponseTextFormatSchemaUnion) AsFloat() (v float64)
- func (u ResponseListResponseTextFormatSchemaUnion) AsString() (v string)
- func (u ResponseListResponseTextFormatSchemaUnion) RawJSON() string
- func (r *ResponseListResponseTextFormatSchemaUnion) UnmarshalJSON(data []byte) error
- type ResponseListResponseTextFormatType
- type ResponseListResponseToolFileSearch
- type ResponseListResponseToolFileSearchFilterUnion
- func (u ResponseListResponseToolFileSearchFilterUnion) AsAnyArray() (v []any)
- func (u ResponseListResponseToolFileSearchFilterUnion) AsBool() (v bool)
- func (u ResponseListResponseToolFileSearchFilterUnion) AsFloat() (v float64)
- func (u ResponseListResponseToolFileSearchFilterUnion) AsString() (v string)
- func (u ResponseListResponseToolFileSearchFilterUnion) RawJSON() string
- func (r *ResponseListResponseToolFileSearchFilterUnion) UnmarshalJSON(data []byte) error
- type ResponseListResponseToolFileSearchRankingOptions
- type ResponseListResponseToolFunction
- type ResponseListResponseToolFunctionParameterUnion
- func (u ResponseListResponseToolFunctionParameterUnion) AsAnyArray() (v []any)
- func (u ResponseListResponseToolFunctionParameterUnion) AsBool() (v bool)
- func (u ResponseListResponseToolFunctionParameterUnion) AsFloat() (v float64)
- func (u ResponseListResponseToolFunctionParameterUnion) AsString() (v string)
- func (u ResponseListResponseToolFunctionParameterUnion) RawJSON() string
- func (r *ResponseListResponseToolFunctionParameterUnion) UnmarshalJSON(data []byte) error
- type ResponseListResponseToolMcp
- type ResponseListResponseToolMcpAllowedToolsAllowedToolsFilter
- type ResponseListResponseToolMcpAllowedToolsUnion
- func (u ResponseListResponseToolMcpAllowedToolsUnion) AsAllowedToolsFilter() (v ResponseListResponseToolMcpAllowedToolsAllowedToolsFilter)
- func (u ResponseListResponseToolMcpAllowedToolsUnion) AsStringArray() (v []string)
- func (u ResponseListResponseToolMcpAllowedToolsUnion) RawJSON() string
- func (r *ResponseListResponseToolMcpAllowedToolsUnion) UnmarshalJSON(data []byte) error
- type ResponseListResponseToolOpenAIResponseInputToolWebSearch
- type ResponseListResponseToolOpenAIResponseInputToolWebSearchType
- type ResponseListResponseToolType
- type ResponseListResponseToolUnion
- func (u ResponseListResponseToolUnion) AsFileSearch() (v ResponseListResponseToolFileSearch)
- func (u ResponseListResponseToolUnion) AsFunction() (v ResponseListResponseToolFunction)
- func (u ResponseListResponseToolUnion) AsMcp() (v ResponseListResponseToolMcp)
- func (u ResponseListResponseToolUnion) AsOpenAIResponseInputToolWebSearch() (v ResponseListResponseToolOpenAIResponseInputToolWebSearch)
- func (u ResponseListResponseToolUnion) RawJSON() string
- func (r *ResponseListResponseToolUnion) UnmarshalJSON(data []byte) error
- type ResponseListResponseUsage
- type ResponseListResponseUsageInputTokensDetails
- type ResponseListResponseUsageOutputTokensDetails
- type ResponseNewParams
- type ResponseNewParamsInputArrayItemOpenAIResponseInputFunctionToolCallOutput
- type ResponseNewParamsInputArrayItemOpenAIResponseMcpApprovalRequest
- type ResponseNewParamsInputArrayItemOpenAIResponseMcpApprovalResponse
- type ResponseNewParamsInputArrayItemOpenAIResponseMessage
- type ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemInputFile
- type ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemInputImage
- type ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemInputImageDetail
- type ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemInputText
- type ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemUnion
- func (u ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemUnion) GetDetail() *string
- func (u ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemUnion) GetFileData() *string
- func (u ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemUnion) GetFileID() *string
- func (u ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemUnion) GetFileURL() *string
- func (u ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemUnion) GetFilename() *string
- func (u ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemUnion) GetImageURL() *string
- func (u ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemUnion) GetText() *string
- func (u ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemUnion) GetType() *string
- func (u ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemUnion) MarshalJSON() ([]byte, error)
- func (u *ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemUnion) UnmarshalJSON(data []byte) error
- type ResponseNewParamsInputArrayItemOpenAIResponseMessageContentUnion
- type ResponseNewParamsInputArrayItemOpenAIResponseMessageRole
- type ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageFileSearchToolCall
- type ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageFileSearchToolCallResult
- type ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageFileSearchToolCallResultAttributeUnion
- type ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageFunctionToolCall
- type ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageMcpCall
- type ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageMcpListTools
- type ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageMcpListToolsTool
- type ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageMcpListToolsToolInputSchemaUnion
- type ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageWebSearchToolCall
- type ResponseNewParamsInputArrayItemUnion
- func (u ResponseNewParamsInputArrayItemUnion) GetApprovalRequestID() *string
- func (u ResponseNewParamsInputArrayItemUnion) GetApprove() *bool
- func (u ResponseNewParamsInputArrayItemUnion) GetArguments() *string
- func (u ResponseNewParamsInputArrayItemUnion) GetCallID() *string
- func (u ResponseNewParamsInputArrayItemUnion) GetContent() *ResponseNewParamsInputArrayItemOpenAIResponseMessageContentUnion
- func (u ResponseNewParamsInputArrayItemUnion) GetError() *string
- func (u ResponseNewParamsInputArrayItemUnion) GetID() *string
- func (u ResponseNewParamsInputArrayItemUnion) GetName() *string
- func (u ResponseNewParamsInputArrayItemUnion) GetOutput() *string
- func (u ResponseNewParamsInputArrayItemUnion) GetQueries() []string
- func (u ResponseNewParamsInputArrayItemUnion) GetReason() *string
- func (u ResponseNewParamsInputArrayItemUnion) GetResults() ...
- func (u ResponseNewParamsInputArrayItemUnion) GetRole() *string
- func (u ResponseNewParamsInputArrayItemUnion) GetServerLabel() *string
- func (u ResponseNewParamsInputArrayItemUnion) GetStatus() *string
- func (u ResponseNewParamsInputArrayItemUnion) GetTools() []ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageMcpListToolsTool
- func (u ResponseNewParamsInputArrayItemUnion) GetType() *string
- func (u ResponseNewParamsInputArrayItemUnion) MarshalJSON() ([]byte, error)
- func (u *ResponseNewParamsInputArrayItemUnion) UnmarshalJSON(data []byte) error
- type ResponseNewParamsInputUnion
- type ResponseNewParamsPrompt
- type ResponseNewParamsPromptVariableInputFile
- type ResponseNewParamsPromptVariableInputImage
- type ResponseNewParamsPromptVariableInputImageDetail
- type ResponseNewParamsPromptVariableInputText
- type ResponseNewParamsPromptVariableUnion
- func (u ResponseNewParamsPromptVariableUnion) GetDetail() *string
- func (u ResponseNewParamsPromptVariableUnion) GetFileData() *string
- func (u ResponseNewParamsPromptVariableUnion) GetFileID() *string
- func (u ResponseNewParamsPromptVariableUnion) GetFileURL() *string
- func (u ResponseNewParamsPromptVariableUnion) GetFilename() *string
- func (u ResponseNewParamsPromptVariableUnion) GetImageURL() *string
- func (u ResponseNewParamsPromptVariableUnion) GetText() *string
- func (u ResponseNewParamsPromptVariableUnion) GetType() *string
- func (u ResponseNewParamsPromptVariableUnion) MarshalJSON() ([]byte, error)
- func (u *ResponseNewParamsPromptVariableUnion) UnmarshalJSON(data []byte) error
- type ResponseNewParamsText
- type ResponseNewParamsTextFormat
- type ResponseNewParamsTextFormatSchemaUnion
- type ResponseNewParamsTextFormatType
- type ResponseNewParamsToolFileSearch
- type ResponseNewParamsToolFileSearchFilterUnion
- type ResponseNewParamsToolFileSearchRankingOptions
- type ResponseNewParamsToolFunction
- type ResponseNewParamsToolFunctionParameterUnion
- type ResponseNewParamsToolMcp
- type ResponseNewParamsToolMcpAllowedToolsAllowedToolsFilter
- type ResponseNewParamsToolMcpAllowedToolsUnion
- type ResponseNewParamsToolMcpHeaderUnion
- type ResponseNewParamsToolMcpRequireApprovalApprovalFilter
- type ResponseNewParamsToolMcpRequireApprovalString
- type ResponseNewParamsToolMcpRequireApprovalUnion
- type ResponseNewParamsToolOpenAIResponseInputToolWebSearch
- type ResponseNewParamsToolOpenAIResponseInputToolWebSearchType
- type ResponseNewParamsToolUnion
- func (u ResponseNewParamsToolUnion) GetAllowedTools() *ResponseNewParamsToolMcpAllowedToolsUnion
- func (u ResponseNewParamsToolUnion) GetAuthorization() *string
- func (u ResponseNewParamsToolUnion) GetDescription() *string
- func (u ResponseNewParamsToolUnion) GetFilters() map[string]ResponseNewParamsToolFileSearchFilterUnion
- func (u ResponseNewParamsToolUnion) GetHeaders() map[string]ResponseNewParamsToolMcpHeaderUnion
- func (u ResponseNewParamsToolUnion) GetMaxNumResults() *int64
- func (u ResponseNewParamsToolUnion) GetName() *string
- func (u ResponseNewParamsToolUnion) GetParameters() map[string]ResponseNewParamsToolFunctionParameterUnion
- func (u ResponseNewParamsToolUnion) GetRankingOptions() *ResponseNewParamsToolFileSearchRankingOptions
- func (u ResponseNewParamsToolUnion) GetRequireApproval() *ResponseNewParamsToolMcpRequireApprovalUnion
- func (u ResponseNewParamsToolUnion) GetSearchContextSize() *string
- func (u ResponseNewParamsToolUnion) GetServerLabel() *string
- func (u ResponseNewParamsToolUnion) GetServerURL() *string
- func (u ResponseNewParamsToolUnion) GetStrict() *bool
- func (u ResponseNewParamsToolUnion) GetType() *string
- func (u ResponseNewParamsToolUnion) GetVectorStoreIDs() []string
- func (u ResponseNewParamsToolUnion) MarshalJSON() ([]byte, error)
- func (u *ResponseNewParamsToolUnion) UnmarshalJSON(data []byte) error
- type ResponseObject
- type ResponseObjectError
- type ResponseObjectOutputFileSearchCall
- type ResponseObjectOutputFileSearchCallResult
- type ResponseObjectOutputFileSearchCallResultAttributeUnion
- func (u ResponseObjectOutputFileSearchCallResultAttributeUnion) AsAnyArray() (v []any)
- func (u ResponseObjectOutputFileSearchCallResultAttributeUnion) AsBool() (v bool)
- func (u ResponseObjectOutputFileSearchCallResultAttributeUnion) AsFloat() (v float64)
- func (u ResponseObjectOutputFileSearchCallResultAttributeUnion) AsString() (v string)
- func (u ResponseObjectOutputFileSearchCallResultAttributeUnion) RawJSON() string
- func (r *ResponseObjectOutputFileSearchCallResultAttributeUnion) UnmarshalJSON(data []byte) error
- type ResponseObjectOutputFunctionCall
- type ResponseObjectOutputMcpApprovalRequest
- type ResponseObjectOutputMcpCall
- type ResponseObjectOutputMcpListTools
- type ResponseObjectOutputMcpListToolsTool
- type ResponseObjectOutputMcpListToolsToolInputSchemaUnion
- func (u ResponseObjectOutputMcpListToolsToolInputSchemaUnion) AsAnyArray() (v []any)
- func (u ResponseObjectOutputMcpListToolsToolInputSchemaUnion) AsBool() (v bool)
- func (u ResponseObjectOutputMcpListToolsToolInputSchemaUnion) AsFloat() (v float64)
- func (u ResponseObjectOutputMcpListToolsToolInputSchemaUnion) AsString() (v string)
- func (u ResponseObjectOutputMcpListToolsToolInputSchemaUnion) RawJSON() string
- func (r *ResponseObjectOutputMcpListToolsToolInputSchemaUnion) UnmarshalJSON(data []byte) error
- type ResponseObjectOutputMessage
- type ResponseObjectOutputMessageContentArrayItemDetail
- type ResponseObjectOutputMessageContentArrayItemInputFile
- type ResponseObjectOutputMessageContentArrayItemInputImage
- type ResponseObjectOutputMessageContentArrayItemInputImageDetail
- type ResponseObjectOutputMessageContentArrayItemInputText
- type ResponseObjectOutputMessageContentArrayItemUnion
- func (u ResponseObjectOutputMessageContentArrayItemUnion) AsAny() anyResponseObjectOutputMessageContentArrayItem
- func (u ResponseObjectOutputMessageContentArrayItemUnion) AsInputFile() (v ResponseObjectOutputMessageContentArrayItemInputFile)
- func (u ResponseObjectOutputMessageContentArrayItemUnion) AsInputImage() (v ResponseObjectOutputMessageContentArrayItemInputImage)
- func (u ResponseObjectOutputMessageContentArrayItemUnion) AsInputText() (v ResponseObjectOutputMessageContentArrayItemInputText)
- func (u ResponseObjectOutputMessageContentArrayItemUnion) RawJSON() string
- func (r *ResponseObjectOutputMessageContentArrayItemUnion) UnmarshalJSON(data []byte) error
- type ResponseObjectOutputMessageContentUnion
- func (u ResponseObjectOutputMessageContentUnion) AsResponseObjectOutputMessageContentArray() (v []ResponseObjectOutputMessageContentArrayItemUnion)
- func (u ResponseObjectOutputMessageContentUnion) AsString() (v string)
- func (u ResponseObjectOutputMessageContentUnion) AsVariant2() (v []ResponseObjectOutputMessageContentArrayItemUnion)
- func (u ResponseObjectOutputMessageContentUnion) RawJSON() string
- func (r *ResponseObjectOutputMessageContentUnion) UnmarshalJSON(data []byte) error
- type ResponseObjectOutputMessageRole
- type ResponseObjectOutputRole
- type ResponseObjectOutputUnion
- func (u ResponseObjectOutputUnion) AsAny() anyResponseObjectOutput
- func (u ResponseObjectOutputUnion) AsFileSearchCall() (v ResponseObjectOutputFileSearchCall)
- func (u ResponseObjectOutputUnion) AsFunctionCall() (v ResponseObjectOutputFunctionCall)
- func (u ResponseObjectOutputUnion) AsMcpApprovalRequest() (v ResponseObjectOutputMcpApprovalRequest)
- func (u ResponseObjectOutputUnion) AsMcpCall() (v ResponseObjectOutputMcpCall)
- func (u ResponseObjectOutputUnion) AsMcpListTools() (v ResponseObjectOutputMcpListTools)
- func (u ResponseObjectOutputUnion) AsMessage() (v ResponseObjectOutputMessage)
- func (u ResponseObjectOutputUnion) AsWebSearchCall() (v ResponseObjectOutputWebSearchCall)
- func (u ResponseObjectOutputUnion) RawJSON() string
- func (r *ResponseObjectOutputUnion) UnmarshalJSON(data []byte) error
- type ResponseObjectOutputWebSearchCall
- type ResponseObjectPrompt
- type ResponseObjectPromptVariableDetail
- type ResponseObjectPromptVariableInputFile
- type ResponseObjectPromptVariableInputImage
- type ResponseObjectPromptVariableInputImageDetail
- type ResponseObjectPromptVariableInputText
- type ResponseObjectPromptVariableUnion
- func (u ResponseObjectPromptVariableUnion) AsAny() anyResponseObjectPromptVariable
- func (u ResponseObjectPromptVariableUnion) AsInputFile() (v ResponseObjectPromptVariableInputFile)
- func (u ResponseObjectPromptVariableUnion) AsInputImage() (v ResponseObjectPromptVariableInputImage)
- func (u ResponseObjectPromptVariableUnion) AsInputText() (v ResponseObjectPromptVariableInputText)
- func (u ResponseObjectPromptVariableUnion) RawJSON() string
- func (r *ResponseObjectPromptVariableUnion) UnmarshalJSON(data []byte) error
- type ResponseObjectStreamResponseCompleted
- type ResponseObjectStreamResponseContentPartAdded
- type ResponseObjectStreamResponseContentPartAddedPartOutputText
- type ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationContainerFileCitation
- type ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationFileCitation
- type ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationFilePath
- type ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationURLCitation
- type ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationUnion
- func (u ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationUnion) AsAny() anyResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotation
- func (u ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationUnion) AsContainerFileCitation() (...)
- func (u ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationUnion) AsFileCitation() (...)
- func (u ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationUnion) AsFilePath() (v ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationFilePath)
- func (u ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationUnion) AsURLCitation() (...)
- func (u ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationUnion) RawJSON() string
- func (r *ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationUnion) UnmarshalJSON(data []byte) error
- type ResponseObjectStreamResponseContentPartAddedPartOutputTextLogprobUnion
- func (u ResponseObjectStreamResponseContentPartAddedPartOutputTextLogprobUnion) AsAnyArray() (v []any)
- func (u ResponseObjectStreamResponseContentPartAddedPartOutputTextLogprobUnion) AsBool() (v bool)
- func (u ResponseObjectStreamResponseContentPartAddedPartOutputTextLogprobUnion) AsFloat() (v float64)
- func (u ResponseObjectStreamResponseContentPartAddedPartOutputTextLogprobUnion) AsString() (v string)
- func (u ResponseObjectStreamResponseContentPartAddedPartOutputTextLogprobUnion) RawJSON() string
- func (r *ResponseObjectStreamResponseContentPartAddedPartOutputTextLogprobUnion) UnmarshalJSON(data []byte) error
- type ResponseObjectStreamResponseContentPartAddedPartReasoningText
- type ResponseObjectStreamResponseContentPartAddedPartRefusal
- type ResponseObjectStreamResponseContentPartAddedPartUnion
- func (u ResponseObjectStreamResponseContentPartAddedPartUnion) AsAny() anyResponseObjectStreamResponseContentPartAddedPart
- func (u ResponseObjectStreamResponseContentPartAddedPartUnion) AsOutputText() (v ResponseObjectStreamResponseContentPartAddedPartOutputText)
- func (u ResponseObjectStreamResponseContentPartAddedPartUnion) AsReasoningText() (v ResponseObjectStreamResponseContentPartAddedPartReasoningText)
- func (u ResponseObjectStreamResponseContentPartAddedPartUnion) AsRefusal() (v ResponseObjectStreamResponseContentPartAddedPartRefusal)
- func (u ResponseObjectStreamResponseContentPartAddedPartUnion) RawJSON() string
- func (r *ResponseObjectStreamResponseContentPartAddedPartUnion) UnmarshalJSON(data []byte) error
- type ResponseObjectStreamResponseContentPartDone
- type ResponseObjectStreamResponseContentPartDonePartOutputText
- type ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationContainerFileCitation
- type ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationFileCitation
- type ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationFilePath
- type ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationURLCitation
- type ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationUnion
- func (u ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationUnion) AsAny() anyResponseObjectStreamResponseContentPartDonePartOutputTextAnnotation
- func (u ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationUnion) AsContainerFileCitation() (...)
- func (u ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationUnion) AsFileCitation() (...)
- func (u ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationUnion) AsFilePath() (v ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationFilePath)
- func (u ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationUnion) AsURLCitation() (...)
- func (u ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationUnion) RawJSON() string
- func (r *ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationUnion) UnmarshalJSON(data []byte) error
- type ResponseObjectStreamResponseContentPartDonePartOutputTextLogprobUnion
- func (u ResponseObjectStreamResponseContentPartDonePartOutputTextLogprobUnion) AsAnyArray() (v []any)
- func (u ResponseObjectStreamResponseContentPartDonePartOutputTextLogprobUnion) AsBool() (v bool)
- func (u ResponseObjectStreamResponseContentPartDonePartOutputTextLogprobUnion) AsFloat() (v float64)
- func (u ResponseObjectStreamResponseContentPartDonePartOutputTextLogprobUnion) AsString() (v string)
- func (u ResponseObjectStreamResponseContentPartDonePartOutputTextLogprobUnion) RawJSON() string
- func (r *ResponseObjectStreamResponseContentPartDonePartOutputTextLogprobUnion) UnmarshalJSON(data []byte) error
- type ResponseObjectStreamResponseContentPartDonePartReasoningText
- type ResponseObjectStreamResponseContentPartDonePartRefusal
- type ResponseObjectStreamResponseContentPartDonePartUnion
- func (u ResponseObjectStreamResponseContentPartDonePartUnion) AsAny() anyResponseObjectStreamResponseContentPartDonePart
- func (u ResponseObjectStreamResponseContentPartDonePartUnion) AsOutputText() (v ResponseObjectStreamResponseContentPartDonePartOutputText)
- func (u ResponseObjectStreamResponseContentPartDonePartUnion) AsReasoningText() (v ResponseObjectStreamResponseContentPartDonePartReasoningText)
- func (u ResponseObjectStreamResponseContentPartDonePartUnion) AsRefusal() (v ResponseObjectStreamResponseContentPartDonePartRefusal)
- func (u ResponseObjectStreamResponseContentPartDonePartUnion) RawJSON() string
- func (r *ResponseObjectStreamResponseContentPartDonePartUnion) UnmarshalJSON(data []byte) error
- type ResponseObjectStreamResponseCreated
- type ResponseObjectStreamResponseFailed
- type ResponseObjectStreamResponseFileSearchCallCompleted
- type ResponseObjectStreamResponseFileSearchCallInProgress
- type ResponseObjectStreamResponseFileSearchCallSearching
- type ResponseObjectStreamResponseFunctionCallArgumentsDelta
- type ResponseObjectStreamResponseFunctionCallArgumentsDone
- type ResponseObjectStreamResponseInProgress
- type ResponseObjectStreamResponseIncomplete
- type ResponseObjectStreamResponseMcpCallArgumentsDelta
- type ResponseObjectStreamResponseMcpCallArgumentsDone
- type ResponseObjectStreamResponseMcpCallCompleted
- type ResponseObjectStreamResponseMcpCallFailed
- type ResponseObjectStreamResponseMcpCallInProgress
- type ResponseObjectStreamResponseMcpListToolsCompleted
- type ResponseObjectStreamResponseMcpListToolsFailed
- type ResponseObjectStreamResponseMcpListToolsInProgress
- type ResponseObjectStreamResponseOutputItemAdded
- type ResponseObjectStreamResponseOutputItemAddedItemFileSearchCall
- type ResponseObjectStreamResponseOutputItemAddedItemFileSearchCallResult
- type ResponseObjectStreamResponseOutputItemAddedItemFileSearchCallResultAttributeUnion
- func (u ResponseObjectStreamResponseOutputItemAddedItemFileSearchCallResultAttributeUnion) AsAnyArray() (v []any)
- func (u ResponseObjectStreamResponseOutputItemAddedItemFileSearchCallResultAttributeUnion) AsBool() (v bool)
- func (u ResponseObjectStreamResponseOutputItemAddedItemFileSearchCallResultAttributeUnion) AsFloat() (v float64)
- func (u ResponseObjectStreamResponseOutputItemAddedItemFileSearchCallResultAttributeUnion) AsString() (v string)
- func (u ResponseObjectStreamResponseOutputItemAddedItemFileSearchCallResultAttributeUnion) RawJSON() string
- func (r *ResponseObjectStreamResponseOutputItemAddedItemFileSearchCallResultAttributeUnion) UnmarshalJSON(data []byte) error
- type ResponseObjectStreamResponseOutputItemAddedItemFunctionCall
- type ResponseObjectStreamResponseOutputItemAddedItemMcpApprovalRequest
- type ResponseObjectStreamResponseOutputItemAddedItemMcpCall
- type ResponseObjectStreamResponseOutputItemAddedItemMcpListTools
- type ResponseObjectStreamResponseOutputItemAddedItemMcpListToolsTool
- type ResponseObjectStreamResponseOutputItemAddedItemMcpListToolsToolInputSchemaUnion
- func (u ResponseObjectStreamResponseOutputItemAddedItemMcpListToolsToolInputSchemaUnion) AsAnyArray() (v []any)
- func (u ResponseObjectStreamResponseOutputItemAddedItemMcpListToolsToolInputSchemaUnion) AsBool() (v bool)
- func (u ResponseObjectStreamResponseOutputItemAddedItemMcpListToolsToolInputSchemaUnion) AsFloat() (v float64)
- func (u ResponseObjectStreamResponseOutputItemAddedItemMcpListToolsToolInputSchemaUnion) AsString() (v string)
- func (u ResponseObjectStreamResponseOutputItemAddedItemMcpListToolsToolInputSchemaUnion) RawJSON() string
- func (r *ResponseObjectStreamResponseOutputItemAddedItemMcpListToolsToolInputSchemaUnion) UnmarshalJSON(data []byte) error
- type ResponseObjectStreamResponseOutputItemAddedItemMessage
- type ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemDetail
- type ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemInputFile
- type ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemInputImage
- type ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemInputImageDetail
- type ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemInputText
- type ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemUnion
- func (u ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemUnion) AsAny() anyResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItem
- func (u ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemUnion) AsInputFile() (...)
- func (u ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemUnion) AsInputImage() (...)
- func (u ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemUnion) AsInputText() (...)
- func (u ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemUnion) RawJSON() string
- func (r *ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemUnion) UnmarshalJSON(data []byte) error
- type ResponseObjectStreamResponseOutputItemAddedItemMessageContentUnion
- func (u ResponseObjectStreamResponseOutputItemAddedItemMessageContentUnion) AsResponseObjectStreamResponseOutputItemAddedItemMessageContentArray() (...)
- func (u ResponseObjectStreamResponseOutputItemAddedItemMessageContentUnion) AsString() (v string)
- func (u ResponseObjectStreamResponseOutputItemAddedItemMessageContentUnion) AsVariant2() (...)
- func (u ResponseObjectStreamResponseOutputItemAddedItemMessageContentUnion) RawJSON() string
- func (r *ResponseObjectStreamResponseOutputItemAddedItemMessageContentUnion) UnmarshalJSON(data []byte) error
- type ResponseObjectStreamResponseOutputItemAddedItemMessageRole
- type ResponseObjectStreamResponseOutputItemAddedItemRole
- type ResponseObjectStreamResponseOutputItemAddedItemUnion
- func (u ResponseObjectStreamResponseOutputItemAddedItemUnion) AsAny() anyResponseObjectStreamResponseOutputItemAddedItem
- func (u ResponseObjectStreamResponseOutputItemAddedItemUnion) AsFileSearchCall() (v ResponseObjectStreamResponseOutputItemAddedItemFileSearchCall)
- func (u ResponseObjectStreamResponseOutputItemAddedItemUnion) AsFunctionCall() (v ResponseObjectStreamResponseOutputItemAddedItemFunctionCall)
- func (u ResponseObjectStreamResponseOutputItemAddedItemUnion) AsMcpApprovalRequest() (v ResponseObjectStreamResponseOutputItemAddedItemMcpApprovalRequest)
- func (u ResponseObjectStreamResponseOutputItemAddedItemUnion) AsMcpCall() (v ResponseObjectStreamResponseOutputItemAddedItemMcpCall)
- func (u ResponseObjectStreamResponseOutputItemAddedItemUnion) AsMcpListTools() (v ResponseObjectStreamResponseOutputItemAddedItemMcpListTools)
- func (u ResponseObjectStreamResponseOutputItemAddedItemUnion) AsMessage() (v ResponseObjectStreamResponseOutputItemAddedItemMessage)
- func (u ResponseObjectStreamResponseOutputItemAddedItemUnion) AsWebSearchCall() (v ResponseObjectStreamResponseOutputItemAddedItemWebSearchCall)
- func (u ResponseObjectStreamResponseOutputItemAddedItemUnion) RawJSON() string
- func (r *ResponseObjectStreamResponseOutputItemAddedItemUnion) UnmarshalJSON(data []byte) error
- type ResponseObjectStreamResponseOutputItemAddedItemWebSearchCall
- type ResponseObjectStreamResponseOutputItemDone
- type ResponseObjectStreamResponseOutputItemDoneItemFileSearchCall
- type ResponseObjectStreamResponseOutputItemDoneItemFileSearchCallResult
- type ResponseObjectStreamResponseOutputItemDoneItemFileSearchCallResultAttributeUnion
- func (u ResponseObjectStreamResponseOutputItemDoneItemFileSearchCallResultAttributeUnion) AsAnyArray() (v []any)
- func (u ResponseObjectStreamResponseOutputItemDoneItemFileSearchCallResultAttributeUnion) AsBool() (v bool)
- func (u ResponseObjectStreamResponseOutputItemDoneItemFileSearchCallResultAttributeUnion) AsFloat() (v float64)
- func (u ResponseObjectStreamResponseOutputItemDoneItemFileSearchCallResultAttributeUnion) AsString() (v string)
- func (u ResponseObjectStreamResponseOutputItemDoneItemFileSearchCallResultAttributeUnion) RawJSON() string
- func (r *ResponseObjectStreamResponseOutputItemDoneItemFileSearchCallResultAttributeUnion) UnmarshalJSON(data []byte) error
- type ResponseObjectStreamResponseOutputItemDoneItemFunctionCall
- type ResponseObjectStreamResponseOutputItemDoneItemMcpApprovalRequest
- type ResponseObjectStreamResponseOutputItemDoneItemMcpCall
- type ResponseObjectStreamResponseOutputItemDoneItemMcpListTools
- type ResponseObjectStreamResponseOutputItemDoneItemMcpListToolsTool
- type ResponseObjectStreamResponseOutputItemDoneItemMcpListToolsToolInputSchemaUnion
- func (u ResponseObjectStreamResponseOutputItemDoneItemMcpListToolsToolInputSchemaUnion) AsAnyArray() (v []any)
- func (u ResponseObjectStreamResponseOutputItemDoneItemMcpListToolsToolInputSchemaUnion) AsBool() (v bool)
- func (u ResponseObjectStreamResponseOutputItemDoneItemMcpListToolsToolInputSchemaUnion) AsFloat() (v float64)
- func (u ResponseObjectStreamResponseOutputItemDoneItemMcpListToolsToolInputSchemaUnion) AsString() (v string)
- func (u ResponseObjectStreamResponseOutputItemDoneItemMcpListToolsToolInputSchemaUnion) RawJSON() string
- func (r *ResponseObjectStreamResponseOutputItemDoneItemMcpListToolsToolInputSchemaUnion) UnmarshalJSON(data []byte) error
- type ResponseObjectStreamResponseOutputItemDoneItemMessage
- type ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemDetail
- type ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemInputFile
- type ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemInputImage
- type ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemInputImageDetail
- type ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemInputText
- type ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemUnion
- func (u ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemUnion) AsAny() anyResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItem
- func (u ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemUnion) AsInputFile() (...)
- func (u ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemUnion) AsInputImage() (...)
- func (u ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemUnion) AsInputText() (...)
- func (u ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemUnion) RawJSON() string
- func (r *ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemUnion) UnmarshalJSON(data []byte) error
- type ResponseObjectStreamResponseOutputItemDoneItemMessageContentUnion
- func (u ResponseObjectStreamResponseOutputItemDoneItemMessageContentUnion) AsResponseObjectStreamResponseOutputItemDoneItemMessageContentArray() (v []ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemUnion)
- func (u ResponseObjectStreamResponseOutputItemDoneItemMessageContentUnion) AsString() (v string)
- func (u ResponseObjectStreamResponseOutputItemDoneItemMessageContentUnion) AsVariant2() (v []ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemUnion)
- func (u ResponseObjectStreamResponseOutputItemDoneItemMessageContentUnion) RawJSON() string
- func (r *ResponseObjectStreamResponseOutputItemDoneItemMessageContentUnion) UnmarshalJSON(data []byte) error
- type ResponseObjectStreamResponseOutputItemDoneItemMessageRole
- type ResponseObjectStreamResponseOutputItemDoneItemRole
- type ResponseObjectStreamResponseOutputItemDoneItemUnion
- func (u ResponseObjectStreamResponseOutputItemDoneItemUnion) AsAny() anyResponseObjectStreamResponseOutputItemDoneItem
- func (u ResponseObjectStreamResponseOutputItemDoneItemUnion) AsFileSearchCall() (v ResponseObjectStreamResponseOutputItemDoneItemFileSearchCall)
- func (u ResponseObjectStreamResponseOutputItemDoneItemUnion) AsFunctionCall() (v ResponseObjectStreamResponseOutputItemDoneItemFunctionCall)
- func (u ResponseObjectStreamResponseOutputItemDoneItemUnion) AsMcpApprovalRequest() (v ResponseObjectStreamResponseOutputItemDoneItemMcpApprovalRequest)
- func (u ResponseObjectStreamResponseOutputItemDoneItemUnion) AsMcpCall() (v ResponseObjectStreamResponseOutputItemDoneItemMcpCall)
- func (u ResponseObjectStreamResponseOutputItemDoneItemUnion) AsMcpListTools() (v ResponseObjectStreamResponseOutputItemDoneItemMcpListTools)
- func (u ResponseObjectStreamResponseOutputItemDoneItemUnion) AsMessage() (v ResponseObjectStreamResponseOutputItemDoneItemMessage)
- func (u ResponseObjectStreamResponseOutputItemDoneItemUnion) AsWebSearchCall() (v ResponseObjectStreamResponseOutputItemDoneItemWebSearchCall)
- func (u ResponseObjectStreamResponseOutputItemDoneItemUnion) RawJSON() string
- func (r *ResponseObjectStreamResponseOutputItemDoneItemUnion) UnmarshalJSON(data []byte) error
- type ResponseObjectStreamResponseOutputItemDoneItemWebSearchCall
- type ResponseObjectStreamResponseOutputTextAnnotationAdded
- type ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationContainerFileCitation
- type ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationFileCitation
- type ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationFilePath
- type ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationURLCitation
- type ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationUnion
- func (u ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationUnion) AsAny() anyResponseObjectStreamResponseOutputTextAnnotationAddedAnnotation
- func (u ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationUnion) AsContainerFileCitation() (...)
- func (u ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationUnion) AsFileCitation() (v ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationFileCitation)
- func (u ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationUnion) AsFilePath() (v ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationFilePath)
- func (u ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationUnion) AsURLCitation() (v ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationURLCitation)
- func (u ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationUnion) RawJSON() string
- func (r *ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationUnion) UnmarshalJSON(data []byte) error
- type ResponseObjectStreamResponseOutputTextDelta
- type ResponseObjectStreamResponseOutputTextDone
- type ResponseObjectStreamResponseReasoningSummaryPartAdded
- type ResponseObjectStreamResponseReasoningSummaryPartAddedPart
- type ResponseObjectStreamResponseReasoningSummaryPartDone
- type ResponseObjectStreamResponseReasoningSummaryPartDonePart
- type ResponseObjectStreamResponseReasoningSummaryTextDelta
- type ResponseObjectStreamResponseReasoningSummaryTextDone
- type ResponseObjectStreamResponseReasoningTextDelta
- type ResponseObjectStreamResponseReasoningTextDone
- type ResponseObjectStreamResponseRefusalDelta
- type ResponseObjectStreamResponseRefusalDone
- type ResponseObjectStreamResponseWebSearchCallCompleted
- type ResponseObjectStreamResponseWebSearchCallInProgress
- type ResponseObjectStreamResponseWebSearchCallSearching
- type ResponseObjectStreamUnion
- func (u ResponseObjectStreamUnion) AsAny() anyResponseObjectStream
- func (u ResponseObjectStreamUnion) AsResponseCompleted() (v ResponseObjectStreamResponseCompleted)
- func (u ResponseObjectStreamUnion) AsResponseContentPartAdded() (v ResponseObjectStreamResponseContentPartAdded)
- func (u ResponseObjectStreamUnion) AsResponseContentPartDone() (v ResponseObjectStreamResponseContentPartDone)
- func (u ResponseObjectStreamUnion) AsResponseCreated() (v ResponseObjectStreamResponseCreated)
- func (u ResponseObjectStreamUnion) AsResponseFailed() (v ResponseObjectStreamResponseFailed)
- func (u ResponseObjectStreamUnion) AsResponseFileSearchCallCompleted() (v ResponseObjectStreamResponseFileSearchCallCompleted)
- func (u ResponseObjectStreamUnion) AsResponseFileSearchCallInProgress() (v ResponseObjectStreamResponseFileSearchCallInProgress)
- func (u ResponseObjectStreamUnion) AsResponseFileSearchCallSearching() (v ResponseObjectStreamResponseFileSearchCallSearching)
- func (u ResponseObjectStreamUnion) AsResponseFunctionCallArgumentsDelta() (v ResponseObjectStreamResponseFunctionCallArgumentsDelta)
- func (u ResponseObjectStreamUnion) AsResponseFunctionCallArgumentsDone() (v ResponseObjectStreamResponseFunctionCallArgumentsDone)
- func (u ResponseObjectStreamUnion) AsResponseInProgress() (v ResponseObjectStreamResponseInProgress)
- func (u ResponseObjectStreamUnion) AsResponseIncomplete() (v ResponseObjectStreamResponseIncomplete)
- func (u ResponseObjectStreamUnion) AsResponseMcpCallArgumentsDelta() (v ResponseObjectStreamResponseMcpCallArgumentsDelta)
- func (u ResponseObjectStreamUnion) AsResponseMcpCallArgumentsDone() (v ResponseObjectStreamResponseMcpCallArgumentsDone)
- func (u ResponseObjectStreamUnion) AsResponseMcpCallCompleted() (v ResponseObjectStreamResponseMcpCallCompleted)
- func (u ResponseObjectStreamUnion) AsResponseMcpCallFailed() (v ResponseObjectStreamResponseMcpCallFailed)
- func (u ResponseObjectStreamUnion) AsResponseMcpCallInProgress() (v ResponseObjectStreamResponseMcpCallInProgress)
- func (u ResponseObjectStreamUnion) AsResponseMcpListToolsCompleted() (v ResponseObjectStreamResponseMcpListToolsCompleted)
- func (u ResponseObjectStreamUnion) AsResponseMcpListToolsFailed() (v ResponseObjectStreamResponseMcpListToolsFailed)
- func (u ResponseObjectStreamUnion) AsResponseMcpListToolsInProgress() (v ResponseObjectStreamResponseMcpListToolsInProgress)
- func (u ResponseObjectStreamUnion) AsResponseOutputItemAdded() (v ResponseObjectStreamResponseOutputItemAdded)
- func (u ResponseObjectStreamUnion) AsResponseOutputItemDone() (v ResponseObjectStreamResponseOutputItemDone)
- func (u ResponseObjectStreamUnion) AsResponseOutputTextAnnotationAdded() (v ResponseObjectStreamResponseOutputTextAnnotationAdded)
- func (u ResponseObjectStreamUnion) AsResponseOutputTextDelta() (v ResponseObjectStreamResponseOutputTextDelta)
- func (u ResponseObjectStreamUnion) AsResponseOutputTextDone() (v ResponseObjectStreamResponseOutputTextDone)
- func (u ResponseObjectStreamUnion) AsResponseReasoningSummaryPartAdded() (v ResponseObjectStreamResponseReasoningSummaryPartAdded)
- func (u ResponseObjectStreamUnion) AsResponseReasoningSummaryPartDone() (v ResponseObjectStreamResponseReasoningSummaryPartDone)
- func (u ResponseObjectStreamUnion) AsResponseReasoningSummaryTextDelta() (v ResponseObjectStreamResponseReasoningSummaryTextDelta)
- func (u ResponseObjectStreamUnion) AsResponseReasoningSummaryTextDone() (v ResponseObjectStreamResponseReasoningSummaryTextDone)
- func (u ResponseObjectStreamUnion) AsResponseReasoningTextDelta() (v ResponseObjectStreamResponseReasoningTextDelta)
- func (u ResponseObjectStreamUnion) AsResponseReasoningTextDone() (v ResponseObjectStreamResponseReasoningTextDone)
- func (u ResponseObjectStreamUnion) AsResponseRefusalDelta() (v ResponseObjectStreamResponseRefusalDelta)
- func (u ResponseObjectStreamUnion) AsResponseRefusalDone() (v ResponseObjectStreamResponseRefusalDone)
- func (u ResponseObjectStreamUnion) AsResponseWebSearchCallCompleted() (v ResponseObjectStreamResponseWebSearchCallCompleted)
- func (u ResponseObjectStreamUnion) AsResponseWebSearchCallInProgress() (v ResponseObjectStreamResponseWebSearchCallInProgress)
- func (u ResponseObjectStreamUnion) AsResponseWebSearchCallSearching() (v ResponseObjectStreamResponseWebSearchCallSearching)
- func (u ResponseObjectStreamUnion) RawJSON() string
- func (r *ResponseObjectStreamUnion) UnmarshalJSON(data []byte) error
- type ResponseObjectStreamUnionItem
- type ResponseObjectStreamUnionItemContent
- type ResponseObjectStreamUnionItemResults
- type ResponseObjectStreamUnionItemTools
- type ResponseObjectStreamUnionPart
- type ResponseObjectStreamUnionPartAnnotations
- type ResponseObjectStreamUnionPartLogprobs
- type ResponseObjectText
- type ResponseObjectTextFormat
- type ResponseObjectTextFormatSchemaUnion
- func (u ResponseObjectTextFormatSchemaUnion) AsAnyArray() (v []any)
- func (u ResponseObjectTextFormatSchemaUnion) AsBool() (v bool)
- func (u ResponseObjectTextFormatSchemaUnion) AsFloat() (v float64)
- func (u ResponseObjectTextFormatSchemaUnion) AsString() (v string)
- func (u ResponseObjectTextFormatSchemaUnion) RawJSON() string
- func (r *ResponseObjectTextFormatSchemaUnion) UnmarshalJSON(data []byte) error
- type ResponseObjectTextFormatType
- type ResponseObjectToolFileSearch
- type ResponseObjectToolFileSearchFilterUnion
- func (u ResponseObjectToolFileSearchFilterUnion) AsAnyArray() (v []any)
- func (u ResponseObjectToolFileSearchFilterUnion) AsBool() (v bool)
- func (u ResponseObjectToolFileSearchFilterUnion) AsFloat() (v float64)
- func (u ResponseObjectToolFileSearchFilterUnion) AsString() (v string)
- func (u ResponseObjectToolFileSearchFilterUnion) RawJSON() string
- func (r *ResponseObjectToolFileSearchFilterUnion) UnmarshalJSON(data []byte) error
- type ResponseObjectToolFileSearchRankingOptions
- type ResponseObjectToolFunction
- type ResponseObjectToolFunctionParameterUnion
- func (u ResponseObjectToolFunctionParameterUnion) AsAnyArray() (v []any)
- func (u ResponseObjectToolFunctionParameterUnion) AsBool() (v bool)
- func (u ResponseObjectToolFunctionParameterUnion) AsFloat() (v float64)
- func (u ResponseObjectToolFunctionParameterUnion) AsString() (v string)
- func (u ResponseObjectToolFunctionParameterUnion) RawJSON() string
- func (r *ResponseObjectToolFunctionParameterUnion) UnmarshalJSON(data []byte) error
- type ResponseObjectToolMcp
- type ResponseObjectToolMcpAllowedToolsAllowedToolsFilter
- type ResponseObjectToolMcpAllowedToolsUnion
- func (u ResponseObjectToolMcpAllowedToolsUnion) AsAllowedToolsFilter() (v ResponseObjectToolMcpAllowedToolsAllowedToolsFilter)
- func (u ResponseObjectToolMcpAllowedToolsUnion) AsStringArray() (v []string)
- func (u ResponseObjectToolMcpAllowedToolsUnion) RawJSON() string
- func (r *ResponseObjectToolMcpAllowedToolsUnion) UnmarshalJSON(data []byte) error
- type ResponseObjectToolOpenAIResponseInputToolWebSearch
- type ResponseObjectToolOpenAIResponseInputToolWebSearchType
- type ResponseObjectToolType
- type ResponseObjectToolUnion
- func (u ResponseObjectToolUnion) AsFileSearch() (v ResponseObjectToolFileSearch)
- func (u ResponseObjectToolUnion) AsFunction() (v ResponseObjectToolFunction)
- func (u ResponseObjectToolUnion) AsMcp() (v ResponseObjectToolMcp)
- func (u ResponseObjectToolUnion) AsOpenAIResponseInputToolWebSearch() (v ResponseObjectToolOpenAIResponseInputToolWebSearch)
- func (u ResponseObjectToolUnion) RawJSON() string
- func (r *ResponseObjectToolUnion) UnmarshalJSON(data []byte) error
- type ResponseObjectUsage
- type ResponseObjectUsageInputTokensDetails
- type ResponseObjectUsageOutputTokensDetails
- type ResponseService
- func (r *ResponseService) Delete(ctx context.Context, responseID string, opts ...option.RequestOption) (res *ResponseDeleteResponse, err error)
- func (r *ResponseService) Get(ctx context.Context, responseID string, opts ...option.RequestOption) (res *ResponseObject, err error)
- func (r *ResponseService) List(ctx context.Context, query ResponseListParams, opts ...option.RequestOption) (res *pagination.OpenAICursorPage[ResponseListResponse], err error)
- func (r *ResponseService) ListAutoPaging(ctx context.Context, query ResponseListParams, opts ...option.RequestOption) *pagination.OpenAICursorPageAutoPager[ResponseListResponse]
- func (r *ResponseService) New(ctx context.Context, body ResponseNewParams, opts ...option.RequestOption) (res *ResponseObject, err error)
- func (r *ResponseService) NewStreaming(ctx context.Context, body ResponseNewParams, opts ...option.RequestOption) (stream *ssestream.Stream[ResponseObjectStreamUnion])
- type RouteInfo
- type RouteListParams
- type RouteListParamsAPIFilter
- type RouteService
- type RunShieldResponse
- type SafetyRunShieldParams
- type SafetyRunShieldParamsMessageAssistant
- type SafetyRunShieldParamsMessageAssistantContentArrayItem
- type SafetyRunShieldParamsMessageAssistantContentUnion
- type SafetyRunShieldParamsMessageAssistantToolCall
- type SafetyRunShieldParamsMessageAssistantToolCallFunction
- type SafetyRunShieldParamsMessageDeveloper
- type SafetyRunShieldParamsMessageDeveloperContentArrayItem
- type SafetyRunShieldParamsMessageDeveloperContentUnion
- type SafetyRunShieldParamsMessageSystem
- type SafetyRunShieldParamsMessageSystemContentArrayItem
- type SafetyRunShieldParamsMessageSystemContentUnion
- type SafetyRunShieldParamsMessageTool
- type SafetyRunShieldParamsMessageToolContentArrayItem
- type SafetyRunShieldParamsMessageToolContentUnion
- type SafetyRunShieldParamsMessageUnion
- func (u SafetyRunShieldParamsMessageUnion) GetContent() (res safetyRunShieldParamsMessageUnionContent)
- func (u SafetyRunShieldParamsMessageUnion) GetName() *string
- func (u SafetyRunShieldParamsMessageUnion) GetRole() *string
- func (u SafetyRunShieldParamsMessageUnion) GetToolCallID() *string
- func (u SafetyRunShieldParamsMessageUnion) GetToolCalls() []SafetyRunShieldParamsMessageAssistantToolCall
- func (u SafetyRunShieldParamsMessageUnion) MarshalJSON() ([]byte, error)
- func (u *SafetyRunShieldParamsMessageUnion) UnmarshalJSON(data []byte) error
- type SafetyRunShieldParamsMessageUser
- type SafetyRunShieldParamsMessageUserContentArrayItemFile
- type SafetyRunShieldParamsMessageUserContentArrayItemFileFile
- type SafetyRunShieldParamsMessageUserContentArrayItemImageURL
- type SafetyRunShieldParamsMessageUserContentArrayItemImageURLImageURL
- type SafetyRunShieldParamsMessageUserContentArrayItemText
- type SafetyRunShieldParamsMessageUserContentArrayItemUnion
- func (u SafetyRunShieldParamsMessageUserContentArrayItemUnion) GetFile() *SafetyRunShieldParamsMessageUserContentArrayItemFileFile
- func (u SafetyRunShieldParamsMessageUserContentArrayItemUnion) GetImageURL() *SafetyRunShieldParamsMessageUserContentArrayItemImageURLImageURL
- func (u SafetyRunShieldParamsMessageUserContentArrayItemUnion) GetText() *string
- func (u SafetyRunShieldParamsMessageUserContentArrayItemUnion) GetType() *string
- func (u SafetyRunShieldParamsMessageUserContentArrayItemUnion) MarshalJSON() ([]byte, error)
- func (u *SafetyRunShieldParamsMessageUserContentArrayItemUnion) UnmarshalJSON(data []byte) error
- type SafetyRunShieldParamsMessageUserContentUnion
- type SafetyRunShieldParamsParamUnion
- type SafetyService
- type SafetyViolation
- type SafetyViolationMetadataUnion
- func (u SafetyViolationMetadataUnion) AsAnyArray() (v []any)
- func (u SafetyViolationMetadataUnion) AsBool() (v bool)
- func (u SafetyViolationMetadataUnion) AsFloat() (v float64)
- func (u SafetyViolationMetadataUnion) AsString() (v string)
- func (u SafetyViolationMetadataUnion) RawJSON() string
- func (r *SafetyViolationMetadataUnion) UnmarshalJSON(data []byte) error
- type SafetyViolationViolationLevel
- type SamplingParams
- type SamplingParamsStrategyGreedy
- type SamplingParamsStrategyTopK
- type SamplingParamsStrategyTopP
- type SamplingParamsStrategyUnion
- func (u SamplingParamsStrategyUnion) GetTemperature() *float64
- func (u SamplingParamsStrategyUnion) GetTopK() *int64
- func (u SamplingParamsStrategyUnion) GetTopP() *float64
- func (u SamplingParamsStrategyUnion) GetType() *string
- func (u SamplingParamsStrategyUnion) MarshalJSON() ([]byte, error)
- func (u *SamplingParamsStrategyUnion) UnmarshalJSON(data []byte) error
- type ScoringFn
- type ScoringFnMetadataUnion
- func (u ScoringFnMetadataUnion) AsAnyArray() (v []any)
- func (u ScoringFnMetadataUnion) AsBool() (v bool)
- func (u ScoringFnMetadataUnion) AsFloat() (v float64)
- func (u ScoringFnMetadataUnion) AsString() (v string)
- func (u ScoringFnMetadataUnion) RawJSON() string
- func (r *ScoringFnMetadataUnion) UnmarshalJSON(data []byte) error
- type ScoringFnParamsBasic
- type ScoringFnParamsBasicResp
- type ScoringFnParamsLlmAsJudge
- type ScoringFnParamsLlmAsJudgeResp
- type ScoringFnParamsRegexParser
- type ScoringFnParamsRegexParserResp
- type ScoringFnParamsUnion
- func ScoringFnParamsOfBasic(aggregationFunctions []string) ScoringFnParamsUnion
- func ScoringFnParamsOfLlmAsJudge(aggregationFunctions []string, judgeModel string, judgeScoreRegexes []string) ScoringFnParamsUnion
- func ScoringFnParamsOfRegexParser(aggregationFunctions []string, parsingRegexes []string) ScoringFnParamsUnion
- func (u ScoringFnParamsUnion) GetAggregationFunctions() []string
- func (u ScoringFnParamsUnion) GetJudgeModel() *string
- func (u ScoringFnParamsUnion) GetJudgeScoreRegexes() []string
- func (u ScoringFnParamsUnion) GetParsingRegexes() []string
- func (u ScoringFnParamsUnion) GetPromptTemplate() *string
- func (u ScoringFnParamsUnion) GetType() *string
- func (u ScoringFnParamsUnion) MarshalJSON() ([]byte, error)
- func (u *ScoringFnParamsUnion) UnmarshalJSON(data []byte) error
- type ScoringFnParamsUnionResp
- func (u ScoringFnParamsUnionResp) AsAny() anyScoringFnParamsResp
- func (u ScoringFnParamsUnionResp) AsBasic() (v ScoringFnParamsBasicResp)
- func (u ScoringFnParamsUnionResp) AsLlmAsJudge() (v ScoringFnParamsLlmAsJudgeResp)
- func (u ScoringFnParamsUnionResp) AsRegexParser() (v ScoringFnParamsRegexParserResp)
- func (u ScoringFnParamsUnionResp) RawJSON() string
- func (r ScoringFnParamsUnionResp) ToParam() ScoringFnParamsUnion
- func (r *ScoringFnParamsUnionResp) UnmarshalJSON(data []byte) error
- type ScoringFnReturnType
- type ScoringFunctionRegisterParams
- type ScoringFunctionRegisterParamsReturnType
- type ScoringFunctionService
- func (r *ScoringFunctionService) Get(ctx context.Context, scoringFnID string, opts ...option.RequestOption) (res *ScoringFn, err error)
- func (r *ScoringFunctionService) List(ctx context.Context, opts ...option.RequestOption) (res *[]ScoringFn, err error)
- func (r *ScoringFunctionService) Register(ctx context.Context, body ScoringFunctionRegisterParams, ...) (err error)deprecated
- type ScoringResult
- type ScoringResultAggregatedResultUnion
- func (u ScoringResultAggregatedResultUnion) AsAnyArray() (v []any)
- func (u ScoringResultAggregatedResultUnion) AsBool() (v bool)
- func (u ScoringResultAggregatedResultUnion) AsFloat() (v float64)
- func (u ScoringResultAggregatedResultUnion) AsString() (v string)
- func (u ScoringResultAggregatedResultUnion) RawJSON() string
- func (r *ScoringResultAggregatedResultUnion) UnmarshalJSON(data []byte) error
- type ScoringResultScoreRowUnion
- func (u ScoringResultScoreRowUnion) AsAnyArray() (v []any)
- func (u ScoringResultScoreRowUnion) AsBool() (v bool)
- func (u ScoringResultScoreRowUnion) AsFloat() (v float64)
- func (u ScoringResultScoreRowUnion) AsString() (v string)
- func (u ScoringResultScoreRowUnion) RawJSON() string
- func (r *ScoringResultScoreRowUnion) UnmarshalJSON(data []byte) error
- type ScoringScoreBatchParams
- type ScoringScoreBatchResponse
- type ScoringScoreParams
- type ScoringScoreParamsInputRowUnion
- type ScoringScoreResponse
- type ScoringService
- type Shield
- type ShieldParamUnion
- type ShieldRegisterParams
- type ShieldRegisterParamsParamUnion
- type ShieldService
- func (r *ShieldService) Delete(ctx context.Context, identifier string, opts ...option.RequestOption) (err error)deprecated
- func (r *ShieldService) Get(ctx context.Context, identifier string, opts ...option.RequestOption) (res *Shield, err error)
- func (r *ShieldService) List(ctx context.Context, opts ...option.RequestOption) (res *[]Shield, err error)
- func (r *ShieldService) Register(ctx context.Context, body ShieldRegisterParams, opts ...option.RequestOption) (res *Shield, err error)deprecated
- type SystemMessageParam
- type ToolDef
- type ToolDefInputSchemaUnion
- func (u ToolDefInputSchemaUnion) AsAnyArray() (v []any)
- func (u ToolDefInputSchemaUnion) AsBool() (v bool)
- func (u ToolDefInputSchemaUnion) AsFloat() (v float64)
- func (u ToolDefInputSchemaUnion) AsString() (v string)
- func (u ToolDefInputSchemaUnion) RawJSON() string
- func (r *ToolDefInputSchemaUnion) UnmarshalJSON(data []byte) error
- type ToolDefMetadataUnion
- func (u ToolDefMetadataUnion) AsAnyArray() (v []any)
- func (u ToolDefMetadataUnion) AsBool() (v bool)
- func (u ToolDefMetadataUnion) AsFloat() (v float64)
- func (u ToolDefMetadataUnion) AsString() (v string)
- func (u ToolDefMetadataUnion) RawJSON() string
- func (r *ToolDefMetadataUnion) UnmarshalJSON(data []byte) error
- type ToolDefOutputSchemaUnion
- func (u ToolDefOutputSchemaUnion) AsAnyArray() (v []any)
- func (u ToolDefOutputSchemaUnion) AsBool() (v bool)
- func (u ToolDefOutputSchemaUnion) AsFloat() (v float64)
- func (u ToolDefOutputSchemaUnion) AsString() (v string)
- func (u ToolDefOutputSchemaUnion) RawJSON() string
- func (r *ToolDefOutputSchemaUnion) UnmarshalJSON(data []byte) error
- type ToolGroup
- type ToolGroupArgUnion
- type ToolGroupMcpEndpoint
- type ToolInvocationResult
- type ToolInvocationResultMetadataUnion
- func (u ToolInvocationResultMetadataUnion) AsAnyArray() (v []any)
- func (u ToolInvocationResultMetadataUnion) AsBool() (v bool)
- func (u ToolInvocationResultMetadataUnion) AsFloat() (v float64)
- func (u ToolInvocationResultMetadataUnion) AsString() (v string)
- func (u ToolInvocationResultMetadataUnion) RawJSON() string
- func (r *ToolInvocationResultMetadataUnion) UnmarshalJSON(data []byte) error
- type ToolListParams
- type ToolListResponseEnvelope
- type ToolRuntimeInvokeToolParams
- type ToolRuntimeInvokeToolParamsKwargUnion
- type ToolRuntimeListToolsParams
- type ToolRuntimeListToolsParamsMcpEndpoint
- type ToolRuntimeListToolsResponseEnvelope
- type ToolRuntimeRagToolService
- type ToolRuntimeService
- type ToolService
- type ToolgroupRegisterParams
- type ToolgroupRegisterParamsArgUnion
- type ToolgroupRegisterParamsMcpEndpoint
- type ToolgroupService
- func (r *ToolgroupService) Get(ctx context.Context, toolgroupID string, opts ...option.RequestOption) (res *ToolGroup, err error)
- func (r *ToolgroupService) List(ctx context.Context, opts ...option.RequestOption) (res *[]ToolGroup, err error)
- func (r *ToolgroupService) Register(ctx context.Context, body ToolgroupRegisterParams, ...) (err error)deprecated
- func (r *ToolgroupService) Unregister(ctx context.Context, toolgroupID string, opts ...option.RequestOption) (err error)deprecated
- type VectorIoInsertParams
- type VectorIoInsertParamsChunk
- type VectorIoInsertParamsChunkChunkMetadata
- type VectorIoInsertParamsChunkMetadataUnion
- type VectorIoQueryParams
- type VectorIoQueryParamsParamUnion
- type VectorIoService
- type VectorStore
- type VectorStoreDeleteResponse
- type VectorStoreExpiresAfterUnion
- func (u VectorStoreExpiresAfterUnion) AsAnyArray() (v []any)
- func (u VectorStoreExpiresAfterUnion) AsBool() (v bool)
- func (u VectorStoreExpiresAfterUnion) AsFloat() (v float64)
- func (u VectorStoreExpiresAfterUnion) AsString() (v string)
- func (u VectorStoreExpiresAfterUnion) RawJSON() string
- func (r *VectorStoreExpiresAfterUnion) UnmarshalJSON(data []byte) error
- type VectorStoreFile
- type VectorStoreFileAttributeUnion
- func (u VectorStoreFileAttributeUnion) AsAnyArray() (v []any)
- func (u VectorStoreFileAttributeUnion) AsBool() (v bool)
- func (u VectorStoreFileAttributeUnion) AsFloat() (v float64)
- func (u VectorStoreFileAttributeUnion) AsString() (v string)
- func (u VectorStoreFileAttributeUnion) RawJSON() string
- func (r *VectorStoreFileAttributeUnion) UnmarshalJSON(data []byte) error
- type VectorStoreFileBatchCancelParams
- type VectorStoreFileBatchGetParams
- type VectorStoreFileBatchListFilesParams
- type VectorStoreFileBatchNewParams
- type VectorStoreFileBatchNewParamsAttributeUnion
- type VectorStoreFileBatchNewParamsChunkingStrategyAuto
- type VectorStoreFileBatchNewParamsChunkingStrategyStatic
- type VectorStoreFileBatchNewParamsChunkingStrategyStaticStatic
- type VectorStoreFileBatchNewParamsChunkingStrategyUnion
- func (u VectorStoreFileBatchNewParamsChunkingStrategyUnion) GetStatic() *VectorStoreFileBatchNewParamsChunkingStrategyStaticStatic
- func (u VectorStoreFileBatchNewParamsChunkingStrategyUnion) GetType() *string
- func (u VectorStoreFileBatchNewParamsChunkingStrategyUnion) MarshalJSON() ([]byte, error)
- func (u *VectorStoreFileBatchNewParamsChunkingStrategyUnion) UnmarshalJSON(data []byte) error
- type VectorStoreFileBatchService
- func (r *VectorStoreFileBatchService) Cancel(ctx context.Context, batchID string, body VectorStoreFileBatchCancelParams, ...) (res *VectorStoreFileBatches, err error)
- func (r *VectorStoreFileBatchService) Get(ctx context.Context, batchID string, query VectorStoreFileBatchGetParams, ...) (res *VectorStoreFileBatches, err error)
- func (r *VectorStoreFileBatchService) ListFiles(ctx context.Context, batchID string, ...) (res *pagination.OpenAICursorPage[VectorStoreFile], err error)
- func (r *VectorStoreFileBatchService) ListFilesAutoPaging(ctx context.Context, batchID string, ...) *pagination.OpenAICursorPageAutoPager[VectorStoreFile]
- func (r *VectorStoreFileBatchService) New(ctx context.Context, vectorStoreID string, body VectorStoreFileBatchNewParams, ...) (res *VectorStoreFileBatches, err error)
- type VectorStoreFileBatches
- type VectorStoreFileBatchesFileCounts
- type VectorStoreFileBatchesStatus
- type VectorStoreFileChunkingStrategyAuto
- type VectorStoreFileChunkingStrategyStatic
- type VectorStoreFileChunkingStrategyStaticStatic
- type VectorStoreFileChunkingStrategyUnion
- func (u VectorStoreFileChunkingStrategyUnion) AsAny() anyVectorStoreFileChunkingStrategy
- func (u VectorStoreFileChunkingStrategyUnion) AsAuto() (v VectorStoreFileChunkingStrategyAuto)
- func (u VectorStoreFileChunkingStrategyUnion) AsStatic() (v VectorStoreFileChunkingStrategyStatic)
- func (u VectorStoreFileChunkingStrategyUnion) RawJSON() string
- func (r *VectorStoreFileChunkingStrategyUnion) UnmarshalJSON(data []byte) error
- type VectorStoreFileContentParams
- type VectorStoreFileContentResponse
- type VectorStoreFileContentResponseData
- type VectorStoreFileContentResponseDataChunkMetadata
- type VectorStoreFileContentResponseDataMetadataUnion
- func (u VectorStoreFileContentResponseDataMetadataUnion) AsAnyArray() (v []any)
- func (u VectorStoreFileContentResponseDataMetadataUnion) AsBool() (v bool)
- func (u VectorStoreFileContentResponseDataMetadataUnion) AsFloat() (v float64)
- func (u VectorStoreFileContentResponseDataMetadataUnion) AsString() (v string)
- func (u VectorStoreFileContentResponseDataMetadataUnion) RawJSON() string
- func (r *VectorStoreFileContentResponseDataMetadataUnion) UnmarshalJSON(data []byte) error
- type VectorStoreFileCounts
- type VectorStoreFileDeleteParams
- type VectorStoreFileDeleteResponse
- type VectorStoreFileGetParams
- type VectorStoreFileLastError
- type VectorStoreFileLastErrorCode
- type VectorStoreFileListParams
- type VectorStoreFileListParamsFilter
- type VectorStoreFileNewParams
- type VectorStoreFileNewParamsAttributeUnion
- type VectorStoreFileNewParamsChunkingStrategyAuto
- type VectorStoreFileNewParamsChunkingStrategyStatic
- type VectorStoreFileNewParamsChunkingStrategyStaticStatic
- type VectorStoreFileNewParamsChunkingStrategyUnion
- func (u VectorStoreFileNewParamsChunkingStrategyUnion) GetStatic() *VectorStoreFileNewParamsChunkingStrategyStaticStatic
- func (u VectorStoreFileNewParamsChunkingStrategyUnion) GetType() *string
- func (u VectorStoreFileNewParamsChunkingStrategyUnion) MarshalJSON() ([]byte, error)
- func (u *VectorStoreFileNewParamsChunkingStrategyUnion) UnmarshalJSON(data []byte) error
- type VectorStoreFileService
- func (r *VectorStoreFileService) Content(ctx context.Context, fileID string, params VectorStoreFileContentParams, ...) (res *VectorStoreFileContentResponse, err error)
- func (r *VectorStoreFileService) Delete(ctx context.Context, fileID string, body VectorStoreFileDeleteParams, ...) (res *VectorStoreFileDeleteResponse, err error)
- func (r *VectorStoreFileService) Get(ctx context.Context, fileID string, query VectorStoreFileGetParams, ...) (res *VectorStoreFile, err error)
- func (r *VectorStoreFileService) List(ctx context.Context, vectorStoreID string, query VectorStoreFileListParams, ...) (res *pagination.OpenAICursorPage[VectorStoreFile], err error)
- func (r *VectorStoreFileService) ListAutoPaging(ctx context.Context, vectorStoreID string, query VectorStoreFileListParams, ...) *pagination.OpenAICursorPageAutoPager[VectorStoreFile]
- func (r *VectorStoreFileService) New(ctx context.Context, vectorStoreID string, body VectorStoreFileNewParams, ...) (res *VectorStoreFile, err error)
- func (r *VectorStoreFileService) Update(ctx context.Context, fileID string, params VectorStoreFileUpdateParams, ...) (res *VectorStoreFile, err error)
- type VectorStoreFileStatus
- type VectorStoreFileUpdateParams
- type VectorStoreFileUpdateParamsAttributeUnion
- type VectorStoreListParams
- type VectorStoreMetadataUnion
- func (u VectorStoreMetadataUnion) AsAnyArray() (v []any)
- func (u VectorStoreMetadataUnion) AsBool() (v bool)
- func (u VectorStoreMetadataUnion) AsFloat() (v float64)
- func (u VectorStoreMetadataUnion) AsString() (v string)
- func (u VectorStoreMetadataUnion) RawJSON() string
- func (r *VectorStoreMetadataUnion) UnmarshalJSON(data []byte) error
- type VectorStoreNewParams
- type VectorStoreNewParamsChunkingStrategyAuto
- type VectorStoreNewParamsChunkingStrategyStatic
- type VectorStoreNewParamsChunkingStrategyStaticStatic
- type VectorStoreNewParamsChunkingStrategyUnion
- func (u VectorStoreNewParamsChunkingStrategyUnion) GetStatic() *VectorStoreNewParamsChunkingStrategyStaticStatic
- func (u VectorStoreNewParamsChunkingStrategyUnion) GetType() *string
- func (u VectorStoreNewParamsChunkingStrategyUnion) MarshalJSON() ([]byte, error)
- func (u *VectorStoreNewParamsChunkingStrategyUnion) UnmarshalJSON(data []byte) error
- type VectorStoreNewParamsExpiresAfterUnion
- type VectorStoreNewParamsMetadataUnion
- type VectorStoreSearchParams
- type VectorStoreSearchParamsFilterUnion
- type VectorStoreSearchParamsQueryUnion
- type VectorStoreSearchParamsRankingOptions
- type VectorStoreSearchResponse
- type VectorStoreSearchResponseData
- type VectorStoreSearchResponseDataAttributeUnion
- func (u VectorStoreSearchResponseDataAttributeUnion) AsBool() (v bool)
- func (u VectorStoreSearchResponseDataAttributeUnion) AsFloat() (v float64)
- func (u VectorStoreSearchResponseDataAttributeUnion) AsString() (v string)
- func (u VectorStoreSearchResponseDataAttributeUnion) RawJSON() string
- func (r *VectorStoreSearchResponseDataAttributeUnion) UnmarshalJSON(data []byte) error
- type VectorStoreSearchResponseDataContent
- type VectorStoreSearchResponseDataContentChunkMetadata
- type VectorStoreSearchResponseDataContentMetadataUnion
- func (u VectorStoreSearchResponseDataContentMetadataUnion) AsAnyArray() (v []any)
- func (u VectorStoreSearchResponseDataContentMetadataUnion) AsBool() (v bool)
- func (u VectorStoreSearchResponseDataContentMetadataUnion) AsFloat() (v float64)
- func (u VectorStoreSearchResponseDataContentMetadataUnion) AsString() (v string)
- func (u VectorStoreSearchResponseDataContentMetadataUnion) RawJSON() string
- func (r *VectorStoreSearchResponseDataContentMetadataUnion) UnmarshalJSON(data []byte) error
- type VectorStoreService
- func (r *VectorStoreService) Delete(ctx context.Context, vectorStoreID string, opts ...option.RequestOption) (res *VectorStoreDeleteResponse, err error)
- func (r *VectorStoreService) Get(ctx context.Context, vectorStoreID string, opts ...option.RequestOption) (res *VectorStore, err error)
- func (r *VectorStoreService) List(ctx context.Context, query VectorStoreListParams, opts ...option.RequestOption) (res *pagination.OpenAICursorPage[VectorStore], err error)
- func (r *VectorStoreService) ListAutoPaging(ctx context.Context, query VectorStoreListParams, opts ...option.RequestOption) *pagination.OpenAICursorPageAutoPager[VectorStore]
- func (r *VectorStoreService) New(ctx context.Context, body VectorStoreNewParams, opts ...option.RequestOption) (res *VectorStore, err error)
- func (r *VectorStoreService) Search(ctx context.Context, vectorStoreID string, body VectorStoreSearchParams, ...) (res *VectorStoreSearchResponse, err error)
- func (r *VectorStoreService) Update(ctx context.Context, vectorStoreID string, body VectorStoreUpdateParams, ...) (res *VectorStore, err error)
- type VectorStoreUpdateParams
- type VectorStoreUpdateParamsExpiresAfterUnion
- type VectorStoreUpdateParamsMetadataUnion
- type VersionInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultClientOptions ¶
func DefaultClientOptions() []option.RequestOption
DefaultClientOptions read from the environment (LLAMA_STACK_CLIENT_API_KEY, LLAMA_STACK_CLIENT_BASE_URL). This should be used to initialize new clients.
func Opt ¶
func Opt[T comparable](v T) param.Opt[T]
Types ¶
type AlgorithmConfigLoRaParam ¶
type AlgorithmConfigLoRaParam struct {
// LoRA scaling parameter that controls adaptation strength
Alpha int64 `json:"alpha,required"`
// Whether to apply LoRA to MLP layers
ApplyLoraToMlp bool `json:"apply_lora_to_mlp,required"`
// Whether to apply LoRA to output projection layers
ApplyLoraToOutput bool `json:"apply_lora_to_output,required"`
// List of attention module names to apply LoRA to
LoraAttnModules []string `json:"lora_attn_modules,omitzero,required"`
// Rank of the LoRA adaptation (lower rank = fewer parameters)
Rank int64 `json:"rank,required"`
// (Optional) Whether to quantize the base model weights
QuantizeBase param.Opt[bool] `json:"quantize_base,omitzero"`
// (Optional) Whether to use DoRA (Weight-Decomposed Low-Rank Adaptation)
UseDora param.Opt[bool] `json:"use_dora,omitzero"`
// Algorithm type identifier, always "LoRA"
//
// This field can be elided, and will marshal its zero value as "LoRA".
Type constant.LoRa `json:"type,required"`
// contains filtered or unexported fields
}
Configuration for Low-Rank Adaptation (LoRA) fine-tuning.
The properties Alpha, ApplyLoraToMlp, ApplyLoraToOutput, LoraAttnModules, Rank, Type are required.
func (AlgorithmConfigLoRaParam) MarshalJSON ¶
func (r AlgorithmConfigLoRaParam) MarshalJSON() (data []byte, err error)
func (*AlgorithmConfigLoRaParam) UnmarshalJSON ¶
func (r *AlgorithmConfigLoRaParam) UnmarshalJSON(data []byte) error
type AlgorithmConfigQatParam ¶
type AlgorithmConfigQatParam struct {
// Size of groups for grouped quantization
GroupSize int64 `json:"group_size,required"`
// Name of the quantization algorithm to use
QuantizerName string `json:"quantizer_name,required"`
// Algorithm type identifier, always "QAT"
//
// This field can be elided, and will marshal its zero value as "QAT".
Type constant.Qat `json:"type,required"`
// contains filtered or unexported fields
}
Configuration for Quantization-Aware Training (QAT) fine-tuning.
The properties GroupSize, QuantizerName, Type are required.
func (AlgorithmConfigQatParam) MarshalJSON ¶
func (r AlgorithmConfigQatParam) MarshalJSON() (data []byte, err error)
func (*AlgorithmConfigQatParam) UnmarshalJSON ¶
func (r *AlgorithmConfigQatParam) UnmarshalJSON(data []byte) error
type AlgorithmConfigUnionParam ¶
type AlgorithmConfigUnionParam struct {
OfLoRa *AlgorithmConfigLoRaParam `json:",omitzero,inline"`
OfQat *AlgorithmConfigQatParam `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 AlgorithmConfigParamOfQat ¶
func AlgorithmConfigParamOfQat(groupSize int64, quantizerName string) AlgorithmConfigUnionParam
func (AlgorithmConfigUnionParam) GetAlpha ¶
func (u AlgorithmConfigUnionParam) GetAlpha() *int64
Returns a pointer to the underlying variant's property, if present.
func (AlgorithmConfigUnionParam) GetApplyLoraToMlp ¶
func (u AlgorithmConfigUnionParam) GetApplyLoraToMlp() *bool
Returns a pointer to the underlying variant's property, if present.
func (AlgorithmConfigUnionParam) GetApplyLoraToOutput ¶
func (u AlgorithmConfigUnionParam) GetApplyLoraToOutput() *bool
Returns a pointer to the underlying variant's property, if present.
func (AlgorithmConfigUnionParam) GetGroupSize ¶
func (u AlgorithmConfigUnionParam) GetGroupSize() *int64
Returns a pointer to the underlying variant's property, if present.
func (AlgorithmConfigUnionParam) GetLoraAttnModules ¶
func (u AlgorithmConfigUnionParam) GetLoraAttnModules() []string
Returns a pointer to the underlying variant's property, if present.
func (AlgorithmConfigUnionParam) GetQuantizeBase ¶
func (u AlgorithmConfigUnionParam) GetQuantizeBase() *bool
Returns a pointer to the underlying variant's property, if present.
func (AlgorithmConfigUnionParam) GetQuantizerName ¶
func (u AlgorithmConfigUnionParam) GetQuantizerName() *string
Returns a pointer to the underlying variant's property, if present.
func (AlgorithmConfigUnionParam) GetRank ¶
func (u AlgorithmConfigUnionParam) GetRank() *int64
Returns a pointer to the underlying variant's property, if present.
func (AlgorithmConfigUnionParam) GetType ¶
func (u AlgorithmConfigUnionParam) GetType() *string
Returns a pointer to the underlying variant's property, if present.
func (AlgorithmConfigUnionParam) GetUseDora ¶
func (u AlgorithmConfigUnionParam) GetUseDora() *bool
Returns a pointer to the underlying variant's property, if present.
func (AlgorithmConfigUnionParam) MarshalJSON ¶
func (u AlgorithmConfigUnionParam) MarshalJSON() ([]byte, error)
func (*AlgorithmConfigUnionParam) UnmarshalJSON ¶
func (u *AlgorithmConfigUnionParam) UnmarshalJSON(data []byte) error
type AlphaBenchmarkRegisterParams ¶
type AlphaBenchmarkRegisterParams struct {
// The ID of the benchmark to register.
BenchmarkID string `json:"benchmark_id,required"`
// The ID of the dataset to use for the benchmark.
DatasetID string `json:"dataset_id,required"`
// The scoring functions to use for the benchmark.
ScoringFunctions []string `json:"scoring_functions,omitzero,required"`
// The ID of the provider benchmark to use for the benchmark.
ProviderBenchmarkID param.Opt[string] `json:"provider_benchmark_id,omitzero"`
// The ID of the provider to use for the benchmark.
ProviderID param.Opt[string] `json:"provider_id,omitzero"`
// The metadata to use for the benchmark.
Metadata map[string]AlphaBenchmarkRegisterParamsMetadataUnion `json:"metadata,omitzero"`
// contains filtered or unexported fields
}
func (AlphaBenchmarkRegisterParams) MarshalJSON ¶
func (r AlphaBenchmarkRegisterParams) MarshalJSON() (data []byte, err error)
func (*AlphaBenchmarkRegisterParams) UnmarshalJSON ¶
func (r *AlphaBenchmarkRegisterParams) UnmarshalJSON(data []byte) error
type AlphaBenchmarkRegisterParamsMetadataUnion ¶
type AlphaBenchmarkRegisterParamsMetadataUnion struct {
OfBool param.Opt[bool] `json:",omitzero,inline"`
OfFloat param.Opt[float64] `json:",omitzero,inline"`
OfString param.Opt[string] `json:",omitzero,inline"`
OfAnyArray []any `json:",omitzero,inline"`
// contains filtered or unexported fields
}
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (AlphaBenchmarkRegisterParamsMetadataUnion) MarshalJSON ¶
func (u AlphaBenchmarkRegisterParamsMetadataUnion) MarshalJSON() ([]byte, error)
func (*AlphaBenchmarkRegisterParamsMetadataUnion) UnmarshalJSON ¶
func (u *AlphaBenchmarkRegisterParamsMetadataUnion) UnmarshalJSON(data []byte) error
type AlphaBenchmarkService ¶
type AlphaBenchmarkService struct {
Options []option.RequestOption
}
AlphaBenchmarkService contains methods and other services that help with interacting with the llama-stack-client API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAlphaBenchmarkService method instead.
func NewAlphaBenchmarkService ¶
func NewAlphaBenchmarkService(opts ...option.RequestOption) (r AlphaBenchmarkService)
NewAlphaBenchmarkService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*AlphaBenchmarkService) Get ¶
func (r *AlphaBenchmarkService) Get(ctx context.Context, benchmarkID string, opts ...option.RequestOption) (res *Benchmark, err error)
Get a benchmark by its ID.
func (*AlphaBenchmarkService) List ¶
func (r *AlphaBenchmarkService) List(ctx context.Context, opts ...option.RequestOption) (res *[]Benchmark, err error)
List all benchmarks.
func (*AlphaBenchmarkService) Register
deprecated
func (r *AlphaBenchmarkService) Register(ctx context.Context, body AlphaBenchmarkRegisterParams, opts ...option.RequestOption) (err error)
Register a benchmark.
Deprecated: deprecated
type AlphaEvalEvaluateRowsAlphaParams ¶
type AlphaEvalEvaluateRowsAlphaParams struct {
// The configuration for the benchmark.
BenchmarkConfig BenchmarkConfigParam `json:"benchmark_config,omitzero,required"`
// The rows to evaluate.
InputRows []map[string]AlphaEvalEvaluateRowsAlphaParamsInputRowUnion `json:"input_rows,omitzero,required"`
// The scoring functions to use for the evaluation.
ScoringFunctions []string `json:"scoring_functions,omitzero,required"`
// contains filtered or unexported fields
}
func (AlphaEvalEvaluateRowsAlphaParams) MarshalJSON ¶
func (r AlphaEvalEvaluateRowsAlphaParams) MarshalJSON() (data []byte, err error)
func (*AlphaEvalEvaluateRowsAlphaParams) UnmarshalJSON ¶
func (r *AlphaEvalEvaluateRowsAlphaParams) UnmarshalJSON(data []byte) error
type AlphaEvalEvaluateRowsAlphaParamsInputRowUnion ¶
type AlphaEvalEvaluateRowsAlphaParamsInputRowUnion 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 (AlphaEvalEvaluateRowsAlphaParamsInputRowUnion) MarshalJSON ¶
func (u AlphaEvalEvaluateRowsAlphaParamsInputRowUnion) MarshalJSON() ([]byte, error)
func (*AlphaEvalEvaluateRowsAlphaParamsInputRowUnion) UnmarshalJSON ¶
func (u *AlphaEvalEvaluateRowsAlphaParamsInputRowUnion) UnmarshalJSON(data []byte) error
type AlphaEvalEvaluateRowsParams ¶
type AlphaEvalEvaluateRowsParams struct {
// The configuration for the benchmark.
BenchmarkConfig BenchmarkConfigParam `json:"benchmark_config,omitzero,required"`
// The rows to evaluate.
InputRows []map[string]AlphaEvalEvaluateRowsParamsInputRowUnion `json:"input_rows,omitzero,required"`
// The scoring functions to use for the evaluation.
ScoringFunctions []string `json:"scoring_functions,omitzero,required"`
// contains filtered or unexported fields
}
func (AlphaEvalEvaluateRowsParams) MarshalJSON ¶
func (r AlphaEvalEvaluateRowsParams) MarshalJSON() (data []byte, err error)
func (*AlphaEvalEvaluateRowsParams) UnmarshalJSON ¶
func (r *AlphaEvalEvaluateRowsParams) UnmarshalJSON(data []byte) error
type AlphaEvalEvaluateRowsParamsInputRowUnion ¶
type AlphaEvalEvaluateRowsParamsInputRowUnion 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 (AlphaEvalEvaluateRowsParamsInputRowUnion) MarshalJSON ¶
func (u AlphaEvalEvaluateRowsParamsInputRowUnion) MarshalJSON() ([]byte, error)
func (*AlphaEvalEvaluateRowsParamsInputRowUnion) UnmarshalJSON ¶
func (u *AlphaEvalEvaluateRowsParamsInputRowUnion) UnmarshalJSON(data []byte) error
type AlphaEvalJobCancelParams ¶
type AlphaEvalJobCancelParams struct {
BenchmarkID string `path:"benchmark_id,required" json:"-"`
// contains filtered or unexported fields
}
type AlphaEvalJobGetParams ¶
type AlphaEvalJobGetParams struct {
BenchmarkID string `path:"benchmark_id,required" json:"-"`
// contains filtered or unexported fields
}
type AlphaEvalJobService ¶
type AlphaEvalJobService struct {
Options []option.RequestOption
}
AlphaEvalJobService contains methods and other services that help with interacting with the llama-stack-client API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAlphaEvalJobService method instead.
func NewAlphaEvalJobService ¶
func NewAlphaEvalJobService(opts ...option.RequestOption) (r AlphaEvalJobService)
NewAlphaEvalJobService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*AlphaEvalJobService) Cancel ¶
func (r *AlphaEvalJobService) Cancel(ctx context.Context, jobID string, body AlphaEvalJobCancelParams, opts ...option.RequestOption) (err error)
Cancel a job.
func (*AlphaEvalJobService) Get ¶
func (r *AlphaEvalJobService) Get(ctx context.Context, jobID string, query AlphaEvalJobGetParams, opts ...option.RequestOption) (res *EvaluateResponse, err error)
Get the result of a job.
func (*AlphaEvalJobService) Status ¶
func (r *AlphaEvalJobService) Status(ctx context.Context, jobID string, query AlphaEvalJobStatusParams, opts ...option.RequestOption) (res *Job, err error)
Get the status of a job.
type AlphaEvalJobStatusParams ¶
type AlphaEvalJobStatusParams struct {
BenchmarkID string `path:"benchmark_id,required" json:"-"`
// contains filtered or unexported fields
}
type AlphaEvalRunEvalAlphaParams ¶
type AlphaEvalRunEvalAlphaParams struct {
// The configuration for the benchmark.
BenchmarkConfig BenchmarkConfigParam `json:"benchmark_config,omitzero,required"`
// contains filtered or unexported fields
}
func (AlphaEvalRunEvalAlphaParams) MarshalJSON ¶
func (r AlphaEvalRunEvalAlphaParams) MarshalJSON() (data []byte, err error)
func (*AlphaEvalRunEvalAlphaParams) UnmarshalJSON ¶
func (r *AlphaEvalRunEvalAlphaParams) UnmarshalJSON(data []byte) error
type AlphaEvalRunEvalParams ¶
type AlphaEvalRunEvalParams struct {
// The configuration for the benchmark.
BenchmarkConfig BenchmarkConfigParam `json:"benchmark_config,omitzero,required"`
// contains filtered or unexported fields
}
func (AlphaEvalRunEvalParams) MarshalJSON ¶
func (r AlphaEvalRunEvalParams) MarshalJSON() (data []byte, err error)
func (*AlphaEvalRunEvalParams) UnmarshalJSON ¶
func (r *AlphaEvalRunEvalParams) UnmarshalJSON(data []byte) error
type AlphaEvalService ¶
type AlphaEvalService struct {
Options []option.RequestOption
Jobs AlphaEvalJobService
}
AlphaEvalService contains methods and other services that help with interacting with the llama-stack-client API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAlphaEvalService method instead.
func NewAlphaEvalService ¶
func NewAlphaEvalService(opts ...option.RequestOption) (r AlphaEvalService)
NewAlphaEvalService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*AlphaEvalService) EvaluateRows ¶
func (r *AlphaEvalService) EvaluateRows(ctx context.Context, benchmarkID string, body AlphaEvalEvaluateRowsParams, opts ...option.RequestOption) (res *EvaluateResponse, err error)
Evaluate a list of rows on a benchmark.
func (*AlphaEvalService) EvaluateRowsAlpha ¶
func (r *AlphaEvalService) EvaluateRowsAlpha(ctx context.Context, benchmarkID string, body AlphaEvalEvaluateRowsAlphaParams, opts ...option.RequestOption) (res *EvaluateResponse, err error)
Evaluate a list of rows on a benchmark.
func (*AlphaEvalService) RunEval ¶
func (r *AlphaEvalService) RunEval(ctx context.Context, benchmarkID string, body AlphaEvalRunEvalParams, opts ...option.RequestOption) (res *Job, err error)
Run an evaluation on a benchmark.
func (*AlphaEvalService) RunEvalAlpha ¶
func (r *AlphaEvalService) RunEvalAlpha(ctx context.Context, benchmarkID string, body AlphaEvalRunEvalAlphaParams, opts ...option.RequestOption) (res *Job, err error)
Run an evaluation on a benchmark.
type AlphaInferenceRerankParams ¶
type AlphaInferenceRerankParams struct {
// List of items to rerank. Each item can be a string, text content part, or image
// content part. Each input must not exceed the model's max input token length.
Items []AlphaInferenceRerankParamsItemUnion `json:"items,omitzero,required"`
// The identifier of the reranking model to use.
Model string `json:"model,required"`
// The search query to rank items against. Can be a string, text content part, or
// image content part. The input must not exceed the model's max input token
// length.
Query AlphaInferenceRerankParamsQueryUnion `json:"query,omitzero,required"`
// (Optional) Maximum number of results to return. Default: returns all.
MaxNumResults param.Opt[int64] `json:"max_num_results,omitzero"`
// contains filtered or unexported fields
}
func (AlphaInferenceRerankParams) MarshalJSON ¶
func (r AlphaInferenceRerankParams) MarshalJSON() (data []byte, err error)
func (*AlphaInferenceRerankParams) UnmarshalJSON ¶
func (r *AlphaInferenceRerankParams) UnmarshalJSON(data []byte) error
type AlphaInferenceRerankParamsItemOpenAIChatCompletionContentPartImageParam ¶
type AlphaInferenceRerankParamsItemOpenAIChatCompletionContentPartImageParam struct {
// Image URL specification and processing details
ImageURL AlphaInferenceRerankParamsItemOpenAIChatCompletionContentPartImageParamImageURL `json:"image_url,omitzero,required"`
// Must be "image_url" to identify this as image content
//
// This field can be elided, and will marshal its zero value as "image_url".
Type constant.ImageURL `json:"type,required"`
// contains filtered or unexported fields
}
Image content part for OpenAI-compatible chat completion messages.
The properties ImageURL, Type are required.
func (AlphaInferenceRerankParamsItemOpenAIChatCompletionContentPartImageParam) MarshalJSON ¶
func (r AlphaInferenceRerankParamsItemOpenAIChatCompletionContentPartImageParam) MarshalJSON() (data []byte, err error)
func (*AlphaInferenceRerankParamsItemOpenAIChatCompletionContentPartImageParam) UnmarshalJSON ¶
func (r *AlphaInferenceRerankParamsItemOpenAIChatCompletionContentPartImageParam) UnmarshalJSON(data []byte) error
type AlphaInferenceRerankParamsItemOpenAIChatCompletionContentPartImageParamImageURL ¶
type AlphaInferenceRerankParamsItemOpenAIChatCompletionContentPartImageParamImageURL struct {
// URL of the image to include in the message
URL string `json:"url,required"`
// (Optional) Level of detail for image processing. Can be "low", "high", or "auto"
Detail param.Opt[string] `json:"detail,omitzero"`
// contains filtered or unexported fields
}
Image URL specification and processing details
The property URL is required.
func (AlphaInferenceRerankParamsItemOpenAIChatCompletionContentPartImageParamImageURL) MarshalJSON ¶
func (r AlphaInferenceRerankParamsItemOpenAIChatCompletionContentPartImageParamImageURL) MarshalJSON() (data []byte, err error)
func (*AlphaInferenceRerankParamsItemOpenAIChatCompletionContentPartImageParamImageURL) UnmarshalJSON ¶
func (r *AlphaInferenceRerankParamsItemOpenAIChatCompletionContentPartImageParamImageURL) UnmarshalJSON(data []byte) error
type AlphaInferenceRerankParamsItemOpenAIChatCompletionContentPartTextParam ¶
type AlphaInferenceRerankParamsItemOpenAIChatCompletionContentPartTextParam struct {
// The text content of the message
Text string `json:"text,required"`
// Must be "text" to identify this as text content
//
// This field can be elided, and will marshal its zero value as "text".
Type constant.Text `json:"type,required"`
// contains filtered or unexported fields
}
Text content part for OpenAI-compatible chat completion messages.
The properties Text, Type are required.
func (AlphaInferenceRerankParamsItemOpenAIChatCompletionContentPartTextParam) MarshalJSON ¶
func (r AlphaInferenceRerankParamsItemOpenAIChatCompletionContentPartTextParam) MarshalJSON() (data []byte, err error)
func (*AlphaInferenceRerankParamsItemOpenAIChatCompletionContentPartTextParam) UnmarshalJSON ¶
func (r *AlphaInferenceRerankParamsItemOpenAIChatCompletionContentPartTextParam) UnmarshalJSON(data []byte) error
type AlphaInferenceRerankParamsItemUnion ¶
type AlphaInferenceRerankParamsItemUnion struct {
OfString param.Opt[string] `json:",omitzero,inline"`
OfOpenAIChatCompletionContentPartText *AlphaInferenceRerankParamsItemOpenAIChatCompletionContentPartTextParam `json:",omitzero,inline"`
OfOpenAIChatCompletionContentPartImage *AlphaInferenceRerankParamsItemOpenAIChatCompletionContentPartImageParam `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 (AlphaInferenceRerankParamsItemUnion) GetImageURL ¶
func (u AlphaInferenceRerankParamsItemUnion) GetImageURL() *AlphaInferenceRerankParamsItemOpenAIChatCompletionContentPartImageParamImageURL
Returns a pointer to the underlying variant's property, if present.
func (AlphaInferenceRerankParamsItemUnion) GetText ¶
func (u AlphaInferenceRerankParamsItemUnion) GetText() *string
Returns a pointer to the underlying variant's property, if present.
func (AlphaInferenceRerankParamsItemUnion) GetType ¶
func (u AlphaInferenceRerankParamsItemUnion) GetType() *string
Returns a pointer to the underlying variant's property, if present.
func (AlphaInferenceRerankParamsItemUnion) MarshalJSON ¶
func (u AlphaInferenceRerankParamsItemUnion) MarshalJSON() ([]byte, error)
func (*AlphaInferenceRerankParamsItemUnion) UnmarshalJSON ¶
func (u *AlphaInferenceRerankParamsItemUnion) UnmarshalJSON(data []byte) error
type AlphaInferenceRerankParamsQueryOpenAIChatCompletionContentPartImageParam ¶
type AlphaInferenceRerankParamsQueryOpenAIChatCompletionContentPartImageParam struct {
// Image URL specification and processing details
ImageURL AlphaInferenceRerankParamsQueryOpenAIChatCompletionContentPartImageParamImageURL `json:"image_url,omitzero,required"`
// Must be "image_url" to identify this as image content
//
// This field can be elided, and will marshal its zero value as "image_url".
Type constant.ImageURL `json:"type,required"`
// contains filtered or unexported fields
}
Image content part for OpenAI-compatible chat completion messages.
The properties ImageURL, Type are required.
func (AlphaInferenceRerankParamsQueryOpenAIChatCompletionContentPartImageParam) MarshalJSON ¶
func (r AlphaInferenceRerankParamsQueryOpenAIChatCompletionContentPartImageParam) MarshalJSON() (data []byte, err error)
func (*AlphaInferenceRerankParamsQueryOpenAIChatCompletionContentPartImageParam) UnmarshalJSON ¶
func (r *AlphaInferenceRerankParamsQueryOpenAIChatCompletionContentPartImageParam) UnmarshalJSON(data []byte) error
type AlphaInferenceRerankParamsQueryOpenAIChatCompletionContentPartImageParamImageURL ¶
type AlphaInferenceRerankParamsQueryOpenAIChatCompletionContentPartImageParamImageURL struct {
// URL of the image to include in the message
URL string `json:"url,required"`
// (Optional) Level of detail for image processing. Can be "low", "high", or "auto"
Detail param.Opt[string] `json:"detail,omitzero"`
// contains filtered or unexported fields
}
Image URL specification and processing details
The property URL is required.
func (AlphaInferenceRerankParamsQueryOpenAIChatCompletionContentPartImageParamImageURL) MarshalJSON ¶
func (r AlphaInferenceRerankParamsQueryOpenAIChatCompletionContentPartImageParamImageURL) MarshalJSON() (data []byte, err error)
func (*AlphaInferenceRerankParamsQueryOpenAIChatCompletionContentPartImageParamImageURL) UnmarshalJSON ¶
func (r *AlphaInferenceRerankParamsQueryOpenAIChatCompletionContentPartImageParamImageURL) UnmarshalJSON(data []byte) error
type AlphaInferenceRerankParamsQueryOpenAIChatCompletionContentPartTextParam ¶
type AlphaInferenceRerankParamsQueryOpenAIChatCompletionContentPartTextParam struct {
// The text content of the message
Text string `json:"text,required"`
// Must be "text" to identify this as text content
//
// This field can be elided, and will marshal its zero value as "text".
Type constant.Text `json:"type,required"`
// contains filtered or unexported fields
}
Text content part for OpenAI-compatible chat completion messages.
The properties Text, Type are required.
func (AlphaInferenceRerankParamsQueryOpenAIChatCompletionContentPartTextParam) MarshalJSON ¶
func (r AlphaInferenceRerankParamsQueryOpenAIChatCompletionContentPartTextParam) MarshalJSON() (data []byte, err error)
func (*AlphaInferenceRerankParamsQueryOpenAIChatCompletionContentPartTextParam) UnmarshalJSON ¶
func (r *AlphaInferenceRerankParamsQueryOpenAIChatCompletionContentPartTextParam) UnmarshalJSON(data []byte) error
type AlphaInferenceRerankParamsQueryUnion ¶
type AlphaInferenceRerankParamsQueryUnion struct {
OfString param.Opt[string] `json:",omitzero,inline"`
OfOpenAIChatCompletionContentPartText *AlphaInferenceRerankParamsQueryOpenAIChatCompletionContentPartTextParam `json:",omitzero,inline"`
OfOpenAIChatCompletionContentPartImage *AlphaInferenceRerankParamsQueryOpenAIChatCompletionContentPartImageParam `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 (AlphaInferenceRerankParamsQueryUnion) GetImageURL ¶
func (u AlphaInferenceRerankParamsQueryUnion) GetImageURL() *AlphaInferenceRerankParamsQueryOpenAIChatCompletionContentPartImageParamImageURL
Returns a pointer to the underlying variant's property, if present.
func (AlphaInferenceRerankParamsQueryUnion) GetText ¶
func (u AlphaInferenceRerankParamsQueryUnion) GetText() *string
Returns a pointer to the underlying variant's property, if present.
func (AlphaInferenceRerankParamsQueryUnion) GetType ¶
func (u AlphaInferenceRerankParamsQueryUnion) GetType() *string
Returns a pointer to the underlying variant's property, if present.
func (AlphaInferenceRerankParamsQueryUnion) MarshalJSON ¶
func (u AlphaInferenceRerankParamsQueryUnion) MarshalJSON() ([]byte, error)
func (*AlphaInferenceRerankParamsQueryUnion) UnmarshalJSON ¶
func (u *AlphaInferenceRerankParamsQueryUnion) UnmarshalJSON(data []byte) error
type AlphaInferenceRerankResponse ¶
type AlphaInferenceRerankResponse struct {
// The original index of the document in the input list
Index int64 `json:"index,required"`
// The relevance score from the model output. Values are inverted when applicable
// so that higher scores indicate greater relevance.
RelevanceScore float64 `json:"relevance_score,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Index respjson.Field
RelevanceScore respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A single rerank result from a reranking response.
func (AlphaInferenceRerankResponse) RawJSON ¶
func (r AlphaInferenceRerankResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*AlphaInferenceRerankResponse) UnmarshalJSON ¶
func (r *AlphaInferenceRerankResponse) UnmarshalJSON(data []byte) error
type AlphaInferenceRerankResponseEnvelope ¶
type AlphaInferenceRerankResponseEnvelope struct {
// List of rerank result objects, sorted by relevance score (descending)
Data []AlphaInferenceRerankResponse `json:"data,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Response from a reranking request.
func (AlphaInferenceRerankResponseEnvelope) RawJSON ¶
func (r AlphaInferenceRerankResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*AlphaInferenceRerankResponseEnvelope) UnmarshalJSON ¶
func (r *AlphaInferenceRerankResponseEnvelope) UnmarshalJSON(data []byte) error
type AlphaInferenceService ¶
type AlphaInferenceService struct {
Options []option.RequestOption
}
AlphaInferenceService contains methods and other services that help with interacting with the llama-stack-client API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAlphaInferenceService method instead.
func NewAlphaInferenceService ¶
func NewAlphaInferenceService(opts ...option.RequestOption) (r AlphaInferenceService)
NewAlphaInferenceService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*AlphaInferenceService) Rerank ¶
func (r *AlphaInferenceService) Rerank(ctx context.Context, body AlphaInferenceRerankParams, opts ...option.RequestOption) (res *[]AlphaInferenceRerankResponse, err error)
Rerank a list of documents based on their relevance to a query.
type AlphaPostTrainingJobArtifactsParams ¶
type AlphaPostTrainingJobArtifactsParams struct {
// The UUID of the job to get the artifacts of.
JobUuid string `query:"job_uuid,required" json:"-"`
// contains filtered or unexported fields
}
func (AlphaPostTrainingJobArtifactsParams) URLQuery ¶
func (r AlphaPostTrainingJobArtifactsParams) URLQuery() (v url.Values, err error)
URLQuery serializes AlphaPostTrainingJobArtifactsParams's query parameters as `url.Values`.
type AlphaPostTrainingJobArtifactsResponse ¶
type AlphaPostTrainingJobArtifactsResponse struct {
// List of model checkpoints created during training
Checkpoints []AlphaPostTrainingJobArtifactsResponseCheckpoint `json:"checkpoints,required"`
// Unique identifier for the training job
JobUuid string `json:"job_uuid,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Checkpoints respjson.Field
JobUuid respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Artifacts of a finetuning job.
func (AlphaPostTrainingJobArtifactsResponse) RawJSON ¶
func (r AlphaPostTrainingJobArtifactsResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*AlphaPostTrainingJobArtifactsResponse) UnmarshalJSON ¶
func (r *AlphaPostTrainingJobArtifactsResponse) UnmarshalJSON(data []byte) error
type AlphaPostTrainingJobArtifactsResponseCheckpoint ¶
type AlphaPostTrainingJobArtifactsResponseCheckpoint struct {
// Timestamp when the checkpoint was created
CreatedAt time.Time `json:"created_at,required" format:"date-time"`
// Training epoch when the checkpoint was saved
Epoch int64 `json:"epoch,required"`
// Unique identifier for the checkpoint
Identifier string `json:"identifier,required"`
// File system path where the checkpoint is stored
Path string `json:"path,required"`
// Identifier of the training job that created this checkpoint
PostTrainingJobID string `json:"post_training_job_id,required"`
// (Optional) Training metrics associated with this checkpoint
TrainingMetrics AlphaPostTrainingJobArtifactsResponseCheckpointTrainingMetrics `json:"training_metrics"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CreatedAt respjson.Field
Epoch respjson.Field
Identifier respjson.Field
Path respjson.Field
PostTrainingJobID respjson.Field
TrainingMetrics respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Checkpoint created during training runs.
func (AlphaPostTrainingJobArtifactsResponseCheckpoint) RawJSON ¶
func (r AlphaPostTrainingJobArtifactsResponseCheckpoint) RawJSON() string
Returns the unmodified JSON received from the API
func (*AlphaPostTrainingJobArtifactsResponseCheckpoint) UnmarshalJSON ¶
func (r *AlphaPostTrainingJobArtifactsResponseCheckpoint) UnmarshalJSON(data []byte) error
type AlphaPostTrainingJobArtifactsResponseCheckpointTrainingMetrics ¶
type AlphaPostTrainingJobArtifactsResponseCheckpointTrainingMetrics struct {
// Training epoch number
Epoch int64 `json:"epoch,required"`
// Perplexity metric indicating model confidence
Perplexity float64 `json:"perplexity,required"`
// Loss value on the training dataset
TrainLoss float64 `json:"train_loss,required"`
// Loss value on the validation dataset
ValidationLoss float64 `json:"validation_loss,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Epoch respjson.Field
Perplexity respjson.Field
TrainLoss respjson.Field
ValidationLoss respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
(Optional) Training metrics associated with this checkpoint
func (AlphaPostTrainingJobArtifactsResponseCheckpointTrainingMetrics) RawJSON ¶
func (r AlphaPostTrainingJobArtifactsResponseCheckpointTrainingMetrics) RawJSON() string
Returns the unmodified JSON received from the API
func (*AlphaPostTrainingJobArtifactsResponseCheckpointTrainingMetrics) UnmarshalJSON ¶
func (r *AlphaPostTrainingJobArtifactsResponseCheckpointTrainingMetrics) UnmarshalJSON(data []byte) error
type AlphaPostTrainingJobCancelParams ¶
type AlphaPostTrainingJobCancelParams struct {
// The UUID of the job to cancel.
JobUuid string `json:"job_uuid,required"`
// contains filtered or unexported fields
}
func (AlphaPostTrainingJobCancelParams) MarshalJSON ¶
func (r AlphaPostTrainingJobCancelParams) MarshalJSON() (data []byte, err error)
func (*AlphaPostTrainingJobCancelParams) UnmarshalJSON ¶
func (r *AlphaPostTrainingJobCancelParams) UnmarshalJSON(data []byte) error
type AlphaPostTrainingJobService ¶
type AlphaPostTrainingJobService struct {
Options []option.RequestOption
}
AlphaPostTrainingJobService contains methods and other services that help with interacting with the llama-stack-client API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAlphaPostTrainingJobService method instead.
func NewAlphaPostTrainingJobService ¶
func NewAlphaPostTrainingJobService(opts ...option.RequestOption) (r AlphaPostTrainingJobService)
NewAlphaPostTrainingJobService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*AlphaPostTrainingJobService) Artifacts ¶
func (r *AlphaPostTrainingJobService) Artifacts(ctx context.Context, query AlphaPostTrainingJobArtifactsParams, opts ...option.RequestOption) (res *AlphaPostTrainingJobArtifactsResponse, err error)
Get the artifacts of a training job.
func (*AlphaPostTrainingJobService) Cancel ¶
func (r *AlphaPostTrainingJobService) Cancel(ctx context.Context, body AlphaPostTrainingJobCancelParams, opts ...option.RequestOption) (err error)
Cancel a training job.
func (*AlphaPostTrainingJobService) List ¶
func (r *AlphaPostTrainingJobService) List(ctx context.Context, opts ...option.RequestOption) (res *[]ListPostTrainingJobsResponseData, err error)
Get all training jobs.
func (*AlphaPostTrainingJobService) Status ¶
func (r *AlphaPostTrainingJobService) Status(ctx context.Context, query AlphaPostTrainingJobStatusParams, opts ...option.RequestOption) (res *AlphaPostTrainingJobStatusResponse, err error)
Get the status of a training job.
type AlphaPostTrainingJobStatusParams ¶
type AlphaPostTrainingJobStatusParams struct {
// The UUID of the job to get the status of.
JobUuid string `query:"job_uuid,required" json:"-"`
// contains filtered or unexported fields
}
func (AlphaPostTrainingJobStatusParams) URLQuery ¶
func (r AlphaPostTrainingJobStatusParams) URLQuery() (v url.Values, err error)
URLQuery serializes AlphaPostTrainingJobStatusParams's query parameters as `url.Values`.
type AlphaPostTrainingJobStatusResponse ¶
type AlphaPostTrainingJobStatusResponse struct {
// List of model checkpoints created during training
Checkpoints []AlphaPostTrainingJobStatusResponseCheckpoint `json:"checkpoints,required"`
// Unique identifier for the training job
JobUuid string `json:"job_uuid,required"`
// Current status of the training job
//
// Any of "completed", "in_progress", "failed", "scheduled", "cancelled".
Status AlphaPostTrainingJobStatusResponseStatus `json:"status,required"`
// (Optional) Timestamp when the job finished, if completed
CompletedAt time.Time `json:"completed_at" format:"date-time"`
// (Optional) Information about computational resources allocated to the job
ResourcesAllocated map[string]AlphaPostTrainingJobStatusResponseResourcesAllocatedUnion `json:"resources_allocated"`
// (Optional) Timestamp when the job was scheduled
ScheduledAt time.Time `json:"scheduled_at" format:"date-time"`
// (Optional) Timestamp when the job execution began
StartedAt time.Time `json:"started_at" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Checkpoints respjson.Field
JobUuid respjson.Field
Status respjson.Field
CompletedAt respjson.Field
ResourcesAllocated respjson.Field
ScheduledAt respjson.Field
StartedAt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Status of a finetuning job.
func (AlphaPostTrainingJobStatusResponse) RawJSON ¶
func (r AlphaPostTrainingJobStatusResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*AlphaPostTrainingJobStatusResponse) UnmarshalJSON ¶
func (r *AlphaPostTrainingJobStatusResponse) UnmarshalJSON(data []byte) error
type AlphaPostTrainingJobStatusResponseCheckpoint ¶
type AlphaPostTrainingJobStatusResponseCheckpoint struct {
// Timestamp when the checkpoint was created
CreatedAt time.Time `json:"created_at,required" format:"date-time"`
// Training epoch when the checkpoint was saved
Epoch int64 `json:"epoch,required"`
// Unique identifier for the checkpoint
Identifier string `json:"identifier,required"`
// File system path where the checkpoint is stored
Path string `json:"path,required"`
// Identifier of the training job that created this checkpoint
PostTrainingJobID string `json:"post_training_job_id,required"`
// (Optional) Training metrics associated with this checkpoint
TrainingMetrics AlphaPostTrainingJobStatusResponseCheckpointTrainingMetrics `json:"training_metrics"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CreatedAt respjson.Field
Epoch respjson.Field
Identifier respjson.Field
Path respjson.Field
PostTrainingJobID respjson.Field
TrainingMetrics respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Checkpoint created during training runs.
func (AlphaPostTrainingJobStatusResponseCheckpoint) RawJSON ¶
func (r AlphaPostTrainingJobStatusResponseCheckpoint) RawJSON() string
Returns the unmodified JSON received from the API
func (*AlphaPostTrainingJobStatusResponseCheckpoint) UnmarshalJSON ¶
func (r *AlphaPostTrainingJobStatusResponseCheckpoint) UnmarshalJSON(data []byte) error
type AlphaPostTrainingJobStatusResponseCheckpointTrainingMetrics ¶
type AlphaPostTrainingJobStatusResponseCheckpointTrainingMetrics struct {
// Training epoch number
Epoch int64 `json:"epoch,required"`
// Perplexity metric indicating model confidence
Perplexity float64 `json:"perplexity,required"`
// Loss value on the training dataset
TrainLoss float64 `json:"train_loss,required"`
// Loss value on the validation dataset
ValidationLoss float64 `json:"validation_loss,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Epoch respjson.Field
Perplexity respjson.Field
TrainLoss respjson.Field
ValidationLoss respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
(Optional) Training metrics associated with this checkpoint
func (AlphaPostTrainingJobStatusResponseCheckpointTrainingMetrics) RawJSON ¶
func (r AlphaPostTrainingJobStatusResponseCheckpointTrainingMetrics) RawJSON() string
Returns the unmodified JSON received from the API
func (*AlphaPostTrainingJobStatusResponseCheckpointTrainingMetrics) UnmarshalJSON ¶
func (r *AlphaPostTrainingJobStatusResponseCheckpointTrainingMetrics) UnmarshalJSON(data []byte) error
type AlphaPostTrainingJobStatusResponseResourcesAllocatedUnion ¶
type AlphaPostTrainingJobStatusResponseResourcesAllocatedUnion 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:"-"`
}
AlphaPostTrainingJobStatusResponseResourcesAllocatedUnion 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 (AlphaPostTrainingJobStatusResponseResourcesAllocatedUnion) AsAnyArray ¶
func (u AlphaPostTrainingJobStatusResponseResourcesAllocatedUnion) AsAnyArray() (v []any)
func (AlphaPostTrainingJobStatusResponseResourcesAllocatedUnion) AsBool ¶
func (u AlphaPostTrainingJobStatusResponseResourcesAllocatedUnion) AsBool() (v bool)
func (AlphaPostTrainingJobStatusResponseResourcesAllocatedUnion) AsFloat ¶
func (u AlphaPostTrainingJobStatusResponseResourcesAllocatedUnion) AsFloat() (v float64)
func (AlphaPostTrainingJobStatusResponseResourcesAllocatedUnion) AsString ¶
func (u AlphaPostTrainingJobStatusResponseResourcesAllocatedUnion) AsString() (v string)
func (AlphaPostTrainingJobStatusResponseResourcesAllocatedUnion) RawJSON ¶
func (u AlphaPostTrainingJobStatusResponseResourcesAllocatedUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*AlphaPostTrainingJobStatusResponseResourcesAllocatedUnion) UnmarshalJSON ¶
func (r *AlphaPostTrainingJobStatusResponseResourcesAllocatedUnion) UnmarshalJSON(data []byte) error
type AlphaPostTrainingJobStatusResponseStatus ¶
type AlphaPostTrainingJobStatusResponseStatus string
Current status of the training job
const ( AlphaPostTrainingJobStatusResponseStatusCompleted AlphaPostTrainingJobStatusResponseStatus = "completed" AlphaPostTrainingJobStatusResponseStatusInProgress AlphaPostTrainingJobStatusResponseStatus = "in_progress" AlphaPostTrainingJobStatusResponseStatusFailed AlphaPostTrainingJobStatusResponseStatus = "failed" AlphaPostTrainingJobStatusResponseStatusScheduled AlphaPostTrainingJobStatusResponseStatus = "scheduled" AlphaPostTrainingJobStatusResponseStatusCancelled AlphaPostTrainingJobStatusResponseStatus = "cancelled" )
type AlphaPostTrainingPreferenceOptimizeParams ¶
type AlphaPostTrainingPreferenceOptimizeParams struct {
// The algorithm configuration.
AlgorithmConfig AlphaPostTrainingPreferenceOptimizeParamsAlgorithmConfig `json:"algorithm_config,omitzero,required"`
// The model to fine-tune.
FinetunedModel string `json:"finetuned_model,required"`
// The hyperparam search configuration.
HyperparamSearchConfig map[string]AlphaPostTrainingPreferenceOptimizeParamsHyperparamSearchConfigUnion `json:"hyperparam_search_config,omitzero,required"`
// The UUID of the job to create.
JobUuid string `json:"job_uuid,required"`
// The logger configuration.
LoggerConfig map[string]AlphaPostTrainingPreferenceOptimizeParamsLoggerConfigUnion `json:"logger_config,omitzero,required"`
// The training configuration.
TrainingConfig AlphaPostTrainingPreferenceOptimizeParamsTrainingConfig `json:"training_config,omitzero,required"`
// contains filtered or unexported fields
}
func (AlphaPostTrainingPreferenceOptimizeParams) MarshalJSON ¶
func (r AlphaPostTrainingPreferenceOptimizeParams) MarshalJSON() (data []byte, err error)
func (*AlphaPostTrainingPreferenceOptimizeParams) UnmarshalJSON ¶
func (r *AlphaPostTrainingPreferenceOptimizeParams) UnmarshalJSON(data []byte) error
type AlphaPostTrainingPreferenceOptimizeParamsAlgorithmConfig ¶
type AlphaPostTrainingPreferenceOptimizeParamsAlgorithmConfig struct {
// Temperature parameter for the DPO loss
Beta float64 `json:"beta,required"`
// The type of loss function to use for DPO
//
// Any of "sigmoid", "hinge", "ipo", "kto_pair".
LossType string `json:"loss_type,omitzero,required"`
// contains filtered or unexported fields
}
The algorithm configuration.
The properties Beta, LossType are required.
func (AlphaPostTrainingPreferenceOptimizeParamsAlgorithmConfig) MarshalJSON ¶
func (r AlphaPostTrainingPreferenceOptimizeParamsAlgorithmConfig) MarshalJSON() (data []byte, err error)
func (*AlphaPostTrainingPreferenceOptimizeParamsAlgorithmConfig) UnmarshalJSON ¶
func (r *AlphaPostTrainingPreferenceOptimizeParamsAlgorithmConfig) UnmarshalJSON(data []byte) error
type AlphaPostTrainingPreferenceOptimizeParamsHyperparamSearchConfigUnion ¶
type AlphaPostTrainingPreferenceOptimizeParamsHyperparamSearchConfigUnion 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 (AlphaPostTrainingPreferenceOptimizeParamsHyperparamSearchConfigUnion) MarshalJSON ¶
func (u AlphaPostTrainingPreferenceOptimizeParamsHyperparamSearchConfigUnion) MarshalJSON() ([]byte, error)
func (*AlphaPostTrainingPreferenceOptimizeParamsHyperparamSearchConfigUnion) UnmarshalJSON ¶
func (u *AlphaPostTrainingPreferenceOptimizeParamsHyperparamSearchConfigUnion) UnmarshalJSON(data []byte) error
type AlphaPostTrainingPreferenceOptimizeParamsLoggerConfigUnion ¶
type AlphaPostTrainingPreferenceOptimizeParamsLoggerConfigUnion 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 (AlphaPostTrainingPreferenceOptimizeParamsLoggerConfigUnion) MarshalJSON ¶
func (u AlphaPostTrainingPreferenceOptimizeParamsLoggerConfigUnion) MarshalJSON() ([]byte, error)
func (*AlphaPostTrainingPreferenceOptimizeParamsLoggerConfigUnion) UnmarshalJSON ¶
func (u *AlphaPostTrainingPreferenceOptimizeParamsLoggerConfigUnion) UnmarshalJSON(data []byte) error
type AlphaPostTrainingPreferenceOptimizeParamsTrainingConfig ¶
type AlphaPostTrainingPreferenceOptimizeParamsTrainingConfig struct {
// Number of steps to accumulate gradients before updating
GradientAccumulationSteps int64 `json:"gradient_accumulation_steps,required"`
// Maximum number of steps to run per epoch
MaxStepsPerEpoch int64 `json:"max_steps_per_epoch,required"`
// Number of training epochs to run
NEpochs int64 `json:"n_epochs,required"`
// (Optional) Data type for model parameters (bf16, fp16, fp32)
Dtype param.Opt[string] `json:"dtype,omitzero"`
// (Optional) Maximum number of validation steps per epoch
MaxValidationSteps param.Opt[int64] `json:"max_validation_steps,omitzero"`
// (Optional) Configuration for data loading and formatting
DataConfig AlphaPostTrainingPreferenceOptimizeParamsTrainingConfigDataConfig `json:"data_config,omitzero"`
// (Optional) Configuration for memory and compute optimizations
EfficiencyConfig AlphaPostTrainingPreferenceOptimizeParamsTrainingConfigEfficiencyConfig `json:"efficiency_config,omitzero"`
// (Optional) Configuration for the optimization algorithm
OptimizerConfig AlphaPostTrainingPreferenceOptimizeParamsTrainingConfigOptimizerConfig `json:"optimizer_config,omitzero"`
// contains filtered or unexported fields
}
The training configuration.
The properties GradientAccumulationSteps, MaxStepsPerEpoch, NEpochs are required.
func (AlphaPostTrainingPreferenceOptimizeParamsTrainingConfig) MarshalJSON ¶
func (r AlphaPostTrainingPreferenceOptimizeParamsTrainingConfig) MarshalJSON() (data []byte, err error)
func (*AlphaPostTrainingPreferenceOptimizeParamsTrainingConfig) UnmarshalJSON ¶
func (r *AlphaPostTrainingPreferenceOptimizeParamsTrainingConfig) UnmarshalJSON(data []byte) error
type AlphaPostTrainingPreferenceOptimizeParamsTrainingConfigDataConfig ¶
type AlphaPostTrainingPreferenceOptimizeParamsTrainingConfigDataConfig struct {
// Number of samples per training batch
BatchSize int64 `json:"batch_size,required"`
// Format of the dataset (instruct or dialog)
//
// Any of "instruct", "dialog".
DataFormat string `json:"data_format,omitzero,required"`
// Unique identifier for the training dataset
DatasetID string `json:"dataset_id,required"`
// Whether to shuffle the dataset during training
Shuffle bool `json:"shuffle,required"`
// (Optional) Whether to pack multiple samples into a single sequence for
// efficiency
Packed param.Opt[bool] `json:"packed,omitzero"`
// (Optional) Whether to compute loss on input tokens as well as output tokens
TrainOnInput param.Opt[bool] `json:"train_on_input,omitzero"`
// (Optional) Unique identifier for the validation dataset
ValidationDatasetID param.Opt[string] `json:"validation_dataset_id,omitzero"`
// contains filtered or unexported fields
}
(Optional) Configuration for data loading and formatting
The properties BatchSize, DataFormat, DatasetID, Shuffle are required.
func (AlphaPostTrainingPreferenceOptimizeParamsTrainingConfigDataConfig) MarshalJSON ¶
func (r AlphaPostTrainingPreferenceOptimizeParamsTrainingConfigDataConfig) MarshalJSON() (data []byte, err error)
func (*AlphaPostTrainingPreferenceOptimizeParamsTrainingConfigDataConfig) UnmarshalJSON ¶
func (r *AlphaPostTrainingPreferenceOptimizeParamsTrainingConfigDataConfig) UnmarshalJSON(data []byte) error
type AlphaPostTrainingPreferenceOptimizeParamsTrainingConfigEfficiencyConfig ¶
type AlphaPostTrainingPreferenceOptimizeParamsTrainingConfigEfficiencyConfig struct {
// (Optional) Whether to use activation checkpointing to reduce memory usage
EnableActivationCheckpointing param.Opt[bool] `json:"enable_activation_checkpointing,omitzero"`
// (Optional) Whether to offload activations to CPU to save GPU memory
EnableActivationOffloading param.Opt[bool] `json:"enable_activation_offloading,omitzero"`
// (Optional) Whether to offload FSDP parameters to CPU
FsdpCPUOffload param.Opt[bool] `json:"fsdp_cpu_offload,omitzero"`
// (Optional) Whether to use memory-efficient FSDP wrapping
MemoryEfficientFsdpWrap param.Opt[bool] `json:"memory_efficient_fsdp_wrap,omitzero"`
// contains filtered or unexported fields
}
(Optional) Configuration for memory and compute optimizations
func (AlphaPostTrainingPreferenceOptimizeParamsTrainingConfigEfficiencyConfig) MarshalJSON ¶
func (r AlphaPostTrainingPreferenceOptimizeParamsTrainingConfigEfficiencyConfig) MarshalJSON() (data []byte, err error)
func (*AlphaPostTrainingPreferenceOptimizeParamsTrainingConfigEfficiencyConfig) UnmarshalJSON ¶
func (r *AlphaPostTrainingPreferenceOptimizeParamsTrainingConfigEfficiencyConfig) UnmarshalJSON(data []byte) error
type AlphaPostTrainingPreferenceOptimizeParamsTrainingConfigOptimizerConfig ¶
type AlphaPostTrainingPreferenceOptimizeParamsTrainingConfigOptimizerConfig struct {
// Learning rate for the optimizer
Lr float64 `json:"lr,required"`
// Number of steps for learning rate warmup
NumWarmupSteps int64 `json:"num_warmup_steps,required"`
// Type of optimizer to use (adam, adamw, or sgd)
//
// Any of "adam", "adamw", "sgd".
OptimizerType string `json:"optimizer_type,omitzero,required"`
// Weight decay coefficient for regularization
WeightDecay float64 `json:"weight_decay,required"`
// contains filtered or unexported fields
}
(Optional) Configuration for the optimization algorithm
The properties Lr, NumWarmupSteps, OptimizerType, WeightDecay are required.
func (AlphaPostTrainingPreferenceOptimizeParamsTrainingConfigOptimizerConfig) MarshalJSON ¶
func (r AlphaPostTrainingPreferenceOptimizeParamsTrainingConfigOptimizerConfig) MarshalJSON() (data []byte, err error)
func (*AlphaPostTrainingPreferenceOptimizeParamsTrainingConfigOptimizerConfig) UnmarshalJSON ¶
func (r *AlphaPostTrainingPreferenceOptimizeParamsTrainingConfigOptimizerConfig) UnmarshalJSON(data []byte) error
type AlphaPostTrainingService ¶
type AlphaPostTrainingService struct {
Options []option.RequestOption
Job AlphaPostTrainingJobService
}
AlphaPostTrainingService contains methods and other services that help with interacting with the llama-stack-client API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAlphaPostTrainingService method instead.
func NewAlphaPostTrainingService ¶
func NewAlphaPostTrainingService(opts ...option.RequestOption) (r AlphaPostTrainingService)
NewAlphaPostTrainingService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*AlphaPostTrainingService) PreferenceOptimize ¶
func (r *AlphaPostTrainingService) PreferenceOptimize(ctx context.Context, body AlphaPostTrainingPreferenceOptimizeParams, opts ...option.RequestOption) (res *PostTrainingJob, err error)
Run preference optimization of a model.
func (*AlphaPostTrainingService) SupervisedFineTune ¶
func (r *AlphaPostTrainingService) SupervisedFineTune(ctx context.Context, body AlphaPostTrainingSupervisedFineTuneParams, opts ...option.RequestOption) (res *PostTrainingJob, err error)
Run supervised fine-tuning of a model.
type AlphaPostTrainingSupervisedFineTuneParams ¶
type AlphaPostTrainingSupervisedFineTuneParams struct {
// The hyperparam search configuration.
HyperparamSearchConfig map[string]AlphaPostTrainingSupervisedFineTuneParamsHyperparamSearchConfigUnion `json:"hyperparam_search_config,omitzero,required"`
// The UUID of the job to create.
JobUuid string `json:"job_uuid,required"`
// The logger configuration.
LoggerConfig map[string]AlphaPostTrainingSupervisedFineTuneParamsLoggerConfigUnion `json:"logger_config,omitzero,required"`
// The training configuration.
TrainingConfig AlphaPostTrainingSupervisedFineTuneParamsTrainingConfig `json:"training_config,omitzero,required"`
// The directory to save checkpoint(s) to.
CheckpointDir param.Opt[string] `json:"checkpoint_dir,omitzero"`
// The model to fine-tune.
Model param.Opt[string] `json:"model,omitzero"`
// The algorithm configuration.
AlgorithmConfig AlgorithmConfigUnionParam `json:"algorithm_config,omitzero"`
// contains filtered or unexported fields
}
func (AlphaPostTrainingSupervisedFineTuneParams) MarshalJSON ¶
func (r AlphaPostTrainingSupervisedFineTuneParams) MarshalJSON() (data []byte, err error)
func (*AlphaPostTrainingSupervisedFineTuneParams) UnmarshalJSON ¶
func (r *AlphaPostTrainingSupervisedFineTuneParams) UnmarshalJSON(data []byte) error
type AlphaPostTrainingSupervisedFineTuneParamsHyperparamSearchConfigUnion ¶
type AlphaPostTrainingSupervisedFineTuneParamsHyperparamSearchConfigUnion 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 (AlphaPostTrainingSupervisedFineTuneParamsHyperparamSearchConfigUnion) MarshalJSON ¶
func (u AlphaPostTrainingSupervisedFineTuneParamsHyperparamSearchConfigUnion) MarshalJSON() ([]byte, error)
func (*AlphaPostTrainingSupervisedFineTuneParamsHyperparamSearchConfigUnion) UnmarshalJSON ¶
func (u *AlphaPostTrainingSupervisedFineTuneParamsHyperparamSearchConfigUnion) UnmarshalJSON(data []byte) error
type AlphaPostTrainingSupervisedFineTuneParamsLoggerConfigUnion ¶
type AlphaPostTrainingSupervisedFineTuneParamsLoggerConfigUnion 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 (AlphaPostTrainingSupervisedFineTuneParamsLoggerConfigUnion) MarshalJSON ¶
func (u AlphaPostTrainingSupervisedFineTuneParamsLoggerConfigUnion) MarshalJSON() ([]byte, error)
func (*AlphaPostTrainingSupervisedFineTuneParamsLoggerConfigUnion) UnmarshalJSON ¶
func (u *AlphaPostTrainingSupervisedFineTuneParamsLoggerConfigUnion) UnmarshalJSON(data []byte) error
type AlphaPostTrainingSupervisedFineTuneParamsTrainingConfig ¶
type AlphaPostTrainingSupervisedFineTuneParamsTrainingConfig struct {
// Number of steps to accumulate gradients before updating
GradientAccumulationSteps int64 `json:"gradient_accumulation_steps,required"`
// Maximum number of steps to run per epoch
MaxStepsPerEpoch int64 `json:"max_steps_per_epoch,required"`
// Number of training epochs to run
NEpochs int64 `json:"n_epochs,required"`
// (Optional) Data type for model parameters (bf16, fp16, fp32)
Dtype param.Opt[string] `json:"dtype,omitzero"`
// (Optional) Maximum number of validation steps per epoch
MaxValidationSteps param.Opt[int64] `json:"max_validation_steps,omitzero"`
// (Optional) Configuration for data loading and formatting
DataConfig AlphaPostTrainingSupervisedFineTuneParamsTrainingConfigDataConfig `json:"data_config,omitzero"`
// (Optional) Configuration for memory and compute optimizations
EfficiencyConfig AlphaPostTrainingSupervisedFineTuneParamsTrainingConfigEfficiencyConfig `json:"efficiency_config,omitzero"`
// (Optional) Configuration for the optimization algorithm
OptimizerConfig AlphaPostTrainingSupervisedFineTuneParamsTrainingConfigOptimizerConfig `json:"optimizer_config,omitzero"`
// contains filtered or unexported fields
}
The training configuration.
The properties GradientAccumulationSteps, MaxStepsPerEpoch, NEpochs are required.
func (AlphaPostTrainingSupervisedFineTuneParamsTrainingConfig) MarshalJSON ¶
func (r AlphaPostTrainingSupervisedFineTuneParamsTrainingConfig) MarshalJSON() (data []byte, err error)
func (*AlphaPostTrainingSupervisedFineTuneParamsTrainingConfig) UnmarshalJSON ¶
func (r *AlphaPostTrainingSupervisedFineTuneParamsTrainingConfig) UnmarshalJSON(data []byte) error
type AlphaPostTrainingSupervisedFineTuneParamsTrainingConfigDataConfig ¶
type AlphaPostTrainingSupervisedFineTuneParamsTrainingConfigDataConfig struct {
// Number of samples per training batch
BatchSize int64 `json:"batch_size,required"`
// Format of the dataset (instruct or dialog)
//
// Any of "instruct", "dialog".
DataFormat string `json:"data_format,omitzero,required"`
// Unique identifier for the training dataset
DatasetID string `json:"dataset_id,required"`
// Whether to shuffle the dataset during training
Shuffle bool `json:"shuffle,required"`
// (Optional) Whether to pack multiple samples into a single sequence for
// efficiency
Packed param.Opt[bool] `json:"packed,omitzero"`
// (Optional) Whether to compute loss on input tokens as well as output tokens
TrainOnInput param.Opt[bool] `json:"train_on_input,omitzero"`
// (Optional) Unique identifier for the validation dataset
ValidationDatasetID param.Opt[string] `json:"validation_dataset_id,omitzero"`
// contains filtered or unexported fields
}
(Optional) Configuration for data loading and formatting
The properties BatchSize, DataFormat, DatasetID, Shuffle are required.
func (AlphaPostTrainingSupervisedFineTuneParamsTrainingConfigDataConfig) MarshalJSON ¶
func (r AlphaPostTrainingSupervisedFineTuneParamsTrainingConfigDataConfig) MarshalJSON() (data []byte, err error)
func (*AlphaPostTrainingSupervisedFineTuneParamsTrainingConfigDataConfig) UnmarshalJSON ¶
func (r *AlphaPostTrainingSupervisedFineTuneParamsTrainingConfigDataConfig) UnmarshalJSON(data []byte) error
type AlphaPostTrainingSupervisedFineTuneParamsTrainingConfigEfficiencyConfig ¶
type AlphaPostTrainingSupervisedFineTuneParamsTrainingConfigEfficiencyConfig struct {
// (Optional) Whether to use activation checkpointing to reduce memory usage
EnableActivationCheckpointing param.Opt[bool] `json:"enable_activation_checkpointing,omitzero"`
// (Optional) Whether to offload activations to CPU to save GPU memory
EnableActivationOffloading param.Opt[bool] `json:"enable_activation_offloading,omitzero"`
// (Optional) Whether to offload FSDP parameters to CPU
FsdpCPUOffload param.Opt[bool] `json:"fsdp_cpu_offload,omitzero"`
// (Optional) Whether to use memory-efficient FSDP wrapping
MemoryEfficientFsdpWrap param.Opt[bool] `json:"memory_efficient_fsdp_wrap,omitzero"`
// contains filtered or unexported fields
}
(Optional) Configuration for memory and compute optimizations
func (AlphaPostTrainingSupervisedFineTuneParamsTrainingConfigEfficiencyConfig) MarshalJSON ¶
func (r AlphaPostTrainingSupervisedFineTuneParamsTrainingConfigEfficiencyConfig) MarshalJSON() (data []byte, err error)
func (*AlphaPostTrainingSupervisedFineTuneParamsTrainingConfigEfficiencyConfig) UnmarshalJSON ¶
func (r *AlphaPostTrainingSupervisedFineTuneParamsTrainingConfigEfficiencyConfig) UnmarshalJSON(data []byte) error
type AlphaPostTrainingSupervisedFineTuneParamsTrainingConfigOptimizerConfig ¶
type AlphaPostTrainingSupervisedFineTuneParamsTrainingConfigOptimizerConfig struct {
// Learning rate for the optimizer
Lr float64 `json:"lr,required"`
// Number of steps for learning rate warmup
NumWarmupSteps int64 `json:"num_warmup_steps,required"`
// Type of optimizer to use (adam, adamw, or sgd)
//
// Any of "adam", "adamw", "sgd".
OptimizerType string `json:"optimizer_type,omitzero,required"`
// Weight decay coefficient for regularization
WeightDecay float64 `json:"weight_decay,required"`
// contains filtered or unexported fields
}
(Optional) Configuration for the optimization algorithm
The properties Lr, NumWarmupSteps, OptimizerType, WeightDecay are required.
func (AlphaPostTrainingSupervisedFineTuneParamsTrainingConfigOptimizerConfig) MarshalJSON ¶
func (r AlphaPostTrainingSupervisedFineTuneParamsTrainingConfigOptimizerConfig) MarshalJSON() (data []byte, err error)
func (*AlphaPostTrainingSupervisedFineTuneParamsTrainingConfigOptimizerConfig) UnmarshalJSON ¶
func (r *AlphaPostTrainingSupervisedFineTuneParamsTrainingConfigOptimizerConfig) UnmarshalJSON(data []byte) error
type AlphaService ¶
type AlphaService struct {
Options []option.RequestOption
Inference AlphaInferenceService
PostTraining AlphaPostTrainingService
Benchmarks AlphaBenchmarkService
Eval AlphaEvalService
}
AlphaService contains methods and other services that help with interacting with the llama-stack-client API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAlphaService method instead.
func NewAlphaService ¶
func NewAlphaService(opts ...option.RequestOption) (r AlphaService)
NewAlphaService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
type Benchmark ¶
type Benchmark struct {
// Identifier of the dataset to use for the benchmark evaluation
DatasetID string `json:"dataset_id,required"`
Identifier string `json:"identifier,required"`
// Metadata for this evaluation task
Metadata map[string]BenchmarkMetadataUnion `json:"metadata,required"`
ProviderID string `json:"provider_id,required"`
// List of scoring function identifiers to apply during evaluation
ScoringFunctions []string `json:"scoring_functions,required"`
// The resource type, always benchmark
Type constant.Benchmark `json:"type,required"`
ProviderResourceID string `json:"provider_resource_id"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
DatasetID respjson.Field
Identifier respjson.Field
Metadata respjson.Field
ProviderID respjson.Field
ScoringFunctions respjson.Field
Type respjson.Field
ProviderResourceID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A benchmark resource for evaluating model performance.
func (*Benchmark) UnmarshalJSON ¶
type BenchmarkConfigEvalCandidateParam ¶
type BenchmarkConfigEvalCandidateParam struct {
// The model ID to evaluate.
Model string `json:"model,required"`
// The sampling parameters for the model.
SamplingParams SamplingParams `json:"sampling_params,omitzero,required"`
// (Optional) The system message providing instructions or context to the model.
SystemMessage SystemMessageParam `json:"system_message,omitzero"`
// This field can be elided, and will marshal its zero value as "model".
Type constant.Model `json:"type,required"`
// contains filtered or unexported fields
}
The candidate to evaluate.
The properties Model, SamplingParams, Type are required.
func (BenchmarkConfigEvalCandidateParam) MarshalJSON ¶
func (r BenchmarkConfigEvalCandidateParam) MarshalJSON() (data []byte, err error)
func (*BenchmarkConfigEvalCandidateParam) UnmarshalJSON ¶
func (r *BenchmarkConfigEvalCandidateParam) UnmarshalJSON(data []byte) error
type BenchmarkConfigParam ¶
type BenchmarkConfigParam struct {
// The candidate to evaluate.
EvalCandidate BenchmarkConfigEvalCandidateParam `json:"eval_candidate,omitzero,required"`
// Map between scoring function id and parameters for each scoring function you
// want to run
ScoringParams map[string]ScoringFnParamsUnion `json:"scoring_params,omitzero,required"`
// (Optional) The number of examples to evaluate. If not provided, all examples in
// the dataset will be evaluated
NumExamples param.Opt[int64] `json:"num_examples,omitzero"`
// contains filtered or unexported fields
}
A benchmark configuration for evaluation.
The properties EvalCandidate, ScoringParams are required.
func (BenchmarkConfigParam) MarshalJSON ¶
func (r BenchmarkConfigParam) MarshalJSON() (data []byte, err error)
func (*BenchmarkConfigParam) UnmarshalJSON ¶
func (r *BenchmarkConfigParam) UnmarshalJSON(data []byte) error
type BenchmarkMetadataUnion ¶
type BenchmarkMetadataUnion struct {
// This field will be present if the value is a [bool] instead of an object.
OfBool bool `json:",inline"`
// This field will be present if the value is a [float64] instead of an object.
OfFloat float64 `json:",inline"`
// This field will be present if the value is a [string] instead of an object.
OfString string `json:",inline"`
// This field will be present if the value is a [[]any] instead of an object.
OfAnyArray []any `json:",inline"`
JSON struct {
OfBool respjson.Field
OfFloat respjson.Field
OfString respjson.Field
OfAnyArray respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
BenchmarkMetadataUnion contains all possible properties and values from [bool], [float64], [string], [[]any].
Use the methods beginning with 'As' to cast the union to one of its variants.
If the underlying value is not a json object, one of the following properties will be valid: OfBool OfFloat OfString OfAnyArray]
func (BenchmarkMetadataUnion) AsAnyArray ¶
func (u BenchmarkMetadataUnion) AsAnyArray() (v []any)
func (BenchmarkMetadataUnion) AsBool ¶
func (u BenchmarkMetadataUnion) AsBool() (v bool)
func (BenchmarkMetadataUnion) AsFloat ¶
func (u BenchmarkMetadataUnion) AsFloat() (v float64)
func (BenchmarkMetadataUnion) AsString ¶
func (u BenchmarkMetadataUnion) AsString() (v string)
func (BenchmarkMetadataUnion) RawJSON ¶
func (u BenchmarkMetadataUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*BenchmarkMetadataUnion) UnmarshalJSON ¶
func (r *BenchmarkMetadataUnion) UnmarshalJSON(data []byte) error
type BetaDatasetAppendrowsParams ¶
type BetaDatasetAppendrowsParams struct {
// The rows to append to the dataset.
Rows []map[string]BetaDatasetAppendrowsParamsRowUnion `json:"rows,omitzero,required"`
// contains filtered or unexported fields
}
func (BetaDatasetAppendrowsParams) MarshalJSON ¶
func (r BetaDatasetAppendrowsParams) MarshalJSON() (data []byte, err error)
func (*BetaDatasetAppendrowsParams) UnmarshalJSON ¶
func (r *BetaDatasetAppendrowsParams) UnmarshalJSON(data []byte) error
type BetaDatasetAppendrowsParamsRowUnion ¶
type BetaDatasetAppendrowsParamsRowUnion 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 (BetaDatasetAppendrowsParamsRowUnion) MarshalJSON ¶
func (u BetaDatasetAppendrowsParamsRowUnion) MarshalJSON() ([]byte, error)
func (*BetaDatasetAppendrowsParamsRowUnion) UnmarshalJSON ¶
func (u *BetaDatasetAppendrowsParamsRowUnion) UnmarshalJSON(data []byte) error
type BetaDatasetGetResponse ¶
type BetaDatasetGetResponse struct {
Identifier string `json:"identifier,required"`
// Additional metadata for the dataset
Metadata map[string]BetaDatasetGetResponseMetadataUnion `json:"metadata,required"`
ProviderID string `json:"provider_id,required"`
// Purpose of the dataset indicating its intended use
//
// Any of "post-training/messages", "eval/question-answer", "eval/messages-answer".
Purpose BetaDatasetGetResponsePurpose `json:"purpose,required"`
// Data source configuration for the dataset
Source BetaDatasetGetResponseSourceUnion `json:"source,required"`
// Type of resource, always 'dataset' for datasets
Type constant.Dataset `json:"type,required"`
ProviderResourceID string `json:"provider_resource_id"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Identifier respjson.Field
Metadata respjson.Field
ProviderID respjson.Field
Purpose respjson.Field
Source respjson.Field
Type respjson.Field
ProviderResourceID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Dataset resource for storing and accessing training or evaluation data.
func (BetaDatasetGetResponse) RawJSON ¶
func (r BetaDatasetGetResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaDatasetGetResponse) UnmarshalJSON ¶
func (r *BetaDatasetGetResponse) UnmarshalJSON(data []byte) error
type BetaDatasetGetResponseMetadataUnion ¶
type BetaDatasetGetResponseMetadataUnion 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:"-"`
}
BetaDatasetGetResponseMetadataUnion 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 (BetaDatasetGetResponseMetadataUnion) AsAnyArray ¶
func (u BetaDatasetGetResponseMetadataUnion) AsAnyArray() (v []any)
func (BetaDatasetGetResponseMetadataUnion) AsBool ¶
func (u BetaDatasetGetResponseMetadataUnion) AsBool() (v bool)
func (BetaDatasetGetResponseMetadataUnion) AsFloat ¶
func (u BetaDatasetGetResponseMetadataUnion) AsFloat() (v float64)
func (BetaDatasetGetResponseMetadataUnion) AsString ¶
func (u BetaDatasetGetResponseMetadataUnion) AsString() (v string)
func (BetaDatasetGetResponseMetadataUnion) RawJSON ¶
func (u BetaDatasetGetResponseMetadataUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaDatasetGetResponseMetadataUnion) UnmarshalJSON ¶
func (r *BetaDatasetGetResponseMetadataUnion) UnmarshalJSON(data []byte) error
type BetaDatasetGetResponsePurpose ¶
type BetaDatasetGetResponsePurpose string
Purpose of the dataset indicating its intended use
const ( BetaDatasetGetResponsePurposePostTrainingMessages BetaDatasetGetResponsePurpose = "post-training/messages" BetaDatasetGetResponsePurposeEvalQuestionAnswer BetaDatasetGetResponsePurpose = "eval/question-answer" BetaDatasetGetResponsePurposeEvalMessagesAnswer BetaDatasetGetResponsePurpose = "eval/messages-answer" )
type BetaDatasetGetResponseSourceRows ¶
type BetaDatasetGetResponseSourceRows struct {
// The dataset is stored in rows. E.g. - [ {"messages": [{"role": "user",
// "content": "Hello, world!"}, {"role": "assistant", "content": "Hello, world!"}]}
// ]
Rows []map[string]BetaDatasetGetResponseSourceRowsRowUnion `json:"rows,required"`
Type constant.Rows `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Rows respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A dataset stored in rows.
func (BetaDatasetGetResponseSourceRows) RawJSON ¶
func (r BetaDatasetGetResponseSourceRows) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaDatasetGetResponseSourceRows) UnmarshalJSON ¶
func (r *BetaDatasetGetResponseSourceRows) UnmarshalJSON(data []byte) error
type BetaDatasetGetResponseSourceRowsRowUnion ¶
type BetaDatasetGetResponseSourceRowsRowUnion 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:"-"`
}
BetaDatasetGetResponseSourceRowsRowUnion 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 (BetaDatasetGetResponseSourceRowsRowUnion) AsAnyArray ¶
func (u BetaDatasetGetResponseSourceRowsRowUnion) AsAnyArray() (v []any)
func (BetaDatasetGetResponseSourceRowsRowUnion) AsBool ¶
func (u BetaDatasetGetResponseSourceRowsRowUnion) AsBool() (v bool)
func (BetaDatasetGetResponseSourceRowsRowUnion) AsFloat ¶
func (u BetaDatasetGetResponseSourceRowsRowUnion) AsFloat() (v float64)
func (BetaDatasetGetResponseSourceRowsRowUnion) AsString ¶
func (u BetaDatasetGetResponseSourceRowsRowUnion) AsString() (v string)
func (BetaDatasetGetResponseSourceRowsRowUnion) RawJSON ¶
func (u BetaDatasetGetResponseSourceRowsRowUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaDatasetGetResponseSourceRowsRowUnion) UnmarshalJSON ¶
func (r *BetaDatasetGetResponseSourceRowsRowUnion) UnmarshalJSON(data []byte) error
type BetaDatasetGetResponseSourceUnion ¶
type BetaDatasetGetResponseSourceUnion struct {
// Any of "uri", "rows".
Type string `json:"type"`
// This field is from variant [BetaDatasetGetResponseSourceUri].
Uri string `json:"uri"`
// This field is from variant [BetaDatasetGetResponseSourceRows].
Rows []map[string]BetaDatasetGetResponseSourceRowsRowUnion `json:"rows"`
JSON struct {
Type respjson.Field
Uri respjson.Field
Rows respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
BetaDatasetGetResponseSourceUnion contains all possible properties and values from BetaDatasetGetResponseSourceUri, BetaDatasetGetResponseSourceRows.
Use the BetaDatasetGetResponseSourceUnion.AsAny method to switch on the variant.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (BetaDatasetGetResponseSourceUnion) AsAny ¶
func (u BetaDatasetGetResponseSourceUnion) AsAny() anyBetaDatasetGetResponseSource
Use the following switch statement to find the correct variant
switch variant := BetaDatasetGetResponseSourceUnion.AsAny().(type) {
case llamastackclient.BetaDatasetGetResponseSourceUri:
case llamastackclient.BetaDatasetGetResponseSourceRows:
default:
fmt.Errorf("no variant present")
}
func (BetaDatasetGetResponseSourceUnion) AsRows ¶
func (u BetaDatasetGetResponseSourceUnion) AsRows() (v BetaDatasetGetResponseSourceRows)
func (BetaDatasetGetResponseSourceUnion) AsUri ¶
func (u BetaDatasetGetResponseSourceUnion) AsUri() (v BetaDatasetGetResponseSourceUri)
func (BetaDatasetGetResponseSourceUnion) RawJSON ¶
func (u BetaDatasetGetResponseSourceUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaDatasetGetResponseSourceUnion) UnmarshalJSON ¶
func (r *BetaDatasetGetResponseSourceUnion) UnmarshalJSON(data []byte) error
type BetaDatasetGetResponseSourceUri ¶
type BetaDatasetGetResponseSourceUri struct {
Type constant.Uri `json:"type,required"`
// The dataset can be obtained from a URI. E.g. -
// "https://mywebsite.com/mydata.jsonl" - "lsfs://mydata.jsonl" -
// "data:csv;base64,{base64_content}"
Uri string `json:"uri,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Type respjson.Field
Uri respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A dataset that can be obtained from a URI.
func (BetaDatasetGetResponseSourceUri) RawJSON ¶
func (r BetaDatasetGetResponseSourceUri) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaDatasetGetResponseSourceUri) UnmarshalJSON ¶
func (r *BetaDatasetGetResponseSourceUri) UnmarshalJSON(data []byte) error
type BetaDatasetIterrowsParams ¶
type BetaDatasetIterrowsParams struct {
// The number of rows to get.
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Index into dataset for the first row to get. Get all rows if None.
StartIndex param.Opt[int64] `query:"start_index,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (BetaDatasetIterrowsParams) URLQuery ¶
func (r BetaDatasetIterrowsParams) URLQuery() (v url.Values, err error)
URLQuery serializes BetaDatasetIterrowsParams's query parameters as `url.Values`.
type BetaDatasetIterrowsResponse ¶
type BetaDatasetIterrowsResponse struct {
// The list of items for the current page
Data []map[string]BetaDatasetIterrowsResponseDataUnion `json:"data,required"`
// Whether there are more items available after this set
HasMore bool `json:"has_more,required"`
// The URL for accessing this list
URL string `json:"url"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
HasMore respjson.Field
URL respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A generic paginated response that follows a simple format.
func (BetaDatasetIterrowsResponse) RawJSON ¶
func (r BetaDatasetIterrowsResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaDatasetIterrowsResponse) UnmarshalJSON ¶
func (r *BetaDatasetIterrowsResponse) UnmarshalJSON(data []byte) error
type BetaDatasetIterrowsResponseDataUnion ¶
type BetaDatasetIterrowsResponseDataUnion 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:"-"`
}
BetaDatasetIterrowsResponseDataUnion 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 (BetaDatasetIterrowsResponseDataUnion) AsAnyArray ¶
func (u BetaDatasetIterrowsResponseDataUnion) AsAnyArray() (v []any)
func (BetaDatasetIterrowsResponseDataUnion) AsBool ¶
func (u BetaDatasetIterrowsResponseDataUnion) AsBool() (v bool)
func (BetaDatasetIterrowsResponseDataUnion) AsFloat ¶
func (u BetaDatasetIterrowsResponseDataUnion) AsFloat() (v float64)
func (BetaDatasetIterrowsResponseDataUnion) AsString ¶
func (u BetaDatasetIterrowsResponseDataUnion) AsString() (v string)
func (BetaDatasetIterrowsResponseDataUnion) RawJSON ¶
func (u BetaDatasetIterrowsResponseDataUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaDatasetIterrowsResponseDataUnion) UnmarshalJSON ¶
func (r *BetaDatasetIterrowsResponseDataUnion) UnmarshalJSON(data []byte) error
type BetaDatasetRegisterParams ¶
type BetaDatasetRegisterParams struct {
// The purpose of the dataset. One of: - "post-training/messages": The dataset
// contains a messages column with list of messages for post-training. {
// "messages": [ {"role": "user", "content": "Hello, world!"}, {"role":
// "assistant", "content": "Hello, world!"}, ] } - "eval/question-answer": The
// dataset contains a question column and an answer column for evaluation. {
// "question": "What is the capital of France?", "answer": "Paris" } -
// "eval/messages-answer": The dataset contains a messages column with list of
// messages and an answer column for evaluation. { "messages": [ {"role": "user",
// "content": "Hello, my name is John Doe."}, {"role": "assistant", "content":
// "Hello, John Doe. How can I help you today?"}, {"role": "user", "content":
// "What's my name?"}, ], "answer": "John Doe" }
//
// Any of "post-training/messages", "eval/question-answer", "eval/messages-answer".
Purpose BetaDatasetRegisterParamsPurpose `json:"purpose,omitzero,required"`
// The data source of the dataset. Ensure that the data source schema is compatible
// with the purpose of the dataset. Examples: - { "type": "uri", "uri":
// "https://mywebsite.com/mydata.jsonl" } - { "type": "uri", "uri":
// "lsfs://mydata.jsonl" } - { "type": "uri", "uri":
// "data:csv;base64,{base64_content}" } - { "type": "uri", "uri":
// "huggingface://llamastack/simpleqa?split=train" } - { "type": "rows", "rows": [
// { "messages": [ {"role": "user", "content": "Hello, world!"}, {"role":
// "assistant", "content": "Hello, world!"}, ] } ] }
Source BetaDatasetRegisterParamsSourceUnion `json:"source,omitzero,required"`
// The ID of the dataset. If not provided, an ID will be generated.
DatasetID param.Opt[string] `json:"dataset_id,omitzero"`
// The metadata for the dataset. - E.g. {"description": "My dataset"}.
Metadata map[string]BetaDatasetRegisterParamsMetadataUnion `json:"metadata,omitzero"`
// contains filtered or unexported fields
}
func (BetaDatasetRegisterParams) MarshalJSON ¶
func (r BetaDatasetRegisterParams) MarshalJSON() (data []byte, err error)
func (*BetaDatasetRegisterParams) UnmarshalJSON ¶
func (r *BetaDatasetRegisterParams) UnmarshalJSON(data []byte) error
type BetaDatasetRegisterParamsMetadataUnion ¶
type BetaDatasetRegisterParamsMetadataUnion 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 (BetaDatasetRegisterParamsMetadataUnion) MarshalJSON ¶
func (u BetaDatasetRegisterParamsMetadataUnion) MarshalJSON() ([]byte, error)
func (*BetaDatasetRegisterParamsMetadataUnion) UnmarshalJSON ¶
func (u *BetaDatasetRegisterParamsMetadataUnion) UnmarshalJSON(data []byte) error
type BetaDatasetRegisterParamsPurpose ¶
type BetaDatasetRegisterParamsPurpose string
The purpose of the dataset. One of: - "post-training/messages": The dataset contains a messages column with list of messages for post-training. { "messages": [ {"role": "user", "content": "Hello, world!"}, {"role": "assistant", "content": "Hello, world!"}, ] } - "eval/question-answer": The dataset contains a question column and an answer column for evaluation. { "question": "What is the capital of France?", "answer": "Paris" } - "eval/messages-answer": The dataset contains a messages column with list of messages and an answer column for evaluation. { "messages": [ {"role": "user", "content": "Hello, my name is John Doe."}, {"role": "assistant", "content": "Hello, John Doe. How can I help you today?"}, {"role": "user", "content": "What's my name?"}, ], "answer": "John Doe" }
const ( BetaDatasetRegisterParamsPurposePostTrainingMessages BetaDatasetRegisterParamsPurpose = "post-training/messages" BetaDatasetRegisterParamsPurposeEvalQuestionAnswer BetaDatasetRegisterParamsPurpose = "eval/question-answer" BetaDatasetRegisterParamsPurposeEvalMessagesAnswer BetaDatasetRegisterParamsPurpose = "eval/messages-answer" )
type BetaDatasetRegisterParamsSourceRows ¶
type BetaDatasetRegisterParamsSourceRows struct {
// The dataset is stored in rows. E.g. - [ {"messages": [{"role": "user",
// "content": "Hello, world!"}, {"role": "assistant", "content": "Hello, world!"}]}
// ]
Rows []map[string]BetaDatasetRegisterParamsSourceRowsRowUnion `json:"rows,omitzero,required"`
// This field can be elided, and will marshal its zero value as "rows".
Type constant.Rows `json:"type,required"`
// contains filtered or unexported fields
}
A dataset stored in rows.
The properties Rows, Type are required.
func (BetaDatasetRegisterParamsSourceRows) MarshalJSON ¶
func (r BetaDatasetRegisterParamsSourceRows) MarshalJSON() (data []byte, err error)
func (*BetaDatasetRegisterParamsSourceRows) UnmarshalJSON ¶
func (r *BetaDatasetRegisterParamsSourceRows) UnmarshalJSON(data []byte) error
type BetaDatasetRegisterParamsSourceRowsRowUnion ¶
type BetaDatasetRegisterParamsSourceRowsRowUnion 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 (BetaDatasetRegisterParamsSourceRowsRowUnion) MarshalJSON ¶
func (u BetaDatasetRegisterParamsSourceRowsRowUnion) MarshalJSON() ([]byte, error)
func (*BetaDatasetRegisterParamsSourceRowsRowUnion) UnmarshalJSON ¶
func (u *BetaDatasetRegisterParamsSourceRowsRowUnion) UnmarshalJSON(data []byte) error
type BetaDatasetRegisterParamsSourceUnion ¶
type BetaDatasetRegisterParamsSourceUnion struct {
OfUri *BetaDatasetRegisterParamsSourceUri `json:",omitzero,inline"`
OfRows *BetaDatasetRegisterParamsSourceRows `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 (BetaDatasetRegisterParamsSourceUnion) GetRows ¶
func (u BetaDatasetRegisterParamsSourceUnion) GetRows() []map[string]BetaDatasetRegisterParamsSourceRowsRowUnion
Returns a pointer to the underlying variant's property, if present.
func (BetaDatasetRegisterParamsSourceUnion) GetType ¶
func (u BetaDatasetRegisterParamsSourceUnion) GetType() *string
Returns a pointer to the underlying variant's property, if present.
func (BetaDatasetRegisterParamsSourceUnion) GetUri ¶
func (u BetaDatasetRegisterParamsSourceUnion) GetUri() *string
Returns a pointer to the underlying variant's property, if present.
func (BetaDatasetRegisterParamsSourceUnion) MarshalJSON ¶
func (u BetaDatasetRegisterParamsSourceUnion) MarshalJSON() ([]byte, error)
func (*BetaDatasetRegisterParamsSourceUnion) UnmarshalJSON ¶
func (u *BetaDatasetRegisterParamsSourceUnion) UnmarshalJSON(data []byte) error
type BetaDatasetRegisterParamsSourceUri ¶
type BetaDatasetRegisterParamsSourceUri struct {
// The dataset can be obtained from a URI. E.g. -
// "https://mywebsite.com/mydata.jsonl" - "lsfs://mydata.jsonl" -
// "data:csv;base64,{base64_content}"
Uri string `json:"uri,required"`
// This field can be elided, and will marshal its zero value as "uri".
Type constant.Uri `json:"type,required"`
// contains filtered or unexported fields
}
A dataset that can be obtained from a URI.
The properties Type, Uri are required.
func (BetaDatasetRegisterParamsSourceUri) MarshalJSON ¶
func (r BetaDatasetRegisterParamsSourceUri) MarshalJSON() (data []byte, err error)
func (*BetaDatasetRegisterParamsSourceUri) UnmarshalJSON ¶
func (r *BetaDatasetRegisterParamsSourceUri) UnmarshalJSON(data []byte) error
type BetaDatasetRegisterResponse ¶
type BetaDatasetRegisterResponse struct {
Identifier string `json:"identifier,required"`
// Additional metadata for the dataset
Metadata map[string]BetaDatasetRegisterResponseMetadataUnion `json:"metadata,required"`
ProviderID string `json:"provider_id,required"`
// Purpose of the dataset indicating its intended use
//
// Any of "post-training/messages", "eval/question-answer", "eval/messages-answer".
Purpose BetaDatasetRegisterResponsePurpose `json:"purpose,required"`
// Data source configuration for the dataset
Source BetaDatasetRegisterResponseSourceUnion `json:"source,required"`
// Type of resource, always 'dataset' for datasets
Type constant.Dataset `json:"type,required"`
ProviderResourceID string `json:"provider_resource_id"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Identifier respjson.Field
Metadata respjson.Field
ProviderID respjson.Field
Purpose respjson.Field
Source respjson.Field
Type respjson.Field
ProviderResourceID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Dataset resource for storing and accessing training or evaluation data.
func (BetaDatasetRegisterResponse) RawJSON ¶
func (r BetaDatasetRegisterResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaDatasetRegisterResponse) UnmarshalJSON ¶
func (r *BetaDatasetRegisterResponse) UnmarshalJSON(data []byte) error
type BetaDatasetRegisterResponseMetadataUnion ¶
type BetaDatasetRegisterResponseMetadataUnion 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:"-"`
}
BetaDatasetRegisterResponseMetadataUnion 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 (BetaDatasetRegisterResponseMetadataUnion) AsAnyArray ¶
func (u BetaDatasetRegisterResponseMetadataUnion) AsAnyArray() (v []any)
func (BetaDatasetRegisterResponseMetadataUnion) AsBool ¶
func (u BetaDatasetRegisterResponseMetadataUnion) AsBool() (v bool)
func (BetaDatasetRegisterResponseMetadataUnion) AsFloat ¶
func (u BetaDatasetRegisterResponseMetadataUnion) AsFloat() (v float64)
func (BetaDatasetRegisterResponseMetadataUnion) AsString ¶
func (u BetaDatasetRegisterResponseMetadataUnion) AsString() (v string)
func (BetaDatasetRegisterResponseMetadataUnion) RawJSON ¶
func (u BetaDatasetRegisterResponseMetadataUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaDatasetRegisterResponseMetadataUnion) UnmarshalJSON ¶
func (r *BetaDatasetRegisterResponseMetadataUnion) UnmarshalJSON(data []byte) error
type BetaDatasetRegisterResponsePurpose ¶
type BetaDatasetRegisterResponsePurpose string
Purpose of the dataset indicating its intended use
const ( BetaDatasetRegisterResponsePurposePostTrainingMessages BetaDatasetRegisterResponsePurpose = "post-training/messages" BetaDatasetRegisterResponsePurposeEvalQuestionAnswer BetaDatasetRegisterResponsePurpose = "eval/question-answer" BetaDatasetRegisterResponsePurposeEvalMessagesAnswer BetaDatasetRegisterResponsePurpose = "eval/messages-answer" )
type BetaDatasetRegisterResponseSourceRows ¶
type BetaDatasetRegisterResponseSourceRows struct {
// The dataset is stored in rows. E.g. - [ {"messages": [{"role": "user",
// "content": "Hello, world!"}, {"role": "assistant", "content": "Hello, world!"}]}
// ]
Rows []map[string]BetaDatasetRegisterResponseSourceRowsRowUnion `json:"rows,required"`
Type constant.Rows `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Rows respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A dataset stored in rows.
func (BetaDatasetRegisterResponseSourceRows) RawJSON ¶
func (r BetaDatasetRegisterResponseSourceRows) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaDatasetRegisterResponseSourceRows) UnmarshalJSON ¶
func (r *BetaDatasetRegisterResponseSourceRows) UnmarshalJSON(data []byte) error
type BetaDatasetRegisterResponseSourceRowsRowUnion ¶
type BetaDatasetRegisterResponseSourceRowsRowUnion 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:"-"`
}
BetaDatasetRegisterResponseSourceRowsRowUnion 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 (BetaDatasetRegisterResponseSourceRowsRowUnion) AsAnyArray ¶
func (u BetaDatasetRegisterResponseSourceRowsRowUnion) AsAnyArray() (v []any)
func (BetaDatasetRegisterResponseSourceRowsRowUnion) AsBool ¶
func (u BetaDatasetRegisterResponseSourceRowsRowUnion) AsBool() (v bool)
func (BetaDatasetRegisterResponseSourceRowsRowUnion) AsFloat ¶
func (u BetaDatasetRegisterResponseSourceRowsRowUnion) AsFloat() (v float64)
func (BetaDatasetRegisterResponseSourceRowsRowUnion) AsString ¶
func (u BetaDatasetRegisterResponseSourceRowsRowUnion) AsString() (v string)
func (BetaDatasetRegisterResponseSourceRowsRowUnion) RawJSON ¶
func (u BetaDatasetRegisterResponseSourceRowsRowUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaDatasetRegisterResponseSourceRowsRowUnion) UnmarshalJSON ¶
func (r *BetaDatasetRegisterResponseSourceRowsRowUnion) UnmarshalJSON(data []byte) error
type BetaDatasetRegisterResponseSourceUnion ¶
type BetaDatasetRegisterResponseSourceUnion struct {
// Any of "uri", "rows".
Type string `json:"type"`
// This field is from variant [BetaDatasetRegisterResponseSourceUri].
Uri string `json:"uri"`
// This field is from variant [BetaDatasetRegisterResponseSourceRows].
Rows []map[string]BetaDatasetRegisterResponseSourceRowsRowUnion `json:"rows"`
JSON struct {
Type respjson.Field
Uri respjson.Field
Rows respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
BetaDatasetRegisterResponseSourceUnion contains all possible properties and values from BetaDatasetRegisterResponseSourceUri, BetaDatasetRegisterResponseSourceRows.
Use the BetaDatasetRegisterResponseSourceUnion.AsAny method to switch on the variant.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (BetaDatasetRegisterResponseSourceUnion) AsAny ¶
func (u BetaDatasetRegisterResponseSourceUnion) AsAny() anyBetaDatasetRegisterResponseSource
Use the following switch statement to find the correct variant
switch variant := BetaDatasetRegisterResponseSourceUnion.AsAny().(type) {
case llamastackclient.BetaDatasetRegisterResponseSourceUri:
case llamastackclient.BetaDatasetRegisterResponseSourceRows:
default:
fmt.Errorf("no variant present")
}
func (BetaDatasetRegisterResponseSourceUnion) AsRows ¶
func (u BetaDatasetRegisterResponseSourceUnion) AsRows() (v BetaDatasetRegisterResponseSourceRows)
func (BetaDatasetRegisterResponseSourceUnion) AsUri ¶
func (u BetaDatasetRegisterResponseSourceUnion) AsUri() (v BetaDatasetRegisterResponseSourceUri)
func (BetaDatasetRegisterResponseSourceUnion) RawJSON ¶
func (u BetaDatasetRegisterResponseSourceUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaDatasetRegisterResponseSourceUnion) UnmarshalJSON ¶
func (r *BetaDatasetRegisterResponseSourceUnion) UnmarshalJSON(data []byte) error
type BetaDatasetRegisterResponseSourceUri ¶
type BetaDatasetRegisterResponseSourceUri struct {
Type constant.Uri `json:"type,required"`
// The dataset can be obtained from a URI. E.g. -
// "https://mywebsite.com/mydata.jsonl" - "lsfs://mydata.jsonl" -
// "data:csv;base64,{base64_content}"
Uri string `json:"uri,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Type respjson.Field
Uri respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A dataset that can be obtained from a URI.
func (BetaDatasetRegisterResponseSourceUri) RawJSON ¶
func (r BetaDatasetRegisterResponseSourceUri) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaDatasetRegisterResponseSourceUri) UnmarshalJSON ¶
func (r *BetaDatasetRegisterResponseSourceUri) UnmarshalJSON(data []byte) error
type BetaDatasetService ¶
type BetaDatasetService struct {
Options []option.RequestOption
}
BetaDatasetService contains methods and other services that help with interacting with the llama-stack-client API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewBetaDatasetService method instead.
func NewBetaDatasetService ¶
func NewBetaDatasetService(opts ...option.RequestOption) (r BetaDatasetService)
NewBetaDatasetService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*BetaDatasetService) Appendrows ¶
func (r *BetaDatasetService) Appendrows(ctx context.Context, datasetID string, body BetaDatasetAppendrowsParams, opts ...option.RequestOption) (err error)
Append rows to a dataset.
func (*BetaDatasetService) Get ¶
func (r *BetaDatasetService) Get(ctx context.Context, datasetID string, opts ...option.RequestOption) (res *BetaDatasetGetResponse, err error)
Get a dataset by its ID.
func (*BetaDatasetService) Iterrows ¶
func (r *BetaDatasetService) Iterrows(ctx context.Context, datasetID string, query BetaDatasetIterrowsParams, opts ...option.RequestOption) (res *BetaDatasetIterrowsResponse, err error)
Get a paginated list of rows from a dataset. Uses offset-based pagination where:
- start_index: The starting index (0-based). If None, starts from beginning. - limit: Number of items to return. If None or -1, returns all items.
The response includes:
- data: List of items for the current page. - has_more: Whether there are more items available after this set.
func (*BetaDatasetService) List ¶
func (r *BetaDatasetService) List(ctx context.Context, opts ...option.RequestOption) (res *[]ListDatasetsResponseData, err error)
List all datasets.
func (*BetaDatasetService) Register
deprecated
func (r *BetaDatasetService) Register(ctx context.Context, body BetaDatasetRegisterParams, opts ...option.RequestOption) (res *BetaDatasetRegisterResponse, err error)
Register a new dataset.
Deprecated: deprecated
func (*BetaDatasetService) Unregister
deprecated
func (r *BetaDatasetService) Unregister(ctx context.Context, datasetID string, opts ...option.RequestOption) (err error)
Unregister a dataset by its ID.
Deprecated: deprecated
type BetaService ¶
type BetaService struct {
Options []option.RequestOption
Datasets BetaDatasetService
}
BetaService contains methods and other services that help with interacting with the llama-stack-client API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewBetaService method instead.
func NewBetaService ¶
func NewBetaService(opts ...option.RequestOption) (r BetaService)
NewBetaService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
type ChatCompletionChunk ¶
type ChatCompletionChunk struct {
// The ID of the chat completion
ID string `json:"id,required"`
// List of choices
Choices []ChatCompletionChunkChoice `json:"choices,required"`
// The Unix timestamp in seconds when the chat completion was created
Created int64 `json:"created,required"`
// The model that was used to generate the chat completion
Model string `json:"model,required"`
// The object type, which will be "chat.completion.chunk"
Object constant.ChatCompletionChunk `json:"object,required"`
// Token usage information (typically included in final chunk with stream_options)
Usage ChatCompletionChunkUsage `json:"usage"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Choices respjson.Field
Created respjson.Field
Model respjson.Field
Object respjson.Field
Usage respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Chunk from a streaming response to an OpenAI-compatible chat completion request.
func (ChatCompletionChunk) RawJSON ¶
func (r ChatCompletionChunk) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionChunk) UnmarshalJSON ¶
func (r *ChatCompletionChunk) UnmarshalJSON(data []byte) error
type ChatCompletionChunkChoice ¶
type ChatCompletionChunkChoice struct {
// The delta from the chunk
Delta ChatCompletionChunkChoiceDelta `json:"delta,required"`
// The reason the model stopped generating
FinishReason string `json:"finish_reason,required"`
// The index of the choice
Index int64 `json:"index,required"`
// (Optional) The log probabilities for the tokens in the message
Logprobs ChatCompletionChunkChoiceLogprobs `json:"logprobs"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Delta respjson.Field
FinishReason respjson.Field
Index respjson.Field
Logprobs respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A chunk choice from an OpenAI-compatible chat completion streaming response.
func (ChatCompletionChunkChoice) RawJSON ¶
func (r ChatCompletionChunkChoice) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionChunkChoice) UnmarshalJSON ¶
func (r *ChatCompletionChunkChoice) UnmarshalJSON(data []byte) error
type ChatCompletionChunkChoiceDelta ¶
type ChatCompletionChunkChoiceDelta struct {
// (Optional) The content of the delta
Content string `json:"content"`
// (Optional) The reasoning content from the model (non-standard, for o1/o3 models)
ReasoningContent string `json:"reasoning_content"`
// (Optional) The refusal of the delta
Refusal string `json:"refusal"`
// (Optional) The role of the delta
Role string `json:"role"`
// (Optional) The tool calls of the delta
ToolCalls []ChatCompletionChunkChoiceDeltaToolCall `json:"tool_calls"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Content respjson.Field
ReasoningContent respjson.Field
Refusal respjson.Field
Role respjson.Field
ToolCalls respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The delta from the chunk
func (ChatCompletionChunkChoiceDelta) RawJSON ¶
func (r ChatCompletionChunkChoiceDelta) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionChunkChoiceDelta) UnmarshalJSON ¶
func (r *ChatCompletionChunkChoiceDelta) UnmarshalJSON(data []byte) error
type ChatCompletionChunkChoiceDeltaToolCall ¶
type ChatCompletionChunkChoiceDeltaToolCall struct {
// Must be "function" to identify this as a function call
Type constant.Function `json:"type,required"`
// (Optional) Unique identifier for the tool call
ID string `json:"id"`
// (Optional) Function call details
Function ChatCompletionChunkChoiceDeltaToolCallFunction `json:"function"`
// (Optional) Index of the tool call in the list
Index int64 `json:"index"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Type respjson.Field
ID respjson.Field
Function respjson.Field
Index respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Tool call specification for OpenAI-compatible chat completion responses.
func (ChatCompletionChunkChoiceDeltaToolCall) RawJSON ¶
func (r ChatCompletionChunkChoiceDeltaToolCall) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionChunkChoiceDeltaToolCall) UnmarshalJSON ¶
func (r *ChatCompletionChunkChoiceDeltaToolCall) UnmarshalJSON(data []byte) error
type ChatCompletionChunkChoiceDeltaToolCallFunction ¶
type ChatCompletionChunkChoiceDeltaToolCallFunction struct {
// (Optional) Arguments to pass to the function as a JSON string
Arguments string `json:"arguments"`
// (Optional) Name of the function to call
Name string `json:"name"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Arguments respjson.Field
Name respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
(Optional) Function call details
func (ChatCompletionChunkChoiceDeltaToolCallFunction) RawJSON ¶
func (r ChatCompletionChunkChoiceDeltaToolCallFunction) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionChunkChoiceDeltaToolCallFunction) UnmarshalJSON ¶
func (r *ChatCompletionChunkChoiceDeltaToolCallFunction) UnmarshalJSON(data []byte) error
type ChatCompletionChunkChoiceLogprobs ¶
type ChatCompletionChunkChoiceLogprobs struct {
// (Optional) The log probabilities for the tokens in the message
Content []ChatCompletionChunkChoiceLogprobsContent `json:"content"`
// (Optional) The log probabilities for the tokens in the message
Refusal []ChatCompletionChunkChoiceLogprobsRefusal `json:"refusal"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Content respjson.Field
Refusal respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
(Optional) The log probabilities for the tokens in the message
func (ChatCompletionChunkChoiceLogprobs) RawJSON ¶
func (r ChatCompletionChunkChoiceLogprobs) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionChunkChoiceLogprobs) UnmarshalJSON ¶
func (r *ChatCompletionChunkChoiceLogprobs) UnmarshalJSON(data []byte) error
type ChatCompletionChunkChoiceLogprobsContent ¶
type ChatCompletionChunkChoiceLogprobsContent struct {
Token string `json:"token,required"`
Logprob float64 `json:"logprob,required"`
TopLogprobs []ChatCompletionChunkChoiceLogprobsContentTopLogprob `json:"top_logprobs,required"`
Bytes []int64 `json:"bytes"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Token respjson.Field
Logprob respjson.Field
TopLogprobs respjson.Field
Bytes respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The log probability for a token from an OpenAI-compatible chat completion response.
func (ChatCompletionChunkChoiceLogprobsContent) RawJSON ¶
func (r ChatCompletionChunkChoiceLogprobsContent) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionChunkChoiceLogprobsContent) UnmarshalJSON ¶
func (r *ChatCompletionChunkChoiceLogprobsContent) UnmarshalJSON(data []byte) error
type ChatCompletionChunkChoiceLogprobsContentTopLogprob ¶
type ChatCompletionChunkChoiceLogprobsContentTopLogprob struct {
Token string `json:"token,required"`
Logprob float64 `json:"logprob,required"`
Bytes []int64 `json:"bytes"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Token respjson.Field
Logprob respjson.Field
Bytes respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The top log probability for a token from an OpenAI-compatible chat completion response.
func (ChatCompletionChunkChoiceLogprobsContentTopLogprob) RawJSON ¶
func (r ChatCompletionChunkChoiceLogprobsContentTopLogprob) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionChunkChoiceLogprobsContentTopLogprob) UnmarshalJSON ¶
func (r *ChatCompletionChunkChoiceLogprobsContentTopLogprob) UnmarshalJSON(data []byte) error
type ChatCompletionChunkChoiceLogprobsRefusal ¶
type ChatCompletionChunkChoiceLogprobsRefusal struct {
Token string `json:"token,required"`
Logprob float64 `json:"logprob,required"`
TopLogprobs []ChatCompletionChunkChoiceLogprobsRefusalTopLogprob `json:"top_logprobs,required"`
Bytes []int64 `json:"bytes"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Token respjson.Field
Logprob respjson.Field
TopLogprobs respjson.Field
Bytes respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The log probability for a token from an OpenAI-compatible chat completion response.
func (ChatCompletionChunkChoiceLogprobsRefusal) RawJSON ¶
func (r ChatCompletionChunkChoiceLogprobsRefusal) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionChunkChoiceLogprobsRefusal) UnmarshalJSON ¶
func (r *ChatCompletionChunkChoiceLogprobsRefusal) UnmarshalJSON(data []byte) error
type ChatCompletionChunkChoiceLogprobsRefusalTopLogprob ¶
type ChatCompletionChunkChoiceLogprobsRefusalTopLogprob struct {
Token string `json:"token,required"`
Logprob float64 `json:"logprob,required"`
Bytes []int64 `json:"bytes"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Token respjson.Field
Logprob respjson.Field
Bytes respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The top log probability for a token from an OpenAI-compatible chat completion response.
func (ChatCompletionChunkChoiceLogprobsRefusalTopLogprob) RawJSON ¶
func (r ChatCompletionChunkChoiceLogprobsRefusalTopLogprob) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionChunkChoiceLogprobsRefusalTopLogprob) UnmarshalJSON ¶
func (r *ChatCompletionChunkChoiceLogprobsRefusalTopLogprob) UnmarshalJSON(data []byte) error
type ChatCompletionChunkUsage ¶
type ChatCompletionChunkUsage struct {
// Number of tokens in the completion
CompletionTokens int64 `json:"completion_tokens,required"`
// Number of tokens in the prompt
PromptTokens int64 `json:"prompt_tokens,required"`
// Total tokens used (prompt + completion)
TotalTokens int64 `json:"total_tokens,required"`
// Token details for output tokens in OpenAI chat completion usage.
CompletionTokensDetails ChatCompletionChunkUsageCompletionTokensDetails `json:"completion_tokens_details"`
// Token details for prompt tokens in OpenAI chat completion usage.
PromptTokensDetails ChatCompletionChunkUsagePromptTokensDetails `json:"prompt_tokens_details"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CompletionTokens respjson.Field
PromptTokens respjson.Field
TotalTokens respjson.Field
CompletionTokensDetails respjson.Field
PromptTokensDetails respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Token usage information (typically included in final chunk with stream_options)
func (ChatCompletionChunkUsage) RawJSON ¶
func (r ChatCompletionChunkUsage) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionChunkUsage) UnmarshalJSON ¶
func (r *ChatCompletionChunkUsage) UnmarshalJSON(data []byte) error
type ChatCompletionChunkUsageCompletionTokensDetails ¶
type ChatCompletionChunkUsageCompletionTokensDetails struct {
// Number of tokens used for reasoning (o1/o3 models)
ReasoningTokens int64 `json:"reasoning_tokens"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ReasoningTokens respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Token details for output tokens in OpenAI chat completion usage.
func (ChatCompletionChunkUsageCompletionTokensDetails) RawJSON ¶
func (r ChatCompletionChunkUsageCompletionTokensDetails) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionChunkUsageCompletionTokensDetails) UnmarshalJSON ¶
func (r *ChatCompletionChunkUsageCompletionTokensDetails) UnmarshalJSON(data []byte) error
type ChatCompletionChunkUsagePromptTokensDetails ¶
type ChatCompletionChunkUsagePromptTokensDetails struct {
// Number of tokens retrieved from cache
CachedTokens int64 `json:"cached_tokens"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CachedTokens respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Token details for prompt tokens in OpenAI chat completion usage.
func (ChatCompletionChunkUsagePromptTokensDetails) RawJSON ¶
func (r ChatCompletionChunkUsagePromptTokensDetails) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionChunkUsagePromptTokensDetails) UnmarshalJSON ¶
func (r *ChatCompletionChunkUsagePromptTokensDetails) UnmarshalJSON(data []byte) error
type ChatCompletionGetResponse ¶
type ChatCompletionGetResponse struct {
// The ID of the chat completion
ID string `json:"id,required"`
// List of choices
Choices []ChatCompletionGetResponseChoice `json:"choices,required"`
// The Unix timestamp in seconds when the chat completion was created
Created int64 `json:"created,required"`
InputMessages []ChatCompletionGetResponseInputMessageUnion `json:"input_messages,required"`
// The model that was used to generate the chat completion
Model string `json:"model,required"`
// The object type, which will be "chat.completion"
Object constant.ChatCompletion `json:"object,required"`
// Token usage information for the completion
Usage ChatCompletionGetResponseUsage `json:"usage"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Choices respjson.Field
Created respjson.Field
InputMessages respjson.Field
Model respjson.Field
Object respjson.Field
Usage respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ChatCompletionGetResponse) RawJSON ¶
func (r ChatCompletionGetResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionGetResponse) UnmarshalJSON ¶
func (r *ChatCompletionGetResponse) UnmarshalJSON(data []byte) error
type ChatCompletionGetResponseChoice ¶
type ChatCompletionGetResponseChoice struct {
// The reason the model stopped generating
FinishReason string `json:"finish_reason,required"`
// The index of the choice
Index int64 `json:"index,required"`
// The message from the model
Message ChatCompletionGetResponseChoiceMessageUnion `json:"message,required"`
// (Optional) The log probabilities for the tokens in the message
Logprobs ChatCompletionGetResponseChoiceLogprobs `json:"logprobs"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
FinishReason respjson.Field
Index respjson.Field
Message respjson.Field
Logprobs respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A choice from an OpenAI-compatible chat completion response.
func (ChatCompletionGetResponseChoice) RawJSON ¶
func (r ChatCompletionGetResponseChoice) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionGetResponseChoice) UnmarshalJSON ¶
func (r *ChatCompletionGetResponseChoice) UnmarshalJSON(data []byte) error
type ChatCompletionGetResponseChoiceLogprobs ¶
type ChatCompletionGetResponseChoiceLogprobs struct {
// (Optional) The log probabilities for the tokens in the message
Content []ChatCompletionGetResponseChoiceLogprobsContent `json:"content"`
// (Optional) The log probabilities for the tokens in the message
Refusal []ChatCompletionGetResponseChoiceLogprobsRefusal `json:"refusal"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Content respjson.Field
Refusal respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
(Optional) The log probabilities for the tokens in the message
func (ChatCompletionGetResponseChoiceLogprobs) RawJSON ¶
func (r ChatCompletionGetResponseChoiceLogprobs) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionGetResponseChoiceLogprobs) UnmarshalJSON ¶
func (r *ChatCompletionGetResponseChoiceLogprobs) UnmarshalJSON(data []byte) error
type ChatCompletionGetResponseChoiceLogprobsContent ¶
type ChatCompletionGetResponseChoiceLogprobsContent struct {
Token string `json:"token,required"`
Logprob float64 `json:"logprob,required"`
TopLogprobs []ChatCompletionGetResponseChoiceLogprobsContentTopLogprob `json:"top_logprobs,required"`
Bytes []int64 `json:"bytes"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Token respjson.Field
Logprob respjson.Field
TopLogprobs respjson.Field
Bytes respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The log probability for a token from an OpenAI-compatible chat completion response.
func (ChatCompletionGetResponseChoiceLogprobsContent) RawJSON ¶
func (r ChatCompletionGetResponseChoiceLogprobsContent) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionGetResponseChoiceLogprobsContent) UnmarshalJSON ¶
func (r *ChatCompletionGetResponseChoiceLogprobsContent) UnmarshalJSON(data []byte) error
type ChatCompletionGetResponseChoiceLogprobsContentTopLogprob ¶
type ChatCompletionGetResponseChoiceLogprobsContentTopLogprob struct {
Token string `json:"token,required"`
Logprob float64 `json:"logprob,required"`
Bytes []int64 `json:"bytes"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Token respjson.Field
Logprob respjson.Field
Bytes respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The top log probability for a token from an OpenAI-compatible chat completion response.
func (ChatCompletionGetResponseChoiceLogprobsContentTopLogprob) RawJSON ¶
func (r ChatCompletionGetResponseChoiceLogprobsContentTopLogprob) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionGetResponseChoiceLogprobsContentTopLogprob) UnmarshalJSON ¶
func (r *ChatCompletionGetResponseChoiceLogprobsContentTopLogprob) UnmarshalJSON(data []byte) error
type ChatCompletionGetResponseChoiceLogprobsRefusal ¶
type ChatCompletionGetResponseChoiceLogprobsRefusal struct {
Token string `json:"token,required"`
Logprob float64 `json:"logprob,required"`
TopLogprobs []ChatCompletionGetResponseChoiceLogprobsRefusalTopLogprob `json:"top_logprobs,required"`
Bytes []int64 `json:"bytes"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Token respjson.Field
Logprob respjson.Field
TopLogprobs respjson.Field
Bytes respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The log probability for a token from an OpenAI-compatible chat completion response.
func (ChatCompletionGetResponseChoiceLogprobsRefusal) RawJSON ¶
func (r ChatCompletionGetResponseChoiceLogprobsRefusal) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionGetResponseChoiceLogprobsRefusal) UnmarshalJSON ¶
func (r *ChatCompletionGetResponseChoiceLogprobsRefusal) UnmarshalJSON(data []byte) error
type ChatCompletionGetResponseChoiceLogprobsRefusalTopLogprob ¶
type ChatCompletionGetResponseChoiceLogprobsRefusalTopLogprob struct {
Token string `json:"token,required"`
Logprob float64 `json:"logprob,required"`
Bytes []int64 `json:"bytes"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Token respjson.Field
Logprob respjson.Field
Bytes respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The top log probability for a token from an OpenAI-compatible chat completion response.
func (ChatCompletionGetResponseChoiceLogprobsRefusalTopLogprob) RawJSON ¶
func (r ChatCompletionGetResponseChoiceLogprobsRefusalTopLogprob) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionGetResponseChoiceLogprobsRefusalTopLogprob) UnmarshalJSON ¶
func (r *ChatCompletionGetResponseChoiceLogprobsRefusalTopLogprob) UnmarshalJSON(data []byte) error
type ChatCompletionGetResponseChoiceMessageAssistant ¶
type ChatCompletionGetResponseChoiceMessageAssistant struct {
// Must be "assistant" to identify this as the model's response
Role constant.Assistant `json:"role,required"`
// The content of the model's response
Content ChatCompletionGetResponseChoiceMessageAssistantContentUnion `json:"content"`
// (Optional) The name of the assistant message participant.
Name string `json:"name"`
// List of tool calls. Each tool call is an OpenAIChatCompletionToolCall object.
ToolCalls []ChatCompletionGetResponseChoiceMessageAssistantToolCall `json:"tool_calls"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Role respjson.Field
Content respjson.Field
Name 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 an OpenAI-compatible chat completion request.
func (ChatCompletionGetResponseChoiceMessageAssistant) RawJSON ¶
func (r ChatCompletionGetResponseChoiceMessageAssistant) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionGetResponseChoiceMessageAssistant) UnmarshalJSON ¶
func (r *ChatCompletionGetResponseChoiceMessageAssistant) UnmarshalJSON(data []byte) error
type ChatCompletionGetResponseChoiceMessageAssistantContentArrayItem ¶
type ChatCompletionGetResponseChoiceMessageAssistantContentArrayItem struct {
// The text content of the message
Text string `json:"text,required"`
// Must be "text" to identify this as text content
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:"-"`
}
Text content part for OpenAI-compatible chat completion messages.
func (ChatCompletionGetResponseChoiceMessageAssistantContentArrayItem) RawJSON ¶
func (r ChatCompletionGetResponseChoiceMessageAssistantContentArrayItem) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionGetResponseChoiceMessageAssistantContentArrayItem) UnmarshalJSON ¶
func (r *ChatCompletionGetResponseChoiceMessageAssistantContentArrayItem) UnmarshalJSON(data []byte) error
type ChatCompletionGetResponseChoiceMessageAssistantContentUnion ¶
type ChatCompletionGetResponseChoiceMessageAssistantContentUnion 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
// [[]ChatCompletionGetResponseChoiceMessageAssistantContentArrayItem] instead of
// an object.
OfChatCompletionGetResponseChoiceMessageAssistantContentArray []ChatCompletionGetResponseChoiceMessageAssistantContentArrayItem `json:",inline"`
JSON struct {
OfString respjson.Field
OfChatCompletionGetResponseChoiceMessageAssistantContentArray respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ChatCompletionGetResponseChoiceMessageAssistantContentUnion contains all possible properties and values from [string], [[]ChatCompletionGetResponseChoiceMessageAssistantContentArrayItem].
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 OfChatCompletionGetResponseChoiceMessageAssistantContentArray]
func (ChatCompletionGetResponseChoiceMessageAssistantContentUnion) AsChatCompletionGetResponseChoiceMessageAssistantContentArray ¶
func (u ChatCompletionGetResponseChoiceMessageAssistantContentUnion) AsChatCompletionGetResponseChoiceMessageAssistantContentArray() (v []ChatCompletionGetResponseChoiceMessageAssistantContentArrayItem)
func (ChatCompletionGetResponseChoiceMessageAssistantContentUnion) AsString ¶
func (u ChatCompletionGetResponseChoiceMessageAssistantContentUnion) AsString() (v string)
func (ChatCompletionGetResponseChoiceMessageAssistantContentUnion) RawJSON ¶
func (u ChatCompletionGetResponseChoiceMessageAssistantContentUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionGetResponseChoiceMessageAssistantContentUnion) UnmarshalJSON ¶
func (r *ChatCompletionGetResponseChoiceMessageAssistantContentUnion) UnmarshalJSON(data []byte) error
type ChatCompletionGetResponseChoiceMessageAssistantToolCall ¶
type ChatCompletionGetResponseChoiceMessageAssistantToolCall struct {
// Must be "function" to identify this as a function call
Type constant.Function `json:"type,required"`
// (Optional) Unique identifier for the tool call
ID string `json:"id"`
// (Optional) Function call details
Function ChatCompletionGetResponseChoiceMessageAssistantToolCallFunction `json:"function"`
// (Optional) Index of the tool call in the list
Index int64 `json:"index"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Type respjson.Field
ID respjson.Field
Function respjson.Field
Index respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Tool call specification for OpenAI-compatible chat completion responses.
func (ChatCompletionGetResponseChoiceMessageAssistantToolCall) RawJSON ¶
func (r ChatCompletionGetResponseChoiceMessageAssistantToolCall) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionGetResponseChoiceMessageAssistantToolCall) UnmarshalJSON ¶
func (r *ChatCompletionGetResponseChoiceMessageAssistantToolCall) UnmarshalJSON(data []byte) error
type ChatCompletionGetResponseChoiceMessageAssistantToolCallFunction ¶
type ChatCompletionGetResponseChoiceMessageAssistantToolCallFunction struct {
// (Optional) Arguments to pass to the function as a JSON string
Arguments string `json:"arguments"`
// (Optional) Name of the function to call
Name string `json:"name"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Arguments respjson.Field
Name respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
(Optional) Function call details
func (ChatCompletionGetResponseChoiceMessageAssistantToolCallFunction) RawJSON ¶
func (r ChatCompletionGetResponseChoiceMessageAssistantToolCallFunction) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionGetResponseChoiceMessageAssistantToolCallFunction) UnmarshalJSON ¶
func (r *ChatCompletionGetResponseChoiceMessageAssistantToolCallFunction) UnmarshalJSON(data []byte) error
type ChatCompletionGetResponseChoiceMessageDeveloper ¶
type ChatCompletionGetResponseChoiceMessageDeveloper struct {
// The content of the developer message
Content ChatCompletionGetResponseChoiceMessageDeveloperContentUnion `json:"content,required"`
// Must be "developer" to identify this as a developer message
Role constant.Developer `json:"role,required"`
// (Optional) The name of the developer message participant.
Name string `json:"name"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Content respjson.Field
Role respjson.Field
Name respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A message from the developer in an OpenAI-compatible chat completion request.
func (ChatCompletionGetResponseChoiceMessageDeveloper) RawJSON ¶
func (r ChatCompletionGetResponseChoiceMessageDeveloper) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionGetResponseChoiceMessageDeveloper) UnmarshalJSON ¶
func (r *ChatCompletionGetResponseChoiceMessageDeveloper) UnmarshalJSON(data []byte) error
type ChatCompletionGetResponseChoiceMessageDeveloperContentArrayItem ¶
type ChatCompletionGetResponseChoiceMessageDeveloperContentArrayItem struct {
// The text content of the message
Text string `json:"text,required"`
// Must be "text" to identify this as text content
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:"-"`
}
Text content part for OpenAI-compatible chat completion messages.
func (ChatCompletionGetResponseChoiceMessageDeveloperContentArrayItem) RawJSON ¶
func (r ChatCompletionGetResponseChoiceMessageDeveloperContentArrayItem) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionGetResponseChoiceMessageDeveloperContentArrayItem) UnmarshalJSON ¶
func (r *ChatCompletionGetResponseChoiceMessageDeveloperContentArrayItem) UnmarshalJSON(data []byte) error
type ChatCompletionGetResponseChoiceMessageDeveloperContentUnion ¶
type ChatCompletionGetResponseChoiceMessageDeveloperContentUnion 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
// [[]ChatCompletionGetResponseChoiceMessageDeveloperContentArrayItem] instead of
// an object.
OfChatCompletionGetResponseChoiceMessageDeveloperContentArray []ChatCompletionGetResponseChoiceMessageDeveloperContentArrayItem `json:",inline"`
JSON struct {
OfString respjson.Field
OfChatCompletionGetResponseChoiceMessageDeveloperContentArray respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ChatCompletionGetResponseChoiceMessageDeveloperContentUnion contains all possible properties and values from [string], [[]ChatCompletionGetResponseChoiceMessageDeveloperContentArrayItem].
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 OfChatCompletionGetResponseChoiceMessageDeveloperContentArray]
func (ChatCompletionGetResponseChoiceMessageDeveloperContentUnion) AsChatCompletionGetResponseChoiceMessageDeveloperContentArray ¶
func (u ChatCompletionGetResponseChoiceMessageDeveloperContentUnion) AsChatCompletionGetResponseChoiceMessageDeveloperContentArray() (v []ChatCompletionGetResponseChoiceMessageDeveloperContentArrayItem)
func (ChatCompletionGetResponseChoiceMessageDeveloperContentUnion) AsString ¶
func (u ChatCompletionGetResponseChoiceMessageDeveloperContentUnion) AsString() (v string)
func (ChatCompletionGetResponseChoiceMessageDeveloperContentUnion) RawJSON ¶
func (u ChatCompletionGetResponseChoiceMessageDeveloperContentUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionGetResponseChoiceMessageDeveloperContentUnion) UnmarshalJSON ¶
func (r *ChatCompletionGetResponseChoiceMessageDeveloperContentUnion) UnmarshalJSON(data []byte) error
type ChatCompletionGetResponseChoiceMessageSystem ¶
type ChatCompletionGetResponseChoiceMessageSystem 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 ChatCompletionGetResponseChoiceMessageSystemContentUnion `json:"content,required"`
// Must be "system" to identify this as a system message
Role constant.System `json:"role,required"`
// (Optional) The name of the system message participant.
Name string `json:"name"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Content respjson.Field
Role respjson.Field
Name respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A system message providing instructions or context to the model.
func (ChatCompletionGetResponseChoiceMessageSystem) RawJSON ¶
func (r ChatCompletionGetResponseChoiceMessageSystem) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionGetResponseChoiceMessageSystem) UnmarshalJSON ¶
func (r *ChatCompletionGetResponseChoiceMessageSystem) UnmarshalJSON(data []byte) error
type ChatCompletionGetResponseChoiceMessageSystemContentArrayItem ¶
type ChatCompletionGetResponseChoiceMessageSystemContentArrayItem struct {
// The text content of the message
Text string `json:"text,required"`
// Must be "text" to identify this as text content
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:"-"`
}
Text content part for OpenAI-compatible chat completion messages.
func (ChatCompletionGetResponseChoiceMessageSystemContentArrayItem) RawJSON ¶
func (r ChatCompletionGetResponseChoiceMessageSystemContentArrayItem) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionGetResponseChoiceMessageSystemContentArrayItem) UnmarshalJSON ¶
func (r *ChatCompletionGetResponseChoiceMessageSystemContentArrayItem) UnmarshalJSON(data []byte) error
type ChatCompletionGetResponseChoiceMessageSystemContentUnion ¶
type ChatCompletionGetResponseChoiceMessageSystemContentUnion 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
// [[]ChatCompletionGetResponseChoiceMessageSystemContentArrayItem] instead of an
// object.
OfChatCompletionGetResponseChoiceMessageSystemContentArray []ChatCompletionGetResponseChoiceMessageSystemContentArrayItem `json:",inline"`
JSON struct {
OfString respjson.Field
OfChatCompletionGetResponseChoiceMessageSystemContentArray respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ChatCompletionGetResponseChoiceMessageSystemContentUnion contains all possible properties and values from [string], [[]ChatCompletionGetResponseChoiceMessageSystemContentArrayItem].
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 OfChatCompletionGetResponseChoiceMessageSystemContentArray]
func (ChatCompletionGetResponseChoiceMessageSystemContentUnion) AsChatCompletionGetResponseChoiceMessageSystemContentArray ¶
func (u ChatCompletionGetResponseChoiceMessageSystemContentUnion) AsChatCompletionGetResponseChoiceMessageSystemContentArray() (v []ChatCompletionGetResponseChoiceMessageSystemContentArrayItem)
func (ChatCompletionGetResponseChoiceMessageSystemContentUnion) AsString ¶
func (u ChatCompletionGetResponseChoiceMessageSystemContentUnion) AsString() (v string)
func (ChatCompletionGetResponseChoiceMessageSystemContentUnion) RawJSON ¶
func (u ChatCompletionGetResponseChoiceMessageSystemContentUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionGetResponseChoiceMessageSystemContentUnion) UnmarshalJSON ¶
func (r *ChatCompletionGetResponseChoiceMessageSystemContentUnion) UnmarshalJSON(data []byte) error
type ChatCompletionGetResponseChoiceMessageTool ¶
type ChatCompletionGetResponseChoiceMessageTool struct {
// The response content from the tool
Content ChatCompletionGetResponseChoiceMessageToolContentUnion `json:"content,required"`
// Must be "tool" to identify this as a tool response
Role constant.Tool `json:"role,required"`
// Unique identifier for the tool call this response is for
ToolCallID string `json:"tool_call_id,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Content respjson.Field
Role respjson.Field
ToolCallID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A message representing the result of a tool invocation in an OpenAI-compatible chat completion request.
func (ChatCompletionGetResponseChoiceMessageTool) RawJSON ¶
func (r ChatCompletionGetResponseChoiceMessageTool) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionGetResponseChoiceMessageTool) UnmarshalJSON ¶
func (r *ChatCompletionGetResponseChoiceMessageTool) UnmarshalJSON(data []byte) error
type ChatCompletionGetResponseChoiceMessageToolContentArrayItem ¶
type ChatCompletionGetResponseChoiceMessageToolContentArrayItem struct {
// The text content of the message
Text string `json:"text,required"`
// Must be "text" to identify this as text content
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:"-"`
}
Text content part for OpenAI-compatible chat completion messages.
func (ChatCompletionGetResponseChoiceMessageToolContentArrayItem) RawJSON ¶
func (r ChatCompletionGetResponseChoiceMessageToolContentArrayItem) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionGetResponseChoiceMessageToolContentArrayItem) UnmarshalJSON ¶
func (r *ChatCompletionGetResponseChoiceMessageToolContentArrayItem) UnmarshalJSON(data []byte) error
type ChatCompletionGetResponseChoiceMessageToolContentUnion ¶
type ChatCompletionGetResponseChoiceMessageToolContentUnion 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
// [[]ChatCompletionGetResponseChoiceMessageToolContentArrayItem] instead of an
// object.
OfChatCompletionGetResponseChoiceMessageToolContentArray []ChatCompletionGetResponseChoiceMessageToolContentArrayItem `json:",inline"`
JSON struct {
OfString respjson.Field
OfChatCompletionGetResponseChoiceMessageToolContentArray respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ChatCompletionGetResponseChoiceMessageToolContentUnion contains all possible properties and values from [string], [[]ChatCompletionGetResponseChoiceMessageToolContentArrayItem].
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 OfChatCompletionGetResponseChoiceMessageToolContentArray]
func (ChatCompletionGetResponseChoiceMessageToolContentUnion) AsChatCompletionGetResponseChoiceMessageToolContentArray ¶
func (u ChatCompletionGetResponseChoiceMessageToolContentUnion) AsChatCompletionGetResponseChoiceMessageToolContentArray() (v []ChatCompletionGetResponseChoiceMessageToolContentArrayItem)
func (ChatCompletionGetResponseChoiceMessageToolContentUnion) AsString ¶
func (u ChatCompletionGetResponseChoiceMessageToolContentUnion) AsString() (v string)
func (ChatCompletionGetResponseChoiceMessageToolContentUnion) RawJSON ¶
func (u ChatCompletionGetResponseChoiceMessageToolContentUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionGetResponseChoiceMessageToolContentUnion) UnmarshalJSON ¶
func (r *ChatCompletionGetResponseChoiceMessageToolContentUnion) UnmarshalJSON(data []byte) error
type ChatCompletionGetResponseChoiceMessageUnion ¶
type ChatCompletionGetResponseChoiceMessageUnion struct {
// This field is a union of
// [ChatCompletionGetResponseChoiceMessageUserContentUnion],
// [ChatCompletionGetResponseChoiceMessageSystemContentUnion],
// [ChatCompletionGetResponseChoiceMessageAssistantContentUnion],
// [ChatCompletionGetResponseChoiceMessageToolContentUnion],
// [ChatCompletionGetResponseChoiceMessageDeveloperContentUnion]
Content ChatCompletionGetResponseChoiceMessageUnionContent `json:"content"`
// Any of "user", "system", "assistant", "tool", "developer".
Role string `json:"role"`
Name string `json:"name"`
// This field is from variant [ChatCompletionGetResponseChoiceMessageAssistant].
ToolCalls []ChatCompletionGetResponseChoiceMessageAssistantToolCall `json:"tool_calls"`
// This field is from variant [ChatCompletionGetResponseChoiceMessageTool].
ToolCallID string `json:"tool_call_id"`
JSON struct {
Content respjson.Field
Role respjson.Field
Name respjson.Field
ToolCalls respjson.Field
ToolCallID respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ChatCompletionGetResponseChoiceMessageUnion contains all possible properties and values from ChatCompletionGetResponseChoiceMessageUser, ChatCompletionGetResponseChoiceMessageSystem, ChatCompletionGetResponseChoiceMessageAssistant, ChatCompletionGetResponseChoiceMessageTool, ChatCompletionGetResponseChoiceMessageDeveloper.
Use the ChatCompletionGetResponseChoiceMessageUnion.AsAny method to switch on the variant.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (ChatCompletionGetResponseChoiceMessageUnion) AsAny ¶
func (u ChatCompletionGetResponseChoiceMessageUnion) AsAny() anyChatCompletionGetResponseChoiceMessage
Use the following switch statement to find the correct variant
switch variant := ChatCompletionGetResponseChoiceMessageUnion.AsAny().(type) {
case llamastackclient.ChatCompletionGetResponseChoiceMessageUser:
case llamastackclient.ChatCompletionGetResponseChoiceMessageSystem:
case llamastackclient.ChatCompletionGetResponseChoiceMessageAssistant:
case llamastackclient.ChatCompletionGetResponseChoiceMessageTool:
case llamastackclient.ChatCompletionGetResponseChoiceMessageDeveloper:
default:
fmt.Errorf("no variant present")
}
func (ChatCompletionGetResponseChoiceMessageUnion) AsAssistant ¶
func (u ChatCompletionGetResponseChoiceMessageUnion) AsAssistant() (v ChatCompletionGetResponseChoiceMessageAssistant)
func (ChatCompletionGetResponseChoiceMessageUnion) AsDeveloper ¶
func (u ChatCompletionGetResponseChoiceMessageUnion) AsDeveloper() (v ChatCompletionGetResponseChoiceMessageDeveloper)
func (ChatCompletionGetResponseChoiceMessageUnion) AsSystem ¶
func (u ChatCompletionGetResponseChoiceMessageUnion) AsSystem() (v ChatCompletionGetResponseChoiceMessageSystem)
func (ChatCompletionGetResponseChoiceMessageUnion) AsTool ¶
func (u ChatCompletionGetResponseChoiceMessageUnion) AsTool() (v ChatCompletionGetResponseChoiceMessageTool)
func (ChatCompletionGetResponseChoiceMessageUnion) AsUser ¶
func (u ChatCompletionGetResponseChoiceMessageUnion) AsUser() (v ChatCompletionGetResponseChoiceMessageUser)
func (ChatCompletionGetResponseChoiceMessageUnion) RawJSON ¶
func (u ChatCompletionGetResponseChoiceMessageUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionGetResponseChoiceMessageUnion) UnmarshalJSON ¶
func (r *ChatCompletionGetResponseChoiceMessageUnion) UnmarshalJSON(data []byte) error
type ChatCompletionGetResponseChoiceMessageUnionContent ¶
type ChatCompletionGetResponseChoiceMessageUnionContent 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
// [[]ChatCompletionGetResponseChoiceMessageUserContentArrayItemUnion] instead of
// an object.
OfChatCompletionGetResponseChoiceMessageUserContentArray []ChatCompletionGetResponseChoiceMessageUserContentArrayItemUnion `json:",inline"`
// This field will be present if the value is a
// [[]ChatCompletionGetResponseChoiceMessageSystemContentArrayItem] instead of an
// object.
OfChatCompletionGetResponseChoiceMessageSystemContentArray []ChatCompletionGetResponseChoiceMessageSystemContentArrayItem `json:",inline"`
// This field will be present if the value is a
// [[]ChatCompletionGetResponseChoiceMessageAssistantContentArrayItem] instead of
// an object.
OfChatCompletionGetResponseChoiceMessageAssistantContentArray []ChatCompletionGetResponseChoiceMessageAssistantContentArrayItem `json:",inline"`
// This field will be present if the value is a
// [[]ChatCompletionGetResponseChoiceMessageToolContentArrayItem] instead of an
// object.
OfChatCompletionGetResponseChoiceMessageToolContentArray []ChatCompletionGetResponseChoiceMessageToolContentArrayItem `json:",inline"`
// This field will be present if the value is a
// [[]ChatCompletionGetResponseChoiceMessageDeveloperContentArrayItem] instead of
// an object.
OfChatCompletionGetResponseChoiceMessageDeveloperContentArray []ChatCompletionGetResponseChoiceMessageDeveloperContentArrayItem `json:",inline"`
JSON struct {
OfString respjson.Field
OfChatCompletionGetResponseChoiceMessageUserContentArray respjson.Field
OfChatCompletionGetResponseChoiceMessageSystemContentArray respjson.Field
OfChatCompletionGetResponseChoiceMessageAssistantContentArray respjson.Field
OfChatCompletionGetResponseChoiceMessageToolContentArray respjson.Field
OfChatCompletionGetResponseChoiceMessageDeveloperContentArray respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ChatCompletionGetResponseChoiceMessageUnionContent is an implicit subunion of ChatCompletionGetResponseChoiceMessageUnion. ChatCompletionGetResponseChoiceMessageUnionContent provides convenient access to the sub-properties of the union.
For type safety it is recommended to directly use a variant of the ChatCompletionGetResponseChoiceMessageUnion.
If the underlying value is not a json object, one of the following properties will be valid: OfString OfChatCompletionGetResponseChoiceMessageUserContentArray OfChatCompletionGetResponseChoiceMessageSystemContentArray OfChatCompletionGetResponseChoiceMessageAssistantContentArray OfChatCompletionGetResponseChoiceMessageToolContentArray OfChatCompletionGetResponseChoiceMessageDeveloperContentArray]
func (*ChatCompletionGetResponseChoiceMessageUnionContent) UnmarshalJSON ¶
func (r *ChatCompletionGetResponseChoiceMessageUnionContent) UnmarshalJSON(data []byte) error
type ChatCompletionGetResponseChoiceMessageUser ¶
type ChatCompletionGetResponseChoiceMessageUser struct {
// The content of the message, which can include text and other media
Content ChatCompletionGetResponseChoiceMessageUserContentUnion `json:"content,required"`
// Must be "user" to identify this as a user message
Role constant.User `json:"role,required"`
// (Optional) The name of the user message participant.
Name string `json:"name"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Content respjson.Field
Role respjson.Field
Name respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A message from the user in an OpenAI-compatible chat completion request.
func (ChatCompletionGetResponseChoiceMessageUser) RawJSON ¶
func (r ChatCompletionGetResponseChoiceMessageUser) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionGetResponseChoiceMessageUser) UnmarshalJSON ¶
func (r *ChatCompletionGetResponseChoiceMessageUser) UnmarshalJSON(data []byte) error
type ChatCompletionGetResponseChoiceMessageUserContentArrayItemFile ¶
type ChatCompletionGetResponseChoiceMessageUserContentArrayItemFile struct {
File ChatCompletionGetResponseChoiceMessageUserContentArrayItemFileFile `json:"file,required"`
Type constant.File `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
File respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ChatCompletionGetResponseChoiceMessageUserContentArrayItemFile) RawJSON ¶
func (r ChatCompletionGetResponseChoiceMessageUserContentArrayItemFile) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionGetResponseChoiceMessageUserContentArrayItemFile) UnmarshalJSON ¶
func (r *ChatCompletionGetResponseChoiceMessageUserContentArrayItemFile) UnmarshalJSON(data []byte) error
type ChatCompletionGetResponseChoiceMessageUserContentArrayItemFileFile ¶
type ChatCompletionGetResponseChoiceMessageUserContentArrayItemFileFile struct {
FileData string `json:"file_data"`
FileID string `json:"file_id"`
Filename string `json:"filename"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
FileData respjson.Field
FileID respjson.Field
Filename respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ChatCompletionGetResponseChoiceMessageUserContentArrayItemFileFile) RawJSON ¶
func (r ChatCompletionGetResponseChoiceMessageUserContentArrayItemFileFile) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionGetResponseChoiceMessageUserContentArrayItemFileFile) UnmarshalJSON ¶
func (r *ChatCompletionGetResponseChoiceMessageUserContentArrayItemFileFile) UnmarshalJSON(data []byte) error
type ChatCompletionGetResponseChoiceMessageUserContentArrayItemImageURL ¶
type ChatCompletionGetResponseChoiceMessageUserContentArrayItemImageURL struct {
// Image URL specification and processing details
ImageURL ChatCompletionGetResponseChoiceMessageUserContentArrayItemImageURLImageURL `json:"image_url,required"`
// Must be "image_url" to identify this as image content
Type constant.ImageURL `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ImageURL respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Image content part for OpenAI-compatible chat completion messages.
func (ChatCompletionGetResponseChoiceMessageUserContentArrayItemImageURL) RawJSON ¶
func (r ChatCompletionGetResponseChoiceMessageUserContentArrayItemImageURL) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionGetResponseChoiceMessageUserContentArrayItemImageURL) UnmarshalJSON ¶
func (r *ChatCompletionGetResponseChoiceMessageUserContentArrayItemImageURL) UnmarshalJSON(data []byte) error
type ChatCompletionGetResponseChoiceMessageUserContentArrayItemImageURLImageURL ¶
type ChatCompletionGetResponseChoiceMessageUserContentArrayItemImageURLImageURL struct {
// URL of the image to include in the message
URL string `json:"url,required"`
// (Optional) Level of detail for image processing. Can be "low", "high", or "auto"
Detail string `json:"detail"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
URL respjson.Field
Detail respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Image URL specification and processing details
func (ChatCompletionGetResponseChoiceMessageUserContentArrayItemImageURLImageURL) RawJSON ¶
func (r ChatCompletionGetResponseChoiceMessageUserContentArrayItemImageURLImageURL) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionGetResponseChoiceMessageUserContentArrayItemImageURLImageURL) UnmarshalJSON ¶
func (r *ChatCompletionGetResponseChoiceMessageUserContentArrayItemImageURLImageURL) UnmarshalJSON(data []byte) error
type ChatCompletionGetResponseChoiceMessageUserContentArrayItemText ¶
type ChatCompletionGetResponseChoiceMessageUserContentArrayItemText struct {
// The text content of the message
Text string `json:"text,required"`
// Must be "text" to identify this as text content
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:"-"`
}
Text content part for OpenAI-compatible chat completion messages.
func (ChatCompletionGetResponseChoiceMessageUserContentArrayItemText) RawJSON ¶
func (r ChatCompletionGetResponseChoiceMessageUserContentArrayItemText) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionGetResponseChoiceMessageUserContentArrayItemText) UnmarshalJSON ¶
func (r *ChatCompletionGetResponseChoiceMessageUserContentArrayItemText) UnmarshalJSON(data []byte) error
type ChatCompletionGetResponseChoiceMessageUserContentArrayItemUnion ¶
type ChatCompletionGetResponseChoiceMessageUserContentArrayItemUnion struct {
// This field is from variant
// [ChatCompletionGetResponseChoiceMessageUserContentArrayItemText].
Text string `json:"text"`
// Any of "text", "image_url", "file".
Type string `json:"type"`
// This field is from variant
// [ChatCompletionGetResponseChoiceMessageUserContentArrayItemImageURL].
ImageURL ChatCompletionGetResponseChoiceMessageUserContentArrayItemImageURLImageURL `json:"image_url"`
// This field is from variant
// [ChatCompletionGetResponseChoiceMessageUserContentArrayItemFile].
File ChatCompletionGetResponseChoiceMessageUserContentArrayItemFileFile `json:"file"`
JSON struct {
Text respjson.Field
Type respjson.Field
ImageURL respjson.Field
File respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ChatCompletionGetResponseChoiceMessageUserContentArrayItemUnion contains all possible properties and values from ChatCompletionGetResponseChoiceMessageUserContentArrayItemText, ChatCompletionGetResponseChoiceMessageUserContentArrayItemImageURL, ChatCompletionGetResponseChoiceMessageUserContentArrayItemFile.
Use the ChatCompletionGetResponseChoiceMessageUserContentArrayItemUnion.AsAny method to switch on the variant.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (ChatCompletionGetResponseChoiceMessageUserContentArrayItemUnion) AsAny ¶
func (u ChatCompletionGetResponseChoiceMessageUserContentArrayItemUnion) AsAny() anyChatCompletionGetResponseChoiceMessageUserContentArrayItem
Use the following switch statement to find the correct variant
switch variant := ChatCompletionGetResponseChoiceMessageUserContentArrayItemUnion.AsAny().(type) {
case llamastackclient.ChatCompletionGetResponseChoiceMessageUserContentArrayItemText:
case llamastackclient.ChatCompletionGetResponseChoiceMessageUserContentArrayItemImageURL:
case llamastackclient.ChatCompletionGetResponseChoiceMessageUserContentArrayItemFile:
default:
fmt.Errorf("no variant present")
}
func (ChatCompletionGetResponseChoiceMessageUserContentArrayItemUnion) AsImageURL ¶
func (ChatCompletionGetResponseChoiceMessageUserContentArrayItemUnion) RawJSON ¶
func (u ChatCompletionGetResponseChoiceMessageUserContentArrayItemUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionGetResponseChoiceMessageUserContentArrayItemUnion) UnmarshalJSON ¶
func (r *ChatCompletionGetResponseChoiceMessageUserContentArrayItemUnion) UnmarshalJSON(data []byte) error
type ChatCompletionGetResponseChoiceMessageUserContentUnion ¶
type ChatCompletionGetResponseChoiceMessageUserContentUnion 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
// [[]ChatCompletionGetResponseChoiceMessageUserContentArrayItemUnion] instead of
// an object.
OfChatCompletionGetResponseChoiceMessageUserContentArray []ChatCompletionGetResponseChoiceMessageUserContentArrayItemUnion `json:",inline"`
JSON struct {
OfString respjson.Field
OfChatCompletionGetResponseChoiceMessageUserContentArray respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ChatCompletionGetResponseChoiceMessageUserContentUnion contains all possible properties and values from [string], [[]ChatCompletionGetResponseChoiceMessageUserContentArrayItemUnion].
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 OfChatCompletionGetResponseChoiceMessageUserContentArray]
func (ChatCompletionGetResponseChoiceMessageUserContentUnion) AsChatCompletionGetResponseChoiceMessageUserContentArray ¶
func (u ChatCompletionGetResponseChoiceMessageUserContentUnion) AsChatCompletionGetResponseChoiceMessageUserContentArray() (v []ChatCompletionGetResponseChoiceMessageUserContentArrayItemUnion)
func (ChatCompletionGetResponseChoiceMessageUserContentUnion) AsString ¶
func (u ChatCompletionGetResponseChoiceMessageUserContentUnion) AsString() (v string)
func (ChatCompletionGetResponseChoiceMessageUserContentUnion) RawJSON ¶
func (u ChatCompletionGetResponseChoiceMessageUserContentUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionGetResponseChoiceMessageUserContentUnion) UnmarshalJSON ¶
func (r *ChatCompletionGetResponseChoiceMessageUserContentUnion) UnmarshalJSON(data []byte) error
type ChatCompletionGetResponseInputMessageAssistant ¶
type ChatCompletionGetResponseInputMessageAssistant struct {
// Must be "assistant" to identify this as the model's response
Role constant.Assistant `json:"role,required"`
// The content of the model's response
Content ChatCompletionGetResponseInputMessageAssistantContentUnion `json:"content"`
// (Optional) The name of the assistant message participant.
Name string `json:"name"`
// List of tool calls. Each tool call is an OpenAIChatCompletionToolCall object.
ToolCalls []ChatCompletionGetResponseInputMessageAssistantToolCall `json:"tool_calls"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Role respjson.Field
Content respjson.Field
Name 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 an OpenAI-compatible chat completion request.
func (ChatCompletionGetResponseInputMessageAssistant) RawJSON ¶
func (r ChatCompletionGetResponseInputMessageAssistant) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionGetResponseInputMessageAssistant) UnmarshalJSON ¶
func (r *ChatCompletionGetResponseInputMessageAssistant) UnmarshalJSON(data []byte) error
type ChatCompletionGetResponseInputMessageAssistantContentArrayItem ¶
type ChatCompletionGetResponseInputMessageAssistantContentArrayItem struct {
// The text content of the message
Text string `json:"text,required"`
// Must be "text" to identify this as text content
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:"-"`
}
Text content part for OpenAI-compatible chat completion messages.
func (ChatCompletionGetResponseInputMessageAssistantContentArrayItem) RawJSON ¶
func (r ChatCompletionGetResponseInputMessageAssistantContentArrayItem) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionGetResponseInputMessageAssistantContentArrayItem) UnmarshalJSON ¶
func (r *ChatCompletionGetResponseInputMessageAssistantContentArrayItem) UnmarshalJSON(data []byte) error
type ChatCompletionGetResponseInputMessageAssistantContentUnion ¶
type ChatCompletionGetResponseInputMessageAssistantContentUnion 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
// [[]ChatCompletionGetResponseInputMessageAssistantContentArrayItem] instead of an
// object.
OfChatCompletionGetResponseInputMessageAssistantContentArray []ChatCompletionGetResponseInputMessageAssistantContentArrayItem `json:",inline"`
JSON struct {
OfString respjson.Field
OfChatCompletionGetResponseInputMessageAssistantContentArray respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ChatCompletionGetResponseInputMessageAssistantContentUnion contains all possible properties and values from [string], [[]ChatCompletionGetResponseInputMessageAssistantContentArrayItem].
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 OfChatCompletionGetResponseInputMessageAssistantContentArray]
func (ChatCompletionGetResponseInputMessageAssistantContentUnion) AsChatCompletionGetResponseInputMessageAssistantContentArray ¶
func (u ChatCompletionGetResponseInputMessageAssistantContentUnion) AsChatCompletionGetResponseInputMessageAssistantContentArray() (v []ChatCompletionGetResponseInputMessageAssistantContentArrayItem)
func (ChatCompletionGetResponseInputMessageAssistantContentUnion) AsString ¶
func (u ChatCompletionGetResponseInputMessageAssistantContentUnion) AsString() (v string)
func (ChatCompletionGetResponseInputMessageAssistantContentUnion) RawJSON ¶
func (u ChatCompletionGetResponseInputMessageAssistantContentUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionGetResponseInputMessageAssistantContentUnion) UnmarshalJSON ¶
func (r *ChatCompletionGetResponseInputMessageAssistantContentUnion) UnmarshalJSON(data []byte) error
type ChatCompletionGetResponseInputMessageAssistantToolCall ¶
type ChatCompletionGetResponseInputMessageAssistantToolCall struct {
// Must be "function" to identify this as a function call
Type constant.Function `json:"type,required"`
// (Optional) Unique identifier for the tool call
ID string `json:"id"`
// (Optional) Function call details
Function ChatCompletionGetResponseInputMessageAssistantToolCallFunction `json:"function"`
// (Optional) Index of the tool call in the list
Index int64 `json:"index"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Type respjson.Field
ID respjson.Field
Function respjson.Field
Index respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Tool call specification for OpenAI-compatible chat completion responses.
func (ChatCompletionGetResponseInputMessageAssistantToolCall) RawJSON ¶
func (r ChatCompletionGetResponseInputMessageAssistantToolCall) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionGetResponseInputMessageAssistantToolCall) UnmarshalJSON ¶
func (r *ChatCompletionGetResponseInputMessageAssistantToolCall) UnmarshalJSON(data []byte) error
type ChatCompletionGetResponseInputMessageAssistantToolCallFunction ¶
type ChatCompletionGetResponseInputMessageAssistantToolCallFunction struct {
// (Optional) Arguments to pass to the function as a JSON string
Arguments string `json:"arguments"`
// (Optional) Name of the function to call
Name string `json:"name"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Arguments respjson.Field
Name respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
(Optional) Function call details
func (ChatCompletionGetResponseInputMessageAssistantToolCallFunction) RawJSON ¶
func (r ChatCompletionGetResponseInputMessageAssistantToolCallFunction) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionGetResponseInputMessageAssistantToolCallFunction) UnmarshalJSON ¶
func (r *ChatCompletionGetResponseInputMessageAssistantToolCallFunction) UnmarshalJSON(data []byte) error
type ChatCompletionGetResponseInputMessageDeveloper ¶
type ChatCompletionGetResponseInputMessageDeveloper struct {
// The content of the developer message
Content ChatCompletionGetResponseInputMessageDeveloperContentUnion `json:"content,required"`
// Must be "developer" to identify this as a developer message
Role constant.Developer `json:"role,required"`
// (Optional) The name of the developer message participant.
Name string `json:"name"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Content respjson.Field
Role respjson.Field
Name respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A message from the developer in an OpenAI-compatible chat completion request.
func (ChatCompletionGetResponseInputMessageDeveloper) RawJSON ¶
func (r ChatCompletionGetResponseInputMessageDeveloper) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionGetResponseInputMessageDeveloper) UnmarshalJSON ¶
func (r *ChatCompletionGetResponseInputMessageDeveloper) UnmarshalJSON(data []byte) error
type ChatCompletionGetResponseInputMessageDeveloperContentArrayItem ¶
type ChatCompletionGetResponseInputMessageDeveloperContentArrayItem struct {
// The text content of the message
Text string `json:"text,required"`
// Must be "text" to identify this as text content
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:"-"`
}
Text content part for OpenAI-compatible chat completion messages.
func (ChatCompletionGetResponseInputMessageDeveloperContentArrayItem) RawJSON ¶
func (r ChatCompletionGetResponseInputMessageDeveloperContentArrayItem) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionGetResponseInputMessageDeveloperContentArrayItem) UnmarshalJSON ¶
func (r *ChatCompletionGetResponseInputMessageDeveloperContentArrayItem) UnmarshalJSON(data []byte) error
type ChatCompletionGetResponseInputMessageDeveloperContentUnion ¶
type ChatCompletionGetResponseInputMessageDeveloperContentUnion 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
// [[]ChatCompletionGetResponseInputMessageDeveloperContentArrayItem] instead of an
// object.
OfChatCompletionGetResponseInputMessageDeveloperContentArray []ChatCompletionGetResponseInputMessageDeveloperContentArrayItem `json:",inline"`
JSON struct {
OfString respjson.Field
OfChatCompletionGetResponseInputMessageDeveloperContentArray respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ChatCompletionGetResponseInputMessageDeveloperContentUnion contains all possible properties and values from [string], [[]ChatCompletionGetResponseInputMessageDeveloperContentArrayItem].
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 OfChatCompletionGetResponseInputMessageDeveloperContentArray]
func (ChatCompletionGetResponseInputMessageDeveloperContentUnion) AsChatCompletionGetResponseInputMessageDeveloperContentArray ¶
func (u ChatCompletionGetResponseInputMessageDeveloperContentUnion) AsChatCompletionGetResponseInputMessageDeveloperContentArray() (v []ChatCompletionGetResponseInputMessageDeveloperContentArrayItem)
func (ChatCompletionGetResponseInputMessageDeveloperContentUnion) AsString ¶
func (u ChatCompletionGetResponseInputMessageDeveloperContentUnion) AsString() (v string)
func (ChatCompletionGetResponseInputMessageDeveloperContentUnion) RawJSON ¶
func (u ChatCompletionGetResponseInputMessageDeveloperContentUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionGetResponseInputMessageDeveloperContentUnion) UnmarshalJSON ¶
func (r *ChatCompletionGetResponseInputMessageDeveloperContentUnion) UnmarshalJSON(data []byte) error
type ChatCompletionGetResponseInputMessageSystem ¶
type ChatCompletionGetResponseInputMessageSystem 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 ChatCompletionGetResponseInputMessageSystemContentUnion `json:"content,required"`
// Must be "system" to identify this as a system message
Role constant.System `json:"role,required"`
// (Optional) The name of the system message participant.
Name string `json:"name"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Content respjson.Field
Role respjson.Field
Name respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A system message providing instructions or context to the model.
func (ChatCompletionGetResponseInputMessageSystem) RawJSON ¶
func (r ChatCompletionGetResponseInputMessageSystem) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionGetResponseInputMessageSystem) UnmarshalJSON ¶
func (r *ChatCompletionGetResponseInputMessageSystem) UnmarshalJSON(data []byte) error
type ChatCompletionGetResponseInputMessageSystemContentArrayItem ¶
type ChatCompletionGetResponseInputMessageSystemContentArrayItem struct {
// The text content of the message
Text string `json:"text,required"`
// Must be "text" to identify this as text content
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:"-"`
}
Text content part for OpenAI-compatible chat completion messages.
func (ChatCompletionGetResponseInputMessageSystemContentArrayItem) RawJSON ¶
func (r ChatCompletionGetResponseInputMessageSystemContentArrayItem) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionGetResponseInputMessageSystemContentArrayItem) UnmarshalJSON ¶
func (r *ChatCompletionGetResponseInputMessageSystemContentArrayItem) UnmarshalJSON(data []byte) error
type ChatCompletionGetResponseInputMessageSystemContentUnion ¶
type ChatCompletionGetResponseInputMessageSystemContentUnion 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
// [[]ChatCompletionGetResponseInputMessageSystemContentArrayItem] instead of an
// object.
OfChatCompletionGetResponseInputMessageSystemContentArray []ChatCompletionGetResponseInputMessageSystemContentArrayItem `json:",inline"`
JSON struct {
OfString respjson.Field
OfChatCompletionGetResponseInputMessageSystemContentArray respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ChatCompletionGetResponseInputMessageSystemContentUnion contains all possible properties and values from [string], [[]ChatCompletionGetResponseInputMessageSystemContentArrayItem].
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 OfChatCompletionGetResponseInputMessageSystemContentArray]
func (ChatCompletionGetResponseInputMessageSystemContentUnion) AsChatCompletionGetResponseInputMessageSystemContentArray ¶
func (u ChatCompletionGetResponseInputMessageSystemContentUnion) AsChatCompletionGetResponseInputMessageSystemContentArray() (v []ChatCompletionGetResponseInputMessageSystemContentArrayItem)
func (ChatCompletionGetResponseInputMessageSystemContentUnion) AsString ¶
func (u ChatCompletionGetResponseInputMessageSystemContentUnion) AsString() (v string)
func (ChatCompletionGetResponseInputMessageSystemContentUnion) RawJSON ¶
func (u ChatCompletionGetResponseInputMessageSystemContentUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionGetResponseInputMessageSystemContentUnion) UnmarshalJSON ¶
func (r *ChatCompletionGetResponseInputMessageSystemContentUnion) UnmarshalJSON(data []byte) error
type ChatCompletionGetResponseInputMessageTool ¶
type ChatCompletionGetResponseInputMessageTool struct {
// The response content from the tool
Content ChatCompletionGetResponseInputMessageToolContentUnion `json:"content,required"`
// Must be "tool" to identify this as a tool response
Role constant.Tool `json:"role,required"`
// Unique identifier for the tool call this response is for
ToolCallID string `json:"tool_call_id,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Content respjson.Field
Role respjson.Field
ToolCallID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A message representing the result of a tool invocation in an OpenAI-compatible chat completion request.
func (ChatCompletionGetResponseInputMessageTool) RawJSON ¶
func (r ChatCompletionGetResponseInputMessageTool) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionGetResponseInputMessageTool) UnmarshalJSON ¶
func (r *ChatCompletionGetResponseInputMessageTool) UnmarshalJSON(data []byte) error
type ChatCompletionGetResponseInputMessageToolContentArrayItem ¶
type ChatCompletionGetResponseInputMessageToolContentArrayItem struct {
// The text content of the message
Text string `json:"text,required"`
// Must be "text" to identify this as text content
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:"-"`
}
Text content part for OpenAI-compatible chat completion messages.
func (ChatCompletionGetResponseInputMessageToolContentArrayItem) RawJSON ¶
func (r ChatCompletionGetResponseInputMessageToolContentArrayItem) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionGetResponseInputMessageToolContentArrayItem) UnmarshalJSON ¶
func (r *ChatCompletionGetResponseInputMessageToolContentArrayItem) UnmarshalJSON(data []byte) error
type ChatCompletionGetResponseInputMessageToolContentUnion ¶
type ChatCompletionGetResponseInputMessageToolContentUnion 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
// [[]ChatCompletionGetResponseInputMessageToolContentArrayItem] instead of an
// object.
OfChatCompletionGetResponseInputMessageToolContentArray []ChatCompletionGetResponseInputMessageToolContentArrayItem `json:",inline"`
JSON struct {
OfString respjson.Field
OfChatCompletionGetResponseInputMessageToolContentArray respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ChatCompletionGetResponseInputMessageToolContentUnion contains all possible properties and values from [string], [[]ChatCompletionGetResponseInputMessageToolContentArrayItem].
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 OfChatCompletionGetResponseInputMessageToolContentArray]
func (ChatCompletionGetResponseInputMessageToolContentUnion) AsChatCompletionGetResponseInputMessageToolContentArray ¶
func (u ChatCompletionGetResponseInputMessageToolContentUnion) AsChatCompletionGetResponseInputMessageToolContentArray() (v []ChatCompletionGetResponseInputMessageToolContentArrayItem)
func (ChatCompletionGetResponseInputMessageToolContentUnion) AsString ¶
func (u ChatCompletionGetResponseInputMessageToolContentUnion) AsString() (v string)
func (ChatCompletionGetResponseInputMessageToolContentUnion) RawJSON ¶
func (u ChatCompletionGetResponseInputMessageToolContentUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionGetResponseInputMessageToolContentUnion) UnmarshalJSON ¶
func (r *ChatCompletionGetResponseInputMessageToolContentUnion) UnmarshalJSON(data []byte) error
type ChatCompletionGetResponseInputMessageUnion ¶
type ChatCompletionGetResponseInputMessageUnion struct {
// This field is a union of
// [ChatCompletionGetResponseInputMessageUserContentUnion],
// [ChatCompletionGetResponseInputMessageSystemContentUnion],
// [ChatCompletionGetResponseInputMessageAssistantContentUnion],
// [ChatCompletionGetResponseInputMessageToolContentUnion],
// [ChatCompletionGetResponseInputMessageDeveloperContentUnion]
Content ChatCompletionGetResponseInputMessageUnionContent `json:"content"`
// Any of "user", "system", "assistant", "tool", "developer".
Role string `json:"role"`
Name string `json:"name"`
// This field is from variant [ChatCompletionGetResponseInputMessageAssistant].
ToolCalls []ChatCompletionGetResponseInputMessageAssistantToolCall `json:"tool_calls"`
// This field is from variant [ChatCompletionGetResponseInputMessageTool].
ToolCallID string `json:"tool_call_id"`
JSON struct {
Content respjson.Field
Role respjson.Field
Name respjson.Field
ToolCalls respjson.Field
ToolCallID respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ChatCompletionGetResponseInputMessageUnion contains all possible properties and values from ChatCompletionGetResponseInputMessageUser, ChatCompletionGetResponseInputMessageSystem, ChatCompletionGetResponseInputMessageAssistant, ChatCompletionGetResponseInputMessageTool, ChatCompletionGetResponseInputMessageDeveloper.
Use the ChatCompletionGetResponseInputMessageUnion.AsAny method to switch on the variant.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (ChatCompletionGetResponseInputMessageUnion) AsAny ¶
func (u ChatCompletionGetResponseInputMessageUnion) AsAny() anyChatCompletionGetResponseInputMessage
Use the following switch statement to find the correct variant
switch variant := ChatCompletionGetResponseInputMessageUnion.AsAny().(type) {
case llamastackclient.ChatCompletionGetResponseInputMessageUser:
case llamastackclient.ChatCompletionGetResponseInputMessageSystem:
case llamastackclient.ChatCompletionGetResponseInputMessageAssistant:
case llamastackclient.ChatCompletionGetResponseInputMessageTool:
case llamastackclient.ChatCompletionGetResponseInputMessageDeveloper:
default:
fmt.Errorf("no variant present")
}
func (ChatCompletionGetResponseInputMessageUnion) AsAssistant ¶
func (u ChatCompletionGetResponseInputMessageUnion) AsAssistant() (v ChatCompletionGetResponseInputMessageAssistant)
func (ChatCompletionGetResponseInputMessageUnion) AsDeveloper ¶
func (u ChatCompletionGetResponseInputMessageUnion) AsDeveloper() (v ChatCompletionGetResponseInputMessageDeveloper)
func (ChatCompletionGetResponseInputMessageUnion) AsSystem ¶
func (u ChatCompletionGetResponseInputMessageUnion) AsSystem() (v ChatCompletionGetResponseInputMessageSystem)
func (ChatCompletionGetResponseInputMessageUnion) AsTool ¶
func (u ChatCompletionGetResponseInputMessageUnion) AsTool() (v ChatCompletionGetResponseInputMessageTool)
func (ChatCompletionGetResponseInputMessageUnion) AsUser ¶
func (u ChatCompletionGetResponseInputMessageUnion) AsUser() (v ChatCompletionGetResponseInputMessageUser)
func (ChatCompletionGetResponseInputMessageUnion) RawJSON ¶
func (u ChatCompletionGetResponseInputMessageUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionGetResponseInputMessageUnion) UnmarshalJSON ¶
func (r *ChatCompletionGetResponseInputMessageUnion) UnmarshalJSON(data []byte) error
type ChatCompletionGetResponseInputMessageUnionContent ¶
type ChatCompletionGetResponseInputMessageUnionContent 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
// [[]ChatCompletionGetResponseInputMessageUserContentArrayItemUnion] instead of an
// object.
OfChatCompletionGetResponseInputMessageUserContentArray []ChatCompletionGetResponseInputMessageUserContentArrayItemUnion `json:",inline"`
// This field will be present if the value is a
// [[]ChatCompletionGetResponseInputMessageSystemContentArrayItem] instead of an
// object.
OfChatCompletionGetResponseInputMessageSystemContentArray []ChatCompletionGetResponseInputMessageSystemContentArrayItem `json:",inline"`
// This field will be present if the value is a
// [[]ChatCompletionGetResponseInputMessageAssistantContentArrayItem] instead of an
// object.
OfChatCompletionGetResponseInputMessageAssistantContentArray []ChatCompletionGetResponseInputMessageAssistantContentArrayItem `json:",inline"`
// This field will be present if the value is a
// [[]ChatCompletionGetResponseInputMessageToolContentArrayItem] instead of an
// object.
OfChatCompletionGetResponseInputMessageToolContentArray []ChatCompletionGetResponseInputMessageToolContentArrayItem `json:",inline"`
// This field will be present if the value is a
// [[]ChatCompletionGetResponseInputMessageDeveloperContentArrayItem] instead of an
// object.
OfChatCompletionGetResponseInputMessageDeveloperContentArray []ChatCompletionGetResponseInputMessageDeveloperContentArrayItem `json:",inline"`
JSON struct {
OfString respjson.Field
OfChatCompletionGetResponseInputMessageUserContentArray respjson.Field
OfChatCompletionGetResponseInputMessageSystemContentArray respjson.Field
OfChatCompletionGetResponseInputMessageAssistantContentArray respjson.Field
OfChatCompletionGetResponseInputMessageToolContentArray respjson.Field
OfChatCompletionGetResponseInputMessageDeveloperContentArray respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ChatCompletionGetResponseInputMessageUnionContent is an implicit subunion of ChatCompletionGetResponseInputMessageUnion. ChatCompletionGetResponseInputMessageUnionContent provides convenient access to the sub-properties of the union.
For type safety it is recommended to directly use a variant of the ChatCompletionGetResponseInputMessageUnion.
If the underlying value is not a json object, one of the following properties will be valid: OfString OfChatCompletionGetResponseInputMessageUserContentArray OfChatCompletionGetResponseInputMessageSystemContentArray OfChatCompletionGetResponseInputMessageAssistantContentArray OfChatCompletionGetResponseInputMessageToolContentArray OfChatCompletionGetResponseInputMessageDeveloperContentArray]
func (*ChatCompletionGetResponseInputMessageUnionContent) UnmarshalJSON ¶
func (r *ChatCompletionGetResponseInputMessageUnionContent) UnmarshalJSON(data []byte) error
type ChatCompletionGetResponseInputMessageUser ¶
type ChatCompletionGetResponseInputMessageUser struct {
// The content of the message, which can include text and other media
Content ChatCompletionGetResponseInputMessageUserContentUnion `json:"content,required"`
// Must be "user" to identify this as a user message
Role constant.User `json:"role,required"`
// (Optional) The name of the user message participant.
Name string `json:"name"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Content respjson.Field
Role respjson.Field
Name respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A message from the user in an OpenAI-compatible chat completion request.
func (ChatCompletionGetResponseInputMessageUser) RawJSON ¶
func (r ChatCompletionGetResponseInputMessageUser) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionGetResponseInputMessageUser) UnmarshalJSON ¶
func (r *ChatCompletionGetResponseInputMessageUser) UnmarshalJSON(data []byte) error
type ChatCompletionGetResponseInputMessageUserContentArrayItemFile ¶
type ChatCompletionGetResponseInputMessageUserContentArrayItemFile struct {
File ChatCompletionGetResponseInputMessageUserContentArrayItemFileFile `json:"file,required"`
Type constant.File `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
File respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ChatCompletionGetResponseInputMessageUserContentArrayItemFile) RawJSON ¶
func (r ChatCompletionGetResponseInputMessageUserContentArrayItemFile) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionGetResponseInputMessageUserContentArrayItemFile) UnmarshalJSON ¶
func (r *ChatCompletionGetResponseInputMessageUserContentArrayItemFile) UnmarshalJSON(data []byte) error
type ChatCompletionGetResponseInputMessageUserContentArrayItemFileFile ¶
type ChatCompletionGetResponseInputMessageUserContentArrayItemFileFile struct {
FileData string `json:"file_data"`
FileID string `json:"file_id"`
Filename string `json:"filename"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
FileData respjson.Field
FileID respjson.Field
Filename respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ChatCompletionGetResponseInputMessageUserContentArrayItemFileFile) RawJSON ¶
func (r ChatCompletionGetResponseInputMessageUserContentArrayItemFileFile) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionGetResponseInputMessageUserContentArrayItemFileFile) UnmarshalJSON ¶
func (r *ChatCompletionGetResponseInputMessageUserContentArrayItemFileFile) UnmarshalJSON(data []byte) error
type ChatCompletionGetResponseInputMessageUserContentArrayItemImageURL ¶
type ChatCompletionGetResponseInputMessageUserContentArrayItemImageURL struct {
// Image URL specification and processing details
ImageURL ChatCompletionGetResponseInputMessageUserContentArrayItemImageURLImageURL `json:"image_url,required"`
// Must be "image_url" to identify this as image content
Type constant.ImageURL `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ImageURL respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Image content part for OpenAI-compatible chat completion messages.
func (ChatCompletionGetResponseInputMessageUserContentArrayItemImageURL) RawJSON ¶
func (r ChatCompletionGetResponseInputMessageUserContentArrayItemImageURL) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionGetResponseInputMessageUserContentArrayItemImageURL) UnmarshalJSON ¶
func (r *ChatCompletionGetResponseInputMessageUserContentArrayItemImageURL) UnmarshalJSON(data []byte) error
type ChatCompletionGetResponseInputMessageUserContentArrayItemImageURLImageURL ¶
type ChatCompletionGetResponseInputMessageUserContentArrayItemImageURLImageURL struct {
// URL of the image to include in the message
URL string `json:"url,required"`
// (Optional) Level of detail for image processing. Can be "low", "high", or "auto"
Detail string `json:"detail"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
URL respjson.Field
Detail respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Image URL specification and processing details
func (ChatCompletionGetResponseInputMessageUserContentArrayItemImageURLImageURL) RawJSON ¶
func (r ChatCompletionGetResponseInputMessageUserContentArrayItemImageURLImageURL) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionGetResponseInputMessageUserContentArrayItemImageURLImageURL) UnmarshalJSON ¶
func (r *ChatCompletionGetResponseInputMessageUserContentArrayItemImageURLImageURL) UnmarshalJSON(data []byte) error
type ChatCompletionGetResponseInputMessageUserContentArrayItemText ¶
type ChatCompletionGetResponseInputMessageUserContentArrayItemText struct {
// The text content of the message
Text string `json:"text,required"`
// Must be "text" to identify this as text content
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:"-"`
}
Text content part for OpenAI-compatible chat completion messages.
func (ChatCompletionGetResponseInputMessageUserContentArrayItemText) RawJSON ¶
func (r ChatCompletionGetResponseInputMessageUserContentArrayItemText) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionGetResponseInputMessageUserContentArrayItemText) UnmarshalJSON ¶
func (r *ChatCompletionGetResponseInputMessageUserContentArrayItemText) UnmarshalJSON(data []byte) error
type ChatCompletionGetResponseInputMessageUserContentArrayItemUnion ¶
type ChatCompletionGetResponseInputMessageUserContentArrayItemUnion struct {
// This field is from variant
// [ChatCompletionGetResponseInputMessageUserContentArrayItemText].
Text string `json:"text"`
// Any of "text", "image_url", "file".
Type string `json:"type"`
// This field is from variant
// [ChatCompletionGetResponseInputMessageUserContentArrayItemImageURL].
ImageURL ChatCompletionGetResponseInputMessageUserContentArrayItemImageURLImageURL `json:"image_url"`
// This field is from variant
// [ChatCompletionGetResponseInputMessageUserContentArrayItemFile].
File ChatCompletionGetResponseInputMessageUserContentArrayItemFileFile `json:"file"`
JSON struct {
Text respjson.Field
Type respjson.Field
ImageURL respjson.Field
File respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ChatCompletionGetResponseInputMessageUserContentArrayItemUnion contains all possible properties and values from ChatCompletionGetResponseInputMessageUserContentArrayItemText, ChatCompletionGetResponseInputMessageUserContentArrayItemImageURL, ChatCompletionGetResponseInputMessageUserContentArrayItemFile.
Use the ChatCompletionGetResponseInputMessageUserContentArrayItemUnion.AsAny method to switch on the variant.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (ChatCompletionGetResponseInputMessageUserContentArrayItemUnion) AsAny ¶
func (u ChatCompletionGetResponseInputMessageUserContentArrayItemUnion) AsAny() anyChatCompletionGetResponseInputMessageUserContentArrayItem
Use the following switch statement to find the correct variant
switch variant := ChatCompletionGetResponseInputMessageUserContentArrayItemUnion.AsAny().(type) {
case llamastackclient.ChatCompletionGetResponseInputMessageUserContentArrayItemText:
case llamastackclient.ChatCompletionGetResponseInputMessageUserContentArrayItemImageURL:
case llamastackclient.ChatCompletionGetResponseInputMessageUserContentArrayItemFile:
default:
fmt.Errorf("no variant present")
}
func (ChatCompletionGetResponseInputMessageUserContentArrayItemUnion) AsImageURL ¶
func (ChatCompletionGetResponseInputMessageUserContentArrayItemUnion) RawJSON ¶
func (u ChatCompletionGetResponseInputMessageUserContentArrayItemUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionGetResponseInputMessageUserContentArrayItemUnion) UnmarshalJSON ¶
func (r *ChatCompletionGetResponseInputMessageUserContentArrayItemUnion) UnmarshalJSON(data []byte) error
type ChatCompletionGetResponseInputMessageUserContentUnion ¶
type ChatCompletionGetResponseInputMessageUserContentUnion 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
// [[]ChatCompletionGetResponseInputMessageUserContentArrayItemUnion] instead of an
// object.
OfChatCompletionGetResponseInputMessageUserContentArray []ChatCompletionGetResponseInputMessageUserContentArrayItemUnion `json:",inline"`
JSON struct {
OfString respjson.Field
OfChatCompletionGetResponseInputMessageUserContentArray respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ChatCompletionGetResponseInputMessageUserContentUnion contains all possible properties and values from [string], [[]ChatCompletionGetResponseInputMessageUserContentArrayItemUnion].
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 OfChatCompletionGetResponseInputMessageUserContentArray]
func (ChatCompletionGetResponseInputMessageUserContentUnion) AsChatCompletionGetResponseInputMessageUserContentArray ¶
func (u ChatCompletionGetResponseInputMessageUserContentUnion) AsChatCompletionGetResponseInputMessageUserContentArray() (v []ChatCompletionGetResponseInputMessageUserContentArrayItemUnion)
func (ChatCompletionGetResponseInputMessageUserContentUnion) AsString ¶
func (u ChatCompletionGetResponseInputMessageUserContentUnion) AsString() (v string)
func (ChatCompletionGetResponseInputMessageUserContentUnion) RawJSON ¶
func (u ChatCompletionGetResponseInputMessageUserContentUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionGetResponseInputMessageUserContentUnion) UnmarshalJSON ¶
func (r *ChatCompletionGetResponseInputMessageUserContentUnion) UnmarshalJSON(data []byte) error
type ChatCompletionGetResponseUsage ¶
type ChatCompletionGetResponseUsage struct {
// Number of tokens in the completion
CompletionTokens int64 `json:"completion_tokens,required"`
// Number of tokens in the prompt
PromptTokens int64 `json:"prompt_tokens,required"`
// Total tokens used (prompt + completion)
TotalTokens int64 `json:"total_tokens,required"`
// Token details for output tokens in OpenAI chat completion usage.
CompletionTokensDetails ChatCompletionGetResponseUsageCompletionTokensDetails `json:"completion_tokens_details"`
// Token details for prompt tokens in OpenAI chat completion usage.
PromptTokensDetails ChatCompletionGetResponseUsagePromptTokensDetails `json:"prompt_tokens_details"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CompletionTokens respjson.Field
PromptTokens respjson.Field
TotalTokens respjson.Field
CompletionTokensDetails respjson.Field
PromptTokensDetails respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Token usage information for the completion
func (ChatCompletionGetResponseUsage) RawJSON ¶
func (r ChatCompletionGetResponseUsage) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionGetResponseUsage) UnmarshalJSON ¶
func (r *ChatCompletionGetResponseUsage) UnmarshalJSON(data []byte) error
type ChatCompletionGetResponseUsageCompletionTokensDetails ¶
type ChatCompletionGetResponseUsageCompletionTokensDetails struct {
// Number of tokens used for reasoning (o1/o3 models)
ReasoningTokens int64 `json:"reasoning_tokens"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ReasoningTokens respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Token details for output tokens in OpenAI chat completion usage.
func (ChatCompletionGetResponseUsageCompletionTokensDetails) RawJSON ¶
func (r ChatCompletionGetResponseUsageCompletionTokensDetails) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionGetResponseUsageCompletionTokensDetails) UnmarshalJSON ¶
func (r *ChatCompletionGetResponseUsageCompletionTokensDetails) UnmarshalJSON(data []byte) error
type ChatCompletionGetResponseUsagePromptTokensDetails ¶
type ChatCompletionGetResponseUsagePromptTokensDetails struct {
// Number of tokens retrieved from cache
CachedTokens int64 `json:"cached_tokens"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CachedTokens respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Token details for prompt tokens in OpenAI chat completion usage.
func (ChatCompletionGetResponseUsagePromptTokensDetails) RawJSON ¶
func (r ChatCompletionGetResponseUsagePromptTokensDetails) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionGetResponseUsagePromptTokensDetails) UnmarshalJSON ¶
func (r *ChatCompletionGetResponseUsagePromptTokensDetails) UnmarshalJSON(data []byte) error
type ChatCompletionListParams ¶
type ChatCompletionListParams struct {
// The ID of the last chat completion to return.
After param.Opt[string] `query:"after,omitzero" json:"-"`
// The maximum number of chat completions to return.
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// The model to filter by.
Model param.Opt[string] `query:"model,omitzero" json:"-"`
// The order to sort the chat completions by: "asc" or "desc". Defaults to "desc".
//
// Any of "asc", "desc".
Order ChatCompletionListParamsOrder `query:"order,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (ChatCompletionListParams) URLQuery ¶
func (r ChatCompletionListParams) URLQuery() (v url.Values, err error)
URLQuery serializes ChatCompletionListParams's query parameters as `url.Values`.
type ChatCompletionListParamsOrder ¶
type ChatCompletionListParamsOrder string
The order to sort the chat completions by: "asc" or "desc". Defaults to "desc".
const ( ChatCompletionListParamsOrderAsc ChatCompletionListParamsOrder = "asc" ChatCompletionListParamsOrderDesc ChatCompletionListParamsOrder = "desc" )
type ChatCompletionListResponse ¶
type ChatCompletionListResponse struct {
// The ID of the chat completion
ID string `json:"id,required"`
// List of choices
Choices []ChatCompletionListResponseChoice `json:"choices,required"`
// The Unix timestamp in seconds when the chat completion was created
Created int64 `json:"created,required"`
InputMessages []ChatCompletionListResponseInputMessageUnion `json:"input_messages,required"`
// The model that was used to generate the chat completion
Model string `json:"model,required"`
// The object type, which will be "chat.completion"
Object constant.ChatCompletion `json:"object,required"`
// Token usage information for the completion
Usage ChatCompletionListResponseUsage `json:"usage"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Choices respjson.Field
Created respjson.Field
InputMessages respjson.Field
Model respjson.Field
Object respjson.Field
Usage respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ChatCompletionListResponse) RawJSON ¶
func (r ChatCompletionListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionListResponse) UnmarshalJSON ¶
func (r *ChatCompletionListResponse) UnmarshalJSON(data []byte) error
type ChatCompletionListResponseChoice ¶
type ChatCompletionListResponseChoice struct {
// The reason the model stopped generating
FinishReason string `json:"finish_reason,required"`
// The index of the choice
Index int64 `json:"index,required"`
// The message from the model
Message ChatCompletionListResponseChoiceMessageUnion `json:"message,required"`
// (Optional) The log probabilities for the tokens in the message
Logprobs ChatCompletionListResponseChoiceLogprobs `json:"logprobs"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
FinishReason respjson.Field
Index respjson.Field
Message respjson.Field
Logprobs respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A choice from an OpenAI-compatible chat completion response.
func (ChatCompletionListResponseChoice) RawJSON ¶
func (r ChatCompletionListResponseChoice) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionListResponseChoice) UnmarshalJSON ¶
func (r *ChatCompletionListResponseChoice) UnmarshalJSON(data []byte) error
type ChatCompletionListResponseChoiceLogprobs ¶
type ChatCompletionListResponseChoiceLogprobs struct {
// (Optional) The log probabilities for the tokens in the message
Content []ChatCompletionListResponseChoiceLogprobsContent `json:"content"`
// (Optional) The log probabilities for the tokens in the message
Refusal []ChatCompletionListResponseChoiceLogprobsRefusal `json:"refusal"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Content respjson.Field
Refusal respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
(Optional) The log probabilities for the tokens in the message
func (ChatCompletionListResponseChoiceLogprobs) RawJSON ¶
func (r ChatCompletionListResponseChoiceLogprobs) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionListResponseChoiceLogprobs) UnmarshalJSON ¶
func (r *ChatCompletionListResponseChoiceLogprobs) UnmarshalJSON(data []byte) error
type ChatCompletionListResponseChoiceLogprobsContent ¶
type ChatCompletionListResponseChoiceLogprobsContent struct {
Token string `json:"token,required"`
Logprob float64 `json:"logprob,required"`
TopLogprobs []ChatCompletionListResponseChoiceLogprobsContentTopLogprob `json:"top_logprobs,required"`
Bytes []int64 `json:"bytes"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Token respjson.Field
Logprob respjson.Field
TopLogprobs respjson.Field
Bytes respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The log probability for a token from an OpenAI-compatible chat completion response.
func (ChatCompletionListResponseChoiceLogprobsContent) RawJSON ¶
func (r ChatCompletionListResponseChoiceLogprobsContent) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionListResponseChoiceLogprobsContent) UnmarshalJSON ¶
func (r *ChatCompletionListResponseChoiceLogprobsContent) UnmarshalJSON(data []byte) error
type ChatCompletionListResponseChoiceLogprobsContentTopLogprob ¶
type ChatCompletionListResponseChoiceLogprobsContentTopLogprob struct {
Token string `json:"token,required"`
Logprob float64 `json:"logprob,required"`
Bytes []int64 `json:"bytes"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Token respjson.Field
Logprob respjson.Field
Bytes respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The top log probability for a token from an OpenAI-compatible chat completion response.
func (ChatCompletionListResponseChoiceLogprobsContentTopLogprob) RawJSON ¶
func (r ChatCompletionListResponseChoiceLogprobsContentTopLogprob) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionListResponseChoiceLogprobsContentTopLogprob) UnmarshalJSON ¶
func (r *ChatCompletionListResponseChoiceLogprobsContentTopLogprob) UnmarshalJSON(data []byte) error
type ChatCompletionListResponseChoiceLogprobsRefusal ¶
type ChatCompletionListResponseChoiceLogprobsRefusal struct {
Token string `json:"token,required"`
Logprob float64 `json:"logprob,required"`
TopLogprobs []ChatCompletionListResponseChoiceLogprobsRefusalTopLogprob `json:"top_logprobs,required"`
Bytes []int64 `json:"bytes"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Token respjson.Field
Logprob respjson.Field
TopLogprobs respjson.Field
Bytes respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The log probability for a token from an OpenAI-compatible chat completion response.
func (ChatCompletionListResponseChoiceLogprobsRefusal) RawJSON ¶
func (r ChatCompletionListResponseChoiceLogprobsRefusal) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionListResponseChoiceLogprobsRefusal) UnmarshalJSON ¶
func (r *ChatCompletionListResponseChoiceLogprobsRefusal) UnmarshalJSON(data []byte) error
type ChatCompletionListResponseChoiceLogprobsRefusalTopLogprob ¶
type ChatCompletionListResponseChoiceLogprobsRefusalTopLogprob struct {
Token string `json:"token,required"`
Logprob float64 `json:"logprob,required"`
Bytes []int64 `json:"bytes"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Token respjson.Field
Logprob respjson.Field
Bytes respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The top log probability for a token from an OpenAI-compatible chat completion response.
func (ChatCompletionListResponseChoiceLogprobsRefusalTopLogprob) RawJSON ¶
func (r ChatCompletionListResponseChoiceLogprobsRefusalTopLogprob) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionListResponseChoiceLogprobsRefusalTopLogprob) UnmarshalJSON ¶
func (r *ChatCompletionListResponseChoiceLogprobsRefusalTopLogprob) UnmarshalJSON(data []byte) error
type ChatCompletionListResponseChoiceMessageAssistant ¶
type ChatCompletionListResponseChoiceMessageAssistant struct {
// Must be "assistant" to identify this as the model's response
Role constant.Assistant `json:"role,required"`
// The content of the model's response
Content ChatCompletionListResponseChoiceMessageAssistantContentUnion `json:"content"`
// (Optional) The name of the assistant message participant.
Name string `json:"name"`
// List of tool calls. Each tool call is an OpenAIChatCompletionToolCall object.
ToolCalls []ChatCompletionListResponseChoiceMessageAssistantToolCall `json:"tool_calls"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Role respjson.Field
Content respjson.Field
Name 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 an OpenAI-compatible chat completion request.
func (ChatCompletionListResponseChoiceMessageAssistant) RawJSON ¶
func (r ChatCompletionListResponseChoiceMessageAssistant) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionListResponseChoiceMessageAssistant) UnmarshalJSON ¶
func (r *ChatCompletionListResponseChoiceMessageAssistant) UnmarshalJSON(data []byte) error
type ChatCompletionListResponseChoiceMessageAssistantContentArrayItem ¶
type ChatCompletionListResponseChoiceMessageAssistantContentArrayItem struct {
// The text content of the message
Text string `json:"text,required"`
// Must be "text" to identify this as text content
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:"-"`
}
Text content part for OpenAI-compatible chat completion messages.
func (ChatCompletionListResponseChoiceMessageAssistantContentArrayItem) RawJSON ¶
func (r ChatCompletionListResponseChoiceMessageAssistantContentArrayItem) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionListResponseChoiceMessageAssistantContentArrayItem) UnmarshalJSON ¶
func (r *ChatCompletionListResponseChoiceMessageAssistantContentArrayItem) UnmarshalJSON(data []byte) error
type ChatCompletionListResponseChoiceMessageAssistantContentUnion ¶
type ChatCompletionListResponseChoiceMessageAssistantContentUnion 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
// [[]ChatCompletionListResponseChoiceMessageAssistantContentArrayItem] instead of
// an object.
OfChatCompletionListResponseChoiceMessageAssistantContentArray []ChatCompletionListResponseChoiceMessageAssistantContentArrayItem `json:",inline"`
JSON struct {
OfString respjson.Field
OfChatCompletionListResponseChoiceMessageAssistantContentArray respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ChatCompletionListResponseChoiceMessageAssistantContentUnion contains all possible properties and values from [string], [[]ChatCompletionListResponseChoiceMessageAssistantContentArrayItem].
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 OfChatCompletionListResponseChoiceMessageAssistantContentArray]
func (ChatCompletionListResponseChoiceMessageAssistantContentUnion) AsChatCompletionListResponseChoiceMessageAssistantContentArray ¶
func (u ChatCompletionListResponseChoiceMessageAssistantContentUnion) AsChatCompletionListResponseChoiceMessageAssistantContentArray() (v []ChatCompletionListResponseChoiceMessageAssistantContentArrayItem)
func (ChatCompletionListResponseChoiceMessageAssistantContentUnion) AsString ¶
func (u ChatCompletionListResponseChoiceMessageAssistantContentUnion) AsString() (v string)
func (ChatCompletionListResponseChoiceMessageAssistantContentUnion) RawJSON ¶
func (u ChatCompletionListResponseChoiceMessageAssistantContentUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionListResponseChoiceMessageAssistantContentUnion) UnmarshalJSON ¶
func (r *ChatCompletionListResponseChoiceMessageAssistantContentUnion) UnmarshalJSON(data []byte) error
type ChatCompletionListResponseChoiceMessageAssistantToolCall ¶
type ChatCompletionListResponseChoiceMessageAssistantToolCall struct {
// Must be "function" to identify this as a function call
Type constant.Function `json:"type,required"`
// (Optional) Unique identifier for the tool call
ID string `json:"id"`
// (Optional) Function call details
Function ChatCompletionListResponseChoiceMessageAssistantToolCallFunction `json:"function"`
// (Optional) Index of the tool call in the list
Index int64 `json:"index"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Type respjson.Field
ID respjson.Field
Function respjson.Field
Index respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Tool call specification for OpenAI-compatible chat completion responses.
func (ChatCompletionListResponseChoiceMessageAssistantToolCall) RawJSON ¶
func (r ChatCompletionListResponseChoiceMessageAssistantToolCall) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionListResponseChoiceMessageAssistantToolCall) UnmarshalJSON ¶
func (r *ChatCompletionListResponseChoiceMessageAssistantToolCall) UnmarshalJSON(data []byte) error
type ChatCompletionListResponseChoiceMessageAssistantToolCallFunction ¶
type ChatCompletionListResponseChoiceMessageAssistantToolCallFunction struct {
// (Optional) Arguments to pass to the function as a JSON string
Arguments string `json:"arguments"`
// (Optional) Name of the function to call
Name string `json:"name"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Arguments respjson.Field
Name respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
(Optional) Function call details
func (ChatCompletionListResponseChoiceMessageAssistantToolCallFunction) RawJSON ¶
func (r ChatCompletionListResponseChoiceMessageAssistantToolCallFunction) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionListResponseChoiceMessageAssistantToolCallFunction) UnmarshalJSON ¶
func (r *ChatCompletionListResponseChoiceMessageAssistantToolCallFunction) UnmarshalJSON(data []byte) error
type ChatCompletionListResponseChoiceMessageDeveloper ¶
type ChatCompletionListResponseChoiceMessageDeveloper struct {
// The content of the developer message
Content ChatCompletionListResponseChoiceMessageDeveloperContentUnion `json:"content,required"`
// Must be "developer" to identify this as a developer message
Role constant.Developer `json:"role,required"`
// (Optional) The name of the developer message participant.
Name string `json:"name"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Content respjson.Field
Role respjson.Field
Name respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A message from the developer in an OpenAI-compatible chat completion request.
func (ChatCompletionListResponseChoiceMessageDeveloper) RawJSON ¶
func (r ChatCompletionListResponseChoiceMessageDeveloper) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionListResponseChoiceMessageDeveloper) UnmarshalJSON ¶
func (r *ChatCompletionListResponseChoiceMessageDeveloper) UnmarshalJSON(data []byte) error
type ChatCompletionListResponseChoiceMessageDeveloperContentArrayItem ¶
type ChatCompletionListResponseChoiceMessageDeveloperContentArrayItem struct {
// The text content of the message
Text string `json:"text,required"`
// Must be "text" to identify this as text content
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:"-"`
}
Text content part for OpenAI-compatible chat completion messages.
func (ChatCompletionListResponseChoiceMessageDeveloperContentArrayItem) RawJSON ¶
func (r ChatCompletionListResponseChoiceMessageDeveloperContentArrayItem) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionListResponseChoiceMessageDeveloperContentArrayItem) UnmarshalJSON ¶
func (r *ChatCompletionListResponseChoiceMessageDeveloperContentArrayItem) UnmarshalJSON(data []byte) error
type ChatCompletionListResponseChoiceMessageDeveloperContentUnion ¶
type ChatCompletionListResponseChoiceMessageDeveloperContentUnion 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
// [[]ChatCompletionListResponseChoiceMessageDeveloperContentArrayItem] instead of
// an object.
OfChatCompletionListResponseChoiceMessageDeveloperContentArray []ChatCompletionListResponseChoiceMessageDeveloperContentArrayItem `json:",inline"`
JSON struct {
OfString respjson.Field
OfChatCompletionListResponseChoiceMessageDeveloperContentArray respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ChatCompletionListResponseChoiceMessageDeveloperContentUnion contains all possible properties and values from [string], [[]ChatCompletionListResponseChoiceMessageDeveloperContentArrayItem].
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 OfChatCompletionListResponseChoiceMessageDeveloperContentArray]
func (ChatCompletionListResponseChoiceMessageDeveloperContentUnion) AsChatCompletionListResponseChoiceMessageDeveloperContentArray ¶
func (u ChatCompletionListResponseChoiceMessageDeveloperContentUnion) AsChatCompletionListResponseChoiceMessageDeveloperContentArray() (v []ChatCompletionListResponseChoiceMessageDeveloperContentArrayItem)
func (ChatCompletionListResponseChoiceMessageDeveloperContentUnion) AsString ¶
func (u ChatCompletionListResponseChoiceMessageDeveloperContentUnion) AsString() (v string)
func (ChatCompletionListResponseChoiceMessageDeveloperContentUnion) RawJSON ¶
func (u ChatCompletionListResponseChoiceMessageDeveloperContentUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionListResponseChoiceMessageDeveloperContentUnion) UnmarshalJSON ¶
func (r *ChatCompletionListResponseChoiceMessageDeveloperContentUnion) UnmarshalJSON(data []byte) error
type ChatCompletionListResponseChoiceMessageSystem ¶
type ChatCompletionListResponseChoiceMessageSystem 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 ChatCompletionListResponseChoiceMessageSystemContentUnion `json:"content,required"`
// Must be "system" to identify this as a system message
Role constant.System `json:"role,required"`
// (Optional) The name of the system message participant.
Name string `json:"name"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Content respjson.Field
Role respjson.Field
Name respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A system message providing instructions or context to the model.
func (ChatCompletionListResponseChoiceMessageSystem) RawJSON ¶
func (r ChatCompletionListResponseChoiceMessageSystem) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionListResponseChoiceMessageSystem) UnmarshalJSON ¶
func (r *ChatCompletionListResponseChoiceMessageSystem) UnmarshalJSON(data []byte) error
type ChatCompletionListResponseChoiceMessageSystemContentArrayItem ¶
type ChatCompletionListResponseChoiceMessageSystemContentArrayItem struct {
// The text content of the message
Text string `json:"text,required"`
// Must be "text" to identify this as text content
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:"-"`
}
Text content part for OpenAI-compatible chat completion messages.
func (ChatCompletionListResponseChoiceMessageSystemContentArrayItem) RawJSON ¶
func (r ChatCompletionListResponseChoiceMessageSystemContentArrayItem) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionListResponseChoiceMessageSystemContentArrayItem) UnmarshalJSON ¶
func (r *ChatCompletionListResponseChoiceMessageSystemContentArrayItem) UnmarshalJSON(data []byte) error
type ChatCompletionListResponseChoiceMessageSystemContentUnion ¶
type ChatCompletionListResponseChoiceMessageSystemContentUnion 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
// [[]ChatCompletionListResponseChoiceMessageSystemContentArrayItem] instead of an
// object.
OfChatCompletionListResponseChoiceMessageSystemContentArray []ChatCompletionListResponseChoiceMessageSystemContentArrayItem `json:",inline"`
JSON struct {
OfString respjson.Field
OfChatCompletionListResponseChoiceMessageSystemContentArray respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ChatCompletionListResponseChoiceMessageSystemContentUnion contains all possible properties and values from [string], [[]ChatCompletionListResponseChoiceMessageSystemContentArrayItem].
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 OfChatCompletionListResponseChoiceMessageSystemContentArray]
func (ChatCompletionListResponseChoiceMessageSystemContentUnion) AsChatCompletionListResponseChoiceMessageSystemContentArray ¶
func (u ChatCompletionListResponseChoiceMessageSystemContentUnion) AsChatCompletionListResponseChoiceMessageSystemContentArray() (v []ChatCompletionListResponseChoiceMessageSystemContentArrayItem)
func (ChatCompletionListResponseChoiceMessageSystemContentUnion) AsString ¶
func (u ChatCompletionListResponseChoiceMessageSystemContentUnion) AsString() (v string)
func (ChatCompletionListResponseChoiceMessageSystemContentUnion) RawJSON ¶
func (u ChatCompletionListResponseChoiceMessageSystemContentUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionListResponseChoiceMessageSystemContentUnion) UnmarshalJSON ¶
func (r *ChatCompletionListResponseChoiceMessageSystemContentUnion) UnmarshalJSON(data []byte) error
type ChatCompletionListResponseChoiceMessageTool ¶
type ChatCompletionListResponseChoiceMessageTool struct {
// The response content from the tool
Content ChatCompletionListResponseChoiceMessageToolContentUnion `json:"content,required"`
// Must be "tool" to identify this as a tool response
Role constant.Tool `json:"role,required"`
// Unique identifier for the tool call this response is for
ToolCallID string `json:"tool_call_id,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Content respjson.Field
Role respjson.Field
ToolCallID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A message representing the result of a tool invocation in an OpenAI-compatible chat completion request.
func (ChatCompletionListResponseChoiceMessageTool) RawJSON ¶
func (r ChatCompletionListResponseChoiceMessageTool) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionListResponseChoiceMessageTool) UnmarshalJSON ¶
func (r *ChatCompletionListResponseChoiceMessageTool) UnmarshalJSON(data []byte) error
type ChatCompletionListResponseChoiceMessageToolContentArrayItem ¶
type ChatCompletionListResponseChoiceMessageToolContentArrayItem struct {
// The text content of the message
Text string `json:"text,required"`
// Must be "text" to identify this as text content
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:"-"`
}
Text content part for OpenAI-compatible chat completion messages.
func (ChatCompletionListResponseChoiceMessageToolContentArrayItem) RawJSON ¶
func (r ChatCompletionListResponseChoiceMessageToolContentArrayItem) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionListResponseChoiceMessageToolContentArrayItem) UnmarshalJSON ¶
func (r *ChatCompletionListResponseChoiceMessageToolContentArrayItem) UnmarshalJSON(data []byte) error
type ChatCompletionListResponseChoiceMessageToolContentUnion ¶
type ChatCompletionListResponseChoiceMessageToolContentUnion 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
// [[]ChatCompletionListResponseChoiceMessageToolContentArrayItem] instead of an
// object.
OfChatCompletionListResponseChoiceMessageToolContentArray []ChatCompletionListResponseChoiceMessageToolContentArrayItem `json:",inline"`
JSON struct {
OfString respjson.Field
OfChatCompletionListResponseChoiceMessageToolContentArray respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ChatCompletionListResponseChoiceMessageToolContentUnion contains all possible properties and values from [string], [[]ChatCompletionListResponseChoiceMessageToolContentArrayItem].
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 OfChatCompletionListResponseChoiceMessageToolContentArray]
func (ChatCompletionListResponseChoiceMessageToolContentUnion) AsChatCompletionListResponseChoiceMessageToolContentArray ¶
func (u ChatCompletionListResponseChoiceMessageToolContentUnion) AsChatCompletionListResponseChoiceMessageToolContentArray() (v []ChatCompletionListResponseChoiceMessageToolContentArrayItem)
func (ChatCompletionListResponseChoiceMessageToolContentUnion) AsString ¶
func (u ChatCompletionListResponseChoiceMessageToolContentUnion) AsString() (v string)
func (ChatCompletionListResponseChoiceMessageToolContentUnion) RawJSON ¶
func (u ChatCompletionListResponseChoiceMessageToolContentUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionListResponseChoiceMessageToolContentUnion) UnmarshalJSON ¶
func (r *ChatCompletionListResponseChoiceMessageToolContentUnion) UnmarshalJSON(data []byte) error
type ChatCompletionListResponseChoiceMessageUnion ¶
type ChatCompletionListResponseChoiceMessageUnion struct {
// This field is a union of
// [ChatCompletionListResponseChoiceMessageUserContentUnion],
// [ChatCompletionListResponseChoiceMessageSystemContentUnion],
// [ChatCompletionListResponseChoiceMessageAssistantContentUnion],
// [ChatCompletionListResponseChoiceMessageToolContentUnion],
// [ChatCompletionListResponseChoiceMessageDeveloperContentUnion]
Content ChatCompletionListResponseChoiceMessageUnionContent `json:"content"`
// Any of "user", "system", "assistant", "tool", "developer".
Role string `json:"role"`
Name string `json:"name"`
// This field is from variant [ChatCompletionListResponseChoiceMessageAssistant].
ToolCalls []ChatCompletionListResponseChoiceMessageAssistantToolCall `json:"tool_calls"`
// This field is from variant [ChatCompletionListResponseChoiceMessageTool].
ToolCallID string `json:"tool_call_id"`
JSON struct {
Content respjson.Field
Role respjson.Field
Name respjson.Field
ToolCalls respjson.Field
ToolCallID respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ChatCompletionListResponseChoiceMessageUnion contains all possible properties and values from ChatCompletionListResponseChoiceMessageUser, ChatCompletionListResponseChoiceMessageSystem, ChatCompletionListResponseChoiceMessageAssistant, ChatCompletionListResponseChoiceMessageTool, ChatCompletionListResponseChoiceMessageDeveloper.
Use the ChatCompletionListResponseChoiceMessageUnion.AsAny method to switch on the variant.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (ChatCompletionListResponseChoiceMessageUnion) AsAny ¶
func (u ChatCompletionListResponseChoiceMessageUnion) AsAny() anyChatCompletionListResponseChoiceMessage
Use the following switch statement to find the correct variant
switch variant := ChatCompletionListResponseChoiceMessageUnion.AsAny().(type) {
case llamastackclient.ChatCompletionListResponseChoiceMessageUser:
case llamastackclient.ChatCompletionListResponseChoiceMessageSystem:
case llamastackclient.ChatCompletionListResponseChoiceMessageAssistant:
case llamastackclient.ChatCompletionListResponseChoiceMessageTool:
case llamastackclient.ChatCompletionListResponseChoiceMessageDeveloper:
default:
fmt.Errorf("no variant present")
}
func (ChatCompletionListResponseChoiceMessageUnion) AsAssistant ¶
func (u ChatCompletionListResponseChoiceMessageUnion) AsAssistant() (v ChatCompletionListResponseChoiceMessageAssistant)
func (ChatCompletionListResponseChoiceMessageUnion) AsDeveloper ¶
func (u ChatCompletionListResponseChoiceMessageUnion) AsDeveloper() (v ChatCompletionListResponseChoiceMessageDeveloper)
func (ChatCompletionListResponseChoiceMessageUnion) AsSystem ¶
func (u ChatCompletionListResponseChoiceMessageUnion) AsSystem() (v ChatCompletionListResponseChoiceMessageSystem)
func (ChatCompletionListResponseChoiceMessageUnion) AsTool ¶
func (u ChatCompletionListResponseChoiceMessageUnion) AsTool() (v ChatCompletionListResponseChoiceMessageTool)
func (ChatCompletionListResponseChoiceMessageUnion) AsUser ¶
func (u ChatCompletionListResponseChoiceMessageUnion) AsUser() (v ChatCompletionListResponseChoiceMessageUser)
func (ChatCompletionListResponseChoiceMessageUnion) RawJSON ¶
func (u ChatCompletionListResponseChoiceMessageUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionListResponseChoiceMessageUnion) UnmarshalJSON ¶
func (r *ChatCompletionListResponseChoiceMessageUnion) UnmarshalJSON(data []byte) error
type ChatCompletionListResponseChoiceMessageUnionContent ¶
type ChatCompletionListResponseChoiceMessageUnionContent 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
// [[]ChatCompletionListResponseChoiceMessageUserContentArrayItemUnion] instead of
// an object.
OfChatCompletionListResponseChoiceMessageUserContentArray []ChatCompletionListResponseChoiceMessageUserContentArrayItemUnion `json:",inline"`
// This field will be present if the value is a
// [[]ChatCompletionListResponseChoiceMessageSystemContentArrayItem] instead of an
// object.
OfChatCompletionListResponseChoiceMessageSystemContentArray []ChatCompletionListResponseChoiceMessageSystemContentArrayItem `json:",inline"`
// This field will be present if the value is a
// [[]ChatCompletionListResponseChoiceMessageAssistantContentArrayItem] instead of
// an object.
OfChatCompletionListResponseChoiceMessageAssistantContentArray []ChatCompletionListResponseChoiceMessageAssistantContentArrayItem `json:",inline"`
// This field will be present if the value is a
// [[]ChatCompletionListResponseChoiceMessageToolContentArrayItem] instead of an
// object.
OfChatCompletionListResponseChoiceMessageToolContentArray []ChatCompletionListResponseChoiceMessageToolContentArrayItem `json:",inline"`
// This field will be present if the value is a
// [[]ChatCompletionListResponseChoiceMessageDeveloperContentArrayItem] instead of
// an object.
OfChatCompletionListResponseChoiceMessageDeveloperContentArray []ChatCompletionListResponseChoiceMessageDeveloperContentArrayItem `json:",inline"`
JSON struct {
OfString respjson.Field
OfChatCompletionListResponseChoiceMessageUserContentArray respjson.Field
OfChatCompletionListResponseChoiceMessageSystemContentArray respjson.Field
OfChatCompletionListResponseChoiceMessageAssistantContentArray respjson.Field
OfChatCompletionListResponseChoiceMessageToolContentArray respjson.Field
OfChatCompletionListResponseChoiceMessageDeveloperContentArray respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ChatCompletionListResponseChoiceMessageUnionContent is an implicit subunion of ChatCompletionListResponseChoiceMessageUnion. ChatCompletionListResponseChoiceMessageUnionContent provides convenient access to the sub-properties of the union.
For type safety it is recommended to directly use a variant of the ChatCompletionListResponseChoiceMessageUnion.
If the underlying value is not a json object, one of the following properties will be valid: OfString OfChatCompletionListResponseChoiceMessageUserContentArray OfChatCompletionListResponseChoiceMessageSystemContentArray OfChatCompletionListResponseChoiceMessageAssistantContentArray OfChatCompletionListResponseChoiceMessageToolContentArray OfChatCompletionListResponseChoiceMessageDeveloperContentArray]
func (*ChatCompletionListResponseChoiceMessageUnionContent) UnmarshalJSON ¶
func (r *ChatCompletionListResponseChoiceMessageUnionContent) UnmarshalJSON(data []byte) error
type ChatCompletionListResponseChoiceMessageUser ¶
type ChatCompletionListResponseChoiceMessageUser struct {
// The content of the message, which can include text and other media
Content ChatCompletionListResponseChoiceMessageUserContentUnion `json:"content,required"`
// Must be "user" to identify this as a user message
Role constant.User `json:"role,required"`
// (Optional) The name of the user message participant.
Name string `json:"name"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Content respjson.Field
Role respjson.Field
Name respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A message from the user in an OpenAI-compatible chat completion request.
func (ChatCompletionListResponseChoiceMessageUser) RawJSON ¶
func (r ChatCompletionListResponseChoiceMessageUser) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionListResponseChoiceMessageUser) UnmarshalJSON ¶
func (r *ChatCompletionListResponseChoiceMessageUser) UnmarshalJSON(data []byte) error
type ChatCompletionListResponseChoiceMessageUserContentArrayItemFile ¶
type ChatCompletionListResponseChoiceMessageUserContentArrayItemFile struct {
File ChatCompletionListResponseChoiceMessageUserContentArrayItemFileFile `json:"file,required"`
Type constant.File `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
File respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ChatCompletionListResponseChoiceMessageUserContentArrayItemFile) RawJSON ¶
func (r ChatCompletionListResponseChoiceMessageUserContentArrayItemFile) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionListResponseChoiceMessageUserContentArrayItemFile) UnmarshalJSON ¶
func (r *ChatCompletionListResponseChoiceMessageUserContentArrayItemFile) UnmarshalJSON(data []byte) error
type ChatCompletionListResponseChoiceMessageUserContentArrayItemFileFile ¶
type ChatCompletionListResponseChoiceMessageUserContentArrayItemFileFile struct {
FileData string `json:"file_data"`
FileID string `json:"file_id"`
Filename string `json:"filename"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
FileData respjson.Field
FileID respjson.Field
Filename respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ChatCompletionListResponseChoiceMessageUserContentArrayItemFileFile) RawJSON ¶
func (r ChatCompletionListResponseChoiceMessageUserContentArrayItemFileFile) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionListResponseChoiceMessageUserContentArrayItemFileFile) UnmarshalJSON ¶
func (r *ChatCompletionListResponseChoiceMessageUserContentArrayItemFileFile) UnmarshalJSON(data []byte) error
type ChatCompletionListResponseChoiceMessageUserContentArrayItemImageURL ¶
type ChatCompletionListResponseChoiceMessageUserContentArrayItemImageURL struct {
// Image URL specification and processing details
ImageURL ChatCompletionListResponseChoiceMessageUserContentArrayItemImageURLImageURL `json:"image_url,required"`
// Must be "image_url" to identify this as image content
Type constant.ImageURL `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ImageURL respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Image content part for OpenAI-compatible chat completion messages.
func (ChatCompletionListResponseChoiceMessageUserContentArrayItemImageURL) RawJSON ¶
func (r ChatCompletionListResponseChoiceMessageUserContentArrayItemImageURL) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionListResponseChoiceMessageUserContentArrayItemImageURL) UnmarshalJSON ¶
func (r *ChatCompletionListResponseChoiceMessageUserContentArrayItemImageURL) UnmarshalJSON(data []byte) error
type ChatCompletionListResponseChoiceMessageUserContentArrayItemImageURLImageURL ¶
type ChatCompletionListResponseChoiceMessageUserContentArrayItemImageURLImageURL struct {
// URL of the image to include in the message
URL string `json:"url,required"`
// (Optional) Level of detail for image processing. Can be "low", "high", or "auto"
Detail string `json:"detail"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
URL respjson.Field
Detail respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Image URL specification and processing details
func (ChatCompletionListResponseChoiceMessageUserContentArrayItemImageURLImageURL) RawJSON ¶
func (r ChatCompletionListResponseChoiceMessageUserContentArrayItemImageURLImageURL) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionListResponseChoiceMessageUserContentArrayItemImageURLImageURL) UnmarshalJSON ¶
func (r *ChatCompletionListResponseChoiceMessageUserContentArrayItemImageURLImageURL) UnmarshalJSON(data []byte) error
type ChatCompletionListResponseChoiceMessageUserContentArrayItemText ¶
type ChatCompletionListResponseChoiceMessageUserContentArrayItemText struct {
// The text content of the message
Text string `json:"text,required"`
// Must be "text" to identify this as text content
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:"-"`
}
Text content part for OpenAI-compatible chat completion messages.
func (ChatCompletionListResponseChoiceMessageUserContentArrayItemText) RawJSON ¶
func (r ChatCompletionListResponseChoiceMessageUserContentArrayItemText) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionListResponseChoiceMessageUserContentArrayItemText) UnmarshalJSON ¶
func (r *ChatCompletionListResponseChoiceMessageUserContentArrayItemText) UnmarshalJSON(data []byte) error
type ChatCompletionListResponseChoiceMessageUserContentArrayItemUnion ¶
type ChatCompletionListResponseChoiceMessageUserContentArrayItemUnion struct {
// This field is from variant
// [ChatCompletionListResponseChoiceMessageUserContentArrayItemText].
Text string `json:"text"`
// Any of "text", "image_url", "file".
Type string `json:"type"`
// This field is from variant
// [ChatCompletionListResponseChoiceMessageUserContentArrayItemImageURL].
ImageURL ChatCompletionListResponseChoiceMessageUserContentArrayItemImageURLImageURL `json:"image_url"`
// This field is from variant
// [ChatCompletionListResponseChoiceMessageUserContentArrayItemFile].
File ChatCompletionListResponseChoiceMessageUserContentArrayItemFileFile `json:"file"`
JSON struct {
Text respjson.Field
Type respjson.Field
ImageURL respjson.Field
File respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ChatCompletionListResponseChoiceMessageUserContentArrayItemUnion contains all possible properties and values from ChatCompletionListResponseChoiceMessageUserContentArrayItemText, ChatCompletionListResponseChoiceMessageUserContentArrayItemImageURL, ChatCompletionListResponseChoiceMessageUserContentArrayItemFile.
Use the ChatCompletionListResponseChoiceMessageUserContentArrayItemUnion.AsAny method to switch on the variant.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (ChatCompletionListResponseChoiceMessageUserContentArrayItemUnion) AsAny ¶
func (u ChatCompletionListResponseChoiceMessageUserContentArrayItemUnion) AsAny() anyChatCompletionListResponseChoiceMessageUserContentArrayItem
Use the following switch statement to find the correct variant
switch variant := ChatCompletionListResponseChoiceMessageUserContentArrayItemUnion.AsAny().(type) {
case llamastackclient.ChatCompletionListResponseChoiceMessageUserContentArrayItemText:
case llamastackclient.ChatCompletionListResponseChoiceMessageUserContentArrayItemImageURL:
case llamastackclient.ChatCompletionListResponseChoiceMessageUserContentArrayItemFile:
default:
fmt.Errorf("no variant present")
}
func (ChatCompletionListResponseChoiceMessageUserContentArrayItemUnion) AsImageURL ¶
func (ChatCompletionListResponseChoiceMessageUserContentArrayItemUnion) RawJSON ¶
func (u ChatCompletionListResponseChoiceMessageUserContentArrayItemUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionListResponseChoiceMessageUserContentArrayItemUnion) UnmarshalJSON ¶
func (r *ChatCompletionListResponseChoiceMessageUserContentArrayItemUnion) UnmarshalJSON(data []byte) error
type ChatCompletionListResponseChoiceMessageUserContentUnion ¶
type ChatCompletionListResponseChoiceMessageUserContentUnion 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
// [[]ChatCompletionListResponseChoiceMessageUserContentArrayItemUnion] instead of
// an object.
OfChatCompletionListResponseChoiceMessageUserContentArray []ChatCompletionListResponseChoiceMessageUserContentArrayItemUnion `json:",inline"`
JSON struct {
OfString respjson.Field
OfChatCompletionListResponseChoiceMessageUserContentArray respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ChatCompletionListResponseChoiceMessageUserContentUnion contains all possible properties and values from [string], [[]ChatCompletionListResponseChoiceMessageUserContentArrayItemUnion].
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 OfChatCompletionListResponseChoiceMessageUserContentArray]
func (ChatCompletionListResponseChoiceMessageUserContentUnion) AsChatCompletionListResponseChoiceMessageUserContentArray ¶
func (u ChatCompletionListResponseChoiceMessageUserContentUnion) AsChatCompletionListResponseChoiceMessageUserContentArray() (v []ChatCompletionListResponseChoiceMessageUserContentArrayItemUnion)
func (ChatCompletionListResponseChoiceMessageUserContentUnion) AsString ¶
func (u ChatCompletionListResponseChoiceMessageUserContentUnion) AsString() (v string)
func (ChatCompletionListResponseChoiceMessageUserContentUnion) RawJSON ¶
func (u ChatCompletionListResponseChoiceMessageUserContentUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionListResponseChoiceMessageUserContentUnion) UnmarshalJSON ¶
func (r *ChatCompletionListResponseChoiceMessageUserContentUnion) UnmarshalJSON(data []byte) error
type ChatCompletionListResponseInputMessageAssistant ¶
type ChatCompletionListResponseInputMessageAssistant struct {
// Must be "assistant" to identify this as the model's response
Role constant.Assistant `json:"role,required"`
// The content of the model's response
Content ChatCompletionListResponseInputMessageAssistantContentUnion `json:"content"`
// (Optional) The name of the assistant message participant.
Name string `json:"name"`
// List of tool calls. Each tool call is an OpenAIChatCompletionToolCall object.
ToolCalls []ChatCompletionListResponseInputMessageAssistantToolCall `json:"tool_calls"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Role respjson.Field
Content respjson.Field
Name 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 an OpenAI-compatible chat completion request.
func (ChatCompletionListResponseInputMessageAssistant) RawJSON ¶
func (r ChatCompletionListResponseInputMessageAssistant) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionListResponseInputMessageAssistant) UnmarshalJSON ¶
func (r *ChatCompletionListResponseInputMessageAssistant) UnmarshalJSON(data []byte) error
type ChatCompletionListResponseInputMessageAssistantContentArrayItem ¶
type ChatCompletionListResponseInputMessageAssistantContentArrayItem struct {
// The text content of the message
Text string `json:"text,required"`
// Must be "text" to identify this as text content
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:"-"`
}
Text content part for OpenAI-compatible chat completion messages.
func (ChatCompletionListResponseInputMessageAssistantContentArrayItem) RawJSON ¶
func (r ChatCompletionListResponseInputMessageAssistantContentArrayItem) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionListResponseInputMessageAssistantContentArrayItem) UnmarshalJSON ¶
func (r *ChatCompletionListResponseInputMessageAssistantContentArrayItem) UnmarshalJSON(data []byte) error
type ChatCompletionListResponseInputMessageAssistantContentUnion ¶
type ChatCompletionListResponseInputMessageAssistantContentUnion 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
// [[]ChatCompletionListResponseInputMessageAssistantContentArrayItem] instead of
// an object.
OfChatCompletionListResponseInputMessageAssistantContentArray []ChatCompletionListResponseInputMessageAssistantContentArrayItem `json:",inline"`
JSON struct {
OfString respjson.Field
OfChatCompletionListResponseInputMessageAssistantContentArray respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ChatCompletionListResponseInputMessageAssistantContentUnion contains all possible properties and values from [string], [[]ChatCompletionListResponseInputMessageAssistantContentArrayItem].
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 OfChatCompletionListResponseInputMessageAssistantContentArray]
func (ChatCompletionListResponseInputMessageAssistantContentUnion) AsChatCompletionListResponseInputMessageAssistantContentArray ¶
func (u ChatCompletionListResponseInputMessageAssistantContentUnion) AsChatCompletionListResponseInputMessageAssistantContentArray() (v []ChatCompletionListResponseInputMessageAssistantContentArrayItem)
func (ChatCompletionListResponseInputMessageAssistantContentUnion) AsString ¶
func (u ChatCompletionListResponseInputMessageAssistantContentUnion) AsString() (v string)
func (ChatCompletionListResponseInputMessageAssistantContentUnion) RawJSON ¶
func (u ChatCompletionListResponseInputMessageAssistantContentUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionListResponseInputMessageAssistantContentUnion) UnmarshalJSON ¶
func (r *ChatCompletionListResponseInputMessageAssistantContentUnion) UnmarshalJSON(data []byte) error
type ChatCompletionListResponseInputMessageAssistantToolCall ¶
type ChatCompletionListResponseInputMessageAssistantToolCall struct {
// Must be "function" to identify this as a function call
Type constant.Function `json:"type,required"`
// (Optional) Unique identifier for the tool call
ID string `json:"id"`
// (Optional) Function call details
Function ChatCompletionListResponseInputMessageAssistantToolCallFunction `json:"function"`
// (Optional) Index of the tool call in the list
Index int64 `json:"index"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Type respjson.Field
ID respjson.Field
Function respjson.Field
Index respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Tool call specification for OpenAI-compatible chat completion responses.
func (ChatCompletionListResponseInputMessageAssistantToolCall) RawJSON ¶
func (r ChatCompletionListResponseInputMessageAssistantToolCall) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionListResponseInputMessageAssistantToolCall) UnmarshalJSON ¶
func (r *ChatCompletionListResponseInputMessageAssistantToolCall) UnmarshalJSON(data []byte) error
type ChatCompletionListResponseInputMessageAssistantToolCallFunction ¶
type ChatCompletionListResponseInputMessageAssistantToolCallFunction struct {
// (Optional) Arguments to pass to the function as a JSON string
Arguments string `json:"arguments"`
// (Optional) Name of the function to call
Name string `json:"name"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Arguments respjson.Field
Name respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
(Optional) Function call details
func (ChatCompletionListResponseInputMessageAssistantToolCallFunction) RawJSON ¶
func (r ChatCompletionListResponseInputMessageAssistantToolCallFunction) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionListResponseInputMessageAssistantToolCallFunction) UnmarshalJSON ¶
func (r *ChatCompletionListResponseInputMessageAssistantToolCallFunction) UnmarshalJSON(data []byte) error
type ChatCompletionListResponseInputMessageDeveloper ¶
type ChatCompletionListResponseInputMessageDeveloper struct {
// The content of the developer message
Content ChatCompletionListResponseInputMessageDeveloperContentUnion `json:"content,required"`
// Must be "developer" to identify this as a developer message
Role constant.Developer `json:"role,required"`
// (Optional) The name of the developer message participant.
Name string `json:"name"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Content respjson.Field
Role respjson.Field
Name respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A message from the developer in an OpenAI-compatible chat completion request.
func (ChatCompletionListResponseInputMessageDeveloper) RawJSON ¶
func (r ChatCompletionListResponseInputMessageDeveloper) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionListResponseInputMessageDeveloper) UnmarshalJSON ¶
func (r *ChatCompletionListResponseInputMessageDeveloper) UnmarshalJSON(data []byte) error
type ChatCompletionListResponseInputMessageDeveloperContentArrayItem ¶
type ChatCompletionListResponseInputMessageDeveloperContentArrayItem struct {
// The text content of the message
Text string `json:"text,required"`
// Must be "text" to identify this as text content
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:"-"`
}
Text content part for OpenAI-compatible chat completion messages.
func (ChatCompletionListResponseInputMessageDeveloperContentArrayItem) RawJSON ¶
func (r ChatCompletionListResponseInputMessageDeveloperContentArrayItem) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionListResponseInputMessageDeveloperContentArrayItem) UnmarshalJSON ¶
func (r *ChatCompletionListResponseInputMessageDeveloperContentArrayItem) UnmarshalJSON(data []byte) error
type ChatCompletionListResponseInputMessageDeveloperContentUnion ¶
type ChatCompletionListResponseInputMessageDeveloperContentUnion 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
// [[]ChatCompletionListResponseInputMessageDeveloperContentArrayItem] instead of
// an object.
OfChatCompletionListResponseInputMessageDeveloperContentArray []ChatCompletionListResponseInputMessageDeveloperContentArrayItem `json:",inline"`
JSON struct {
OfString respjson.Field
OfChatCompletionListResponseInputMessageDeveloperContentArray respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ChatCompletionListResponseInputMessageDeveloperContentUnion contains all possible properties and values from [string], [[]ChatCompletionListResponseInputMessageDeveloperContentArrayItem].
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 OfChatCompletionListResponseInputMessageDeveloperContentArray]
func (ChatCompletionListResponseInputMessageDeveloperContentUnion) AsChatCompletionListResponseInputMessageDeveloperContentArray ¶
func (u ChatCompletionListResponseInputMessageDeveloperContentUnion) AsChatCompletionListResponseInputMessageDeveloperContentArray() (v []ChatCompletionListResponseInputMessageDeveloperContentArrayItem)
func (ChatCompletionListResponseInputMessageDeveloperContentUnion) AsString ¶
func (u ChatCompletionListResponseInputMessageDeveloperContentUnion) AsString() (v string)
func (ChatCompletionListResponseInputMessageDeveloperContentUnion) RawJSON ¶
func (u ChatCompletionListResponseInputMessageDeveloperContentUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionListResponseInputMessageDeveloperContentUnion) UnmarshalJSON ¶
func (r *ChatCompletionListResponseInputMessageDeveloperContentUnion) UnmarshalJSON(data []byte) error
type ChatCompletionListResponseInputMessageSystem ¶
type ChatCompletionListResponseInputMessageSystem 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 ChatCompletionListResponseInputMessageSystemContentUnion `json:"content,required"`
// Must be "system" to identify this as a system message
Role constant.System `json:"role,required"`
// (Optional) The name of the system message participant.
Name string `json:"name"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Content respjson.Field
Role respjson.Field
Name respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A system message providing instructions or context to the model.
func (ChatCompletionListResponseInputMessageSystem) RawJSON ¶
func (r ChatCompletionListResponseInputMessageSystem) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionListResponseInputMessageSystem) UnmarshalJSON ¶
func (r *ChatCompletionListResponseInputMessageSystem) UnmarshalJSON(data []byte) error
type ChatCompletionListResponseInputMessageSystemContentArrayItem ¶
type ChatCompletionListResponseInputMessageSystemContentArrayItem struct {
// The text content of the message
Text string `json:"text,required"`
// Must be "text" to identify this as text content
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:"-"`
}
Text content part for OpenAI-compatible chat completion messages.
func (ChatCompletionListResponseInputMessageSystemContentArrayItem) RawJSON ¶
func (r ChatCompletionListResponseInputMessageSystemContentArrayItem) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionListResponseInputMessageSystemContentArrayItem) UnmarshalJSON ¶
func (r *ChatCompletionListResponseInputMessageSystemContentArrayItem) UnmarshalJSON(data []byte) error
type ChatCompletionListResponseInputMessageSystemContentUnion ¶
type ChatCompletionListResponseInputMessageSystemContentUnion 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
// [[]ChatCompletionListResponseInputMessageSystemContentArrayItem] instead of an
// object.
OfChatCompletionListResponseInputMessageSystemContentArray []ChatCompletionListResponseInputMessageSystemContentArrayItem `json:",inline"`
JSON struct {
OfString respjson.Field
OfChatCompletionListResponseInputMessageSystemContentArray respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ChatCompletionListResponseInputMessageSystemContentUnion contains all possible properties and values from [string], [[]ChatCompletionListResponseInputMessageSystemContentArrayItem].
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 OfChatCompletionListResponseInputMessageSystemContentArray]
func (ChatCompletionListResponseInputMessageSystemContentUnion) AsChatCompletionListResponseInputMessageSystemContentArray ¶
func (u ChatCompletionListResponseInputMessageSystemContentUnion) AsChatCompletionListResponseInputMessageSystemContentArray() (v []ChatCompletionListResponseInputMessageSystemContentArrayItem)
func (ChatCompletionListResponseInputMessageSystemContentUnion) AsString ¶
func (u ChatCompletionListResponseInputMessageSystemContentUnion) AsString() (v string)
func (ChatCompletionListResponseInputMessageSystemContentUnion) RawJSON ¶
func (u ChatCompletionListResponseInputMessageSystemContentUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionListResponseInputMessageSystemContentUnion) UnmarshalJSON ¶
func (r *ChatCompletionListResponseInputMessageSystemContentUnion) UnmarshalJSON(data []byte) error
type ChatCompletionListResponseInputMessageTool ¶
type ChatCompletionListResponseInputMessageTool struct {
// The response content from the tool
Content ChatCompletionListResponseInputMessageToolContentUnion `json:"content,required"`
// Must be "tool" to identify this as a tool response
Role constant.Tool `json:"role,required"`
// Unique identifier for the tool call this response is for
ToolCallID string `json:"tool_call_id,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Content respjson.Field
Role respjson.Field
ToolCallID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A message representing the result of a tool invocation in an OpenAI-compatible chat completion request.
func (ChatCompletionListResponseInputMessageTool) RawJSON ¶
func (r ChatCompletionListResponseInputMessageTool) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionListResponseInputMessageTool) UnmarshalJSON ¶
func (r *ChatCompletionListResponseInputMessageTool) UnmarshalJSON(data []byte) error
type ChatCompletionListResponseInputMessageToolContentArrayItem ¶
type ChatCompletionListResponseInputMessageToolContentArrayItem struct {
// The text content of the message
Text string `json:"text,required"`
// Must be "text" to identify this as text content
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:"-"`
}
Text content part for OpenAI-compatible chat completion messages.
func (ChatCompletionListResponseInputMessageToolContentArrayItem) RawJSON ¶
func (r ChatCompletionListResponseInputMessageToolContentArrayItem) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionListResponseInputMessageToolContentArrayItem) UnmarshalJSON ¶
func (r *ChatCompletionListResponseInputMessageToolContentArrayItem) UnmarshalJSON(data []byte) error
type ChatCompletionListResponseInputMessageToolContentUnion ¶
type ChatCompletionListResponseInputMessageToolContentUnion 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
// [[]ChatCompletionListResponseInputMessageToolContentArrayItem] instead of an
// object.
OfChatCompletionListResponseInputMessageToolContentArray []ChatCompletionListResponseInputMessageToolContentArrayItem `json:",inline"`
JSON struct {
OfString respjson.Field
OfChatCompletionListResponseInputMessageToolContentArray respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ChatCompletionListResponseInputMessageToolContentUnion contains all possible properties and values from [string], [[]ChatCompletionListResponseInputMessageToolContentArrayItem].
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 OfChatCompletionListResponseInputMessageToolContentArray]
func (ChatCompletionListResponseInputMessageToolContentUnion) AsChatCompletionListResponseInputMessageToolContentArray ¶
func (u ChatCompletionListResponseInputMessageToolContentUnion) AsChatCompletionListResponseInputMessageToolContentArray() (v []ChatCompletionListResponseInputMessageToolContentArrayItem)
func (ChatCompletionListResponseInputMessageToolContentUnion) AsString ¶
func (u ChatCompletionListResponseInputMessageToolContentUnion) AsString() (v string)
func (ChatCompletionListResponseInputMessageToolContentUnion) RawJSON ¶
func (u ChatCompletionListResponseInputMessageToolContentUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionListResponseInputMessageToolContentUnion) UnmarshalJSON ¶
func (r *ChatCompletionListResponseInputMessageToolContentUnion) UnmarshalJSON(data []byte) error
type ChatCompletionListResponseInputMessageUnion ¶
type ChatCompletionListResponseInputMessageUnion struct {
// This field is a union of
// [ChatCompletionListResponseInputMessageUserContentUnion],
// [ChatCompletionListResponseInputMessageSystemContentUnion],
// [ChatCompletionListResponseInputMessageAssistantContentUnion],
// [ChatCompletionListResponseInputMessageToolContentUnion],
// [ChatCompletionListResponseInputMessageDeveloperContentUnion]
Content ChatCompletionListResponseInputMessageUnionContent `json:"content"`
// Any of "user", "system", "assistant", "tool", "developer".
Role string `json:"role"`
Name string `json:"name"`
// This field is from variant [ChatCompletionListResponseInputMessageAssistant].
ToolCalls []ChatCompletionListResponseInputMessageAssistantToolCall `json:"tool_calls"`
// This field is from variant [ChatCompletionListResponseInputMessageTool].
ToolCallID string `json:"tool_call_id"`
JSON struct {
Content respjson.Field
Role respjson.Field
Name respjson.Field
ToolCalls respjson.Field
ToolCallID respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ChatCompletionListResponseInputMessageUnion contains all possible properties and values from ChatCompletionListResponseInputMessageUser, ChatCompletionListResponseInputMessageSystem, ChatCompletionListResponseInputMessageAssistant, ChatCompletionListResponseInputMessageTool, ChatCompletionListResponseInputMessageDeveloper.
Use the ChatCompletionListResponseInputMessageUnion.AsAny method to switch on the variant.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (ChatCompletionListResponseInputMessageUnion) AsAny ¶
func (u ChatCompletionListResponseInputMessageUnion) AsAny() anyChatCompletionListResponseInputMessage
Use the following switch statement to find the correct variant
switch variant := ChatCompletionListResponseInputMessageUnion.AsAny().(type) {
case llamastackclient.ChatCompletionListResponseInputMessageUser:
case llamastackclient.ChatCompletionListResponseInputMessageSystem:
case llamastackclient.ChatCompletionListResponseInputMessageAssistant:
case llamastackclient.ChatCompletionListResponseInputMessageTool:
case llamastackclient.ChatCompletionListResponseInputMessageDeveloper:
default:
fmt.Errorf("no variant present")
}
func (ChatCompletionListResponseInputMessageUnion) AsAssistant ¶
func (u ChatCompletionListResponseInputMessageUnion) AsAssistant() (v ChatCompletionListResponseInputMessageAssistant)
func (ChatCompletionListResponseInputMessageUnion) AsDeveloper ¶
func (u ChatCompletionListResponseInputMessageUnion) AsDeveloper() (v ChatCompletionListResponseInputMessageDeveloper)
func (ChatCompletionListResponseInputMessageUnion) AsSystem ¶
func (u ChatCompletionListResponseInputMessageUnion) AsSystem() (v ChatCompletionListResponseInputMessageSystem)
func (ChatCompletionListResponseInputMessageUnion) AsTool ¶
func (u ChatCompletionListResponseInputMessageUnion) AsTool() (v ChatCompletionListResponseInputMessageTool)
func (ChatCompletionListResponseInputMessageUnion) AsUser ¶
func (u ChatCompletionListResponseInputMessageUnion) AsUser() (v ChatCompletionListResponseInputMessageUser)
func (ChatCompletionListResponseInputMessageUnion) RawJSON ¶
func (u ChatCompletionListResponseInputMessageUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionListResponseInputMessageUnion) UnmarshalJSON ¶
func (r *ChatCompletionListResponseInputMessageUnion) UnmarshalJSON(data []byte) error
type ChatCompletionListResponseInputMessageUnionContent ¶
type ChatCompletionListResponseInputMessageUnionContent 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
// [[]ChatCompletionListResponseInputMessageUserContentArrayItemUnion] instead of
// an object.
OfChatCompletionListResponseInputMessageUserContentArray []ChatCompletionListResponseInputMessageUserContentArrayItemUnion `json:",inline"`
// This field will be present if the value is a
// [[]ChatCompletionListResponseInputMessageSystemContentArrayItem] instead of an
// object.
OfChatCompletionListResponseInputMessageSystemContentArray []ChatCompletionListResponseInputMessageSystemContentArrayItem `json:",inline"`
// This field will be present if the value is a
// [[]ChatCompletionListResponseInputMessageAssistantContentArrayItem] instead of
// an object.
OfChatCompletionListResponseInputMessageAssistantContentArray []ChatCompletionListResponseInputMessageAssistantContentArrayItem `json:",inline"`
// This field will be present if the value is a
// [[]ChatCompletionListResponseInputMessageToolContentArrayItem] instead of an
// object.
OfChatCompletionListResponseInputMessageToolContentArray []ChatCompletionListResponseInputMessageToolContentArrayItem `json:",inline"`
// This field will be present if the value is a
// [[]ChatCompletionListResponseInputMessageDeveloperContentArrayItem] instead of
// an object.
OfChatCompletionListResponseInputMessageDeveloperContentArray []ChatCompletionListResponseInputMessageDeveloperContentArrayItem `json:",inline"`
JSON struct {
OfString respjson.Field
OfChatCompletionListResponseInputMessageUserContentArray respjson.Field
OfChatCompletionListResponseInputMessageSystemContentArray respjson.Field
OfChatCompletionListResponseInputMessageAssistantContentArray respjson.Field
OfChatCompletionListResponseInputMessageToolContentArray respjson.Field
OfChatCompletionListResponseInputMessageDeveloperContentArray respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ChatCompletionListResponseInputMessageUnionContent is an implicit subunion of ChatCompletionListResponseInputMessageUnion. ChatCompletionListResponseInputMessageUnionContent provides convenient access to the sub-properties of the union.
For type safety it is recommended to directly use a variant of the ChatCompletionListResponseInputMessageUnion.
If the underlying value is not a json object, one of the following properties will be valid: OfString OfChatCompletionListResponseInputMessageUserContentArray OfChatCompletionListResponseInputMessageSystemContentArray OfChatCompletionListResponseInputMessageAssistantContentArray OfChatCompletionListResponseInputMessageToolContentArray OfChatCompletionListResponseInputMessageDeveloperContentArray]
func (*ChatCompletionListResponseInputMessageUnionContent) UnmarshalJSON ¶
func (r *ChatCompletionListResponseInputMessageUnionContent) UnmarshalJSON(data []byte) error
type ChatCompletionListResponseInputMessageUser ¶
type ChatCompletionListResponseInputMessageUser struct {
// The content of the message, which can include text and other media
Content ChatCompletionListResponseInputMessageUserContentUnion `json:"content,required"`
// Must be "user" to identify this as a user message
Role constant.User `json:"role,required"`
// (Optional) The name of the user message participant.
Name string `json:"name"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Content respjson.Field
Role respjson.Field
Name respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A message from the user in an OpenAI-compatible chat completion request.
func (ChatCompletionListResponseInputMessageUser) RawJSON ¶
func (r ChatCompletionListResponseInputMessageUser) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionListResponseInputMessageUser) UnmarshalJSON ¶
func (r *ChatCompletionListResponseInputMessageUser) UnmarshalJSON(data []byte) error
type ChatCompletionListResponseInputMessageUserContentArrayItemFile ¶
type ChatCompletionListResponseInputMessageUserContentArrayItemFile struct {
File ChatCompletionListResponseInputMessageUserContentArrayItemFileFile `json:"file,required"`
Type constant.File `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
File respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ChatCompletionListResponseInputMessageUserContentArrayItemFile) RawJSON ¶
func (r ChatCompletionListResponseInputMessageUserContentArrayItemFile) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionListResponseInputMessageUserContentArrayItemFile) UnmarshalJSON ¶
func (r *ChatCompletionListResponseInputMessageUserContentArrayItemFile) UnmarshalJSON(data []byte) error
type ChatCompletionListResponseInputMessageUserContentArrayItemFileFile ¶
type ChatCompletionListResponseInputMessageUserContentArrayItemFileFile struct {
FileData string `json:"file_data"`
FileID string `json:"file_id"`
Filename string `json:"filename"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
FileData respjson.Field
FileID respjson.Field
Filename respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ChatCompletionListResponseInputMessageUserContentArrayItemFileFile) RawJSON ¶
func (r ChatCompletionListResponseInputMessageUserContentArrayItemFileFile) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionListResponseInputMessageUserContentArrayItemFileFile) UnmarshalJSON ¶
func (r *ChatCompletionListResponseInputMessageUserContentArrayItemFileFile) UnmarshalJSON(data []byte) error
type ChatCompletionListResponseInputMessageUserContentArrayItemImageURL ¶
type ChatCompletionListResponseInputMessageUserContentArrayItemImageURL struct {
// Image URL specification and processing details
ImageURL ChatCompletionListResponseInputMessageUserContentArrayItemImageURLImageURL `json:"image_url,required"`
// Must be "image_url" to identify this as image content
Type constant.ImageURL `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ImageURL respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Image content part for OpenAI-compatible chat completion messages.
func (ChatCompletionListResponseInputMessageUserContentArrayItemImageURL) RawJSON ¶
func (r ChatCompletionListResponseInputMessageUserContentArrayItemImageURL) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionListResponseInputMessageUserContentArrayItemImageURL) UnmarshalJSON ¶
func (r *ChatCompletionListResponseInputMessageUserContentArrayItemImageURL) UnmarshalJSON(data []byte) error
type ChatCompletionListResponseInputMessageUserContentArrayItemImageURLImageURL ¶
type ChatCompletionListResponseInputMessageUserContentArrayItemImageURLImageURL struct {
// URL of the image to include in the message
URL string `json:"url,required"`
// (Optional) Level of detail for image processing. Can be "low", "high", or "auto"
Detail string `json:"detail"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
URL respjson.Field
Detail respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Image URL specification and processing details
func (ChatCompletionListResponseInputMessageUserContentArrayItemImageURLImageURL) RawJSON ¶
func (r ChatCompletionListResponseInputMessageUserContentArrayItemImageURLImageURL) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionListResponseInputMessageUserContentArrayItemImageURLImageURL) UnmarshalJSON ¶
func (r *ChatCompletionListResponseInputMessageUserContentArrayItemImageURLImageURL) UnmarshalJSON(data []byte) error
type ChatCompletionListResponseInputMessageUserContentArrayItemText ¶
type ChatCompletionListResponseInputMessageUserContentArrayItemText struct {
// The text content of the message
Text string `json:"text,required"`
// Must be "text" to identify this as text content
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:"-"`
}
Text content part for OpenAI-compatible chat completion messages.
func (ChatCompletionListResponseInputMessageUserContentArrayItemText) RawJSON ¶
func (r ChatCompletionListResponseInputMessageUserContentArrayItemText) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionListResponseInputMessageUserContentArrayItemText) UnmarshalJSON ¶
func (r *ChatCompletionListResponseInputMessageUserContentArrayItemText) UnmarshalJSON(data []byte) error
type ChatCompletionListResponseInputMessageUserContentArrayItemUnion ¶
type ChatCompletionListResponseInputMessageUserContentArrayItemUnion struct {
// This field is from variant
// [ChatCompletionListResponseInputMessageUserContentArrayItemText].
Text string `json:"text"`
// Any of "text", "image_url", "file".
Type string `json:"type"`
// This field is from variant
// [ChatCompletionListResponseInputMessageUserContentArrayItemImageURL].
ImageURL ChatCompletionListResponseInputMessageUserContentArrayItemImageURLImageURL `json:"image_url"`
// This field is from variant
// [ChatCompletionListResponseInputMessageUserContentArrayItemFile].
File ChatCompletionListResponseInputMessageUserContentArrayItemFileFile `json:"file"`
JSON struct {
Text respjson.Field
Type respjson.Field
ImageURL respjson.Field
File respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ChatCompletionListResponseInputMessageUserContentArrayItemUnion contains all possible properties and values from ChatCompletionListResponseInputMessageUserContentArrayItemText, ChatCompletionListResponseInputMessageUserContentArrayItemImageURL, ChatCompletionListResponseInputMessageUserContentArrayItemFile.
Use the ChatCompletionListResponseInputMessageUserContentArrayItemUnion.AsAny method to switch on the variant.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (ChatCompletionListResponseInputMessageUserContentArrayItemUnion) AsAny ¶
func (u ChatCompletionListResponseInputMessageUserContentArrayItemUnion) AsAny() anyChatCompletionListResponseInputMessageUserContentArrayItem
Use the following switch statement to find the correct variant
switch variant := ChatCompletionListResponseInputMessageUserContentArrayItemUnion.AsAny().(type) {
case llamastackclient.ChatCompletionListResponseInputMessageUserContentArrayItemText:
case llamastackclient.ChatCompletionListResponseInputMessageUserContentArrayItemImageURL:
case llamastackclient.ChatCompletionListResponseInputMessageUserContentArrayItemFile:
default:
fmt.Errorf("no variant present")
}
func (ChatCompletionListResponseInputMessageUserContentArrayItemUnion) AsImageURL ¶
func (ChatCompletionListResponseInputMessageUserContentArrayItemUnion) RawJSON ¶
func (u ChatCompletionListResponseInputMessageUserContentArrayItemUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionListResponseInputMessageUserContentArrayItemUnion) UnmarshalJSON ¶
func (r *ChatCompletionListResponseInputMessageUserContentArrayItemUnion) UnmarshalJSON(data []byte) error
type ChatCompletionListResponseInputMessageUserContentUnion ¶
type ChatCompletionListResponseInputMessageUserContentUnion 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
// [[]ChatCompletionListResponseInputMessageUserContentArrayItemUnion] instead of
// an object.
OfChatCompletionListResponseInputMessageUserContentArray []ChatCompletionListResponseInputMessageUserContentArrayItemUnion `json:",inline"`
JSON struct {
OfString respjson.Field
OfChatCompletionListResponseInputMessageUserContentArray respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ChatCompletionListResponseInputMessageUserContentUnion contains all possible properties and values from [string], [[]ChatCompletionListResponseInputMessageUserContentArrayItemUnion].
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 OfChatCompletionListResponseInputMessageUserContentArray]
func (ChatCompletionListResponseInputMessageUserContentUnion) AsChatCompletionListResponseInputMessageUserContentArray ¶
func (u ChatCompletionListResponseInputMessageUserContentUnion) AsChatCompletionListResponseInputMessageUserContentArray() (v []ChatCompletionListResponseInputMessageUserContentArrayItemUnion)
func (ChatCompletionListResponseInputMessageUserContentUnion) AsString ¶
func (u ChatCompletionListResponseInputMessageUserContentUnion) AsString() (v string)
func (ChatCompletionListResponseInputMessageUserContentUnion) RawJSON ¶
func (u ChatCompletionListResponseInputMessageUserContentUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionListResponseInputMessageUserContentUnion) UnmarshalJSON ¶
func (r *ChatCompletionListResponseInputMessageUserContentUnion) UnmarshalJSON(data []byte) error
type ChatCompletionListResponseUsage ¶
type ChatCompletionListResponseUsage struct {
// Number of tokens in the completion
CompletionTokens int64 `json:"completion_tokens,required"`
// Number of tokens in the prompt
PromptTokens int64 `json:"prompt_tokens,required"`
// Total tokens used (prompt + completion)
TotalTokens int64 `json:"total_tokens,required"`
// Token details for output tokens in OpenAI chat completion usage.
CompletionTokensDetails ChatCompletionListResponseUsageCompletionTokensDetails `json:"completion_tokens_details"`
// Token details for prompt tokens in OpenAI chat completion usage.
PromptTokensDetails ChatCompletionListResponseUsagePromptTokensDetails `json:"prompt_tokens_details"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CompletionTokens respjson.Field
PromptTokens respjson.Field
TotalTokens respjson.Field
CompletionTokensDetails respjson.Field
PromptTokensDetails respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Token usage information for the completion
func (ChatCompletionListResponseUsage) RawJSON ¶
func (r ChatCompletionListResponseUsage) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionListResponseUsage) UnmarshalJSON ¶
func (r *ChatCompletionListResponseUsage) UnmarshalJSON(data []byte) error
type ChatCompletionListResponseUsageCompletionTokensDetails ¶
type ChatCompletionListResponseUsageCompletionTokensDetails struct {
// Number of tokens used for reasoning (o1/o3 models)
ReasoningTokens int64 `json:"reasoning_tokens"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ReasoningTokens respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Token details for output tokens in OpenAI chat completion usage.
func (ChatCompletionListResponseUsageCompletionTokensDetails) RawJSON ¶
func (r ChatCompletionListResponseUsageCompletionTokensDetails) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionListResponseUsageCompletionTokensDetails) UnmarshalJSON ¶
func (r *ChatCompletionListResponseUsageCompletionTokensDetails) UnmarshalJSON(data []byte) error
type ChatCompletionListResponseUsagePromptTokensDetails ¶
type ChatCompletionListResponseUsagePromptTokensDetails struct {
// Number of tokens retrieved from cache
CachedTokens int64 `json:"cached_tokens"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CachedTokens respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Token details for prompt tokens in OpenAI chat completion usage.
func (ChatCompletionListResponseUsagePromptTokensDetails) RawJSON ¶
func (r ChatCompletionListResponseUsagePromptTokensDetails) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionListResponseUsagePromptTokensDetails) UnmarshalJSON ¶
func (r *ChatCompletionListResponseUsagePromptTokensDetails) UnmarshalJSON(data []byte) error
type ChatCompletionNewParams ¶
type ChatCompletionNewParams struct {
// List of messages in the conversation.
Messages []ChatCompletionNewParamsMessageUnion `json:"messages,omitzero,required"`
// The identifier of the model to use. The model must be registered with Llama
// Stack and available via the /models endpoint.
Model string `json:"model,required"`
// (Optional) The penalty for repeated tokens.
FrequencyPenalty param.Opt[float64] `json:"frequency_penalty,omitzero"`
// (Optional) The log probabilities to use.
Logprobs param.Opt[bool] `json:"logprobs,omitzero"`
// (Optional) The maximum number of tokens to generate.
MaxCompletionTokens param.Opt[int64] `json:"max_completion_tokens,omitzero"`
// (Optional) The maximum number of tokens to generate.
MaxTokens param.Opt[int64] `json:"max_tokens,omitzero"`
// (Optional) The number of completions to generate.
N param.Opt[int64] `json:"n,omitzero"`
// (Optional) Whether to parallelize tool calls.
ParallelToolCalls param.Opt[bool] `json:"parallel_tool_calls,omitzero"`
// (Optional) The penalty for repeated tokens.
PresencePenalty param.Opt[float64] `json:"presence_penalty,omitzero"`
// (Optional) The seed to use.
Seed param.Opt[int64] `json:"seed,omitzero"`
// (Optional) The temperature to use.
Temperature param.Opt[float64] `json:"temperature,omitzero"`
// (Optional) The top log probabilities to use.
TopLogprobs param.Opt[int64] `json:"top_logprobs,omitzero"`
// (Optional) The top p to use.
TopP param.Opt[float64] `json:"top_p,omitzero"`
// (Optional) The user to use.
User param.Opt[string] `json:"user,omitzero"`
// (Optional) The function call to use.
FunctionCall ChatCompletionNewParamsFunctionCallUnion `json:"function_call,omitzero"`
// (Optional) List of functions to use.
Functions []map[string]ChatCompletionNewParamsFunctionUnion `json:"functions,omitzero"`
// (Optional) The logit bias to use.
LogitBias map[string]float64 `json:"logit_bias,omitzero"`
// (Optional) The response format to use.
ResponseFormat ChatCompletionNewParamsResponseFormatUnion `json:"response_format,omitzero"`
// (Optional) The stop tokens to use.
Stop ChatCompletionNewParamsStopUnion `json:"stop,omitzero"`
// (Optional) The stream options to use.
StreamOptions map[string]ChatCompletionNewParamsStreamOptionUnion `json:"stream_options,omitzero"`
// (Optional) The tool choice to use.
ToolChoice ChatCompletionNewParamsToolChoiceUnion `json:"tool_choice,omitzero"`
// (Optional) The tools to use.
Tools []map[string]ChatCompletionNewParamsToolUnion `json:"tools,omitzero"`
// contains filtered or unexported fields
}
func (ChatCompletionNewParams) MarshalJSON ¶
func (r ChatCompletionNewParams) MarshalJSON() (data []byte, err error)
func (*ChatCompletionNewParams) UnmarshalJSON ¶
func (r *ChatCompletionNewParams) UnmarshalJSON(data []byte) error
type ChatCompletionNewParamsFunctionCallMapItemUnion ¶
type ChatCompletionNewParamsFunctionCallMapItemUnion 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 (ChatCompletionNewParamsFunctionCallMapItemUnion) MarshalJSON ¶
func (u ChatCompletionNewParamsFunctionCallMapItemUnion) MarshalJSON() ([]byte, error)
func (*ChatCompletionNewParamsFunctionCallMapItemUnion) UnmarshalJSON ¶
func (u *ChatCompletionNewParamsFunctionCallMapItemUnion) UnmarshalJSON(data []byte) error
type ChatCompletionNewParamsFunctionCallUnion ¶
type ChatCompletionNewParamsFunctionCallUnion struct {
OfString param.Opt[string] `json:",omitzero,inline"`
OfChatCompletionNewsFunctionCallMapMap map[string]ChatCompletionNewParamsFunctionCallMapItemUnion `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 (ChatCompletionNewParamsFunctionCallUnion) MarshalJSON ¶
func (u ChatCompletionNewParamsFunctionCallUnion) MarshalJSON() ([]byte, error)
func (*ChatCompletionNewParamsFunctionCallUnion) UnmarshalJSON ¶
func (u *ChatCompletionNewParamsFunctionCallUnion) UnmarshalJSON(data []byte) error
type ChatCompletionNewParamsFunctionUnion ¶
type ChatCompletionNewParamsFunctionUnion 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 (ChatCompletionNewParamsFunctionUnion) MarshalJSON ¶
func (u ChatCompletionNewParamsFunctionUnion) MarshalJSON() ([]byte, error)
func (*ChatCompletionNewParamsFunctionUnion) UnmarshalJSON ¶
func (u *ChatCompletionNewParamsFunctionUnion) UnmarshalJSON(data []byte) error
type ChatCompletionNewParamsMessageAssistant ¶
type ChatCompletionNewParamsMessageAssistant struct {
// (Optional) The name of the assistant message participant.
Name param.Opt[string] `json:"name,omitzero"`
// The content of the model's response
Content ChatCompletionNewParamsMessageAssistantContentUnion `json:"content,omitzero"`
// List of tool calls. Each tool call is an OpenAIChatCompletionToolCall object.
ToolCalls []ChatCompletionNewParamsMessageAssistantToolCall `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 an OpenAI-compatible chat completion request.
The property Role is required.
func (ChatCompletionNewParamsMessageAssistant) MarshalJSON ¶
func (r ChatCompletionNewParamsMessageAssistant) MarshalJSON() (data []byte, err error)
func (*ChatCompletionNewParamsMessageAssistant) UnmarshalJSON ¶
func (r *ChatCompletionNewParamsMessageAssistant) UnmarshalJSON(data []byte) error
type ChatCompletionNewParamsMessageAssistantContentArrayItem ¶
type ChatCompletionNewParamsMessageAssistantContentArrayItem struct {
// The text content of the message
Text string `json:"text,required"`
// Must be "text" to identify this as text content
//
// This field can be elided, and will marshal its zero value as "text".
Type constant.Text `json:"type,required"`
// contains filtered or unexported fields
}
Text content part for OpenAI-compatible chat completion messages.
The properties Text, Type are required.
func (ChatCompletionNewParamsMessageAssistantContentArrayItem) MarshalJSON ¶
func (r ChatCompletionNewParamsMessageAssistantContentArrayItem) MarshalJSON() (data []byte, err error)
func (*ChatCompletionNewParamsMessageAssistantContentArrayItem) UnmarshalJSON ¶
func (r *ChatCompletionNewParamsMessageAssistantContentArrayItem) UnmarshalJSON(data []byte) error
type ChatCompletionNewParamsMessageAssistantContentUnion ¶
type ChatCompletionNewParamsMessageAssistantContentUnion struct {
OfString param.Opt[string] `json:",omitzero,inline"`
OfChatCompletionNewsMessageAssistantContentArray []ChatCompletionNewParamsMessageAssistantContentArrayItem `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 (ChatCompletionNewParamsMessageAssistantContentUnion) MarshalJSON ¶
func (u ChatCompletionNewParamsMessageAssistantContentUnion) MarshalJSON() ([]byte, error)
func (*ChatCompletionNewParamsMessageAssistantContentUnion) UnmarshalJSON ¶
func (u *ChatCompletionNewParamsMessageAssistantContentUnion) UnmarshalJSON(data []byte) error
type ChatCompletionNewParamsMessageAssistantToolCall ¶
type ChatCompletionNewParamsMessageAssistantToolCall struct {
// (Optional) Unique identifier for the tool call
ID param.Opt[string] `json:"id,omitzero"`
// (Optional) Index of the tool call in the list
Index param.Opt[int64] `json:"index,omitzero"`
// (Optional) Function call details
Function ChatCompletionNewParamsMessageAssistantToolCallFunction `json:"function,omitzero"`
// Must be "function" to identify this as a function call
//
// This field can be elided, and will marshal its zero value as "function".
Type constant.Function `json:"type,required"`
// contains filtered or unexported fields
}
Tool call specification for OpenAI-compatible chat completion responses.
The property Type is required.
func (ChatCompletionNewParamsMessageAssistantToolCall) MarshalJSON ¶
func (r ChatCompletionNewParamsMessageAssistantToolCall) MarshalJSON() (data []byte, err error)
func (*ChatCompletionNewParamsMessageAssistantToolCall) UnmarshalJSON ¶
func (r *ChatCompletionNewParamsMessageAssistantToolCall) UnmarshalJSON(data []byte) error
type ChatCompletionNewParamsMessageAssistantToolCallFunction ¶
type ChatCompletionNewParamsMessageAssistantToolCallFunction struct {
// (Optional) Arguments to pass to the function as a JSON string
Arguments param.Opt[string] `json:"arguments,omitzero"`
// (Optional) Name of the function to call
Name param.Opt[string] `json:"name,omitzero"`
// contains filtered or unexported fields
}
(Optional) Function call details
func (ChatCompletionNewParamsMessageAssistantToolCallFunction) MarshalJSON ¶
func (r ChatCompletionNewParamsMessageAssistantToolCallFunction) MarshalJSON() (data []byte, err error)
func (*ChatCompletionNewParamsMessageAssistantToolCallFunction) UnmarshalJSON ¶
func (r *ChatCompletionNewParamsMessageAssistantToolCallFunction) UnmarshalJSON(data []byte) error
type ChatCompletionNewParamsMessageDeveloper ¶
type ChatCompletionNewParamsMessageDeveloper struct {
// The content of the developer message
Content ChatCompletionNewParamsMessageDeveloperContentUnion `json:"content,omitzero,required"`
// (Optional) The name of the developer message participant.
Name param.Opt[string] `json:"name,omitzero"`
// Must be "developer" to identify this as a developer message
//
// This field can be elided, and will marshal its zero value as "developer".
Role constant.Developer `json:"role,required"`
// contains filtered or unexported fields
}
A message from the developer in an OpenAI-compatible chat completion request.
The properties Content, Role are required.
func (ChatCompletionNewParamsMessageDeveloper) MarshalJSON ¶
func (r ChatCompletionNewParamsMessageDeveloper) MarshalJSON() (data []byte, err error)
func (*ChatCompletionNewParamsMessageDeveloper) UnmarshalJSON ¶
func (r *ChatCompletionNewParamsMessageDeveloper) UnmarshalJSON(data []byte) error
type ChatCompletionNewParamsMessageDeveloperContentArrayItem ¶
type ChatCompletionNewParamsMessageDeveloperContentArrayItem struct {
// The text content of the message
Text string `json:"text,required"`
// Must be "text" to identify this as text content
//
// This field can be elided, and will marshal its zero value as "text".
Type constant.Text `json:"type,required"`
// contains filtered or unexported fields
}
Text content part for OpenAI-compatible chat completion messages.
The properties Text, Type are required.
func (ChatCompletionNewParamsMessageDeveloperContentArrayItem) MarshalJSON ¶
func (r ChatCompletionNewParamsMessageDeveloperContentArrayItem) MarshalJSON() (data []byte, err error)
func (*ChatCompletionNewParamsMessageDeveloperContentArrayItem) UnmarshalJSON ¶
func (r *ChatCompletionNewParamsMessageDeveloperContentArrayItem) UnmarshalJSON(data []byte) error
type ChatCompletionNewParamsMessageDeveloperContentUnion ¶
type ChatCompletionNewParamsMessageDeveloperContentUnion struct {
OfString param.Opt[string] `json:",omitzero,inline"`
OfChatCompletionNewsMessageDeveloperContentArray []ChatCompletionNewParamsMessageDeveloperContentArrayItem `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 (ChatCompletionNewParamsMessageDeveloperContentUnion) MarshalJSON ¶
func (u ChatCompletionNewParamsMessageDeveloperContentUnion) MarshalJSON() ([]byte, error)
func (*ChatCompletionNewParamsMessageDeveloperContentUnion) UnmarshalJSON ¶
func (u *ChatCompletionNewParamsMessageDeveloperContentUnion) UnmarshalJSON(data []byte) error
type ChatCompletionNewParamsMessageSystem ¶
type ChatCompletionNewParamsMessageSystem 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 ChatCompletionNewParamsMessageSystemContentUnion `json:"content,omitzero,required"`
// (Optional) The name of the system message participant.
Name param.Opt[string] `json:"name,omitzero"`
// 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 (ChatCompletionNewParamsMessageSystem) MarshalJSON ¶
func (r ChatCompletionNewParamsMessageSystem) MarshalJSON() (data []byte, err error)
func (*ChatCompletionNewParamsMessageSystem) UnmarshalJSON ¶
func (r *ChatCompletionNewParamsMessageSystem) UnmarshalJSON(data []byte) error
type ChatCompletionNewParamsMessageSystemContentArrayItem ¶
type ChatCompletionNewParamsMessageSystemContentArrayItem struct {
// The text content of the message
Text string `json:"text,required"`
// Must be "text" to identify this as text content
//
// This field can be elided, and will marshal its zero value as "text".
Type constant.Text `json:"type,required"`
// contains filtered or unexported fields
}
Text content part for OpenAI-compatible chat completion messages.
The properties Text, Type are required.
func (ChatCompletionNewParamsMessageSystemContentArrayItem) MarshalJSON ¶
func (r ChatCompletionNewParamsMessageSystemContentArrayItem) MarshalJSON() (data []byte, err error)
func (*ChatCompletionNewParamsMessageSystemContentArrayItem) UnmarshalJSON ¶
func (r *ChatCompletionNewParamsMessageSystemContentArrayItem) UnmarshalJSON(data []byte) error
type ChatCompletionNewParamsMessageSystemContentUnion ¶
type ChatCompletionNewParamsMessageSystemContentUnion struct {
OfString param.Opt[string] `json:",omitzero,inline"`
OfChatCompletionNewsMessageSystemContentArray []ChatCompletionNewParamsMessageSystemContentArrayItem `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 (ChatCompletionNewParamsMessageSystemContentUnion) MarshalJSON ¶
func (u ChatCompletionNewParamsMessageSystemContentUnion) MarshalJSON() ([]byte, error)
func (*ChatCompletionNewParamsMessageSystemContentUnion) UnmarshalJSON ¶
func (u *ChatCompletionNewParamsMessageSystemContentUnion) UnmarshalJSON(data []byte) error
type ChatCompletionNewParamsMessageTool ¶
type ChatCompletionNewParamsMessageTool struct {
// The response content from the tool
Content ChatCompletionNewParamsMessageToolContentUnion `json:"content,omitzero,required"`
// Unique identifier for the tool call this response is for
ToolCallID string `json:"tool_call_id,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 in an OpenAI-compatible chat completion request.
The properties Content, Role, ToolCallID are required.
func (ChatCompletionNewParamsMessageTool) MarshalJSON ¶
func (r ChatCompletionNewParamsMessageTool) MarshalJSON() (data []byte, err error)
func (*ChatCompletionNewParamsMessageTool) UnmarshalJSON ¶
func (r *ChatCompletionNewParamsMessageTool) UnmarshalJSON(data []byte) error
type ChatCompletionNewParamsMessageToolContentArrayItem ¶
type ChatCompletionNewParamsMessageToolContentArrayItem struct {
// The text content of the message
Text string `json:"text,required"`
// Must be "text" to identify this as text content
//
// This field can be elided, and will marshal its zero value as "text".
Type constant.Text `json:"type,required"`
// contains filtered or unexported fields
}
Text content part for OpenAI-compatible chat completion messages.
The properties Text, Type are required.
func (ChatCompletionNewParamsMessageToolContentArrayItem) MarshalJSON ¶
func (r ChatCompletionNewParamsMessageToolContentArrayItem) MarshalJSON() (data []byte, err error)
func (*ChatCompletionNewParamsMessageToolContentArrayItem) UnmarshalJSON ¶
func (r *ChatCompletionNewParamsMessageToolContentArrayItem) UnmarshalJSON(data []byte) error
type ChatCompletionNewParamsMessageToolContentUnion ¶
type ChatCompletionNewParamsMessageToolContentUnion struct {
OfString param.Opt[string] `json:",omitzero,inline"`
OfChatCompletionNewsMessageToolContentArray []ChatCompletionNewParamsMessageToolContentArrayItem `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 (ChatCompletionNewParamsMessageToolContentUnion) MarshalJSON ¶
func (u ChatCompletionNewParamsMessageToolContentUnion) MarshalJSON() ([]byte, error)
func (*ChatCompletionNewParamsMessageToolContentUnion) UnmarshalJSON ¶
func (u *ChatCompletionNewParamsMessageToolContentUnion) UnmarshalJSON(data []byte) error
type ChatCompletionNewParamsMessageUnion ¶
type ChatCompletionNewParamsMessageUnion struct {
OfUser *ChatCompletionNewParamsMessageUser `json:",omitzero,inline"`
OfSystem *ChatCompletionNewParamsMessageSystem `json:",omitzero,inline"`
OfAssistant *ChatCompletionNewParamsMessageAssistant `json:",omitzero,inline"`
OfTool *ChatCompletionNewParamsMessageTool `json:",omitzero,inline"`
OfDeveloper *ChatCompletionNewParamsMessageDeveloper `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 (ChatCompletionNewParamsMessageUnion) GetContent ¶
func (u ChatCompletionNewParamsMessageUnion) GetContent() (res chatCompletionNewParamsMessageUnionContent)
Returns a subunion which exports methods to access subproperties
Or use AsAny() to get the underlying value
func (ChatCompletionNewParamsMessageUnion) GetName ¶
func (u ChatCompletionNewParamsMessageUnion) GetName() *string
Returns a pointer to the underlying variant's property, if present.
func (ChatCompletionNewParamsMessageUnion) GetRole ¶
func (u ChatCompletionNewParamsMessageUnion) GetRole() *string
Returns a pointer to the underlying variant's property, if present.
func (ChatCompletionNewParamsMessageUnion) GetToolCallID ¶
func (u ChatCompletionNewParamsMessageUnion) GetToolCallID() *string
Returns a pointer to the underlying variant's property, if present.
func (ChatCompletionNewParamsMessageUnion) GetToolCalls ¶
func (u ChatCompletionNewParamsMessageUnion) GetToolCalls() []ChatCompletionNewParamsMessageAssistantToolCall
Returns a pointer to the underlying variant's property, if present.
func (ChatCompletionNewParamsMessageUnion) MarshalJSON ¶
func (u ChatCompletionNewParamsMessageUnion) MarshalJSON() ([]byte, error)
func (*ChatCompletionNewParamsMessageUnion) UnmarshalJSON ¶
func (u *ChatCompletionNewParamsMessageUnion) UnmarshalJSON(data []byte) error
type ChatCompletionNewParamsMessageUser ¶
type ChatCompletionNewParamsMessageUser struct {
// The content of the message, which can include text and other media
Content ChatCompletionNewParamsMessageUserContentUnion `json:"content,omitzero,required"`
// (Optional) The name of the user message participant.
Name param.Opt[string] `json:"name,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 an OpenAI-compatible chat completion request.
The properties Content, Role are required.
func (ChatCompletionNewParamsMessageUser) MarshalJSON ¶
func (r ChatCompletionNewParamsMessageUser) MarshalJSON() (data []byte, err error)
func (*ChatCompletionNewParamsMessageUser) UnmarshalJSON ¶
func (r *ChatCompletionNewParamsMessageUser) UnmarshalJSON(data []byte) error
type ChatCompletionNewParamsMessageUserContentArrayItemFile ¶
type ChatCompletionNewParamsMessageUserContentArrayItemFile struct {
File ChatCompletionNewParamsMessageUserContentArrayItemFileFile `json:"file,omitzero,required"`
// This field can be elided, and will marshal its zero value as "file".
Type constant.File `json:"type,required"`
// contains filtered or unexported fields
}
The properties File, Type are required.
func (ChatCompletionNewParamsMessageUserContentArrayItemFile) MarshalJSON ¶
func (r ChatCompletionNewParamsMessageUserContentArrayItemFile) MarshalJSON() (data []byte, err error)
func (*ChatCompletionNewParamsMessageUserContentArrayItemFile) UnmarshalJSON ¶
func (r *ChatCompletionNewParamsMessageUserContentArrayItemFile) UnmarshalJSON(data []byte) error
type ChatCompletionNewParamsMessageUserContentArrayItemFileFile ¶
type ChatCompletionNewParamsMessageUserContentArrayItemFileFile struct {
FileData param.Opt[string] `json:"file_data,omitzero"`
FileID param.Opt[string] `json:"file_id,omitzero"`
Filename param.Opt[string] `json:"filename,omitzero"`
// contains filtered or unexported fields
}
func (ChatCompletionNewParamsMessageUserContentArrayItemFileFile) MarshalJSON ¶
func (r ChatCompletionNewParamsMessageUserContentArrayItemFileFile) MarshalJSON() (data []byte, err error)
func (*ChatCompletionNewParamsMessageUserContentArrayItemFileFile) UnmarshalJSON ¶
func (r *ChatCompletionNewParamsMessageUserContentArrayItemFileFile) UnmarshalJSON(data []byte) error
type ChatCompletionNewParamsMessageUserContentArrayItemImageURL ¶
type ChatCompletionNewParamsMessageUserContentArrayItemImageURL struct {
// Image URL specification and processing details
ImageURL ChatCompletionNewParamsMessageUserContentArrayItemImageURLImageURL `json:"image_url,omitzero,required"`
// Must be "image_url" to identify this as image content
//
// This field can be elided, and will marshal its zero value as "image_url".
Type constant.ImageURL `json:"type,required"`
// contains filtered or unexported fields
}
Image content part for OpenAI-compatible chat completion messages.
The properties ImageURL, Type are required.
func (ChatCompletionNewParamsMessageUserContentArrayItemImageURL) MarshalJSON ¶
func (r ChatCompletionNewParamsMessageUserContentArrayItemImageURL) MarshalJSON() (data []byte, err error)
func (*ChatCompletionNewParamsMessageUserContentArrayItemImageURL) UnmarshalJSON ¶
func (r *ChatCompletionNewParamsMessageUserContentArrayItemImageURL) UnmarshalJSON(data []byte) error
type ChatCompletionNewParamsMessageUserContentArrayItemImageURLImageURL ¶
type ChatCompletionNewParamsMessageUserContentArrayItemImageURLImageURL struct {
// URL of the image to include in the message
URL string `json:"url,required"`
// (Optional) Level of detail for image processing. Can be "low", "high", or "auto"
Detail param.Opt[string] `json:"detail,omitzero"`
// contains filtered or unexported fields
}
Image URL specification and processing details
The property URL is required.
func (ChatCompletionNewParamsMessageUserContentArrayItemImageURLImageURL) MarshalJSON ¶
func (r ChatCompletionNewParamsMessageUserContentArrayItemImageURLImageURL) MarshalJSON() (data []byte, err error)
func (*ChatCompletionNewParamsMessageUserContentArrayItemImageURLImageURL) UnmarshalJSON ¶
func (r *ChatCompletionNewParamsMessageUserContentArrayItemImageURLImageURL) UnmarshalJSON(data []byte) error
type ChatCompletionNewParamsMessageUserContentArrayItemText ¶
type ChatCompletionNewParamsMessageUserContentArrayItemText struct {
// The text content of the message
Text string `json:"text,required"`
// Must be "text" to identify this as text content
//
// This field can be elided, and will marshal its zero value as "text".
Type constant.Text `json:"type,required"`
// contains filtered or unexported fields
}
Text content part for OpenAI-compatible chat completion messages.
The properties Text, Type are required.
func (ChatCompletionNewParamsMessageUserContentArrayItemText) MarshalJSON ¶
func (r ChatCompletionNewParamsMessageUserContentArrayItemText) MarshalJSON() (data []byte, err error)
func (*ChatCompletionNewParamsMessageUserContentArrayItemText) UnmarshalJSON ¶
func (r *ChatCompletionNewParamsMessageUserContentArrayItemText) UnmarshalJSON(data []byte) error
type ChatCompletionNewParamsMessageUserContentArrayItemUnion ¶
type ChatCompletionNewParamsMessageUserContentArrayItemUnion struct {
OfText *ChatCompletionNewParamsMessageUserContentArrayItemText `json:",omitzero,inline"`
OfImageURL *ChatCompletionNewParamsMessageUserContentArrayItemImageURL `json:",omitzero,inline"`
OfFile *ChatCompletionNewParamsMessageUserContentArrayItemFile `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 (ChatCompletionNewParamsMessageUserContentArrayItemUnion) GetFile ¶
func (u ChatCompletionNewParamsMessageUserContentArrayItemUnion) GetFile() *ChatCompletionNewParamsMessageUserContentArrayItemFileFile
Returns a pointer to the underlying variant's property, if present.
func (ChatCompletionNewParamsMessageUserContentArrayItemUnion) GetImageURL ¶
func (u ChatCompletionNewParamsMessageUserContentArrayItemUnion) GetImageURL() *ChatCompletionNewParamsMessageUserContentArrayItemImageURLImageURL
Returns a pointer to the underlying variant's property, if present.
func (ChatCompletionNewParamsMessageUserContentArrayItemUnion) GetText ¶
func (u ChatCompletionNewParamsMessageUserContentArrayItemUnion) GetText() *string
Returns a pointer to the underlying variant's property, if present.
func (ChatCompletionNewParamsMessageUserContentArrayItemUnion) GetType ¶
func (u ChatCompletionNewParamsMessageUserContentArrayItemUnion) GetType() *string
Returns a pointer to the underlying variant's property, if present.
func (ChatCompletionNewParamsMessageUserContentArrayItemUnion) MarshalJSON ¶
func (u ChatCompletionNewParamsMessageUserContentArrayItemUnion) MarshalJSON() ([]byte, error)
func (*ChatCompletionNewParamsMessageUserContentArrayItemUnion) UnmarshalJSON ¶
func (u *ChatCompletionNewParamsMessageUserContentArrayItemUnion) UnmarshalJSON(data []byte) error
type ChatCompletionNewParamsMessageUserContentUnion ¶
type ChatCompletionNewParamsMessageUserContentUnion struct {
OfString param.Opt[string] `json:",omitzero,inline"`
OfChatCompletionNewsMessageUserContentArray []ChatCompletionNewParamsMessageUserContentArrayItemUnion `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 (ChatCompletionNewParamsMessageUserContentUnion) MarshalJSON ¶
func (u ChatCompletionNewParamsMessageUserContentUnion) MarshalJSON() ([]byte, error)
func (*ChatCompletionNewParamsMessageUserContentUnion) UnmarshalJSON ¶
func (u *ChatCompletionNewParamsMessageUserContentUnion) UnmarshalJSON(data []byte) error
type ChatCompletionNewParamsResponseFormatJsonObject ¶
type ChatCompletionNewParamsResponseFormatJsonObject struct {
// Must be "json_object" to indicate generic JSON object response format
Type constant.JsonObject `json:"type,required"`
// contains filtered or unexported fields
}
JSON object response format for OpenAI-compatible chat completion requests.
This struct has a constant value, construct it with NewChatCompletionNewParamsResponseFormatJsonObject.
func NewChatCompletionNewParamsResponseFormatJsonObject ¶
func NewChatCompletionNewParamsResponseFormatJsonObject() ChatCompletionNewParamsResponseFormatJsonObject
func (ChatCompletionNewParamsResponseFormatJsonObject) MarshalJSON ¶
func (r ChatCompletionNewParamsResponseFormatJsonObject) MarshalJSON() (data []byte, err error)
func (*ChatCompletionNewParamsResponseFormatJsonObject) UnmarshalJSON ¶
func (r *ChatCompletionNewParamsResponseFormatJsonObject) UnmarshalJSON(data []byte) error
type ChatCompletionNewParamsResponseFormatJsonSchema ¶
type ChatCompletionNewParamsResponseFormatJsonSchema struct {
// The JSON schema specification for the response
JsonSchema ChatCompletionNewParamsResponseFormatJsonSchemaJsonSchema `json:"json_schema,omitzero,required"`
// Must be "json_schema" to indicate structured JSON response format
//
// 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
}
JSON schema response format for OpenAI-compatible chat completion requests.
The properties JsonSchema, Type are required.
func (ChatCompletionNewParamsResponseFormatJsonSchema) MarshalJSON ¶
func (r ChatCompletionNewParamsResponseFormatJsonSchema) MarshalJSON() (data []byte, err error)
func (*ChatCompletionNewParamsResponseFormatJsonSchema) UnmarshalJSON ¶
func (r *ChatCompletionNewParamsResponseFormatJsonSchema) UnmarshalJSON(data []byte) error
type ChatCompletionNewParamsResponseFormatJsonSchemaJsonSchema ¶
type ChatCompletionNewParamsResponseFormatJsonSchemaJsonSchema struct {
// Name of the schema
Name string `json:"name,required"`
// (Optional) Description of the schema
Description param.Opt[string] `json:"description,omitzero"`
// (Optional) Whether to enforce strict adherence to the schema
Strict param.Opt[bool] `json:"strict,omitzero"`
// (Optional) The JSON schema definition
Schema map[string]ChatCompletionNewParamsResponseFormatJsonSchemaJsonSchemaSchemaUnion `json:"schema,omitzero"`
// contains filtered or unexported fields
}
The JSON schema specification for the response
The property Name is required.
func (ChatCompletionNewParamsResponseFormatJsonSchemaJsonSchema) MarshalJSON ¶
func (r ChatCompletionNewParamsResponseFormatJsonSchemaJsonSchema) MarshalJSON() (data []byte, err error)
func (*ChatCompletionNewParamsResponseFormatJsonSchemaJsonSchema) UnmarshalJSON ¶
func (r *ChatCompletionNewParamsResponseFormatJsonSchemaJsonSchema) UnmarshalJSON(data []byte) error
type ChatCompletionNewParamsResponseFormatJsonSchemaJsonSchemaSchemaUnion ¶
type ChatCompletionNewParamsResponseFormatJsonSchemaJsonSchemaSchemaUnion 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 (ChatCompletionNewParamsResponseFormatJsonSchemaJsonSchemaSchemaUnion) MarshalJSON ¶
func (u ChatCompletionNewParamsResponseFormatJsonSchemaJsonSchemaSchemaUnion) MarshalJSON() ([]byte, error)
func (*ChatCompletionNewParamsResponseFormatJsonSchemaJsonSchemaSchemaUnion) UnmarshalJSON ¶
func (u *ChatCompletionNewParamsResponseFormatJsonSchemaJsonSchemaSchemaUnion) UnmarshalJSON(data []byte) error
type ChatCompletionNewParamsResponseFormatText ¶
type ChatCompletionNewParamsResponseFormatText struct {
// Must be "text" to indicate plain text response format
Type constant.Text `json:"type,required"`
// contains filtered or unexported fields
}
Text response format for OpenAI-compatible chat completion requests.
This struct has a constant value, construct it with NewChatCompletionNewParamsResponseFormatText.
func NewChatCompletionNewParamsResponseFormatText ¶
func NewChatCompletionNewParamsResponseFormatText() ChatCompletionNewParamsResponseFormatText
func (ChatCompletionNewParamsResponseFormatText) MarshalJSON ¶
func (r ChatCompletionNewParamsResponseFormatText) MarshalJSON() (data []byte, err error)
func (*ChatCompletionNewParamsResponseFormatText) UnmarshalJSON ¶
func (r *ChatCompletionNewParamsResponseFormatText) UnmarshalJSON(data []byte) error
type ChatCompletionNewParamsResponseFormatUnion ¶
type ChatCompletionNewParamsResponseFormatUnion struct {
OfText *ChatCompletionNewParamsResponseFormatText `json:",omitzero,inline"`
OfJsonSchema *ChatCompletionNewParamsResponseFormatJsonSchema `json:",omitzero,inline"`
OfJsonObject *ChatCompletionNewParamsResponseFormatJsonObject `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 (ChatCompletionNewParamsResponseFormatUnion) GetJsonSchema ¶
func (u ChatCompletionNewParamsResponseFormatUnion) GetJsonSchema() *ChatCompletionNewParamsResponseFormatJsonSchemaJsonSchema
Returns a pointer to the underlying variant's property, if present.
func (ChatCompletionNewParamsResponseFormatUnion) GetType ¶
func (u ChatCompletionNewParamsResponseFormatUnion) GetType() *string
Returns a pointer to the underlying variant's property, if present.
func (ChatCompletionNewParamsResponseFormatUnion) MarshalJSON ¶
func (u ChatCompletionNewParamsResponseFormatUnion) MarshalJSON() ([]byte, error)
func (*ChatCompletionNewParamsResponseFormatUnion) UnmarshalJSON ¶
func (u *ChatCompletionNewParamsResponseFormatUnion) UnmarshalJSON(data []byte) error
type ChatCompletionNewParamsStopUnion ¶
type ChatCompletionNewParamsStopUnion struct {
OfString param.Opt[string] `json:",omitzero,inline"`
OfStringArray []string `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 (ChatCompletionNewParamsStopUnion) MarshalJSON ¶
func (u ChatCompletionNewParamsStopUnion) MarshalJSON() ([]byte, error)
func (*ChatCompletionNewParamsStopUnion) UnmarshalJSON ¶
func (u *ChatCompletionNewParamsStopUnion) UnmarshalJSON(data []byte) error
type ChatCompletionNewParamsStreamOptionUnion ¶
type ChatCompletionNewParamsStreamOptionUnion 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 (ChatCompletionNewParamsStreamOptionUnion) MarshalJSON ¶
func (u ChatCompletionNewParamsStreamOptionUnion) MarshalJSON() ([]byte, error)
func (*ChatCompletionNewParamsStreamOptionUnion) UnmarshalJSON ¶
func (u *ChatCompletionNewParamsStreamOptionUnion) UnmarshalJSON(data []byte) error
type ChatCompletionNewParamsToolChoiceMapItemUnion ¶
type ChatCompletionNewParamsToolChoiceMapItemUnion 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 (ChatCompletionNewParamsToolChoiceMapItemUnion) MarshalJSON ¶
func (u ChatCompletionNewParamsToolChoiceMapItemUnion) MarshalJSON() ([]byte, error)
func (*ChatCompletionNewParamsToolChoiceMapItemUnion) UnmarshalJSON ¶
func (u *ChatCompletionNewParamsToolChoiceMapItemUnion) UnmarshalJSON(data []byte) error
type ChatCompletionNewParamsToolChoiceUnion ¶
type ChatCompletionNewParamsToolChoiceUnion struct {
OfString param.Opt[string] `json:",omitzero,inline"`
OfChatCompletionNewsToolChoiceMapMap map[string]ChatCompletionNewParamsToolChoiceMapItemUnion `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 (ChatCompletionNewParamsToolChoiceUnion) MarshalJSON ¶
func (u ChatCompletionNewParamsToolChoiceUnion) MarshalJSON() ([]byte, error)
func (*ChatCompletionNewParamsToolChoiceUnion) UnmarshalJSON ¶
func (u *ChatCompletionNewParamsToolChoiceUnion) UnmarshalJSON(data []byte) error
type ChatCompletionNewParamsToolUnion ¶
type ChatCompletionNewParamsToolUnion 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 (ChatCompletionNewParamsToolUnion) MarshalJSON ¶
func (u ChatCompletionNewParamsToolUnion) MarshalJSON() ([]byte, error)
func (*ChatCompletionNewParamsToolUnion) UnmarshalJSON ¶
func (u *ChatCompletionNewParamsToolUnion) UnmarshalJSON(data []byte) error
type ChatCompletionNewResponseOpenAIChatCompletion ¶
type ChatCompletionNewResponseOpenAIChatCompletion struct {
// The ID of the chat completion
ID string `json:"id,required"`
// List of choices
Choices []ChatCompletionNewResponseOpenAIChatCompletionChoice `json:"choices,required"`
// The Unix timestamp in seconds when the chat completion was created
Created int64 `json:"created,required"`
// The model that was used to generate the chat completion
Model string `json:"model,required"`
// The object type, which will be "chat.completion"
Object constant.ChatCompletion `json:"object,required"`
// Token usage information for the completion
Usage ChatCompletionNewResponseOpenAIChatCompletionUsage `json:"usage"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Choices respjson.Field
Created respjson.Field
Model respjson.Field
Object respjson.Field
Usage respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Response from an OpenAI-compatible chat completion request.
func (ChatCompletionNewResponseOpenAIChatCompletion) RawJSON ¶
func (r ChatCompletionNewResponseOpenAIChatCompletion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionNewResponseOpenAIChatCompletion) UnmarshalJSON ¶
func (r *ChatCompletionNewResponseOpenAIChatCompletion) UnmarshalJSON(data []byte) error
type ChatCompletionNewResponseOpenAIChatCompletionChoice ¶
type ChatCompletionNewResponseOpenAIChatCompletionChoice struct {
// The reason the model stopped generating
FinishReason string `json:"finish_reason,required"`
// The index of the choice
Index int64 `json:"index,required"`
// The message from the model
Message ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUnion `json:"message,required"`
// (Optional) The log probabilities for the tokens in the message
Logprobs ChatCompletionNewResponseOpenAIChatCompletionChoiceLogprobs `json:"logprobs"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
FinishReason respjson.Field
Index respjson.Field
Message respjson.Field
Logprobs respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A choice from an OpenAI-compatible chat completion response.
func (ChatCompletionNewResponseOpenAIChatCompletionChoice) RawJSON ¶
func (r ChatCompletionNewResponseOpenAIChatCompletionChoice) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionNewResponseOpenAIChatCompletionChoice) UnmarshalJSON ¶
func (r *ChatCompletionNewResponseOpenAIChatCompletionChoice) UnmarshalJSON(data []byte) error
type ChatCompletionNewResponseOpenAIChatCompletionChoiceLogprobs ¶
type ChatCompletionNewResponseOpenAIChatCompletionChoiceLogprobs struct {
// (Optional) The log probabilities for the tokens in the message
Content []ChatCompletionNewResponseOpenAIChatCompletionChoiceLogprobsContent `json:"content"`
// (Optional) The log probabilities for the tokens in the message
Refusal []ChatCompletionNewResponseOpenAIChatCompletionChoiceLogprobsRefusal `json:"refusal"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Content respjson.Field
Refusal respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
(Optional) The log probabilities for the tokens in the message
func (ChatCompletionNewResponseOpenAIChatCompletionChoiceLogprobs) RawJSON ¶
func (r ChatCompletionNewResponseOpenAIChatCompletionChoiceLogprobs) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionNewResponseOpenAIChatCompletionChoiceLogprobs) UnmarshalJSON ¶
func (r *ChatCompletionNewResponseOpenAIChatCompletionChoiceLogprobs) UnmarshalJSON(data []byte) error
type ChatCompletionNewResponseOpenAIChatCompletionChoiceLogprobsContent ¶
type ChatCompletionNewResponseOpenAIChatCompletionChoiceLogprobsContent struct {
Token string `json:"token,required"`
Logprob float64 `json:"logprob,required"`
TopLogprobs []ChatCompletionNewResponseOpenAIChatCompletionChoiceLogprobsContentTopLogprob `json:"top_logprobs,required"`
Bytes []int64 `json:"bytes"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Token respjson.Field
Logprob respjson.Field
TopLogprobs respjson.Field
Bytes respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The log probability for a token from an OpenAI-compatible chat completion response.
func (ChatCompletionNewResponseOpenAIChatCompletionChoiceLogprobsContent) RawJSON ¶
func (r ChatCompletionNewResponseOpenAIChatCompletionChoiceLogprobsContent) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionNewResponseOpenAIChatCompletionChoiceLogprobsContent) UnmarshalJSON ¶
func (r *ChatCompletionNewResponseOpenAIChatCompletionChoiceLogprobsContent) UnmarshalJSON(data []byte) error
type ChatCompletionNewResponseOpenAIChatCompletionChoiceLogprobsContentTopLogprob ¶
type ChatCompletionNewResponseOpenAIChatCompletionChoiceLogprobsContentTopLogprob struct {
Token string `json:"token,required"`
Logprob float64 `json:"logprob,required"`
Bytes []int64 `json:"bytes"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Token respjson.Field
Logprob respjson.Field
Bytes respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The top log probability for a token from an OpenAI-compatible chat completion response.
func (ChatCompletionNewResponseOpenAIChatCompletionChoiceLogprobsContentTopLogprob) RawJSON ¶
func (r ChatCompletionNewResponseOpenAIChatCompletionChoiceLogprobsContentTopLogprob) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionNewResponseOpenAIChatCompletionChoiceLogprobsContentTopLogprob) UnmarshalJSON ¶
func (r *ChatCompletionNewResponseOpenAIChatCompletionChoiceLogprobsContentTopLogprob) UnmarshalJSON(data []byte) error
type ChatCompletionNewResponseOpenAIChatCompletionChoiceLogprobsRefusal ¶
type ChatCompletionNewResponseOpenAIChatCompletionChoiceLogprobsRefusal struct {
Token string `json:"token,required"`
Logprob float64 `json:"logprob,required"`
TopLogprobs []ChatCompletionNewResponseOpenAIChatCompletionChoiceLogprobsRefusalTopLogprob `json:"top_logprobs,required"`
Bytes []int64 `json:"bytes"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Token respjson.Field
Logprob respjson.Field
TopLogprobs respjson.Field
Bytes respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The log probability for a token from an OpenAI-compatible chat completion response.
func (ChatCompletionNewResponseOpenAIChatCompletionChoiceLogprobsRefusal) RawJSON ¶
func (r ChatCompletionNewResponseOpenAIChatCompletionChoiceLogprobsRefusal) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionNewResponseOpenAIChatCompletionChoiceLogprobsRefusal) UnmarshalJSON ¶
func (r *ChatCompletionNewResponseOpenAIChatCompletionChoiceLogprobsRefusal) UnmarshalJSON(data []byte) error
type ChatCompletionNewResponseOpenAIChatCompletionChoiceLogprobsRefusalTopLogprob ¶
type ChatCompletionNewResponseOpenAIChatCompletionChoiceLogprobsRefusalTopLogprob struct {
Token string `json:"token,required"`
Logprob float64 `json:"logprob,required"`
Bytes []int64 `json:"bytes"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Token respjson.Field
Logprob respjson.Field
Bytes respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The top log probability for a token from an OpenAI-compatible chat completion response.
func (ChatCompletionNewResponseOpenAIChatCompletionChoiceLogprobsRefusalTopLogprob) RawJSON ¶
func (r ChatCompletionNewResponseOpenAIChatCompletionChoiceLogprobsRefusalTopLogprob) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionNewResponseOpenAIChatCompletionChoiceLogprobsRefusalTopLogprob) UnmarshalJSON ¶
func (r *ChatCompletionNewResponseOpenAIChatCompletionChoiceLogprobsRefusalTopLogprob) UnmarshalJSON(data []byte) error
type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistant ¶
type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistant struct {
// Must be "assistant" to identify this as the model's response
Role constant.Assistant `json:"role,required"`
// The content of the model's response
Content ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistantContentUnion `json:"content"`
// (Optional) The name of the assistant message participant.
Name string `json:"name"`
// List of tool calls. Each tool call is an OpenAIChatCompletionToolCall object.
ToolCalls []ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistantToolCall `json:"tool_calls"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Role respjson.Field
Content respjson.Field
Name 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 an OpenAI-compatible chat completion request.
func (ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistant) RawJSON ¶
func (r ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistant) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistant) UnmarshalJSON ¶
func (r *ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistant) UnmarshalJSON(data []byte) error
type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistantContentArrayItem ¶
type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistantContentArrayItem struct {
// The text content of the message
Text string `json:"text,required"`
// Must be "text" to identify this as text content
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:"-"`
}
Text content part for OpenAI-compatible chat completion messages.
func (ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistantContentArrayItem) RawJSON ¶
func (r ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistantContentArrayItem) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistantContentArrayItem) UnmarshalJSON ¶
func (r *ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistantContentArrayItem) UnmarshalJSON(data []byte) error
type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistantContentUnion ¶
type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistantContentUnion 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
// [[]ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistantContentArrayItem]
// instead of an object.
OfChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistantContentArray []ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistantContentArrayItem `json:",inline"`
JSON struct {
OfString respjson.Field
OfChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistantContentArray respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistantContentUnion contains all possible properties and values from [string], [[]ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistantContentArrayItem].
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 OfChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistantContentArray]
func (ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistantContentUnion) AsChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistantContentArray ¶
func (u ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistantContentUnion) AsChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistantContentArray() (v []ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistantContentArrayItem)
func (ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistantContentUnion) AsString ¶
func (u ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistantContentUnion) AsString() (v string)
func (ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistantContentUnion) RawJSON ¶
func (u ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistantContentUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistantContentUnion) UnmarshalJSON ¶
func (r *ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistantContentUnion) UnmarshalJSON(data []byte) error
type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistantToolCall ¶
type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistantToolCall struct {
// Must be "function" to identify this as a function call
Type constant.Function `json:"type,required"`
// (Optional) Unique identifier for the tool call
ID string `json:"id"`
// (Optional) Function call details
Function ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistantToolCallFunction `json:"function"`
// (Optional) Index of the tool call in the list
Index int64 `json:"index"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Type respjson.Field
ID respjson.Field
Function respjson.Field
Index respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Tool call specification for OpenAI-compatible chat completion responses.
func (ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistantToolCall) RawJSON ¶
func (r ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistantToolCall) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistantToolCall) UnmarshalJSON ¶
func (r *ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistantToolCall) UnmarshalJSON(data []byte) error
type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistantToolCallFunction ¶
type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistantToolCallFunction struct {
// (Optional) Arguments to pass to the function as a JSON string
Arguments string `json:"arguments"`
// (Optional) Name of the function to call
Name string `json:"name"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Arguments respjson.Field
Name respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
(Optional) Function call details
func (ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistantToolCallFunction) RawJSON ¶
func (r ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistantToolCallFunction) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistantToolCallFunction) UnmarshalJSON ¶
func (r *ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistantToolCallFunction) UnmarshalJSON(data []byte) error
type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageDeveloper ¶
type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageDeveloper struct {
// The content of the developer message
Content ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageDeveloperContentUnion `json:"content,required"`
// Must be "developer" to identify this as a developer message
Role constant.Developer `json:"role,required"`
// (Optional) The name of the developer message participant.
Name string `json:"name"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Content respjson.Field
Role respjson.Field
Name respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A message from the developer in an OpenAI-compatible chat completion request.
func (ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageDeveloper) RawJSON ¶
func (r ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageDeveloper) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageDeveloper) UnmarshalJSON ¶
func (r *ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageDeveloper) UnmarshalJSON(data []byte) error
type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageDeveloperContentArrayItem ¶
type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageDeveloperContentArrayItem struct {
// The text content of the message
Text string `json:"text,required"`
// Must be "text" to identify this as text content
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:"-"`
}
Text content part for OpenAI-compatible chat completion messages.
func (ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageDeveloperContentArrayItem) RawJSON ¶
func (r ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageDeveloperContentArrayItem) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageDeveloperContentArrayItem) UnmarshalJSON ¶
func (r *ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageDeveloperContentArrayItem) UnmarshalJSON(data []byte) error
type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageDeveloperContentUnion ¶
type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageDeveloperContentUnion 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
// [[]ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageDeveloperContentArrayItem]
// instead of an object.
OfChatCompletionNewResponseOpenAIChatCompletionChoiceMessageDeveloperContentArray []ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageDeveloperContentArrayItem `json:",inline"`
JSON struct {
OfString respjson.Field
OfChatCompletionNewResponseOpenAIChatCompletionChoiceMessageDeveloperContentArray respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageDeveloperContentUnion contains all possible properties and values from [string], [[]ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageDeveloperContentArrayItem].
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 OfChatCompletionNewResponseOpenAIChatCompletionChoiceMessageDeveloperContentArray]
func (ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageDeveloperContentUnion) AsChatCompletionNewResponseOpenAIChatCompletionChoiceMessageDeveloperContentArray ¶
func (u ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageDeveloperContentUnion) AsChatCompletionNewResponseOpenAIChatCompletionChoiceMessageDeveloperContentArray() (v []ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageDeveloperContentArrayItem)
func (ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageDeveloperContentUnion) AsString ¶
func (u ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageDeveloperContentUnion) AsString() (v string)
func (ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageDeveloperContentUnion) RawJSON ¶
func (u ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageDeveloperContentUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageDeveloperContentUnion) UnmarshalJSON ¶
func (r *ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageDeveloperContentUnion) UnmarshalJSON(data []byte) error
type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageSystem ¶
type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageSystem 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 ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageSystemContentUnion `json:"content,required"`
// Must be "system" to identify this as a system message
Role constant.System `json:"role,required"`
// (Optional) The name of the system message participant.
Name string `json:"name"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Content respjson.Field
Role respjson.Field
Name respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A system message providing instructions or context to the model.
func (ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageSystem) RawJSON ¶
func (r ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageSystem) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageSystem) UnmarshalJSON ¶
func (r *ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageSystem) UnmarshalJSON(data []byte) error
type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageSystemContentArrayItem ¶
type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageSystemContentArrayItem struct {
// The text content of the message
Text string `json:"text,required"`
// Must be "text" to identify this as text content
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:"-"`
}
Text content part for OpenAI-compatible chat completion messages.
func (ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageSystemContentArrayItem) RawJSON ¶
func (r ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageSystemContentArrayItem) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageSystemContentArrayItem) UnmarshalJSON ¶
func (r *ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageSystemContentArrayItem) UnmarshalJSON(data []byte) error
type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageSystemContentUnion ¶
type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageSystemContentUnion 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
// [[]ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageSystemContentArrayItem]
// instead of an object.
OfChatCompletionNewResponseOpenAIChatCompletionChoiceMessageSystemContentArray []ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageSystemContentArrayItem `json:",inline"`
JSON struct {
OfString respjson.Field
OfChatCompletionNewResponseOpenAIChatCompletionChoiceMessageSystemContentArray respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageSystemContentUnion contains all possible properties and values from [string], [[]ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageSystemContentArrayItem].
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 OfChatCompletionNewResponseOpenAIChatCompletionChoiceMessageSystemContentArray]
func (ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageSystemContentUnion) AsChatCompletionNewResponseOpenAIChatCompletionChoiceMessageSystemContentArray ¶
func (u ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageSystemContentUnion) AsChatCompletionNewResponseOpenAIChatCompletionChoiceMessageSystemContentArray() (v []ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageSystemContentArrayItem)
func (ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageSystemContentUnion) AsString ¶
func (u ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageSystemContentUnion) AsString() (v string)
func (ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageSystemContentUnion) RawJSON ¶
func (u ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageSystemContentUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageSystemContentUnion) UnmarshalJSON ¶
func (r *ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageSystemContentUnion) UnmarshalJSON(data []byte) error
type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageTool ¶
type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageTool struct {
// The response content from the tool
Content ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageToolContentUnion `json:"content,required"`
// Must be "tool" to identify this as a tool response
Role constant.Tool `json:"role,required"`
// Unique identifier for the tool call this response is for
ToolCallID string `json:"tool_call_id,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Content respjson.Field
Role respjson.Field
ToolCallID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A message representing the result of a tool invocation in an OpenAI-compatible chat completion request.
func (ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageTool) RawJSON ¶
func (r ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageTool) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageTool) UnmarshalJSON ¶
func (r *ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageTool) UnmarshalJSON(data []byte) error
type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageToolContentArrayItem ¶
type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageToolContentArrayItem struct {
// The text content of the message
Text string `json:"text,required"`
// Must be "text" to identify this as text content
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:"-"`
}
Text content part for OpenAI-compatible chat completion messages.
func (ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageToolContentArrayItem) RawJSON ¶
func (r ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageToolContentArrayItem) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageToolContentArrayItem) UnmarshalJSON ¶
func (r *ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageToolContentArrayItem) UnmarshalJSON(data []byte) error
type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageToolContentUnion ¶
type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageToolContentUnion 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
// [[]ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageToolContentArrayItem]
// instead of an object.
OfChatCompletionNewResponseOpenAIChatCompletionChoiceMessageToolContentArray []ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageToolContentArrayItem `json:",inline"`
JSON struct {
OfString respjson.Field
OfChatCompletionNewResponseOpenAIChatCompletionChoiceMessageToolContentArray respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageToolContentUnion contains all possible properties and values from [string], [[]ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageToolContentArrayItem].
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 OfChatCompletionNewResponseOpenAIChatCompletionChoiceMessageToolContentArray]
func (ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageToolContentUnion) AsChatCompletionNewResponseOpenAIChatCompletionChoiceMessageToolContentArray ¶
func (u ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageToolContentUnion) AsChatCompletionNewResponseOpenAIChatCompletionChoiceMessageToolContentArray() (v []ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageToolContentArrayItem)
func (ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageToolContentUnion) AsString ¶
func (u ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageToolContentUnion) AsString() (v string)
func (ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageToolContentUnion) RawJSON ¶
func (u ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageToolContentUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageToolContentUnion) UnmarshalJSON ¶
func (r *ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageToolContentUnion) UnmarshalJSON(data []byte) error
type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUnion ¶
type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUnion struct {
// This field is a union of
// [ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentUnion],
// [ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageSystemContentUnion],
// [ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistantContentUnion],
// [ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageToolContentUnion],
// [ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageDeveloperContentUnion]
Content ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUnionContent `json:"content"`
// Any of "user", "system", "assistant", "tool", "developer".
Role string `json:"role"`
Name string `json:"name"`
// This field is from variant
// [ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistant].
ToolCalls []ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistantToolCall `json:"tool_calls"`
// This field is from variant
// [ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageTool].
ToolCallID string `json:"tool_call_id"`
JSON struct {
Content respjson.Field
Role respjson.Field
Name respjson.Field
ToolCalls respjson.Field
ToolCallID respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUnion contains all possible properties and values from ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUser, ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageSystem, ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistant, ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageTool, ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageDeveloper.
Use the ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUnion.AsAny method to switch on the variant.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUnion) AsAny ¶
func (u ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUnion) AsAny() anyChatCompletionNewResponseOpenAIChatCompletionChoiceMessage
Use the following switch statement to find the correct variant
switch variant := ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUnion.AsAny().(type) {
case llamastackclient.ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUser:
case llamastackclient.ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageSystem:
case llamastackclient.ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistant:
case llamastackclient.ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageTool:
case llamastackclient.ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageDeveloper:
default:
fmt.Errorf("no variant present")
}
func (ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUnion) AsAssistant ¶
func (ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUnion) AsDeveloper ¶
func (ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUnion) RawJSON ¶
func (u ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUnion) UnmarshalJSON ¶
func (r *ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUnion) UnmarshalJSON(data []byte) error
type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUnionContent ¶
type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUnionContent 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
// [[]ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemUnion]
// instead of an object.
OfChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArray []ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemUnion `json:",inline"`
// This field will be present if the value is a
// [[]ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageSystemContentArrayItem]
// instead of an object.
OfChatCompletionNewResponseOpenAIChatCompletionChoiceMessageSystemContentArray []ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageSystemContentArrayItem `json:",inline"`
// This field will be present if the value is a
// [[]ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistantContentArrayItem]
// instead of an object.
OfChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistantContentArray []ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistantContentArrayItem `json:",inline"`
// This field will be present if the value is a
// [[]ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageToolContentArrayItem]
// instead of an object.
OfChatCompletionNewResponseOpenAIChatCompletionChoiceMessageToolContentArray []ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageToolContentArrayItem `json:",inline"`
// This field will be present if the value is a
// [[]ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageDeveloperContentArrayItem]
// instead of an object.
OfChatCompletionNewResponseOpenAIChatCompletionChoiceMessageDeveloperContentArray []ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageDeveloperContentArrayItem `json:",inline"`
JSON struct {
OfString respjson.Field
OfChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArray respjson.Field
OfChatCompletionNewResponseOpenAIChatCompletionChoiceMessageSystemContentArray respjson.Field
OfChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistantContentArray respjson.Field
OfChatCompletionNewResponseOpenAIChatCompletionChoiceMessageToolContentArray respjson.Field
OfChatCompletionNewResponseOpenAIChatCompletionChoiceMessageDeveloperContentArray respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUnionContent is an implicit subunion of ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUnion. ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUnionContent provides convenient access to the sub-properties of the union.
For type safety it is recommended to directly use a variant of the ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUnion.
If the underlying value is not a json object, one of the following properties will be valid: OfString OfChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArray OfChatCompletionNewResponseOpenAIChatCompletionChoiceMessageSystemContentArray OfChatCompletionNewResponseOpenAIChatCompletionChoiceMessageAssistantContentArray OfChatCompletionNewResponseOpenAIChatCompletionChoiceMessageToolContentArray OfChatCompletionNewResponseOpenAIChatCompletionChoiceMessageDeveloperContentArray]
func (*ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUnionContent) UnmarshalJSON ¶
func (r *ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUnionContent) UnmarshalJSON(data []byte) error
type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUser ¶
type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUser struct {
// The content of the message, which can include text and other media
Content ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentUnion `json:"content,required"`
// Must be "user" to identify this as a user message
Role constant.User `json:"role,required"`
// (Optional) The name of the user message participant.
Name string `json:"name"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Content respjson.Field
Role respjson.Field
Name respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A message from the user in an OpenAI-compatible chat completion request.
func (ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUser) RawJSON ¶
func (r ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUser) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUser) UnmarshalJSON ¶
func (r *ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUser) UnmarshalJSON(data []byte) error
type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemFile ¶
type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemFile struct {
File ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemFileFile `json:"file,required"`
Type constant.File `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
File respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemFile) RawJSON ¶
func (r ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemFile) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemFile) UnmarshalJSON ¶
func (r *ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemFile) UnmarshalJSON(data []byte) error
type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemFileFile ¶
type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemFileFile struct {
FileData string `json:"file_data"`
FileID string `json:"file_id"`
Filename string `json:"filename"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
FileData respjson.Field
FileID respjson.Field
Filename respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemFileFile) RawJSON ¶
func (r ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemFileFile) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemFileFile) UnmarshalJSON ¶
func (r *ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemFileFile) UnmarshalJSON(data []byte) error
type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemImageURL ¶
type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemImageURL struct {
// Image URL specification and processing details
ImageURL ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemImageURLImageURL `json:"image_url,required"`
// Must be "image_url" to identify this as image content
Type constant.ImageURL `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ImageURL respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Image content part for OpenAI-compatible chat completion messages.
func (ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemImageURL) RawJSON ¶
func (r ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemImageURL) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemImageURL) UnmarshalJSON ¶
func (r *ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemImageURL) UnmarshalJSON(data []byte) error
type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemImageURLImageURL ¶
type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemImageURLImageURL struct {
// URL of the image to include in the message
URL string `json:"url,required"`
// (Optional) Level of detail for image processing. Can be "low", "high", or "auto"
Detail string `json:"detail"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
URL respjson.Field
Detail respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Image URL specification and processing details
func (ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemImageURLImageURL) RawJSON ¶
func (r ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemImageURLImageURL) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemImageURLImageURL) UnmarshalJSON ¶
func (r *ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemImageURLImageURL) UnmarshalJSON(data []byte) error
type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemText ¶
type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemText struct {
// The text content of the message
Text string `json:"text,required"`
// Must be "text" to identify this as text content
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:"-"`
}
Text content part for OpenAI-compatible chat completion messages.
func (ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemText) RawJSON ¶
func (r ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemText) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemText) UnmarshalJSON ¶
func (r *ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemText) UnmarshalJSON(data []byte) error
type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemUnion ¶
type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemUnion struct {
// This field is from variant
// [ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemText].
Text string `json:"text"`
// Any of "text", "image_url", "file".
Type string `json:"type"`
// This field is from variant
// [ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemImageURL].
ImageURL ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemImageURLImageURL `json:"image_url"`
// This field is from variant
// [ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemFile].
File ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemFileFile `json:"file"`
JSON struct {
Text respjson.Field
Type respjson.Field
ImageURL respjson.Field
File respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemUnion contains all possible properties and values from ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemText, ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemImageURL, ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemFile.
Use the ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemUnion.AsAny method to switch on the variant.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemUnion) AsAny ¶
func (u ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemUnion) AsAny() anyChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItem
Use the following switch statement to find the correct variant
switch variant := ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemUnion.AsAny().(type) {
case llamastackclient.ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemText:
case llamastackclient.ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemImageURL:
case llamastackclient.ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemFile:
default:
fmt.Errorf("no variant present")
}
func (ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemUnion) AsImageURL ¶
func (ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemUnion) RawJSON ¶
func (u ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemUnion) UnmarshalJSON ¶
func (r *ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemUnion) UnmarshalJSON(data []byte) error
type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentUnion ¶
type ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentUnion 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
// [[]ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemUnion]
// instead of an object.
OfChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArray []ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemUnion `json:",inline"`
JSON struct {
OfString respjson.Field
OfChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArray respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentUnion contains all possible properties and values from [string], [[]ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemUnion].
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 OfChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArray]
func (ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentUnion) AsChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArray ¶
func (u ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentUnion) AsChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArray() (v []ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentArrayItemUnion)
func (ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentUnion) AsString ¶
func (u ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentUnion) AsString() (v string)
func (ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentUnion) RawJSON ¶
func (u ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentUnion) UnmarshalJSON ¶
func (r *ChatCompletionNewResponseOpenAIChatCompletionChoiceMessageUserContentUnion) UnmarshalJSON(data []byte) error
type ChatCompletionNewResponseOpenAIChatCompletionUsage ¶
type ChatCompletionNewResponseOpenAIChatCompletionUsage struct {
// Number of tokens in the completion
CompletionTokens int64 `json:"completion_tokens,required"`
// Number of tokens in the prompt
PromptTokens int64 `json:"prompt_tokens,required"`
// Total tokens used (prompt + completion)
TotalTokens int64 `json:"total_tokens,required"`
// Token details for output tokens in OpenAI chat completion usage.
CompletionTokensDetails ChatCompletionNewResponseOpenAIChatCompletionUsageCompletionTokensDetails `json:"completion_tokens_details"`
// Token details for prompt tokens in OpenAI chat completion usage.
PromptTokensDetails ChatCompletionNewResponseOpenAIChatCompletionUsagePromptTokensDetails `json:"prompt_tokens_details"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CompletionTokens respjson.Field
PromptTokens respjson.Field
TotalTokens respjson.Field
CompletionTokensDetails respjson.Field
PromptTokensDetails respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Token usage information for the completion
func (ChatCompletionNewResponseOpenAIChatCompletionUsage) RawJSON ¶
func (r ChatCompletionNewResponseOpenAIChatCompletionUsage) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionNewResponseOpenAIChatCompletionUsage) UnmarshalJSON ¶
func (r *ChatCompletionNewResponseOpenAIChatCompletionUsage) UnmarshalJSON(data []byte) error
type ChatCompletionNewResponseOpenAIChatCompletionUsageCompletionTokensDetails ¶
type ChatCompletionNewResponseOpenAIChatCompletionUsageCompletionTokensDetails struct {
// Number of tokens used for reasoning (o1/o3 models)
ReasoningTokens int64 `json:"reasoning_tokens"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ReasoningTokens respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Token details for output tokens in OpenAI chat completion usage.
func (ChatCompletionNewResponseOpenAIChatCompletionUsageCompletionTokensDetails) RawJSON ¶
func (r ChatCompletionNewResponseOpenAIChatCompletionUsageCompletionTokensDetails) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionNewResponseOpenAIChatCompletionUsageCompletionTokensDetails) UnmarshalJSON ¶
func (r *ChatCompletionNewResponseOpenAIChatCompletionUsageCompletionTokensDetails) UnmarshalJSON(data []byte) error
type ChatCompletionNewResponseOpenAIChatCompletionUsagePromptTokensDetails ¶
type ChatCompletionNewResponseOpenAIChatCompletionUsagePromptTokensDetails struct {
// Number of tokens retrieved from cache
CachedTokens int64 `json:"cached_tokens"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CachedTokens respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Token details for prompt tokens in OpenAI chat completion usage.
func (ChatCompletionNewResponseOpenAIChatCompletionUsagePromptTokensDetails) RawJSON ¶
func (r ChatCompletionNewResponseOpenAIChatCompletionUsagePromptTokensDetails) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionNewResponseOpenAIChatCompletionUsagePromptTokensDetails) UnmarshalJSON ¶
func (r *ChatCompletionNewResponseOpenAIChatCompletionUsagePromptTokensDetails) UnmarshalJSON(data []byte) error
type ChatCompletionNewResponseUnion ¶
type ChatCompletionNewResponseUnion struct {
ID string `json:"id"`
// This field is a union of
// [[]ChatCompletionNewResponseOpenAIChatCompletionChoice],
// [[]ChatCompletionChunkChoice]
Choices ChatCompletionNewResponseUnionChoices `json:"choices"`
Created int64 `json:"created"`
Model string `json:"model"`
Object string `json:"object"`
// This field is a union of [ChatCompletionNewResponseOpenAIChatCompletionUsage],
// [ChatCompletionChunkUsage]
Usage ChatCompletionNewResponseUnionUsage `json:"usage"`
JSON struct {
ID respjson.Field
Choices respjson.Field
Created respjson.Field
Model respjson.Field
Object respjson.Field
Usage respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ChatCompletionNewResponseUnion contains all possible properties and values from ChatCompletionNewResponseOpenAIChatCompletion, ChatCompletionChunk.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (ChatCompletionNewResponseUnion) AsOpenAIChatCompletion ¶
func (u ChatCompletionNewResponseUnion) AsOpenAIChatCompletion() (v ChatCompletionNewResponseOpenAIChatCompletion)
func (ChatCompletionNewResponseUnion) AsOpenAIChatCompletionChunk ¶
func (u ChatCompletionNewResponseUnion) AsOpenAIChatCompletionChunk() (v ChatCompletionChunk)
func (ChatCompletionNewResponseUnion) RawJSON ¶
func (u ChatCompletionNewResponseUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionNewResponseUnion) UnmarshalJSON ¶
func (r *ChatCompletionNewResponseUnion) UnmarshalJSON(data []byte) error
type ChatCompletionNewResponseUnionChoices ¶
type ChatCompletionNewResponseUnionChoices struct {
// This field will be present if the value is a
// [[]ChatCompletionNewResponseOpenAIChatCompletionChoice] instead of an object.
OfChatCompletionNewResponseOpenAIChatCompletionChoices []ChatCompletionNewResponseOpenAIChatCompletionChoice `json:",inline"`
// This field will be present if the value is a [[]ChatCompletionChunkChoice]
// instead of an object.
OfChatCompletionChunkChoices []ChatCompletionChunkChoice `json:",inline"`
JSON struct {
OfChatCompletionNewResponseOpenAIChatCompletionChoices respjson.Field
OfChatCompletionChunkChoices respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ChatCompletionNewResponseUnionChoices is an implicit subunion of ChatCompletionNewResponseUnion. ChatCompletionNewResponseUnionChoices provides convenient access to the sub-properties of the union.
For type safety it is recommended to directly use a variant of the ChatCompletionNewResponseUnion.
If the underlying value is not a json object, one of the following properties will be valid: OfChatCompletionNewResponseOpenAIChatCompletionChoices OfChatCompletionChunkChoices]
func (*ChatCompletionNewResponseUnionChoices) UnmarshalJSON ¶
func (r *ChatCompletionNewResponseUnionChoices) UnmarshalJSON(data []byte) error
type ChatCompletionNewResponseUnionUsage ¶
type ChatCompletionNewResponseUnionUsage struct {
CompletionTokens int64 `json:"completion_tokens"`
PromptTokens int64 `json:"prompt_tokens"`
TotalTokens int64 `json:"total_tokens"`
// This field is a union of
// [ChatCompletionNewResponseOpenAIChatCompletionUsageCompletionTokensDetails],
// [ChatCompletionChunkUsageCompletionTokensDetails]
CompletionTokensDetails ChatCompletionNewResponseUnionUsageCompletionTokensDetails `json:"completion_tokens_details"`
// This field is a union of
// [ChatCompletionNewResponseOpenAIChatCompletionUsagePromptTokensDetails],
// [ChatCompletionChunkUsagePromptTokensDetails]
PromptTokensDetails ChatCompletionNewResponseUnionUsagePromptTokensDetails `json:"prompt_tokens_details"`
JSON struct {
CompletionTokens respjson.Field
PromptTokens respjson.Field
TotalTokens respjson.Field
CompletionTokensDetails respjson.Field
PromptTokensDetails respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ChatCompletionNewResponseUnionUsage is an implicit subunion of ChatCompletionNewResponseUnion. ChatCompletionNewResponseUnionUsage provides convenient access to the sub-properties of the union.
For type safety it is recommended to directly use a variant of the ChatCompletionNewResponseUnion.
func (*ChatCompletionNewResponseUnionUsage) UnmarshalJSON ¶
func (r *ChatCompletionNewResponseUnionUsage) UnmarshalJSON(data []byte) error
type ChatCompletionNewResponseUnionUsageCompletionTokensDetails ¶
type ChatCompletionNewResponseUnionUsageCompletionTokensDetails struct {
ReasoningTokens int64 `json:"reasoning_tokens"`
JSON struct {
ReasoningTokens respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ChatCompletionNewResponseUnionUsageCompletionTokensDetails is an implicit subunion of ChatCompletionNewResponseUnion. ChatCompletionNewResponseUnionUsageCompletionTokensDetails provides convenient access to the sub-properties of the union.
For type safety it is recommended to directly use a variant of the ChatCompletionNewResponseUnion.
func (*ChatCompletionNewResponseUnionUsageCompletionTokensDetails) UnmarshalJSON ¶
func (r *ChatCompletionNewResponseUnionUsageCompletionTokensDetails) UnmarshalJSON(data []byte) error
type ChatCompletionNewResponseUnionUsagePromptTokensDetails ¶
type ChatCompletionNewResponseUnionUsagePromptTokensDetails struct {
CachedTokens int64 `json:"cached_tokens"`
JSON struct {
CachedTokens respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ChatCompletionNewResponseUnionUsagePromptTokensDetails is an implicit subunion of ChatCompletionNewResponseUnion. ChatCompletionNewResponseUnionUsagePromptTokensDetails provides convenient access to the sub-properties of the union.
For type safety it is recommended to directly use a variant of the ChatCompletionNewResponseUnion.
func (*ChatCompletionNewResponseUnionUsagePromptTokensDetails) UnmarshalJSON ¶
func (r *ChatCompletionNewResponseUnionUsagePromptTokensDetails) UnmarshalJSON(data []byte) error
type ChatCompletionService ¶
type ChatCompletionService struct {
Options []option.RequestOption
}
ChatCompletionService contains methods and other services that help with interacting with the llama-stack-client API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewChatCompletionService method instead.
func NewChatCompletionService ¶
func NewChatCompletionService(opts ...option.RequestOption) (r ChatCompletionService)
NewChatCompletionService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ChatCompletionService) Get ¶
func (r *ChatCompletionService) Get(ctx context.Context, completionID string, opts ...option.RequestOption) (res *ChatCompletionGetResponse, err error)
Get chat completion. Describe a chat completion by its ID.
func (*ChatCompletionService) List ¶
func (r *ChatCompletionService) List(ctx context.Context, query ChatCompletionListParams, opts ...option.RequestOption) (res *pagination.OpenAICursorPage[ChatCompletionListResponse], err error)
List chat completions.
func (*ChatCompletionService) ListAutoPaging ¶
func (r *ChatCompletionService) ListAutoPaging(ctx context.Context, query ChatCompletionListParams, opts ...option.RequestOption) *pagination.OpenAICursorPageAutoPager[ChatCompletionListResponse]
List chat completions.
func (*ChatCompletionService) New ¶
func (r *ChatCompletionService) New(ctx context.Context, body ChatCompletionNewParams, opts ...option.RequestOption) (res *ChatCompletionNewResponseUnion, err error)
Create chat completions. Generate an OpenAI-compatible chat completion for the given messages using the specified model.
func (*ChatCompletionService) NewStreaming ¶
func (r *ChatCompletionService) NewStreaming(ctx context.Context, body ChatCompletionNewParams, opts ...option.RequestOption) (stream *ssestream.Stream[ChatCompletionChunk])
Create chat completions. Generate an OpenAI-compatible chat completion for the given messages using the specified model.
type ChatService ¶
type ChatService struct {
Options []option.RequestOption
Completions ChatCompletionService
}
ChatService contains methods and other services that help with interacting with the llama-stack-client API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewChatService method instead.
func NewChatService ¶
func NewChatService(opts ...option.RequestOption) (r ChatService)
NewChatService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
type Client ¶
type Client struct {
Options []option.RequestOption
Toolgroups ToolgroupService
Tools ToolService
ToolRuntime ToolRuntimeService
Responses ResponseService
Prompts PromptService
Conversations ConversationService
Inspect InspectService
Embeddings EmbeddingService
Chat ChatService
Completions CompletionService
VectorIo VectorIoService
VectorStores VectorStoreService
Models ModelService
Providers ProviderService
Routes RouteService
Moderations ModerationService
Safety SafetyService
Shields ShieldService
Scoring ScoringService
ScoringFunctions ScoringFunctionService
Files FileService
Alpha AlphaService
Beta BetaService
}
Client creates a struct with services and top level methods that help with interacting with the llama-stack-client API. You should not instantiate this client directly, and instead use the NewClient method instead.
func NewClient ¶
func NewClient(opts ...option.RequestOption) (r Client)
NewClient generates a new client with the default option read from the environment (LLAMA_STACK_CLIENT_API_KEY, LLAMA_STACK_CLIENT_BASE_URL). The option passed in as arguments are applied after these default arguments, and all option will be passed down to the services and requests that this client makes.
func (*Client) Delete ¶
func (r *Client) Delete(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Delete makes a DELETE request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Execute ¶
func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, opts ...option.RequestOption) error
Execute makes a request with the given context, method, URL, request params, response, and request options. This is useful for hitting undocumented endpoints while retaining the base URL, auth, retries, and other options from the client.
If a byte slice or an io.Reader is supplied to params, it will be used as-is for the request body.
The params is by default serialized into the body using encoding/json. If your type implements a MarshalJSON function, it will be used instead to serialize the request. If a URLQuery method is implemented, the returned url.Values will be used as query strings to the url.
If your params struct uses param.Field, you must provide either [MarshalJSON], [URLQuery], and/or [MarshalForm] functions. It is undefined behavior to use a struct uses param.Field without specifying how it is serialized.
Any "…Params" object defined in this library can be used as the request argument. Note that 'path' arguments will not be forwarded into the url.
The response body will be deserialized into the res variable, depending on its type:
- A pointer to a *http.Response is populated by the raw response.
- A pointer to a byte array will be populated with the contents of the request body.
- A pointer to any other type uses this library's default JSON decoding, which respects UnmarshalJSON if it is defined on the type.
- A nil value will not read the response body.
For even greater flexibility, see option.WithResponseInto and option.WithResponseBodyInto.
func (*Client) Get ¶
func (r *Client) Get(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Get makes a GET request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Patch ¶
func (r *Client) Patch(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Patch makes a PATCH request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
type CompletionNewParams ¶
type CompletionNewParams struct {
// The identifier of the model to use. The model must be registered with Llama
// Stack and available via the /models endpoint.
Model string `json:"model,required"`
// The prompt to generate a completion for.
Prompt CompletionNewParamsPromptUnion `json:"prompt,omitzero,required"`
// (Optional) The number of completions to generate.
BestOf param.Opt[int64] `json:"best_of,omitzero"`
// (Optional) Whether to echo the prompt.
Echo param.Opt[bool] `json:"echo,omitzero"`
// (Optional) The penalty for repeated tokens.
FrequencyPenalty param.Opt[float64] `json:"frequency_penalty,omitzero"`
// (Optional) The log probabilities to use.
Logprobs param.Opt[bool] `json:"logprobs,omitzero"`
// (Optional) The maximum number of tokens to generate.
MaxTokens param.Opt[int64] `json:"max_tokens,omitzero"`
// (Optional) The number of completions to generate.
N param.Opt[int64] `json:"n,omitzero"`
// (Optional) The penalty for repeated tokens.
PresencePenalty param.Opt[float64] `json:"presence_penalty,omitzero"`
// (Optional) The seed to use.
Seed param.Opt[int64] `json:"seed,omitzero"`
// (Optional) The suffix that should be appended to the completion.
Suffix param.Opt[string] `json:"suffix,omitzero"`
// (Optional) The temperature to use.
Temperature param.Opt[float64] `json:"temperature,omitzero"`
// (Optional) The top p to use.
TopP param.Opt[float64] `json:"top_p,omitzero"`
// (Optional) The user to use.
User param.Opt[string] `json:"user,omitzero"`
// (Optional) The logit bias to use.
LogitBias map[string]float64 `json:"logit_bias,omitzero"`
// (Optional) The stop tokens to use.
Stop CompletionNewParamsStopUnion `json:"stop,omitzero"`
// (Optional) The stream options to use.
StreamOptions map[string]CompletionNewParamsStreamOptionUnion `json:"stream_options,omitzero"`
// contains filtered or unexported fields
}
func (CompletionNewParams) MarshalJSON ¶
func (r CompletionNewParams) MarshalJSON() (data []byte, err error)
func (*CompletionNewParams) UnmarshalJSON ¶
func (r *CompletionNewParams) UnmarshalJSON(data []byte) error
type CompletionNewParamsPromptUnion ¶
type CompletionNewParamsPromptUnion struct {
OfString param.Opt[string] `json:",omitzero,inline"`
OfStringArray []string `json:",omitzero,inline"`
OfIntArray []int64 `json:",omitzero,inline"`
OfArrayOfIntArray [][]int64 `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 (CompletionNewParamsPromptUnion) MarshalJSON ¶
func (u CompletionNewParamsPromptUnion) MarshalJSON() ([]byte, error)
func (*CompletionNewParamsPromptUnion) UnmarshalJSON ¶
func (u *CompletionNewParamsPromptUnion) UnmarshalJSON(data []byte) error
type CompletionNewParamsStopUnion ¶
type CompletionNewParamsStopUnion struct {
OfString param.Opt[string] `json:",omitzero,inline"`
OfStringArray []string `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 (CompletionNewParamsStopUnion) MarshalJSON ¶
func (u CompletionNewParamsStopUnion) MarshalJSON() ([]byte, error)
func (*CompletionNewParamsStopUnion) UnmarshalJSON ¶
func (u *CompletionNewParamsStopUnion) UnmarshalJSON(data []byte) error
type CompletionNewParamsStreamOptionUnion ¶
type CompletionNewParamsStreamOptionUnion 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 (CompletionNewParamsStreamOptionUnion) MarshalJSON ¶
func (u CompletionNewParamsStreamOptionUnion) MarshalJSON() ([]byte, error)
func (*CompletionNewParamsStreamOptionUnion) UnmarshalJSON ¶
func (u *CompletionNewParamsStreamOptionUnion) UnmarshalJSON(data []byte) error
type CompletionNewResponse ¶
type CompletionNewResponse struct {
ID string `json:"id,required"`
Choices []CompletionNewResponseChoice `json:"choices,required"`
Created int64 `json:"created,required"`
Model string `json:"model,required"`
Object constant.TextCompletion `json:"object,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Choices respjson.Field
Created respjson.Field
Model respjson.Field
Object respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Response from an OpenAI-compatible completion request.
func (CompletionNewResponse) RawJSON ¶
func (r CompletionNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*CompletionNewResponse) UnmarshalJSON ¶
func (r *CompletionNewResponse) UnmarshalJSON(data []byte) error
type CompletionNewResponseChoice ¶
type CompletionNewResponseChoice struct {
FinishReason string `json:"finish_reason,required"`
Index int64 `json:"index,required"`
Text string `json:"text,required"`
// The log probabilities for the tokens in the message from an OpenAI-compatible
// chat completion response.
Logprobs CompletionNewResponseChoiceLogprobs `json:"logprobs"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
FinishReason respjson.Field
Index respjson.Field
Text respjson.Field
Logprobs respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A choice from an OpenAI-compatible completion response.
func (CompletionNewResponseChoice) RawJSON ¶
func (r CompletionNewResponseChoice) RawJSON() string
Returns the unmodified JSON received from the API
func (*CompletionNewResponseChoice) UnmarshalJSON ¶
func (r *CompletionNewResponseChoice) UnmarshalJSON(data []byte) error
type CompletionNewResponseChoiceLogprobs ¶
type CompletionNewResponseChoiceLogprobs struct {
// (Optional) The log probabilities for the tokens in the message
Content []CompletionNewResponseChoiceLogprobsContent `json:"content"`
// (Optional) The log probabilities for the tokens in the message
Refusal []CompletionNewResponseChoiceLogprobsRefusal `json:"refusal"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Content respjson.Field
Refusal respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The log probabilities for the tokens in the message from an OpenAI-compatible chat completion response.
func (CompletionNewResponseChoiceLogprobs) RawJSON ¶
func (r CompletionNewResponseChoiceLogprobs) RawJSON() string
Returns the unmodified JSON received from the API
func (*CompletionNewResponseChoiceLogprobs) UnmarshalJSON ¶
func (r *CompletionNewResponseChoiceLogprobs) UnmarshalJSON(data []byte) error
type CompletionNewResponseChoiceLogprobsContent ¶
type CompletionNewResponseChoiceLogprobsContent struct {
Token string `json:"token,required"`
Logprob float64 `json:"logprob,required"`
TopLogprobs []CompletionNewResponseChoiceLogprobsContentTopLogprob `json:"top_logprobs,required"`
Bytes []int64 `json:"bytes"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Token respjson.Field
Logprob respjson.Field
TopLogprobs respjson.Field
Bytes respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The log probability for a token from an OpenAI-compatible chat completion response.
func (CompletionNewResponseChoiceLogprobsContent) RawJSON ¶
func (r CompletionNewResponseChoiceLogprobsContent) RawJSON() string
Returns the unmodified JSON received from the API
func (*CompletionNewResponseChoiceLogprobsContent) UnmarshalJSON ¶
func (r *CompletionNewResponseChoiceLogprobsContent) UnmarshalJSON(data []byte) error
type CompletionNewResponseChoiceLogprobsContentTopLogprob ¶
type CompletionNewResponseChoiceLogprobsContentTopLogprob struct {
Token string `json:"token,required"`
Logprob float64 `json:"logprob,required"`
Bytes []int64 `json:"bytes"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Token respjson.Field
Logprob respjson.Field
Bytes respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The top log probability for a token from an OpenAI-compatible chat completion response.
func (CompletionNewResponseChoiceLogprobsContentTopLogprob) RawJSON ¶
func (r CompletionNewResponseChoiceLogprobsContentTopLogprob) RawJSON() string
Returns the unmodified JSON received from the API
func (*CompletionNewResponseChoiceLogprobsContentTopLogprob) UnmarshalJSON ¶
func (r *CompletionNewResponseChoiceLogprobsContentTopLogprob) UnmarshalJSON(data []byte) error
type CompletionNewResponseChoiceLogprobsRefusal ¶
type CompletionNewResponseChoiceLogprobsRefusal struct {
Token string `json:"token,required"`
Logprob float64 `json:"logprob,required"`
TopLogprobs []CompletionNewResponseChoiceLogprobsRefusalTopLogprob `json:"top_logprobs,required"`
Bytes []int64 `json:"bytes"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Token respjson.Field
Logprob respjson.Field
TopLogprobs respjson.Field
Bytes respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The log probability for a token from an OpenAI-compatible chat completion response.
func (CompletionNewResponseChoiceLogprobsRefusal) RawJSON ¶
func (r CompletionNewResponseChoiceLogprobsRefusal) RawJSON() string
Returns the unmodified JSON received from the API
func (*CompletionNewResponseChoiceLogprobsRefusal) UnmarshalJSON ¶
func (r *CompletionNewResponseChoiceLogprobsRefusal) UnmarshalJSON(data []byte) error
type CompletionNewResponseChoiceLogprobsRefusalTopLogprob ¶
type CompletionNewResponseChoiceLogprobsRefusalTopLogprob struct {
Token string `json:"token,required"`
Logprob float64 `json:"logprob,required"`
Bytes []int64 `json:"bytes"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Token respjson.Field
Logprob respjson.Field
Bytes respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The top log probability for a token from an OpenAI-compatible chat completion response.
func (CompletionNewResponseChoiceLogprobsRefusalTopLogprob) RawJSON ¶
func (r CompletionNewResponseChoiceLogprobsRefusalTopLogprob) RawJSON() string
Returns the unmodified JSON received from the API
func (*CompletionNewResponseChoiceLogprobsRefusalTopLogprob) UnmarshalJSON ¶
func (r *CompletionNewResponseChoiceLogprobsRefusalTopLogprob) UnmarshalJSON(data []byte) error
type CompletionService ¶
type CompletionService struct {
Options []option.RequestOption
}
CompletionService contains methods and other services that help with interacting with the llama-stack-client API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewCompletionService method instead.
func NewCompletionService ¶
func NewCompletionService(opts ...option.RequestOption) (r CompletionService)
NewCompletionService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*CompletionService) New ¶
func (r *CompletionService) New(ctx context.Context, body CompletionNewParams, opts ...option.RequestOption) (res *CompletionNewResponse, err error)
Create completion. Generate an OpenAI-compatible completion for the given prompt using the specified model.
func (*CompletionService) NewStreaming ¶
func (r *CompletionService) NewStreaming(ctx context.Context, body CompletionNewParams, opts ...option.RequestOption) (stream *ssestream.Stream[CompletionNewResponse])
Create completion. Generate an OpenAI-compatible completion for the given prompt using the specified model.
type ConversationDeleteResponse ¶
type ConversationDeleteResponse struct {
ID string `json:"id,required"`
Deleted bool `json:"deleted,required"`
Object string `json:"object,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Deleted respjson.Field
Object respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Response for deleted conversation.
func (ConversationDeleteResponse) RawJSON ¶
func (r ConversationDeleteResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConversationDeleteResponse) UnmarshalJSON ¶
func (r *ConversationDeleteResponse) UnmarshalJSON(data []byte) error
type ConversationItemGetParams ¶
type ConversationItemGetParams struct {
ConversationID string `path:"conversation_id,required" json:"-"`
// contains filtered or unexported fields
}
type ConversationItemGetResponseFileSearchCall ¶
type ConversationItemGetResponseFileSearchCall struct {
// Unique identifier for this tool call
ID string `json:"id,required"`
// List of search queries executed
Queries []string `json:"queries,required"`
// Current status of the file search operation
Status string `json:"status,required"`
// Tool call type identifier, always "file_search_call"
Type constant.FileSearchCall `json:"type,required"`
// (Optional) Search results returned by the file search operation
Results []ConversationItemGetResponseFileSearchCallResult `json:"results"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Queries respjson.Field
Status respjson.Field
Type respjson.Field
Results respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
File search tool call output message for OpenAI responses.
func (ConversationItemGetResponseFileSearchCall) RawJSON ¶
func (r ConversationItemGetResponseFileSearchCall) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConversationItemGetResponseFileSearchCall) UnmarshalJSON ¶
func (r *ConversationItemGetResponseFileSearchCall) UnmarshalJSON(data []byte) error
type ConversationItemGetResponseFileSearchCallResult ¶
type ConversationItemGetResponseFileSearchCallResult struct {
// (Optional) Key-value attributes associated with the file
Attributes map[string]ConversationItemGetResponseFileSearchCallResultAttributeUnion `json:"attributes,required"`
// Unique identifier of the file containing the result
FileID string `json:"file_id,required"`
// Name of the file containing the result
Filename string `json:"filename,required"`
// Relevance score for this search result (between 0 and 1)
Score float64 `json:"score,required"`
// Text content of the search result
Text string `json:"text,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Attributes respjson.Field
FileID respjson.Field
Filename respjson.Field
Score respjson.Field
Text respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Search results returned by the file search operation.
func (ConversationItemGetResponseFileSearchCallResult) RawJSON ¶
func (r ConversationItemGetResponseFileSearchCallResult) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConversationItemGetResponseFileSearchCallResult) UnmarshalJSON ¶
func (r *ConversationItemGetResponseFileSearchCallResult) UnmarshalJSON(data []byte) error
type ConversationItemGetResponseFileSearchCallResultAttributeUnion ¶
type ConversationItemGetResponseFileSearchCallResultAttributeUnion 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:"-"`
}
ConversationItemGetResponseFileSearchCallResultAttributeUnion 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 (ConversationItemGetResponseFileSearchCallResultAttributeUnion) AsAnyArray ¶
func (u ConversationItemGetResponseFileSearchCallResultAttributeUnion) AsAnyArray() (v []any)
func (ConversationItemGetResponseFileSearchCallResultAttributeUnion) AsBool ¶
func (u ConversationItemGetResponseFileSearchCallResultAttributeUnion) AsBool() (v bool)
func (ConversationItemGetResponseFileSearchCallResultAttributeUnion) AsFloat ¶
func (u ConversationItemGetResponseFileSearchCallResultAttributeUnion) AsFloat() (v float64)
func (ConversationItemGetResponseFileSearchCallResultAttributeUnion) AsString ¶
func (u ConversationItemGetResponseFileSearchCallResultAttributeUnion) AsString() (v string)
func (ConversationItemGetResponseFileSearchCallResultAttributeUnion) RawJSON ¶
func (u ConversationItemGetResponseFileSearchCallResultAttributeUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConversationItemGetResponseFileSearchCallResultAttributeUnion) UnmarshalJSON ¶
func (r *ConversationItemGetResponseFileSearchCallResultAttributeUnion) UnmarshalJSON(data []byte) error
type ConversationItemGetResponseFunctionCall ¶
type ConversationItemGetResponseFunctionCall struct {
// JSON string containing the function arguments
Arguments string `json:"arguments,required"`
// Unique identifier for the function call
CallID string `json:"call_id,required"`
// Name of the function being called
Name string `json:"name,required"`
// Tool call type identifier, always "function_call"
Type constant.FunctionCall `json:"type,required"`
// (Optional) Additional identifier for the tool call
ID string `json:"id"`
// (Optional) Current status of the function call execution
Status string `json:"status"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Arguments respjson.Field
CallID respjson.Field
Name respjson.Field
Type respjson.Field
ID respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Function tool call output message for OpenAI responses.
func (ConversationItemGetResponseFunctionCall) RawJSON ¶
func (r ConversationItemGetResponseFunctionCall) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConversationItemGetResponseFunctionCall) UnmarshalJSON ¶
func (r *ConversationItemGetResponseFunctionCall) UnmarshalJSON(data []byte) error
type ConversationItemGetResponseFunctionCallOutput ¶
type ConversationItemGetResponseFunctionCallOutput struct {
CallID string `json:"call_id,required"`
Output string `json:"output,required"`
Type constant.FunctionCallOutput `json:"type,required"`
ID string `json:"id"`
Status string `json:"status"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CallID respjson.Field
Output respjson.Field
Type respjson.Field
ID respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
This represents the output of a function call that gets passed back to the model.
func (ConversationItemGetResponseFunctionCallOutput) RawJSON ¶
func (r ConversationItemGetResponseFunctionCallOutput) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConversationItemGetResponseFunctionCallOutput) UnmarshalJSON ¶
func (r *ConversationItemGetResponseFunctionCallOutput) UnmarshalJSON(data []byte) error
type ConversationItemGetResponseMcpApprovalRequest ¶
type ConversationItemGetResponseMcpApprovalRequest struct {
ID string `json:"id,required"`
Arguments string `json:"arguments,required"`
Name string `json:"name,required"`
ServerLabel string `json:"server_label,required"`
Type constant.McpApprovalRequest `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Arguments respjson.Field
Name respjson.Field
ServerLabel respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A request for human approval of a tool invocation.
func (ConversationItemGetResponseMcpApprovalRequest) RawJSON ¶
func (r ConversationItemGetResponseMcpApprovalRequest) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConversationItemGetResponseMcpApprovalRequest) UnmarshalJSON ¶
func (r *ConversationItemGetResponseMcpApprovalRequest) UnmarshalJSON(data []byte) error
type ConversationItemGetResponseMcpApprovalResponse ¶
type ConversationItemGetResponseMcpApprovalResponse struct {
ApprovalRequestID string `json:"approval_request_id,required"`
Approve bool `json:"approve,required"`
Type constant.McpApprovalResponse `json:"type,required"`
ID string `json:"id"`
Reason string `json:"reason"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ApprovalRequestID respjson.Field
Approve respjson.Field
Type respjson.Field
ID respjson.Field
Reason respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A response to an MCP approval request.
func (ConversationItemGetResponseMcpApprovalResponse) RawJSON ¶
func (r ConversationItemGetResponseMcpApprovalResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConversationItemGetResponseMcpApprovalResponse) UnmarshalJSON ¶
func (r *ConversationItemGetResponseMcpApprovalResponse) UnmarshalJSON(data []byte) error
type ConversationItemGetResponseMcpCall ¶
type ConversationItemGetResponseMcpCall struct {
// Unique identifier for this MCP call
ID string `json:"id,required"`
// JSON string containing the MCP call arguments
Arguments string `json:"arguments,required"`
// Name of the MCP method being called
Name string `json:"name,required"`
// Label identifying the MCP server handling the call
ServerLabel string `json:"server_label,required"`
// Tool call type identifier, always "mcp_call"
Type constant.McpCall `json:"type,required"`
// (Optional) Error message if the MCP call failed
Error string `json:"error"`
// (Optional) Output result from the successful MCP call
Output string `json:"output"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Arguments respjson.Field
Name respjson.Field
ServerLabel respjson.Field
Type respjson.Field
Error respjson.Field
Output respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Model Context Protocol (MCP) call output message for OpenAI responses.
func (ConversationItemGetResponseMcpCall) RawJSON ¶
func (r ConversationItemGetResponseMcpCall) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConversationItemGetResponseMcpCall) UnmarshalJSON ¶
func (r *ConversationItemGetResponseMcpCall) UnmarshalJSON(data []byte) error
type ConversationItemGetResponseMcpListTools ¶
type ConversationItemGetResponseMcpListTools struct {
// Unique identifier for this MCP list tools operation
ID string `json:"id,required"`
// Label identifying the MCP server providing the tools
ServerLabel string `json:"server_label,required"`
// List of available tools provided by the MCP server
Tools []ConversationItemGetResponseMcpListToolsTool `json:"tools,required"`
// Tool call type identifier, always "mcp_list_tools"
Type constant.McpListTools `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
ServerLabel respjson.Field
Tools respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
MCP list tools output message containing available tools from an MCP server.
func (ConversationItemGetResponseMcpListTools) RawJSON ¶
func (r ConversationItemGetResponseMcpListTools) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConversationItemGetResponseMcpListTools) UnmarshalJSON ¶
func (r *ConversationItemGetResponseMcpListTools) UnmarshalJSON(data []byte) error
type ConversationItemGetResponseMcpListToolsTool ¶
type ConversationItemGetResponseMcpListToolsTool struct {
// JSON schema defining the tool's input parameters
InputSchema map[string]ConversationItemGetResponseMcpListToolsToolInputSchemaUnion `json:"input_schema,required"`
// Name of the tool
Name string `json:"name,required"`
// (Optional) Description of what the tool does
Description string `json:"description"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
InputSchema respjson.Field
Name respjson.Field
Description respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Tool definition returned by MCP list tools operation.
func (ConversationItemGetResponseMcpListToolsTool) RawJSON ¶
func (r ConversationItemGetResponseMcpListToolsTool) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConversationItemGetResponseMcpListToolsTool) UnmarshalJSON ¶
func (r *ConversationItemGetResponseMcpListToolsTool) UnmarshalJSON(data []byte) error
type ConversationItemGetResponseMcpListToolsToolInputSchemaUnion ¶
type ConversationItemGetResponseMcpListToolsToolInputSchemaUnion 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:"-"`
}
ConversationItemGetResponseMcpListToolsToolInputSchemaUnion 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 (ConversationItemGetResponseMcpListToolsToolInputSchemaUnion) AsAnyArray ¶
func (u ConversationItemGetResponseMcpListToolsToolInputSchemaUnion) AsAnyArray() (v []any)
func (ConversationItemGetResponseMcpListToolsToolInputSchemaUnion) AsBool ¶
func (u ConversationItemGetResponseMcpListToolsToolInputSchemaUnion) AsBool() (v bool)
func (ConversationItemGetResponseMcpListToolsToolInputSchemaUnion) AsFloat ¶
func (u ConversationItemGetResponseMcpListToolsToolInputSchemaUnion) AsFloat() (v float64)
func (ConversationItemGetResponseMcpListToolsToolInputSchemaUnion) AsString ¶
func (u ConversationItemGetResponseMcpListToolsToolInputSchemaUnion) AsString() (v string)
func (ConversationItemGetResponseMcpListToolsToolInputSchemaUnion) RawJSON ¶
func (u ConversationItemGetResponseMcpListToolsToolInputSchemaUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConversationItemGetResponseMcpListToolsToolInputSchemaUnion) UnmarshalJSON ¶
func (r *ConversationItemGetResponseMcpListToolsToolInputSchemaUnion) UnmarshalJSON(data []byte) error
type ConversationItemGetResponseMessage ¶
type ConversationItemGetResponseMessage struct {
Content ConversationItemGetResponseMessageContentUnion `json:"content,required"`
// Any of "system", "developer", "user", "assistant".
Role ConversationItemGetResponseMessageRole `json:"role,required"`
Type constant.Message `json:"type,required"`
ID string `json:"id"`
Status string `json:"status"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Content respjson.Field
Role respjson.Field
Type respjson.Field
ID respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Corresponds to the various Message types in the Responses API. They are all under one type because the Responses API gives them all the same "type" value, and there is no way to tell them apart in certain scenarios.
func (ConversationItemGetResponseMessage) RawJSON ¶
func (r ConversationItemGetResponseMessage) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConversationItemGetResponseMessage) UnmarshalJSON ¶
func (r *ConversationItemGetResponseMessage) UnmarshalJSON(data []byte) error
type ConversationItemGetResponseMessageContentArrayItemDetail ¶
type ConversationItemGetResponseMessageContentArrayItemDetail string
Level of detail for image processing, can be "low", "high", or "auto"
const ( ConversationItemGetResponseMessageContentArrayItemDetailLow ConversationItemGetResponseMessageContentArrayItemDetail = "low" ConversationItemGetResponseMessageContentArrayItemDetailHigh ConversationItemGetResponseMessageContentArrayItemDetail = "high" ConversationItemGetResponseMessageContentArrayItemDetailAuto ConversationItemGetResponseMessageContentArrayItemDetail = "auto" )
type ConversationItemGetResponseMessageContentArrayItemInputFile ¶
type ConversationItemGetResponseMessageContentArrayItemInputFile struct {
// The type of the input item. Always `input_file`.
Type constant.InputFile `json:"type,required"`
// The data of the file to be sent to the model.
FileData string `json:"file_data"`
// (Optional) The ID of the file to be sent to the model.
FileID string `json:"file_id"`
// The URL of the file to be sent to the model.
FileURL string `json:"file_url"`
// The name of the file to be sent to the model.
Filename string `json:"filename"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Type respjson.Field
FileData respjson.Field
FileID respjson.Field
FileURL respjson.Field
Filename respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
File content for input messages in OpenAI response format.
func (ConversationItemGetResponseMessageContentArrayItemInputFile) RawJSON ¶
func (r ConversationItemGetResponseMessageContentArrayItemInputFile) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConversationItemGetResponseMessageContentArrayItemInputFile) UnmarshalJSON ¶
func (r *ConversationItemGetResponseMessageContentArrayItemInputFile) UnmarshalJSON(data []byte) error
type ConversationItemGetResponseMessageContentArrayItemInputImage ¶
type ConversationItemGetResponseMessageContentArrayItemInputImage struct {
// Level of detail for image processing, can be "low", "high", or "auto"
//
// Any of "low", "high", "auto".
Detail ConversationItemGetResponseMessageContentArrayItemInputImageDetail `json:"detail,required"`
// Content type identifier, always "input_image"
Type constant.InputImage `json:"type,required"`
// (Optional) The ID of the file to be sent to the model.
FileID string `json:"file_id"`
// (Optional) URL of the image content
ImageURL string `json:"image_url"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Detail respjson.Field
Type respjson.Field
FileID respjson.Field
ImageURL respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Image content for input messages in OpenAI response format.
func (ConversationItemGetResponseMessageContentArrayItemInputImage) RawJSON ¶
func (r ConversationItemGetResponseMessageContentArrayItemInputImage) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConversationItemGetResponseMessageContentArrayItemInputImage) UnmarshalJSON ¶
func (r *ConversationItemGetResponseMessageContentArrayItemInputImage) UnmarshalJSON(data []byte) error
type ConversationItemGetResponseMessageContentArrayItemInputImageDetail ¶
type ConversationItemGetResponseMessageContentArrayItemInputImageDetail string
Level of detail for image processing, can be "low", "high", or "auto"
const ( ConversationItemGetResponseMessageContentArrayItemInputImageDetailLow ConversationItemGetResponseMessageContentArrayItemInputImageDetail = "low" ConversationItemGetResponseMessageContentArrayItemInputImageDetailHigh ConversationItemGetResponseMessageContentArrayItemInputImageDetail = "high" ConversationItemGetResponseMessageContentArrayItemInputImageDetailAuto ConversationItemGetResponseMessageContentArrayItemInputImageDetail = "auto" )
type ConversationItemGetResponseMessageContentArrayItemInputText ¶
type ConversationItemGetResponseMessageContentArrayItemInputText struct {
// The text content of the input message
Text string `json:"text,required"`
// Content type identifier, always "input_text"
Type constant.InputText `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:"-"`
}
Text content for input messages in OpenAI response format.
func (ConversationItemGetResponseMessageContentArrayItemInputText) RawJSON ¶
func (r ConversationItemGetResponseMessageContentArrayItemInputText) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConversationItemGetResponseMessageContentArrayItemInputText) UnmarshalJSON ¶
func (r *ConversationItemGetResponseMessageContentArrayItemInputText) UnmarshalJSON(data []byte) error
type ConversationItemGetResponseMessageContentArrayItemUnion ¶
type ConversationItemGetResponseMessageContentArrayItemUnion struct {
// This field is from variant
// [ConversationItemGetResponseMessageContentArrayItemInputText].
Text string `json:"text"`
// Any of "input_text", "input_image", "input_file".
Type string `json:"type"`
// This field is from variant
// [ConversationItemGetResponseMessageContentArrayItemInputImage].
Detail ConversationItemGetResponseMessageContentArrayItemInputImageDetail `json:"detail"`
FileID string `json:"file_id"`
// This field is from variant
// [ConversationItemGetResponseMessageContentArrayItemInputImage].
ImageURL string `json:"image_url"`
// This field is from variant
// [ConversationItemGetResponseMessageContentArrayItemInputFile].
FileData string `json:"file_data"`
// This field is from variant
// [ConversationItemGetResponseMessageContentArrayItemInputFile].
FileURL string `json:"file_url"`
// This field is from variant
// [ConversationItemGetResponseMessageContentArrayItemInputFile].
Filename string `json:"filename"`
JSON struct {
Text respjson.Field
Type respjson.Field
Detail respjson.Field
FileID respjson.Field
ImageURL respjson.Field
FileData respjson.Field
FileURL respjson.Field
Filename respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ConversationItemGetResponseMessageContentArrayItemUnion contains all possible properties and values from ConversationItemGetResponseMessageContentArrayItemInputText, ConversationItemGetResponseMessageContentArrayItemInputImage, ConversationItemGetResponseMessageContentArrayItemInputFile.
Use the ConversationItemGetResponseMessageContentArrayItemUnion.AsAny method to switch on the variant.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (ConversationItemGetResponseMessageContentArrayItemUnion) AsAny ¶
func (u ConversationItemGetResponseMessageContentArrayItemUnion) AsAny() anyConversationItemGetResponseMessageContentArrayItem
Use the following switch statement to find the correct variant
switch variant := ConversationItemGetResponseMessageContentArrayItemUnion.AsAny().(type) {
case llamastackclient.ConversationItemGetResponseMessageContentArrayItemInputText:
case llamastackclient.ConversationItemGetResponseMessageContentArrayItemInputImage:
case llamastackclient.ConversationItemGetResponseMessageContentArrayItemInputFile:
default:
fmt.Errorf("no variant present")
}
func (ConversationItemGetResponseMessageContentArrayItemUnion) AsInputFile ¶
func (ConversationItemGetResponseMessageContentArrayItemUnion) AsInputImage ¶
func (u ConversationItemGetResponseMessageContentArrayItemUnion) AsInputImage() (v ConversationItemGetResponseMessageContentArrayItemInputImage)
func (ConversationItemGetResponseMessageContentArrayItemUnion) AsInputText ¶
func (ConversationItemGetResponseMessageContentArrayItemUnion) RawJSON ¶
func (u ConversationItemGetResponseMessageContentArrayItemUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConversationItemGetResponseMessageContentArrayItemUnion) UnmarshalJSON ¶
func (r *ConversationItemGetResponseMessageContentArrayItemUnion) UnmarshalJSON(data []byte) error
type ConversationItemGetResponseMessageContentUnion ¶
type ConversationItemGetResponseMessageContentUnion 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
// [[]ConversationItemGetResponseMessageContentArrayItemUnion] instead of an
// object.
OfVariant2 []ConversationItemGetResponseMessageContentArrayItemUnion `json:",inline"`
JSON struct {
OfString respjson.Field
OfVariant2 respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ConversationItemGetResponseMessageContentUnion contains all possible properties and values from [string], [[]ConversationItemGetResponseMessageContentArrayItemUnion], [[]ConversationItemGetResponseMessageContentArrayItemUnion].
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 OfVariant2]
func (ConversationItemGetResponseMessageContentUnion) AsConversationItemGetResponseMessageContentArray ¶
func (u ConversationItemGetResponseMessageContentUnion) AsConversationItemGetResponseMessageContentArray() (v []ConversationItemGetResponseMessageContentArrayItemUnion)
func (ConversationItemGetResponseMessageContentUnion) AsString ¶
func (u ConversationItemGetResponseMessageContentUnion) AsString() (v string)
func (ConversationItemGetResponseMessageContentUnion) AsVariant2 ¶
func (u ConversationItemGetResponseMessageContentUnion) AsVariant2() (v []ConversationItemGetResponseMessageContentArrayItemUnion)
func (ConversationItemGetResponseMessageContentUnion) RawJSON ¶
func (u ConversationItemGetResponseMessageContentUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConversationItemGetResponseMessageContentUnion) UnmarshalJSON ¶
func (r *ConversationItemGetResponseMessageContentUnion) UnmarshalJSON(data []byte) error
type ConversationItemGetResponseMessageRole ¶
type ConversationItemGetResponseMessageRole string
const ( ConversationItemGetResponseMessageRoleSystem ConversationItemGetResponseMessageRole = "system" ConversationItemGetResponseMessageRoleDeveloper ConversationItemGetResponseMessageRole = "developer" ConversationItemGetResponseMessageRoleUser ConversationItemGetResponseMessageRole = "user" ConversationItemGetResponseMessageRoleAssistant ConversationItemGetResponseMessageRole = "assistant" )
type ConversationItemGetResponseRole ¶
type ConversationItemGetResponseRole string
const ( ConversationItemGetResponseRoleSystem ConversationItemGetResponseRole = "system" ConversationItemGetResponseRoleDeveloper ConversationItemGetResponseRole = "developer" ConversationItemGetResponseRoleUser ConversationItemGetResponseRole = "user" ConversationItemGetResponseRoleAssistant ConversationItemGetResponseRole = "assistant" )
type ConversationItemGetResponseUnion ¶
type ConversationItemGetResponseUnion struct {
// This field is from variant [ConversationItemGetResponseMessage].
Content ConversationItemGetResponseMessageContentUnion `json:"content"`
// This field is from variant [ConversationItemGetResponseMessage].
Role ConversationItemGetResponseMessageRole `json:"role"`
// Any of "message", "web_search_call", "file_search_call", "function_call",
// "function_call_output", "mcp_approval_request", "mcp_approval_response",
// "mcp_call", "mcp_list_tools".
Type string `json:"type"`
ID string `json:"id"`
Status string `json:"status"`
// This field is from variant [ConversationItemGetResponseFileSearchCall].
Queries []string `json:"queries"`
// This field is from variant [ConversationItemGetResponseFileSearchCall].
Results []ConversationItemGetResponseFileSearchCallResult `json:"results"`
Arguments string `json:"arguments"`
CallID string `json:"call_id"`
Name string `json:"name"`
Output string `json:"output"`
ServerLabel string `json:"server_label"`
// This field is from variant [ConversationItemGetResponseMcpApprovalResponse].
ApprovalRequestID string `json:"approval_request_id"`
// This field is from variant [ConversationItemGetResponseMcpApprovalResponse].
Approve bool `json:"approve"`
// This field is from variant [ConversationItemGetResponseMcpApprovalResponse].
Reason string `json:"reason"`
// This field is from variant [ConversationItemGetResponseMcpCall].
Error string `json:"error"`
// This field is from variant [ConversationItemGetResponseMcpListTools].
Tools []ConversationItemGetResponseMcpListToolsTool `json:"tools"`
JSON struct {
Content respjson.Field
Role respjson.Field
Type respjson.Field
ID respjson.Field
Status respjson.Field
Queries respjson.Field
Results respjson.Field
Arguments respjson.Field
CallID respjson.Field
Name respjson.Field
Output respjson.Field
ServerLabel respjson.Field
ApprovalRequestID respjson.Field
Approve respjson.Field
Reason respjson.Field
Error respjson.Field
Tools respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ConversationItemGetResponseUnion contains all possible properties and values from ConversationItemGetResponseMessage, ConversationItemGetResponseWebSearchCall, ConversationItemGetResponseFileSearchCall, ConversationItemGetResponseFunctionCall, ConversationItemGetResponseFunctionCallOutput, ConversationItemGetResponseMcpApprovalRequest, ConversationItemGetResponseMcpApprovalResponse, ConversationItemGetResponseMcpCall, ConversationItemGetResponseMcpListTools.
Use the ConversationItemGetResponseUnion.AsAny method to switch on the variant.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (ConversationItemGetResponseUnion) AsAny ¶
func (u ConversationItemGetResponseUnion) AsAny() anyConversationItemGetResponse
Use the following switch statement to find the correct variant
switch variant := ConversationItemGetResponseUnion.AsAny().(type) {
case llamastackclient.ConversationItemGetResponseMessage:
case llamastackclient.ConversationItemGetResponseWebSearchCall:
case llamastackclient.ConversationItemGetResponseFileSearchCall:
case llamastackclient.ConversationItemGetResponseFunctionCall:
case llamastackclient.ConversationItemGetResponseFunctionCallOutput:
case llamastackclient.ConversationItemGetResponseMcpApprovalRequest:
case llamastackclient.ConversationItemGetResponseMcpApprovalResponse:
case llamastackclient.ConversationItemGetResponseMcpCall:
case llamastackclient.ConversationItemGetResponseMcpListTools:
default:
fmt.Errorf("no variant present")
}
func (ConversationItemGetResponseUnion) AsFileSearchCall ¶
func (u ConversationItemGetResponseUnion) AsFileSearchCall() (v ConversationItemGetResponseFileSearchCall)
func (ConversationItemGetResponseUnion) AsFunctionCall ¶
func (u ConversationItemGetResponseUnion) AsFunctionCall() (v ConversationItemGetResponseFunctionCall)
func (ConversationItemGetResponseUnion) AsFunctionCallOutput ¶
func (u ConversationItemGetResponseUnion) AsFunctionCallOutput() (v ConversationItemGetResponseFunctionCallOutput)
func (ConversationItemGetResponseUnion) AsMcpApprovalRequest ¶
func (u ConversationItemGetResponseUnion) AsMcpApprovalRequest() (v ConversationItemGetResponseMcpApprovalRequest)
func (ConversationItemGetResponseUnion) AsMcpApprovalResponse ¶
func (u ConversationItemGetResponseUnion) AsMcpApprovalResponse() (v ConversationItemGetResponseMcpApprovalResponse)
func (ConversationItemGetResponseUnion) AsMcpCall ¶
func (u ConversationItemGetResponseUnion) AsMcpCall() (v ConversationItemGetResponseMcpCall)
func (ConversationItemGetResponseUnion) AsMcpListTools ¶
func (u ConversationItemGetResponseUnion) AsMcpListTools() (v ConversationItemGetResponseMcpListTools)
func (ConversationItemGetResponseUnion) AsMessage ¶
func (u ConversationItemGetResponseUnion) AsMessage() (v ConversationItemGetResponseMessage)
func (ConversationItemGetResponseUnion) AsWebSearchCall ¶
func (u ConversationItemGetResponseUnion) AsWebSearchCall() (v ConversationItemGetResponseWebSearchCall)
func (ConversationItemGetResponseUnion) RawJSON ¶
func (u ConversationItemGetResponseUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConversationItemGetResponseUnion) UnmarshalJSON ¶
func (r *ConversationItemGetResponseUnion) UnmarshalJSON(data []byte) error
type ConversationItemGetResponseWebSearchCall ¶
type ConversationItemGetResponseWebSearchCall struct {
// Unique identifier for this tool call
ID string `json:"id,required"`
// Current status of the web search operation
Status string `json:"status,required"`
// Tool call type identifier, always "web_search_call"
Type constant.WebSearchCall `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Status respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Web search tool call output message for OpenAI responses.
func (ConversationItemGetResponseWebSearchCall) RawJSON ¶
func (r ConversationItemGetResponseWebSearchCall) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConversationItemGetResponseWebSearchCall) UnmarshalJSON ¶
func (r *ConversationItemGetResponseWebSearchCall) UnmarshalJSON(data []byte) error
type ConversationItemListParams ¶
type ConversationItemListParams struct {
// An item ID to list items after, used in pagination.
After param.Opt[string] `query:"after,omitzero" json:"-"`
// A limit on the number of objects to be returned (1-100, default 20).
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Specify additional output data to include in the response.
//
// Any of "web_search_call.action.sources", "code_interpreter_call.outputs",
// "computer_call_output.output.image_url", "file_search_call.results",
// "message.input_image.image_url", "message.output_text.logprobs",
// "reasoning.encrypted_content".
Include []string `query:"include,omitzero" json:"-"`
// The order to return items in (asc or desc, default desc).
//
// Any of "asc", "desc".
Order ConversationItemListParamsOrder `query:"order,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (ConversationItemListParams) URLQuery ¶
func (r ConversationItemListParams) URLQuery() (v url.Values, err error)
URLQuery serializes ConversationItemListParams's query parameters as `url.Values`.
type ConversationItemListParamsOrder ¶
type ConversationItemListParamsOrder string
The order to return items in (asc or desc, default desc).
const ( ConversationItemListParamsOrderAsc ConversationItemListParamsOrder = "asc" ConversationItemListParamsOrderDesc ConversationItemListParamsOrder = "desc" )
type ConversationItemListResponseFileSearchCall ¶
type ConversationItemListResponseFileSearchCall struct {
// Unique identifier for this tool call
ID string `json:"id,required"`
// List of search queries executed
Queries []string `json:"queries,required"`
// Current status of the file search operation
Status string `json:"status,required"`
// Tool call type identifier, always "file_search_call"
Type constant.FileSearchCall `json:"type,required"`
// (Optional) Search results returned by the file search operation
Results []ConversationItemListResponseFileSearchCallResult `json:"results"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Queries respjson.Field
Status respjson.Field
Type respjson.Field
Results respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
File search tool call output message for OpenAI responses.
func (ConversationItemListResponseFileSearchCall) RawJSON ¶
func (r ConversationItemListResponseFileSearchCall) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConversationItemListResponseFileSearchCall) UnmarshalJSON ¶
func (r *ConversationItemListResponseFileSearchCall) UnmarshalJSON(data []byte) error
type ConversationItemListResponseFileSearchCallResult ¶
type ConversationItemListResponseFileSearchCallResult struct {
// (Optional) Key-value attributes associated with the file
Attributes map[string]ConversationItemListResponseFileSearchCallResultAttributeUnion `json:"attributes,required"`
// Unique identifier of the file containing the result
FileID string `json:"file_id,required"`
// Name of the file containing the result
Filename string `json:"filename,required"`
// Relevance score for this search result (between 0 and 1)
Score float64 `json:"score,required"`
// Text content of the search result
Text string `json:"text,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Attributes respjson.Field
FileID respjson.Field
Filename respjson.Field
Score respjson.Field
Text respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Search results returned by the file search operation.
func (ConversationItemListResponseFileSearchCallResult) RawJSON ¶
func (r ConversationItemListResponseFileSearchCallResult) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConversationItemListResponseFileSearchCallResult) UnmarshalJSON ¶
func (r *ConversationItemListResponseFileSearchCallResult) UnmarshalJSON(data []byte) error
type ConversationItemListResponseFileSearchCallResultAttributeUnion ¶
type ConversationItemListResponseFileSearchCallResultAttributeUnion 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:"-"`
}
ConversationItemListResponseFileSearchCallResultAttributeUnion 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 (ConversationItemListResponseFileSearchCallResultAttributeUnion) AsAnyArray ¶
func (u ConversationItemListResponseFileSearchCallResultAttributeUnion) AsAnyArray() (v []any)
func (ConversationItemListResponseFileSearchCallResultAttributeUnion) AsBool ¶
func (u ConversationItemListResponseFileSearchCallResultAttributeUnion) AsBool() (v bool)
func (ConversationItemListResponseFileSearchCallResultAttributeUnion) AsFloat ¶
func (u ConversationItemListResponseFileSearchCallResultAttributeUnion) AsFloat() (v float64)
func (ConversationItemListResponseFileSearchCallResultAttributeUnion) AsString ¶
func (u ConversationItemListResponseFileSearchCallResultAttributeUnion) AsString() (v string)
func (ConversationItemListResponseFileSearchCallResultAttributeUnion) RawJSON ¶
func (u ConversationItemListResponseFileSearchCallResultAttributeUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConversationItemListResponseFileSearchCallResultAttributeUnion) UnmarshalJSON ¶
func (r *ConversationItemListResponseFileSearchCallResultAttributeUnion) UnmarshalJSON(data []byte) error
type ConversationItemListResponseFunctionCall ¶
type ConversationItemListResponseFunctionCall struct {
// JSON string containing the function arguments
Arguments string `json:"arguments,required"`
// Unique identifier for the function call
CallID string `json:"call_id,required"`
// Name of the function being called
Name string `json:"name,required"`
// Tool call type identifier, always "function_call"
Type constant.FunctionCall `json:"type,required"`
// (Optional) Additional identifier for the tool call
ID string `json:"id"`
// (Optional) Current status of the function call execution
Status string `json:"status"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Arguments respjson.Field
CallID respjson.Field
Name respjson.Field
Type respjson.Field
ID respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Function tool call output message for OpenAI responses.
func (ConversationItemListResponseFunctionCall) RawJSON ¶
func (r ConversationItemListResponseFunctionCall) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConversationItemListResponseFunctionCall) UnmarshalJSON ¶
func (r *ConversationItemListResponseFunctionCall) UnmarshalJSON(data []byte) error
type ConversationItemListResponseFunctionCallOutput ¶
type ConversationItemListResponseFunctionCallOutput struct {
CallID string `json:"call_id,required"`
Output string `json:"output,required"`
Type constant.FunctionCallOutput `json:"type,required"`
ID string `json:"id"`
Status string `json:"status"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CallID respjson.Field
Output respjson.Field
Type respjson.Field
ID respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
This represents the output of a function call that gets passed back to the model.
func (ConversationItemListResponseFunctionCallOutput) RawJSON ¶
func (r ConversationItemListResponseFunctionCallOutput) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConversationItemListResponseFunctionCallOutput) UnmarshalJSON ¶
func (r *ConversationItemListResponseFunctionCallOutput) UnmarshalJSON(data []byte) error
type ConversationItemListResponseMcpApprovalRequest ¶
type ConversationItemListResponseMcpApprovalRequest struct {
ID string `json:"id,required"`
Arguments string `json:"arguments,required"`
Name string `json:"name,required"`
ServerLabel string `json:"server_label,required"`
Type constant.McpApprovalRequest `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Arguments respjson.Field
Name respjson.Field
ServerLabel respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A request for human approval of a tool invocation.
func (ConversationItemListResponseMcpApprovalRequest) RawJSON ¶
func (r ConversationItemListResponseMcpApprovalRequest) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConversationItemListResponseMcpApprovalRequest) UnmarshalJSON ¶
func (r *ConversationItemListResponseMcpApprovalRequest) UnmarshalJSON(data []byte) error
type ConversationItemListResponseMcpApprovalResponse ¶
type ConversationItemListResponseMcpApprovalResponse struct {
ApprovalRequestID string `json:"approval_request_id,required"`
Approve bool `json:"approve,required"`
Type constant.McpApprovalResponse `json:"type,required"`
ID string `json:"id"`
Reason string `json:"reason"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ApprovalRequestID respjson.Field
Approve respjson.Field
Type respjson.Field
ID respjson.Field
Reason respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A response to an MCP approval request.
func (ConversationItemListResponseMcpApprovalResponse) RawJSON ¶
func (r ConversationItemListResponseMcpApprovalResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConversationItemListResponseMcpApprovalResponse) UnmarshalJSON ¶
func (r *ConversationItemListResponseMcpApprovalResponse) UnmarshalJSON(data []byte) error
type ConversationItemListResponseMcpCall ¶
type ConversationItemListResponseMcpCall struct {
// Unique identifier for this MCP call
ID string `json:"id,required"`
// JSON string containing the MCP call arguments
Arguments string `json:"arguments,required"`
// Name of the MCP method being called
Name string `json:"name,required"`
// Label identifying the MCP server handling the call
ServerLabel string `json:"server_label,required"`
// Tool call type identifier, always "mcp_call"
Type constant.McpCall `json:"type,required"`
// (Optional) Error message if the MCP call failed
Error string `json:"error"`
// (Optional) Output result from the successful MCP call
Output string `json:"output"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Arguments respjson.Field
Name respjson.Field
ServerLabel respjson.Field
Type respjson.Field
Error respjson.Field
Output respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Model Context Protocol (MCP) call output message for OpenAI responses.
func (ConversationItemListResponseMcpCall) RawJSON ¶
func (r ConversationItemListResponseMcpCall) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConversationItemListResponseMcpCall) UnmarshalJSON ¶
func (r *ConversationItemListResponseMcpCall) UnmarshalJSON(data []byte) error
type ConversationItemListResponseMcpListTools ¶
type ConversationItemListResponseMcpListTools struct {
// Unique identifier for this MCP list tools operation
ID string `json:"id,required"`
// Label identifying the MCP server providing the tools
ServerLabel string `json:"server_label,required"`
// List of available tools provided by the MCP server
Tools []ConversationItemListResponseMcpListToolsTool `json:"tools,required"`
// Tool call type identifier, always "mcp_list_tools"
Type constant.McpListTools `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
ServerLabel respjson.Field
Tools respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
MCP list tools output message containing available tools from an MCP server.
func (ConversationItemListResponseMcpListTools) RawJSON ¶
func (r ConversationItemListResponseMcpListTools) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConversationItemListResponseMcpListTools) UnmarshalJSON ¶
func (r *ConversationItemListResponseMcpListTools) UnmarshalJSON(data []byte) error
type ConversationItemListResponseMcpListToolsTool ¶
type ConversationItemListResponseMcpListToolsTool struct {
// JSON schema defining the tool's input parameters
InputSchema map[string]ConversationItemListResponseMcpListToolsToolInputSchemaUnion `json:"input_schema,required"`
// Name of the tool
Name string `json:"name,required"`
// (Optional) Description of what the tool does
Description string `json:"description"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
InputSchema respjson.Field
Name respjson.Field
Description respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Tool definition returned by MCP list tools operation.
func (ConversationItemListResponseMcpListToolsTool) RawJSON ¶
func (r ConversationItemListResponseMcpListToolsTool) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConversationItemListResponseMcpListToolsTool) UnmarshalJSON ¶
func (r *ConversationItemListResponseMcpListToolsTool) UnmarshalJSON(data []byte) error
type ConversationItemListResponseMcpListToolsToolInputSchemaUnion ¶
type ConversationItemListResponseMcpListToolsToolInputSchemaUnion 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:"-"`
}
ConversationItemListResponseMcpListToolsToolInputSchemaUnion 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 (ConversationItemListResponseMcpListToolsToolInputSchemaUnion) AsAnyArray ¶
func (u ConversationItemListResponseMcpListToolsToolInputSchemaUnion) AsAnyArray() (v []any)
func (ConversationItemListResponseMcpListToolsToolInputSchemaUnion) AsBool ¶
func (u ConversationItemListResponseMcpListToolsToolInputSchemaUnion) AsBool() (v bool)
func (ConversationItemListResponseMcpListToolsToolInputSchemaUnion) AsFloat ¶
func (u ConversationItemListResponseMcpListToolsToolInputSchemaUnion) AsFloat() (v float64)
func (ConversationItemListResponseMcpListToolsToolInputSchemaUnion) AsString ¶
func (u ConversationItemListResponseMcpListToolsToolInputSchemaUnion) AsString() (v string)
func (ConversationItemListResponseMcpListToolsToolInputSchemaUnion) RawJSON ¶
func (u ConversationItemListResponseMcpListToolsToolInputSchemaUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConversationItemListResponseMcpListToolsToolInputSchemaUnion) UnmarshalJSON ¶
func (r *ConversationItemListResponseMcpListToolsToolInputSchemaUnion) UnmarshalJSON(data []byte) error
type ConversationItemListResponseMessage ¶
type ConversationItemListResponseMessage struct {
Content ConversationItemListResponseMessageContentUnion `json:"content,required"`
// Any of "system", "developer", "user", "assistant".
Role ConversationItemListResponseMessageRole `json:"role,required"`
Type constant.Message `json:"type,required"`
ID string `json:"id"`
Status string `json:"status"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Content respjson.Field
Role respjson.Field
Type respjson.Field
ID respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Corresponds to the various Message types in the Responses API. They are all under one type because the Responses API gives them all the same "type" value, and there is no way to tell them apart in certain scenarios.
func (ConversationItemListResponseMessage) RawJSON ¶
func (r ConversationItemListResponseMessage) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConversationItemListResponseMessage) UnmarshalJSON ¶
func (r *ConversationItemListResponseMessage) UnmarshalJSON(data []byte) error
type ConversationItemListResponseMessageContentArrayItemDetail ¶
type ConversationItemListResponseMessageContentArrayItemDetail string
Level of detail for image processing, can be "low", "high", or "auto"
const ( ConversationItemListResponseMessageContentArrayItemDetailLow ConversationItemListResponseMessageContentArrayItemDetail = "low" ConversationItemListResponseMessageContentArrayItemDetailHigh ConversationItemListResponseMessageContentArrayItemDetail = "high" ConversationItemListResponseMessageContentArrayItemDetailAuto ConversationItemListResponseMessageContentArrayItemDetail = "auto" )
type ConversationItemListResponseMessageContentArrayItemInputFile ¶
type ConversationItemListResponseMessageContentArrayItemInputFile struct {
// The type of the input item. Always `input_file`.
Type constant.InputFile `json:"type,required"`
// The data of the file to be sent to the model.
FileData string `json:"file_data"`
// (Optional) The ID of the file to be sent to the model.
FileID string `json:"file_id"`
// The URL of the file to be sent to the model.
FileURL string `json:"file_url"`
// The name of the file to be sent to the model.
Filename string `json:"filename"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Type respjson.Field
FileData respjson.Field
FileID respjson.Field
FileURL respjson.Field
Filename respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
File content for input messages in OpenAI response format.
func (ConversationItemListResponseMessageContentArrayItemInputFile) RawJSON ¶
func (r ConversationItemListResponseMessageContentArrayItemInputFile) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConversationItemListResponseMessageContentArrayItemInputFile) UnmarshalJSON ¶
func (r *ConversationItemListResponseMessageContentArrayItemInputFile) UnmarshalJSON(data []byte) error
type ConversationItemListResponseMessageContentArrayItemInputImage ¶
type ConversationItemListResponseMessageContentArrayItemInputImage struct {
// Level of detail for image processing, can be "low", "high", or "auto"
//
// Any of "low", "high", "auto".
Detail ConversationItemListResponseMessageContentArrayItemInputImageDetail `json:"detail,required"`
// Content type identifier, always "input_image"
Type constant.InputImage `json:"type,required"`
// (Optional) The ID of the file to be sent to the model.
FileID string `json:"file_id"`
// (Optional) URL of the image content
ImageURL string `json:"image_url"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Detail respjson.Field
Type respjson.Field
FileID respjson.Field
ImageURL respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Image content for input messages in OpenAI response format.
func (ConversationItemListResponseMessageContentArrayItemInputImage) RawJSON ¶
func (r ConversationItemListResponseMessageContentArrayItemInputImage) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConversationItemListResponseMessageContentArrayItemInputImage) UnmarshalJSON ¶
func (r *ConversationItemListResponseMessageContentArrayItemInputImage) UnmarshalJSON(data []byte) error
type ConversationItemListResponseMessageContentArrayItemInputImageDetail ¶
type ConversationItemListResponseMessageContentArrayItemInputImageDetail string
Level of detail for image processing, can be "low", "high", or "auto"
const ( ConversationItemListResponseMessageContentArrayItemInputImageDetailLow ConversationItemListResponseMessageContentArrayItemInputImageDetail = "low" ConversationItemListResponseMessageContentArrayItemInputImageDetailHigh ConversationItemListResponseMessageContentArrayItemInputImageDetail = "high" ConversationItemListResponseMessageContentArrayItemInputImageDetailAuto ConversationItemListResponseMessageContentArrayItemInputImageDetail = "auto" )
type ConversationItemListResponseMessageContentArrayItemInputText ¶
type ConversationItemListResponseMessageContentArrayItemInputText struct {
// The text content of the input message
Text string `json:"text,required"`
// Content type identifier, always "input_text"
Type constant.InputText `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:"-"`
}
Text content for input messages in OpenAI response format.
func (ConversationItemListResponseMessageContentArrayItemInputText) RawJSON ¶
func (r ConversationItemListResponseMessageContentArrayItemInputText) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConversationItemListResponseMessageContentArrayItemInputText) UnmarshalJSON ¶
func (r *ConversationItemListResponseMessageContentArrayItemInputText) UnmarshalJSON(data []byte) error
type ConversationItemListResponseMessageContentArrayItemUnion ¶
type ConversationItemListResponseMessageContentArrayItemUnion struct {
// This field is from variant
// [ConversationItemListResponseMessageContentArrayItemInputText].
Text string `json:"text"`
// Any of "input_text", "input_image", "input_file".
Type string `json:"type"`
// This field is from variant
// [ConversationItemListResponseMessageContentArrayItemInputImage].
Detail ConversationItemListResponseMessageContentArrayItemInputImageDetail `json:"detail"`
FileID string `json:"file_id"`
// This field is from variant
// [ConversationItemListResponseMessageContentArrayItemInputImage].
ImageURL string `json:"image_url"`
// This field is from variant
// [ConversationItemListResponseMessageContentArrayItemInputFile].
FileData string `json:"file_data"`
// This field is from variant
// [ConversationItemListResponseMessageContentArrayItemInputFile].
FileURL string `json:"file_url"`
// This field is from variant
// [ConversationItemListResponseMessageContentArrayItemInputFile].
Filename string `json:"filename"`
JSON struct {
Text respjson.Field
Type respjson.Field
Detail respjson.Field
FileID respjson.Field
ImageURL respjson.Field
FileData respjson.Field
FileURL respjson.Field
Filename respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ConversationItemListResponseMessageContentArrayItemUnion contains all possible properties and values from ConversationItemListResponseMessageContentArrayItemInputText, ConversationItemListResponseMessageContentArrayItemInputImage, ConversationItemListResponseMessageContentArrayItemInputFile.
Use the ConversationItemListResponseMessageContentArrayItemUnion.AsAny method to switch on the variant.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (ConversationItemListResponseMessageContentArrayItemUnion) AsAny ¶
func (u ConversationItemListResponseMessageContentArrayItemUnion) AsAny() anyConversationItemListResponseMessageContentArrayItem
Use the following switch statement to find the correct variant
switch variant := ConversationItemListResponseMessageContentArrayItemUnion.AsAny().(type) {
case llamastackclient.ConversationItemListResponseMessageContentArrayItemInputText:
case llamastackclient.ConversationItemListResponseMessageContentArrayItemInputImage:
case llamastackclient.ConversationItemListResponseMessageContentArrayItemInputFile:
default:
fmt.Errorf("no variant present")
}
func (ConversationItemListResponseMessageContentArrayItemUnion) AsInputFile ¶
func (ConversationItemListResponseMessageContentArrayItemUnion) AsInputImage ¶
func (ConversationItemListResponseMessageContentArrayItemUnion) AsInputText ¶
func (ConversationItemListResponseMessageContentArrayItemUnion) RawJSON ¶
func (u ConversationItemListResponseMessageContentArrayItemUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConversationItemListResponseMessageContentArrayItemUnion) UnmarshalJSON ¶
func (r *ConversationItemListResponseMessageContentArrayItemUnion) UnmarshalJSON(data []byte) error
type ConversationItemListResponseMessageContentUnion ¶
type ConversationItemListResponseMessageContentUnion 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
// [[]ConversationItemListResponseMessageContentArrayItemUnion] instead of an
// object.
OfVariant2 []ConversationItemListResponseMessageContentArrayItemUnion `json:",inline"`
JSON struct {
OfString respjson.Field
OfVariant2 respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ConversationItemListResponseMessageContentUnion contains all possible properties and values from [string], [[]ConversationItemListResponseMessageContentArrayItemUnion], [[]ConversationItemListResponseMessageContentArrayItemUnion].
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 OfVariant2]
func (ConversationItemListResponseMessageContentUnion) AsConversationItemListResponseMessageContentArray ¶
func (u ConversationItemListResponseMessageContentUnion) AsConversationItemListResponseMessageContentArray() (v []ConversationItemListResponseMessageContentArrayItemUnion)
func (ConversationItemListResponseMessageContentUnion) AsString ¶
func (u ConversationItemListResponseMessageContentUnion) AsString() (v string)
func (ConversationItemListResponseMessageContentUnion) AsVariant2 ¶
func (u ConversationItemListResponseMessageContentUnion) AsVariant2() (v []ConversationItemListResponseMessageContentArrayItemUnion)
func (ConversationItemListResponseMessageContentUnion) RawJSON ¶
func (u ConversationItemListResponseMessageContentUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConversationItemListResponseMessageContentUnion) UnmarshalJSON ¶
func (r *ConversationItemListResponseMessageContentUnion) UnmarshalJSON(data []byte) error
type ConversationItemListResponseMessageRole ¶
type ConversationItemListResponseMessageRole string
const ( ConversationItemListResponseMessageRoleSystem ConversationItemListResponseMessageRole = "system" ConversationItemListResponseMessageRoleDeveloper ConversationItemListResponseMessageRole = "developer" ConversationItemListResponseMessageRoleUser ConversationItemListResponseMessageRole = "user" ConversationItemListResponseMessageRoleAssistant ConversationItemListResponseMessageRole = "assistant" )
type ConversationItemListResponseRole ¶
type ConversationItemListResponseRole string
const ( ConversationItemListResponseRoleSystem ConversationItemListResponseRole = "system" ConversationItemListResponseRoleDeveloper ConversationItemListResponseRole = "developer" ConversationItemListResponseRoleUser ConversationItemListResponseRole = "user" ConversationItemListResponseRoleAssistant ConversationItemListResponseRole = "assistant" )
type ConversationItemListResponseUnion ¶
type ConversationItemListResponseUnion struct {
// This field is from variant [ConversationItemListResponseMessage].
Content ConversationItemListResponseMessageContentUnion `json:"content"`
// This field is from variant [ConversationItemListResponseMessage].
Role ConversationItemListResponseMessageRole `json:"role"`
// Any of "message", "web_search_call", "file_search_call", "function_call",
// "function_call_output", "mcp_approval_request", "mcp_approval_response",
// "mcp_call", "mcp_list_tools".
Type string `json:"type"`
ID string `json:"id"`
Status string `json:"status"`
// This field is from variant [ConversationItemListResponseFileSearchCall].
Queries []string `json:"queries"`
// This field is from variant [ConversationItemListResponseFileSearchCall].
Results []ConversationItemListResponseFileSearchCallResult `json:"results"`
Arguments string `json:"arguments"`
CallID string `json:"call_id"`
Name string `json:"name"`
Output string `json:"output"`
ServerLabel string `json:"server_label"`
// This field is from variant [ConversationItemListResponseMcpApprovalResponse].
ApprovalRequestID string `json:"approval_request_id"`
// This field is from variant [ConversationItemListResponseMcpApprovalResponse].
Approve bool `json:"approve"`
// This field is from variant [ConversationItemListResponseMcpApprovalResponse].
Reason string `json:"reason"`
// This field is from variant [ConversationItemListResponseMcpCall].
Error string `json:"error"`
// This field is from variant [ConversationItemListResponseMcpListTools].
Tools []ConversationItemListResponseMcpListToolsTool `json:"tools"`
JSON struct {
Content respjson.Field
Role respjson.Field
Type respjson.Field
ID respjson.Field
Status respjson.Field
Queries respjson.Field
Results respjson.Field
Arguments respjson.Field
CallID respjson.Field
Name respjson.Field
Output respjson.Field
ServerLabel respjson.Field
ApprovalRequestID respjson.Field
Approve respjson.Field
Reason respjson.Field
Error respjson.Field
Tools respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ConversationItemListResponseUnion contains all possible properties and values from ConversationItemListResponseMessage, ConversationItemListResponseWebSearchCall, ConversationItemListResponseFileSearchCall, ConversationItemListResponseFunctionCall, ConversationItemListResponseFunctionCallOutput, ConversationItemListResponseMcpApprovalRequest, ConversationItemListResponseMcpApprovalResponse, ConversationItemListResponseMcpCall, ConversationItemListResponseMcpListTools.
Use the ConversationItemListResponseUnion.AsAny method to switch on the variant.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (ConversationItemListResponseUnion) AsAny ¶
func (u ConversationItemListResponseUnion) AsAny() anyConversationItemListResponse
Use the following switch statement to find the correct variant
switch variant := ConversationItemListResponseUnion.AsAny().(type) {
case llamastackclient.ConversationItemListResponseMessage:
case llamastackclient.ConversationItemListResponseWebSearchCall:
case llamastackclient.ConversationItemListResponseFileSearchCall:
case llamastackclient.ConversationItemListResponseFunctionCall:
case llamastackclient.ConversationItemListResponseFunctionCallOutput:
case llamastackclient.ConversationItemListResponseMcpApprovalRequest:
case llamastackclient.ConversationItemListResponseMcpApprovalResponse:
case llamastackclient.ConversationItemListResponseMcpCall:
case llamastackclient.ConversationItemListResponseMcpListTools:
default:
fmt.Errorf("no variant present")
}
func (ConversationItemListResponseUnion) AsFileSearchCall ¶
func (u ConversationItemListResponseUnion) AsFileSearchCall() (v ConversationItemListResponseFileSearchCall)
func (ConversationItemListResponseUnion) AsFunctionCall ¶
func (u ConversationItemListResponseUnion) AsFunctionCall() (v ConversationItemListResponseFunctionCall)
func (ConversationItemListResponseUnion) AsFunctionCallOutput ¶
func (u ConversationItemListResponseUnion) AsFunctionCallOutput() (v ConversationItemListResponseFunctionCallOutput)
func (ConversationItemListResponseUnion) AsMcpApprovalRequest ¶
func (u ConversationItemListResponseUnion) AsMcpApprovalRequest() (v ConversationItemListResponseMcpApprovalRequest)
func (ConversationItemListResponseUnion) AsMcpApprovalResponse ¶
func (u ConversationItemListResponseUnion) AsMcpApprovalResponse() (v ConversationItemListResponseMcpApprovalResponse)
func (ConversationItemListResponseUnion) AsMcpCall ¶
func (u ConversationItemListResponseUnion) AsMcpCall() (v ConversationItemListResponseMcpCall)
func (ConversationItemListResponseUnion) AsMcpListTools ¶
func (u ConversationItemListResponseUnion) AsMcpListTools() (v ConversationItemListResponseMcpListTools)
func (ConversationItemListResponseUnion) AsMessage ¶
func (u ConversationItemListResponseUnion) AsMessage() (v ConversationItemListResponseMessage)
func (ConversationItemListResponseUnion) AsWebSearchCall ¶
func (u ConversationItemListResponseUnion) AsWebSearchCall() (v ConversationItemListResponseWebSearchCall)
func (ConversationItemListResponseUnion) RawJSON ¶
func (u ConversationItemListResponseUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConversationItemListResponseUnion) UnmarshalJSON ¶
func (r *ConversationItemListResponseUnion) UnmarshalJSON(data []byte) error
type ConversationItemListResponseWebSearchCall ¶
type ConversationItemListResponseWebSearchCall struct {
// Unique identifier for this tool call
ID string `json:"id,required"`
// Current status of the web search operation
Status string `json:"status,required"`
// Tool call type identifier, always "web_search_call"
Type constant.WebSearchCall `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Status respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Web search tool call output message for OpenAI responses.
func (ConversationItemListResponseWebSearchCall) RawJSON ¶
func (r ConversationItemListResponseWebSearchCall) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConversationItemListResponseWebSearchCall) UnmarshalJSON ¶
func (r *ConversationItemListResponseWebSearchCall) UnmarshalJSON(data []byte) error
type ConversationItemNewParams ¶
type ConversationItemNewParams struct {
// Items to include in the conversation context.
Items []ConversationItemNewParamsItemUnion `json:"items,omitzero,required"`
// contains filtered or unexported fields
}
func (ConversationItemNewParams) MarshalJSON ¶
func (r ConversationItemNewParams) MarshalJSON() (data []byte, err error)
func (*ConversationItemNewParams) UnmarshalJSON ¶
func (r *ConversationItemNewParams) UnmarshalJSON(data []byte) error
type ConversationItemNewParamsItemFileSearchCall ¶
type ConversationItemNewParamsItemFileSearchCall struct {
// Unique identifier for this tool call
ID string `json:"id,required"`
// List of search queries executed
Queries []string `json:"queries,omitzero,required"`
// Current status of the file search operation
Status string `json:"status,required"`
// (Optional) Search results returned by the file search operation
Results []ConversationItemNewParamsItemFileSearchCallResult `json:"results,omitzero"`
// Tool call type identifier, always "file_search_call"
//
// This field can be elided, and will marshal its zero value as "file_search_call".
Type constant.FileSearchCall `json:"type,required"`
// contains filtered or unexported fields
}
File search tool call output message for OpenAI responses.
The properties ID, Queries, Status, Type are required.
func (ConversationItemNewParamsItemFileSearchCall) MarshalJSON ¶
func (r ConversationItemNewParamsItemFileSearchCall) MarshalJSON() (data []byte, err error)
func (*ConversationItemNewParamsItemFileSearchCall) UnmarshalJSON ¶
func (r *ConversationItemNewParamsItemFileSearchCall) UnmarshalJSON(data []byte) error
type ConversationItemNewParamsItemFileSearchCallResult ¶
type ConversationItemNewParamsItemFileSearchCallResult struct {
// (Optional) Key-value attributes associated with the file
Attributes map[string]ConversationItemNewParamsItemFileSearchCallResultAttributeUnion `json:"attributes,omitzero,required"`
// Unique identifier of the file containing the result
FileID string `json:"file_id,required"`
// Name of the file containing the result
Filename string `json:"filename,required"`
// Relevance score for this search result (between 0 and 1)
Score float64 `json:"score,required"`
// Text content of the search result
Text string `json:"text,required"`
// contains filtered or unexported fields
}
Search results returned by the file search operation.
The properties Attributes, FileID, Filename, Score, Text are required.
func (ConversationItemNewParamsItemFileSearchCallResult) MarshalJSON ¶
func (r ConversationItemNewParamsItemFileSearchCallResult) MarshalJSON() (data []byte, err error)
func (*ConversationItemNewParamsItemFileSearchCallResult) UnmarshalJSON ¶
func (r *ConversationItemNewParamsItemFileSearchCallResult) UnmarshalJSON(data []byte) error
type ConversationItemNewParamsItemFileSearchCallResultAttributeUnion ¶
type ConversationItemNewParamsItemFileSearchCallResultAttributeUnion 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 (ConversationItemNewParamsItemFileSearchCallResultAttributeUnion) MarshalJSON ¶
func (u ConversationItemNewParamsItemFileSearchCallResultAttributeUnion) MarshalJSON() ([]byte, error)
func (*ConversationItemNewParamsItemFileSearchCallResultAttributeUnion) UnmarshalJSON ¶
func (u *ConversationItemNewParamsItemFileSearchCallResultAttributeUnion) UnmarshalJSON(data []byte) error
type ConversationItemNewParamsItemFunctionCall ¶
type ConversationItemNewParamsItemFunctionCall struct {
// JSON string containing the function arguments
Arguments string `json:"arguments,required"`
// Unique identifier for the function call
CallID string `json:"call_id,required"`
// Name of the function being called
Name string `json:"name,required"`
// (Optional) Additional identifier for the tool call
ID param.Opt[string] `json:"id,omitzero"`
// (Optional) Current status of the function call execution
Status param.Opt[string] `json:"status,omitzero"`
// Tool call type identifier, always "function_call"
//
// This field can be elided, and will marshal its zero value as "function_call".
Type constant.FunctionCall `json:"type,required"`
// contains filtered or unexported fields
}
Function tool call output message for OpenAI responses.
The properties Arguments, CallID, Name, Type are required.
func (ConversationItemNewParamsItemFunctionCall) MarshalJSON ¶
func (r ConversationItemNewParamsItemFunctionCall) MarshalJSON() (data []byte, err error)
func (*ConversationItemNewParamsItemFunctionCall) UnmarshalJSON ¶
func (r *ConversationItemNewParamsItemFunctionCall) UnmarshalJSON(data []byte) error
type ConversationItemNewParamsItemFunctionCallOutput ¶
type ConversationItemNewParamsItemFunctionCallOutput struct {
CallID string `json:"call_id,required"`
Output string `json:"output,required"`
ID param.Opt[string] `json:"id,omitzero"`
Status param.Opt[string] `json:"status,omitzero"`
// This field can be elided, and will marshal its zero value as
// "function_call_output".
Type constant.FunctionCallOutput `json:"type,required"`
// contains filtered or unexported fields
}
This represents the output of a function call that gets passed back to the model.
The properties CallID, Output, Type are required.
func (ConversationItemNewParamsItemFunctionCallOutput) MarshalJSON ¶
func (r ConversationItemNewParamsItemFunctionCallOutput) MarshalJSON() (data []byte, err error)
func (*ConversationItemNewParamsItemFunctionCallOutput) UnmarshalJSON ¶
func (r *ConversationItemNewParamsItemFunctionCallOutput) UnmarshalJSON(data []byte) error
type ConversationItemNewParamsItemMcpApprovalRequest ¶
type ConversationItemNewParamsItemMcpApprovalRequest struct {
ID string `json:"id,required"`
Arguments string `json:"arguments,required"`
Name string `json:"name,required"`
ServerLabel string `json:"server_label,required"`
// This field can be elided, and will marshal its zero value as
// "mcp_approval_request".
Type constant.McpApprovalRequest `json:"type,required"`
// contains filtered or unexported fields
}
A request for human approval of a tool invocation.
The properties ID, Arguments, Name, ServerLabel, Type are required.
func (ConversationItemNewParamsItemMcpApprovalRequest) MarshalJSON ¶
func (r ConversationItemNewParamsItemMcpApprovalRequest) MarshalJSON() (data []byte, err error)
func (*ConversationItemNewParamsItemMcpApprovalRequest) UnmarshalJSON ¶
func (r *ConversationItemNewParamsItemMcpApprovalRequest) UnmarshalJSON(data []byte) error
type ConversationItemNewParamsItemMcpApprovalResponse ¶
type ConversationItemNewParamsItemMcpApprovalResponse struct {
ApprovalRequestID string `json:"approval_request_id,required"`
Approve bool `json:"approve,required"`
ID param.Opt[string] `json:"id,omitzero"`
Reason param.Opt[string] `json:"reason,omitzero"`
// This field can be elided, and will marshal its zero value as
// "mcp_approval_response".
Type constant.McpApprovalResponse `json:"type,required"`
// contains filtered or unexported fields
}
A response to an MCP approval request.
The properties ApprovalRequestID, Approve, Type are required.
func (ConversationItemNewParamsItemMcpApprovalResponse) MarshalJSON ¶
func (r ConversationItemNewParamsItemMcpApprovalResponse) MarshalJSON() (data []byte, err error)
func (*ConversationItemNewParamsItemMcpApprovalResponse) UnmarshalJSON ¶
func (r *ConversationItemNewParamsItemMcpApprovalResponse) UnmarshalJSON(data []byte) error
type ConversationItemNewParamsItemMcpCall ¶
type ConversationItemNewParamsItemMcpCall struct {
// Unique identifier for this MCP call
ID string `json:"id,required"`
// JSON string containing the MCP call arguments
Arguments string `json:"arguments,required"`
// Name of the MCP method being called
Name string `json:"name,required"`
// Label identifying the MCP server handling the call
ServerLabel string `json:"server_label,required"`
// (Optional) Error message if the MCP call failed
Error param.Opt[string] `json:"error,omitzero"`
// (Optional) Output result from the successful MCP call
Output param.Opt[string] `json:"output,omitzero"`
// Tool call type identifier, always "mcp_call"
//
// This field can be elided, and will marshal its zero value as "mcp_call".
Type constant.McpCall `json:"type,required"`
// contains filtered or unexported fields
}
Model Context Protocol (MCP) call output message for OpenAI responses.
The properties ID, Arguments, Name, ServerLabel, Type are required.
func (ConversationItemNewParamsItemMcpCall) MarshalJSON ¶
func (r ConversationItemNewParamsItemMcpCall) MarshalJSON() (data []byte, err error)
func (*ConversationItemNewParamsItemMcpCall) UnmarshalJSON ¶
func (r *ConversationItemNewParamsItemMcpCall) UnmarshalJSON(data []byte) error
type ConversationItemNewParamsItemMcpListTools ¶
type ConversationItemNewParamsItemMcpListTools struct {
// Unique identifier for this MCP list tools operation
ID string `json:"id,required"`
// Label identifying the MCP server providing the tools
ServerLabel string `json:"server_label,required"`
// List of available tools provided by the MCP server
Tools []ConversationItemNewParamsItemMcpListToolsTool `json:"tools,omitzero,required"`
// Tool call type identifier, always "mcp_list_tools"
//
// This field can be elided, and will marshal its zero value as "mcp_list_tools".
Type constant.McpListTools `json:"type,required"`
// contains filtered or unexported fields
}
MCP list tools output message containing available tools from an MCP server.
The properties ID, ServerLabel, Tools, Type are required.
func (ConversationItemNewParamsItemMcpListTools) MarshalJSON ¶
func (r ConversationItemNewParamsItemMcpListTools) MarshalJSON() (data []byte, err error)
func (*ConversationItemNewParamsItemMcpListTools) UnmarshalJSON ¶
func (r *ConversationItemNewParamsItemMcpListTools) UnmarshalJSON(data []byte) error
type ConversationItemNewParamsItemMcpListToolsTool ¶
type ConversationItemNewParamsItemMcpListToolsTool struct {
// JSON schema defining the tool's input parameters
InputSchema map[string]ConversationItemNewParamsItemMcpListToolsToolInputSchemaUnion `json:"input_schema,omitzero,required"`
// Name of the tool
Name string `json:"name,required"`
// (Optional) Description of what the tool does
Description param.Opt[string] `json:"description,omitzero"`
// contains filtered or unexported fields
}
Tool definition returned by MCP list tools operation.
The properties InputSchema, Name are required.
func (ConversationItemNewParamsItemMcpListToolsTool) MarshalJSON ¶
func (r ConversationItemNewParamsItemMcpListToolsTool) MarshalJSON() (data []byte, err error)
func (*ConversationItemNewParamsItemMcpListToolsTool) UnmarshalJSON ¶
func (r *ConversationItemNewParamsItemMcpListToolsTool) UnmarshalJSON(data []byte) error
type ConversationItemNewParamsItemMcpListToolsToolInputSchemaUnion ¶
type ConversationItemNewParamsItemMcpListToolsToolInputSchemaUnion 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 (ConversationItemNewParamsItemMcpListToolsToolInputSchemaUnion) MarshalJSON ¶
func (u ConversationItemNewParamsItemMcpListToolsToolInputSchemaUnion) MarshalJSON() ([]byte, error)
func (*ConversationItemNewParamsItemMcpListToolsToolInputSchemaUnion) UnmarshalJSON ¶
func (u *ConversationItemNewParamsItemMcpListToolsToolInputSchemaUnion) UnmarshalJSON(data []byte) error
type ConversationItemNewParamsItemMessage ¶
type ConversationItemNewParamsItemMessage struct {
Content ConversationItemNewParamsItemMessageContentUnion `json:"content,omitzero,required"`
// Any of "system", "developer", "user", "assistant".
Role ConversationItemNewParamsItemMessageRole `json:"role,omitzero,required"`
ID param.Opt[string] `json:"id,omitzero"`
Status param.Opt[string] `json:"status,omitzero"`
// This field can be elided, and will marshal its zero value as "message".
Type constant.Message `json:"type,required"`
// contains filtered or unexported fields
}
Corresponds to the various Message types in the Responses API. They are all under one type because the Responses API gives them all the same "type" value, and there is no way to tell them apart in certain scenarios.
The properties Content, Role, Type are required.
func (ConversationItemNewParamsItemMessage) MarshalJSON ¶
func (r ConversationItemNewParamsItemMessage) MarshalJSON() (data []byte, err error)
func (*ConversationItemNewParamsItemMessage) UnmarshalJSON ¶
func (r *ConversationItemNewParamsItemMessage) UnmarshalJSON(data []byte) error
type ConversationItemNewParamsItemMessageContentArrayItemInputFile ¶
type ConversationItemNewParamsItemMessageContentArrayItemInputFile struct {
// The data of the file to be sent to the model.
FileData param.Opt[string] `json:"file_data,omitzero"`
// (Optional) The ID of the file to be sent to the model.
FileID param.Opt[string] `json:"file_id,omitzero"`
// The URL of the file to be sent to the model.
FileURL param.Opt[string] `json:"file_url,omitzero"`
// The name of the file to be sent to the model.
Filename param.Opt[string] `json:"filename,omitzero"`
// The type of the input item. Always `input_file`.
//
// This field can be elided, and will marshal its zero value as "input_file".
Type constant.InputFile `json:"type,required"`
// contains filtered or unexported fields
}
File content for input messages in OpenAI response format.
The property Type is required.
func (ConversationItemNewParamsItemMessageContentArrayItemInputFile) MarshalJSON ¶
func (r ConversationItemNewParamsItemMessageContentArrayItemInputFile) MarshalJSON() (data []byte, err error)
func (*ConversationItemNewParamsItemMessageContentArrayItemInputFile) UnmarshalJSON ¶
func (r *ConversationItemNewParamsItemMessageContentArrayItemInputFile) UnmarshalJSON(data []byte) error
type ConversationItemNewParamsItemMessageContentArrayItemInputImage ¶
type ConversationItemNewParamsItemMessageContentArrayItemInputImage struct {
// Level of detail for image processing, can be "low", "high", or "auto"
//
// Any of "low", "high", "auto".
Detail ConversationItemNewParamsItemMessageContentArrayItemInputImageDetail `json:"detail,omitzero,required"`
// (Optional) The ID of the file to be sent to the model.
FileID param.Opt[string] `json:"file_id,omitzero"`
// (Optional) URL of the image content
ImageURL param.Opt[string] `json:"image_url,omitzero"`
// Content type identifier, always "input_image"
//
// This field can be elided, and will marshal its zero value as "input_image".
Type constant.InputImage `json:"type,required"`
// contains filtered or unexported fields
}
Image content for input messages in OpenAI response format.
The properties Detail, Type are required.
func (ConversationItemNewParamsItemMessageContentArrayItemInputImage) MarshalJSON ¶
func (r ConversationItemNewParamsItemMessageContentArrayItemInputImage) MarshalJSON() (data []byte, err error)
func (*ConversationItemNewParamsItemMessageContentArrayItemInputImage) UnmarshalJSON ¶
func (r *ConversationItemNewParamsItemMessageContentArrayItemInputImage) UnmarshalJSON(data []byte) error
type ConversationItemNewParamsItemMessageContentArrayItemInputImageDetail ¶
type ConversationItemNewParamsItemMessageContentArrayItemInputImageDetail string
Level of detail for image processing, can be "low", "high", or "auto"
const ( ConversationItemNewParamsItemMessageContentArrayItemInputImageDetailLow ConversationItemNewParamsItemMessageContentArrayItemInputImageDetail = "low" ConversationItemNewParamsItemMessageContentArrayItemInputImageDetailHigh ConversationItemNewParamsItemMessageContentArrayItemInputImageDetail = "high" ConversationItemNewParamsItemMessageContentArrayItemInputImageDetailAuto ConversationItemNewParamsItemMessageContentArrayItemInputImageDetail = "auto" )
type ConversationItemNewParamsItemMessageContentArrayItemInputText ¶
type ConversationItemNewParamsItemMessageContentArrayItemInputText struct {
// The text content of the input message
Text string `json:"text,required"`
// Content type identifier, always "input_text"
//
// This field can be elided, and will marshal its zero value as "input_text".
Type constant.InputText `json:"type,required"`
// contains filtered or unexported fields
}
Text content for input messages in OpenAI response format.
The properties Text, Type are required.
func (ConversationItemNewParamsItemMessageContentArrayItemInputText) MarshalJSON ¶
func (r ConversationItemNewParamsItemMessageContentArrayItemInputText) MarshalJSON() (data []byte, err error)
func (*ConversationItemNewParamsItemMessageContentArrayItemInputText) UnmarshalJSON ¶
func (r *ConversationItemNewParamsItemMessageContentArrayItemInputText) UnmarshalJSON(data []byte) error
type ConversationItemNewParamsItemMessageContentArrayItemUnion ¶
type ConversationItemNewParamsItemMessageContentArrayItemUnion struct {
OfInputText *ConversationItemNewParamsItemMessageContentArrayItemInputText `json:",omitzero,inline"`
OfInputImage *ConversationItemNewParamsItemMessageContentArrayItemInputImage `json:",omitzero,inline"`
OfInputFile *ConversationItemNewParamsItemMessageContentArrayItemInputFile `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 (ConversationItemNewParamsItemMessageContentArrayItemUnion) GetDetail ¶
func (u ConversationItemNewParamsItemMessageContentArrayItemUnion) GetDetail() *string
Returns a pointer to the underlying variant's property, if present.
func (ConversationItemNewParamsItemMessageContentArrayItemUnion) GetFileData ¶
func (u ConversationItemNewParamsItemMessageContentArrayItemUnion) GetFileData() *string
Returns a pointer to the underlying variant's property, if present.
func (ConversationItemNewParamsItemMessageContentArrayItemUnion) GetFileID ¶
func (u ConversationItemNewParamsItemMessageContentArrayItemUnion) GetFileID() *string
Returns a pointer to the underlying variant's property, if present.
func (ConversationItemNewParamsItemMessageContentArrayItemUnion) GetFileURL ¶
func (u ConversationItemNewParamsItemMessageContentArrayItemUnion) GetFileURL() *string
Returns a pointer to the underlying variant's property, if present.
func (ConversationItemNewParamsItemMessageContentArrayItemUnion) GetFilename ¶
func (u ConversationItemNewParamsItemMessageContentArrayItemUnion) GetFilename() *string
Returns a pointer to the underlying variant's property, if present.
func (ConversationItemNewParamsItemMessageContentArrayItemUnion) GetImageURL ¶
func (u ConversationItemNewParamsItemMessageContentArrayItemUnion) GetImageURL() *string
Returns a pointer to the underlying variant's property, if present.
func (ConversationItemNewParamsItemMessageContentArrayItemUnion) GetText ¶
func (u ConversationItemNewParamsItemMessageContentArrayItemUnion) GetText() *string
Returns a pointer to the underlying variant's property, if present.
func (ConversationItemNewParamsItemMessageContentArrayItemUnion) GetType ¶
func (u ConversationItemNewParamsItemMessageContentArrayItemUnion) GetType() *string
Returns a pointer to the underlying variant's property, if present.
func (ConversationItemNewParamsItemMessageContentArrayItemUnion) MarshalJSON ¶
func (u ConversationItemNewParamsItemMessageContentArrayItemUnion) MarshalJSON() ([]byte, error)
func (*ConversationItemNewParamsItemMessageContentArrayItemUnion) UnmarshalJSON ¶
func (u *ConversationItemNewParamsItemMessageContentArrayItemUnion) UnmarshalJSON(data []byte) error
type ConversationItemNewParamsItemMessageContentUnion ¶
type ConversationItemNewParamsItemMessageContentUnion struct {
OfString param.Opt[string] `json:",omitzero,inline"`
OfConversationItemNewsItemMessageContentArray []ConversationItemNewParamsItemMessageContentArrayItemUnion `json:",omitzero,inline"`
OfVariant2 []ConversationItemNewParamsItemMessageContentArrayItemUnion `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 (ConversationItemNewParamsItemMessageContentUnion) MarshalJSON ¶
func (u ConversationItemNewParamsItemMessageContentUnion) MarshalJSON() ([]byte, error)
func (*ConversationItemNewParamsItemMessageContentUnion) UnmarshalJSON ¶
func (u *ConversationItemNewParamsItemMessageContentUnion) UnmarshalJSON(data []byte) error
type ConversationItemNewParamsItemMessageRole ¶
type ConversationItemNewParamsItemMessageRole string
const ( ConversationItemNewParamsItemMessageRoleSystem ConversationItemNewParamsItemMessageRole = "system" ConversationItemNewParamsItemMessageRoleDeveloper ConversationItemNewParamsItemMessageRole = "developer" ConversationItemNewParamsItemMessageRoleUser ConversationItemNewParamsItemMessageRole = "user" ConversationItemNewParamsItemMessageRoleAssistant ConversationItemNewParamsItemMessageRole = "assistant" )
type ConversationItemNewParamsItemUnion ¶
type ConversationItemNewParamsItemUnion struct {
OfMessage *ConversationItemNewParamsItemMessage `json:",omitzero,inline"`
OfWebSearchCall *ConversationItemNewParamsItemWebSearchCall `json:",omitzero,inline"`
OfFileSearchCall *ConversationItemNewParamsItemFileSearchCall `json:",omitzero,inline"`
OfFunctionCall *ConversationItemNewParamsItemFunctionCall `json:",omitzero,inline"`
OfFunctionCallOutput *ConversationItemNewParamsItemFunctionCallOutput `json:",omitzero,inline"`
OfMcpApprovalRequest *ConversationItemNewParamsItemMcpApprovalRequest `json:",omitzero,inline"`
OfMcpApprovalResponse *ConversationItemNewParamsItemMcpApprovalResponse `json:",omitzero,inline"`
OfMcpCall *ConversationItemNewParamsItemMcpCall `json:",omitzero,inline"`
OfMcpListTools *ConversationItemNewParamsItemMcpListTools `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 (ConversationItemNewParamsItemUnion) GetApprovalRequestID ¶
func (u ConversationItemNewParamsItemUnion) GetApprovalRequestID() *string
Returns a pointer to the underlying variant's property, if present.
func (ConversationItemNewParamsItemUnion) GetApprove ¶
func (u ConversationItemNewParamsItemUnion) GetApprove() *bool
Returns a pointer to the underlying variant's property, if present.
func (ConversationItemNewParamsItemUnion) GetArguments ¶
func (u ConversationItemNewParamsItemUnion) GetArguments() *string
Returns a pointer to the underlying variant's property, if present.
func (ConversationItemNewParamsItemUnion) GetCallID ¶
func (u ConversationItemNewParamsItemUnion) GetCallID() *string
Returns a pointer to the underlying variant's property, if present.
func (ConversationItemNewParamsItemUnion) GetContent ¶
func (u ConversationItemNewParamsItemUnion) GetContent() *ConversationItemNewParamsItemMessageContentUnion
Returns a pointer to the underlying variant's property, if present.
func (ConversationItemNewParamsItemUnion) GetError ¶
func (u ConversationItemNewParamsItemUnion) GetError() *string
Returns a pointer to the underlying variant's property, if present.
func (ConversationItemNewParamsItemUnion) GetID ¶
func (u ConversationItemNewParamsItemUnion) GetID() *string
Returns a pointer to the underlying variant's property, if present.
func (ConversationItemNewParamsItemUnion) GetName ¶
func (u ConversationItemNewParamsItemUnion) GetName() *string
Returns a pointer to the underlying variant's property, if present.
func (ConversationItemNewParamsItemUnion) GetOutput ¶
func (u ConversationItemNewParamsItemUnion) GetOutput() *string
Returns a pointer to the underlying variant's property, if present.
func (ConversationItemNewParamsItemUnion) GetQueries ¶
func (u ConversationItemNewParamsItemUnion) GetQueries() []string
Returns a pointer to the underlying variant's property, if present.
func (ConversationItemNewParamsItemUnion) GetReason ¶
func (u ConversationItemNewParamsItemUnion) GetReason() *string
Returns a pointer to the underlying variant's property, if present.
func (ConversationItemNewParamsItemUnion) GetResults ¶
func (u ConversationItemNewParamsItemUnion) GetResults() []ConversationItemNewParamsItemFileSearchCallResult
Returns a pointer to the underlying variant's property, if present.
func (ConversationItemNewParamsItemUnion) GetRole ¶
func (u ConversationItemNewParamsItemUnion) GetRole() *string
Returns a pointer to the underlying variant's property, if present.
func (ConversationItemNewParamsItemUnion) GetServerLabel ¶
func (u ConversationItemNewParamsItemUnion) GetServerLabel() *string
Returns a pointer to the underlying variant's property, if present.
func (ConversationItemNewParamsItemUnion) GetStatus ¶
func (u ConversationItemNewParamsItemUnion) GetStatus() *string
Returns a pointer to the underlying variant's property, if present.
func (ConversationItemNewParamsItemUnion) GetTools ¶
func (u ConversationItemNewParamsItemUnion) GetTools() []ConversationItemNewParamsItemMcpListToolsTool
Returns a pointer to the underlying variant's property, if present.
func (ConversationItemNewParamsItemUnion) GetType ¶
func (u ConversationItemNewParamsItemUnion) GetType() *string
Returns a pointer to the underlying variant's property, if present.
func (ConversationItemNewParamsItemUnion) MarshalJSON ¶
func (u ConversationItemNewParamsItemUnion) MarshalJSON() ([]byte, error)
func (*ConversationItemNewParamsItemUnion) UnmarshalJSON ¶
func (u *ConversationItemNewParamsItemUnion) UnmarshalJSON(data []byte) error
type ConversationItemNewParamsItemWebSearchCall ¶
type ConversationItemNewParamsItemWebSearchCall struct {
// Unique identifier for this tool call
ID string `json:"id,required"`
// Current status of the web search operation
Status string `json:"status,required"`
// Tool call type identifier, always "web_search_call"
//
// This field can be elided, and will marshal its zero value as "web_search_call".
Type constant.WebSearchCall `json:"type,required"`
// contains filtered or unexported fields
}
Web search tool call output message for OpenAI responses.
The properties ID, Status, Type are required.
func (ConversationItemNewParamsItemWebSearchCall) MarshalJSON ¶
func (r ConversationItemNewParamsItemWebSearchCall) MarshalJSON() (data []byte, err error)
func (*ConversationItemNewParamsItemWebSearchCall) UnmarshalJSON ¶
func (r *ConversationItemNewParamsItemWebSearchCall) UnmarshalJSON(data []byte) error
type ConversationItemNewResponse ¶
type ConversationItemNewResponse struct {
Data []ConversationItemNewResponseDataUnion `json:"data,required"`
HasMore bool `json:"has_more,required"`
Object string `json:"object,required"`
FirstID string `json:"first_id"`
LastID string `json:"last_id"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
HasMore respjson.Field
Object respjson.Field
FirstID respjson.Field
LastID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
List of conversation items with pagination.
func (ConversationItemNewResponse) RawJSON ¶
func (r ConversationItemNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConversationItemNewResponse) UnmarshalJSON ¶
func (r *ConversationItemNewResponse) UnmarshalJSON(data []byte) error
type ConversationItemNewResponseDataFileSearchCall ¶
type ConversationItemNewResponseDataFileSearchCall struct {
// Unique identifier for this tool call
ID string `json:"id,required"`
// List of search queries executed
Queries []string `json:"queries,required"`
// Current status of the file search operation
Status string `json:"status,required"`
// Tool call type identifier, always "file_search_call"
Type constant.FileSearchCall `json:"type,required"`
// (Optional) Search results returned by the file search operation
Results []ConversationItemNewResponseDataFileSearchCallResult `json:"results"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Queries respjson.Field
Status respjson.Field
Type respjson.Field
Results respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
File search tool call output message for OpenAI responses.
func (ConversationItemNewResponseDataFileSearchCall) RawJSON ¶
func (r ConversationItemNewResponseDataFileSearchCall) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConversationItemNewResponseDataFileSearchCall) UnmarshalJSON ¶
func (r *ConversationItemNewResponseDataFileSearchCall) UnmarshalJSON(data []byte) error
type ConversationItemNewResponseDataFileSearchCallResult ¶
type ConversationItemNewResponseDataFileSearchCallResult struct {
// (Optional) Key-value attributes associated with the file
Attributes map[string]ConversationItemNewResponseDataFileSearchCallResultAttributeUnion `json:"attributes,required"`
// Unique identifier of the file containing the result
FileID string `json:"file_id,required"`
// Name of the file containing the result
Filename string `json:"filename,required"`
// Relevance score for this search result (between 0 and 1)
Score float64 `json:"score,required"`
// Text content of the search result
Text string `json:"text,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Attributes respjson.Field
FileID respjson.Field
Filename respjson.Field
Score respjson.Field
Text respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Search results returned by the file search operation.
func (ConversationItemNewResponseDataFileSearchCallResult) RawJSON ¶
func (r ConversationItemNewResponseDataFileSearchCallResult) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConversationItemNewResponseDataFileSearchCallResult) UnmarshalJSON ¶
func (r *ConversationItemNewResponseDataFileSearchCallResult) UnmarshalJSON(data []byte) error
type ConversationItemNewResponseDataFileSearchCallResultAttributeUnion ¶
type ConversationItemNewResponseDataFileSearchCallResultAttributeUnion 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:"-"`
}
ConversationItemNewResponseDataFileSearchCallResultAttributeUnion 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 (ConversationItemNewResponseDataFileSearchCallResultAttributeUnion) AsAnyArray ¶
func (u ConversationItemNewResponseDataFileSearchCallResultAttributeUnion) AsAnyArray() (v []any)
func (ConversationItemNewResponseDataFileSearchCallResultAttributeUnion) AsBool ¶
func (u ConversationItemNewResponseDataFileSearchCallResultAttributeUnion) AsBool() (v bool)
func (ConversationItemNewResponseDataFileSearchCallResultAttributeUnion) AsFloat ¶
func (u ConversationItemNewResponseDataFileSearchCallResultAttributeUnion) AsFloat() (v float64)
func (ConversationItemNewResponseDataFileSearchCallResultAttributeUnion) AsString ¶
func (u ConversationItemNewResponseDataFileSearchCallResultAttributeUnion) AsString() (v string)
func (ConversationItemNewResponseDataFileSearchCallResultAttributeUnion) RawJSON ¶
func (u ConversationItemNewResponseDataFileSearchCallResultAttributeUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConversationItemNewResponseDataFileSearchCallResultAttributeUnion) UnmarshalJSON ¶
func (r *ConversationItemNewResponseDataFileSearchCallResultAttributeUnion) UnmarshalJSON(data []byte) error
type ConversationItemNewResponseDataFunctionCall ¶
type ConversationItemNewResponseDataFunctionCall struct {
// JSON string containing the function arguments
Arguments string `json:"arguments,required"`
// Unique identifier for the function call
CallID string `json:"call_id,required"`
// Name of the function being called
Name string `json:"name,required"`
// Tool call type identifier, always "function_call"
Type constant.FunctionCall `json:"type,required"`
// (Optional) Additional identifier for the tool call
ID string `json:"id"`
// (Optional) Current status of the function call execution
Status string `json:"status"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Arguments respjson.Field
CallID respjson.Field
Name respjson.Field
Type respjson.Field
ID respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Function tool call output message for OpenAI responses.
func (ConversationItemNewResponseDataFunctionCall) RawJSON ¶
func (r ConversationItemNewResponseDataFunctionCall) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConversationItemNewResponseDataFunctionCall) UnmarshalJSON ¶
func (r *ConversationItemNewResponseDataFunctionCall) UnmarshalJSON(data []byte) error
type ConversationItemNewResponseDataFunctionCallOutput ¶
type ConversationItemNewResponseDataFunctionCallOutput struct {
CallID string `json:"call_id,required"`
Output string `json:"output,required"`
Type constant.FunctionCallOutput `json:"type,required"`
ID string `json:"id"`
Status string `json:"status"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CallID respjson.Field
Output respjson.Field
Type respjson.Field
ID respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
This represents the output of a function call that gets passed back to the model.
func (ConversationItemNewResponseDataFunctionCallOutput) RawJSON ¶
func (r ConversationItemNewResponseDataFunctionCallOutput) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConversationItemNewResponseDataFunctionCallOutput) UnmarshalJSON ¶
func (r *ConversationItemNewResponseDataFunctionCallOutput) UnmarshalJSON(data []byte) error
type ConversationItemNewResponseDataMcpApprovalRequest ¶
type ConversationItemNewResponseDataMcpApprovalRequest struct {
ID string `json:"id,required"`
Arguments string `json:"arguments,required"`
Name string `json:"name,required"`
ServerLabel string `json:"server_label,required"`
Type constant.McpApprovalRequest `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Arguments respjson.Field
Name respjson.Field
ServerLabel respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A request for human approval of a tool invocation.
func (ConversationItemNewResponseDataMcpApprovalRequest) RawJSON ¶
func (r ConversationItemNewResponseDataMcpApprovalRequest) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConversationItemNewResponseDataMcpApprovalRequest) UnmarshalJSON ¶
func (r *ConversationItemNewResponseDataMcpApprovalRequest) UnmarshalJSON(data []byte) error
type ConversationItemNewResponseDataMcpApprovalResponse ¶
type ConversationItemNewResponseDataMcpApprovalResponse struct {
ApprovalRequestID string `json:"approval_request_id,required"`
Approve bool `json:"approve,required"`
Type constant.McpApprovalResponse `json:"type,required"`
ID string `json:"id"`
Reason string `json:"reason"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ApprovalRequestID respjson.Field
Approve respjson.Field
Type respjson.Field
ID respjson.Field
Reason respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A response to an MCP approval request.
func (ConversationItemNewResponseDataMcpApprovalResponse) RawJSON ¶
func (r ConversationItemNewResponseDataMcpApprovalResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConversationItemNewResponseDataMcpApprovalResponse) UnmarshalJSON ¶
func (r *ConversationItemNewResponseDataMcpApprovalResponse) UnmarshalJSON(data []byte) error
type ConversationItemNewResponseDataMcpCall ¶
type ConversationItemNewResponseDataMcpCall struct {
// Unique identifier for this MCP call
ID string `json:"id,required"`
// JSON string containing the MCP call arguments
Arguments string `json:"arguments,required"`
// Name of the MCP method being called
Name string `json:"name,required"`
// Label identifying the MCP server handling the call
ServerLabel string `json:"server_label,required"`
// Tool call type identifier, always "mcp_call"
Type constant.McpCall `json:"type,required"`
// (Optional) Error message if the MCP call failed
Error string `json:"error"`
// (Optional) Output result from the successful MCP call
Output string `json:"output"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Arguments respjson.Field
Name respjson.Field
ServerLabel respjson.Field
Type respjson.Field
Error respjson.Field
Output respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Model Context Protocol (MCP) call output message for OpenAI responses.
func (ConversationItemNewResponseDataMcpCall) RawJSON ¶
func (r ConversationItemNewResponseDataMcpCall) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConversationItemNewResponseDataMcpCall) UnmarshalJSON ¶
func (r *ConversationItemNewResponseDataMcpCall) UnmarshalJSON(data []byte) error
type ConversationItemNewResponseDataMcpListTools ¶
type ConversationItemNewResponseDataMcpListTools struct {
// Unique identifier for this MCP list tools operation
ID string `json:"id,required"`
// Label identifying the MCP server providing the tools
ServerLabel string `json:"server_label,required"`
// List of available tools provided by the MCP server
Tools []ConversationItemNewResponseDataMcpListToolsTool `json:"tools,required"`
// Tool call type identifier, always "mcp_list_tools"
Type constant.McpListTools `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
ServerLabel respjson.Field
Tools respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
MCP list tools output message containing available tools from an MCP server.
func (ConversationItemNewResponseDataMcpListTools) RawJSON ¶
func (r ConversationItemNewResponseDataMcpListTools) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConversationItemNewResponseDataMcpListTools) UnmarshalJSON ¶
func (r *ConversationItemNewResponseDataMcpListTools) UnmarshalJSON(data []byte) error
type ConversationItemNewResponseDataMcpListToolsTool ¶
type ConversationItemNewResponseDataMcpListToolsTool struct {
// JSON schema defining the tool's input parameters
InputSchema map[string]ConversationItemNewResponseDataMcpListToolsToolInputSchemaUnion `json:"input_schema,required"`
// Name of the tool
Name string `json:"name,required"`
// (Optional) Description of what the tool does
Description string `json:"description"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
InputSchema respjson.Field
Name respjson.Field
Description respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Tool definition returned by MCP list tools operation.
func (ConversationItemNewResponseDataMcpListToolsTool) RawJSON ¶
func (r ConversationItemNewResponseDataMcpListToolsTool) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConversationItemNewResponseDataMcpListToolsTool) UnmarshalJSON ¶
func (r *ConversationItemNewResponseDataMcpListToolsTool) UnmarshalJSON(data []byte) error
type ConversationItemNewResponseDataMcpListToolsToolInputSchemaUnion ¶
type ConversationItemNewResponseDataMcpListToolsToolInputSchemaUnion 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:"-"`
}
ConversationItemNewResponseDataMcpListToolsToolInputSchemaUnion 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 (ConversationItemNewResponseDataMcpListToolsToolInputSchemaUnion) AsAnyArray ¶
func (u ConversationItemNewResponseDataMcpListToolsToolInputSchemaUnion) AsAnyArray() (v []any)
func (ConversationItemNewResponseDataMcpListToolsToolInputSchemaUnion) AsBool ¶
func (u ConversationItemNewResponseDataMcpListToolsToolInputSchemaUnion) AsBool() (v bool)
func (ConversationItemNewResponseDataMcpListToolsToolInputSchemaUnion) AsFloat ¶
func (u ConversationItemNewResponseDataMcpListToolsToolInputSchemaUnion) AsFloat() (v float64)
func (ConversationItemNewResponseDataMcpListToolsToolInputSchemaUnion) AsString ¶
func (u ConversationItemNewResponseDataMcpListToolsToolInputSchemaUnion) AsString() (v string)
func (ConversationItemNewResponseDataMcpListToolsToolInputSchemaUnion) RawJSON ¶
func (u ConversationItemNewResponseDataMcpListToolsToolInputSchemaUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConversationItemNewResponseDataMcpListToolsToolInputSchemaUnion) UnmarshalJSON ¶
func (r *ConversationItemNewResponseDataMcpListToolsToolInputSchemaUnion) UnmarshalJSON(data []byte) error
type ConversationItemNewResponseDataMessage ¶
type ConversationItemNewResponseDataMessage struct {
Content ConversationItemNewResponseDataMessageContentUnion `json:"content,required"`
// Any of "system", "developer", "user", "assistant".
Role ConversationItemNewResponseDataMessageRole `json:"role,required"`
Type constant.Message `json:"type,required"`
ID string `json:"id"`
Status string `json:"status"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Content respjson.Field
Role respjson.Field
Type respjson.Field
ID respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Corresponds to the various Message types in the Responses API. They are all under one type because the Responses API gives them all the same "type" value, and there is no way to tell them apart in certain scenarios.
func (ConversationItemNewResponseDataMessage) RawJSON ¶
func (r ConversationItemNewResponseDataMessage) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConversationItemNewResponseDataMessage) UnmarshalJSON ¶
func (r *ConversationItemNewResponseDataMessage) UnmarshalJSON(data []byte) error
type ConversationItemNewResponseDataMessageContentArrayItemDetail ¶
type ConversationItemNewResponseDataMessageContentArrayItemDetail string
Level of detail for image processing, can be "low", "high", or "auto"
const ( ConversationItemNewResponseDataMessageContentArrayItemDetailLow ConversationItemNewResponseDataMessageContentArrayItemDetail = "low" ConversationItemNewResponseDataMessageContentArrayItemDetailHigh ConversationItemNewResponseDataMessageContentArrayItemDetail = "high" ConversationItemNewResponseDataMessageContentArrayItemDetailAuto ConversationItemNewResponseDataMessageContentArrayItemDetail = "auto" )
type ConversationItemNewResponseDataMessageContentArrayItemInputFile ¶
type ConversationItemNewResponseDataMessageContentArrayItemInputFile struct {
// The type of the input item. Always `input_file`.
Type constant.InputFile `json:"type,required"`
// The data of the file to be sent to the model.
FileData string `json:"file_data"`
// (Optional) The ID of the file to be sent to the model.
FileID string `json:"file_id"`
// The URL of the file to be sent to the model.
FileURL string `json:"file_url"`
// The name of the file to be sent to the model.
Filename string `json:"filename"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Type respjson.Field
FileData respjson.Field
FileID respjson.Field
FileURL respjson.Field
Filename respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
File content for input messages in OpenAI response format.
func (ConversationItemNewResponseDataMessageContentArrayItemInputFile) RawJSON ¶
func (r ConversationItemNewResponseDataMessageContentArrayItemInputFile) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConversationItemNewResponseDataMessageContentArrayItemInputFile) UnmarshalJSON ¶
func (r *ConversationItemNewResponseDataMessageContentArrayItemInputFile) UnmarshalJSON(data []byte) error
type ConversationItemNewResponseDataMessageContentArrayItemInputImage ¶
type ConversationItemNewResponseDataMessageContentArrayItemInputImage struct {
// Level of detail for image processing, can be "low", "high", or "auto"
//
// Any of "low", "high", "auto".
Detail ConversationItemNewResponseDataMessageContentArrayItemInputImageDetail `json:"detail,required"`
// Content type identifier, always "input_image"
Type constant.InputImage `json:"type,required"`
// (Optional) The ID of the file to be sent to the model.
FileID string `json:"file_id"`
// (Optional) URL of the image content
ImageURL string `json:"image_url"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Detail respjson.Field
Type respjson.Field
FileID respjson.Field
ImageURL respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Image content for input messages in OpenAI response format.
func (ConversationItemNewResponseDataMessageContentArrayItemInputImage) RawJSON ¶
func (r ConversationItemNewResponseDataMessageContentArrayItemInputImage) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConversationItemNewResponseDataMessageContentArrayItemInputImage) UnmarshalJSON ¶
func (r *ConversationItemNewResponseDataMessageContentArrayItemInputImage) UnmarshalJSON(data []byte) error
type ConversationItemNewResponseDataMessageContentArrayItemInputImageDetail ¶
type ConversationItemNewResponseDataMessageContentArrayItemInputImageDetail string
Level of detail for image processing, can be "low", "high", or "auto"
const ( ConversationItemNewResponseDataMessageContentArrayItemInputImageDetailLow ConversationItemNewResponseDataMessageContentArrayItemInputImageDetail = "low" ConversationItemNewResponseDataMessageContentArrayItemInputImageDetailHigh ConversationItemNewResponseDataMessageContentArrayItemInputImageDetail = "high" ConversationItemNewResponseDataMessageContentArrayItemInputImageDetailAuto ConversationItemNewResponseDataMessageContentArrayItemInputImageDetail = "auto" )
type ConversationItemNewResponseDataMessageContentArrayItemInputText ¶
type ConversationItemNewResponseDataMessageContentArrayItemInputText struct {
// The text content of the input message
Text string `json:"text,required"`
// Content type identifier, always "input_text"
Type constant.InputText `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:"-"`
}
Text content for input messages in OpenAI response format.
func (ConversationItemNewResponseDataMessageContentArrayItemInputText) RawJSON ¶
func (r ConversationItemNewResponseDataMessageContentArrayItemInputText) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConversationItemNewResponseDataMessageContentArrayItemInputText) UnmarshalJSON ¶
func (r *ConversationItemNewResponseDataMessageContentArrayItemInputText) UnmarshalJSON(data []byte) error
type ConversationItemNewResponseDataMessageContentArrayItemUnion ¶
type ConversationItemNewResponseDataMessageContentArrayItemUnion struct {
// This field is from variant
// [ConversationItemNewResponseDataMessageContentArrayItemInputText].
Text string `json:"text"`
// Any of "input_text", "input_image", "input_file".
Type string `json:"type"`
// This field is from variant
// [ConversationItemNewResponseDataMessageContentArrayItemInputImage].
Detail ConversationItemNewResponseDataMessageContentArrayItemInputImageDetail `json:"detail"`
FileID string `json:"file_id"`
// This field is from variant
// [ConversationItemNewResponseDataMessageContentArrayItemInputImage].
ImageURL string `json:"image_url"`
// This field is from variant
// [ConversationItemNewResponseDataMessageContentArrayItemInputFile].
FileData string `json:"file_data"`
// This field is from variant
// [ConversationItemNewResponseDataMessageContentArrayItemInputFile].
FileURL string `json:"file_url"`
// This field is from variant
// [ConversationItemNewResponseDataMessageContentArrayItemInputFile].
Filename string `json:"filename"`
JSON struct {
Text respjson.Field
Type respjson.Field
Detail respjson.Field
FileID respjson.Field
ImageURL respjson.Field
FileData respjson.Field
FileURL respjson.Field
Filename respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ConversationItemNewResponseDataMessageContentArrayItemUnion contains all possible properties and values from ConversationItemNewResponseDataMessageContentArrayItemInputText, ConversationItemNewResponseDataMessageContentArrayItemInputImage, ConversationItemNewResponseDataMessageContentArrayItemInputFile.
Use the ConversationItemNewResponseDataMessageContentArrayItemUnion.AsAny method to switch on the variant.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (ConversationItemNewResponseDataMessageContentArrayItemUnion) AsAny ¶
func (u ConversationItemNewResponseDataMessageContentArrayItemUnion) AsAny() anyConversationItemNewResponseDataMessageContentArrayItem
Use the following switch statement to find the correct variant
switch variant := ConversationItemNewResponseDataMessageContentArrayItemUnion.AsAny().(type) {
case llamastackclient.ConversationItemNewResponseDataMessageContentArrayItemInputText:
case llamastackclient.ConversationItemNewResponseDataMessageContentArrayItemInputImage:
case llamastackclient.ConversationItemNewResponseDataMessageContentArrayItemInputFile:
default:
fmt.Errorf("no variant present")
}
func (ConversationItemNewResponseDataMessageContentArrayItemUnion) AsInputFile ¶
func (ConversationItemNewResponseDataMessageContentArrayItemUnion) AsInputImage ¶
func (ConversationItemNewResponseDataMessageContentArrayItemUnion) AsInputText ¶
func (ConversationItemNewResponseDataMessageContentArrayItemUnion) RawJSON ¶
func (u ConversationItemNewResponseDataMessageContentArrayItemUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConversationItemNewResponseDataMessageContentArrayItemUnion) UnmarshalJSON ¶
func (r *ConversationItemNewResponseDataMessageContentArrayItemUnion) UnmarshalJSON(data []byte) error
type ConversationItemNewResponseDataMessageContentUnion ¶
type ConversationItemNewResponseDataMessageContentUnion 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
// [[]ConversationItemNewResponseDataMessageContentArrayItemUnion] instead of an
// object.
OfVariant2 []ConversationItemNewResponseDataMessageContentArrayItemUnion `json:",inline"`
JSON struct {
OfString respjson.Field
OfVariant2 respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ConversationItemNewResponseDataMessageContentUnion contains all possible properties and values from [string], [[]ConversationItemNewResponseDataMessageContentArrayItemUnion], [[]ConversationItemNewResponseDataMessageContentArrayItemUnion].
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 OfVariant2]
func (ConversationItemNewResponseDataMessageContentUnion) AsConversationItemNewResponseDataMessageContentArray ¶
func (u ConversationItemNewResponseDataMessageContentUnion) AsConversationItemNewResponseDataMessageContentArray() (v []ConversationItemNewResponseDataMessageContentArrayItemUnion)
func (ConversationItemNewResponseDataMessageContentUnion) AsString ¶
func (u ConversationItemNewResponseDataMessageContentUnion) AsString() (v string)
func (ConversationItemNewResponseDataMessageContentUnion) AsVariant2 ¶
func (u ConversationItemNewResponseDataMessageContentUnion) AsVariant2() (v []ConversationItemNewResponseDataMessageContentArrayItemUnion)
func (ConversationItemNewResponseDataMessageContentUnion) RawJSON ¶
func (u ConversationItemNewResponseDataMessageContentUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConversationItemNewResponseDataMessageContentUnion) UnmarshalJSON ¶
func (r *ConversationItemNewResponseDataMessageContentUnion) UnmarshalJSON(data []byte) error
type ConversationItemNewResponseDataMessageRole ¶
type ConversationItemNewResponseDataMessageRole string
const ( ConversationItemNewResponseDataMessageRoleSystem ConversationItemNewResponseDataMessageRole = "system" ConversationItemNewResponseDataMessageRoleDeveloper ConversationItemNewResponseDataMessageRole = "developer" ConversationItemNewResponseDataMessageRoleUser ConversationItemNewResponseDataMessageRole = "user" ConversationItemNewResponseDataMessageRoleAssistant ConversationItemNewResponseDataMessageRole = "assistant" )
type ConversationItemNewResponseDataRole ¶
type ConversationItemNewResponseDataRole string
const ( ConversationItemNewResponseDataRoleSystem ConversationItemNewResponseDataRole = "system" ConversationItemNewResponseDataRoleDeveloper ConversationItemNewResponseDataRole = "developer" ConversationItemNewResponseDataRoleUser ConversationItemNewResponseDataRole = "user" ConversationItemNewResponseDataRoleAssistant ConversationItemNewResponseDataRole = "assistant" )
type ConversationItemNewResponseDataUnion ¶
type ConversationItemNewResponseDataUnion struct {
// This field is from variant [ConversationItemNewResponseDataMessage].
Content ConversationItemNewResponseDataMessageContentUnion `json:"content"`
// This field is from variant [ConversationItemNewResponseDataMessage].
Role ConversationItemNewResponseDataMessageRole `json:"role"`
// Any of "message", "web_search_call", "file_search_call", "function_call",
// "function_call_output", "mcp_approval_request", "mcp_approval_response",
// "mcp_call", "mcp_list_tools".
Type string `json:"type"`
ID string `json:"id"`
Status string `json:"status"`
// This field is from variant [ConversationItemNewResponseDataFileSearchCall].
Queries []string `json:"queries"`
// This field is from variant [ConversationItemNewResponseDataFileSearchCall].
Results []ConversationItemNewResponseDataFileSearchCallResult `json:"results"`
Arguments string `json:"arguments"`
CallID string `json:"call_id"`
Name string `json:"name"`
Output string `json:"output"`
ServerLabel string `json:"server_label"`
// This field is from variant [ConversationItemNewResponseDataMcpApprovalResponse].
ApprovalRequestID string `json:"approval_request_id"`
// This field is from variant [ConversationItemNewResponseDataMcpApprovalResponse].
Approve bool `json:"approve"`
// This field is from variant [ConversationItemNewResponseDataMcpApprovalResponse].
Reason string `json:"reason"`
// This field is from variant [ConversationItemNewResponseDataMcpCall].
Error string `json:"error"`
// This field is from variant [ConversationItemNewResponseDataMcpListTools].
Tools []ConversationItemNewResponseDataMcpListToolsTool `json:"tools"`
JSON struct {
Content respjson.Field
Role respjson.Field
Type respjson.Field
ID respjson.Field
Status respjson.Field
Queries respjson.Field
Results respjson.Field
Arguments respjson.Field
CallID respjson.Field
Name respjson.Field
Output respjson.Field
ServerLabel respjson.Field
ApprovalRequestID respjson.Field
Approve respjson.Field
Reason respjson.Field
Error respjson.Field
Tools respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ConversationItemNewResponseDataUnion contains all possible properties and values from ConversationItemNewResponseDataMessage, ConversationItemNewResponseDataWebSearchCall, ConversationItemNewResponseDataFileSearchCall, ConversationItemNewResponseDataFunctionCall, ConversationItemNewResponseDataFunctionCallOutput, ConversationItemNewResponseDataMcpApprovalRequest, ConversationItemNewResponseDataMcpApprovalResponse, ConversationItemNewResponseDataMcpCall, ConversationItemNewResponseDataMcpListTools.
Use the ConversationItemNewResponseDataUnion.AsAny method to switch on the variant.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (ConversationItemNewResponseDataUnion) AsAny ¶
func (u ConversationItemNewResponseDataUnion) AsAny() anyConversationItemNewResponseData
Use the following switch statement to find the correct variant
switch variant := ConversationItemNewResponseDataUnion.AsAny().(type) {
case llamastackclient.ConversationItemNewResponseDataMessage:
case llamastackclient.ConversationItemNewResponseDataWebSearchCall:
case llamastackclient.ConversationItemNewResponseDataFileSearchCall:
case llamastackclient.ConversationItemNewResponseDataFunctionCall:
case llamastackclient.ConversationItemNewResponseDataFunctionCallOutput:
case llamastackclient.ConversationItemNewResponseDataMcpApprovalRequest:
case llamastackclient.ConversationItemNewResponseDataMcpApprovalResponse:
case llamastackclient.ConversationItemNewResponseDataMcpCall:
case llamastackclient.ConversationItemNewResponseDataMcpListTools:
default:
fmt.Errorf("no variant present")
}
func (ConversationItemNewResponseDataUnion) AsFileSearchCall ¶
func (u ConversationItemNewResponseDataUnion) AsFileSearchCall() (v ConversationItemNewResponseDataFileSearchCall)
func (ConversationItemNewResponseDataUnion) AsFunctionCall ¶
func (u ConversationItemNewResponseDataUnion) AsFunctionCall() (v ConversationItemNewResponseDataFunctionCall)
func (ConversationItemNewResponseDataUnion) AsFunctionCallOutput ¶
func (u ConversationItemNewResponseDataUnion) AsFunctionCallOutput() (v ConversationItemNewResponseDataFunctionCallOutput)
func (ConversationItemNewResponseDataUnion) AsMcpApprovalRequest ¶
func (u ConversationItemNewResponseDataUnion) AsMcpApprovalRequest() (v ConversationItemNewResponseDataMcpApprovalRequest)
func (ConversationItemNewResponseDataUnion) AsMcpApprovalResponse ¶
func (u ConversationItemNewResponseDataUnion) AsMcpApprovalResponse() (v ConversationItemNewResponseDataMcpApprovalResponse)
func (ConversationItemNewResponseDataUnion) AsMcpCall ¶
func (u ConversationItemNewResponseDataUnion) AsMcpCall() (v ConversationItemNewResponseDataMcpCall)
func (ConversationItemNewResponseDataUnion) AsMcpListTools ¶
func (u ConversationItemNewResponseDataUnion) AsMcpListTools() (v ConversationItemNewResponseDataMcpListTools)
func (ConversationItemNewResponseDataUnion) AsMessage ¶
func (u ConversationItemNewResponseDataUnion) AsMessage() (v ConversationItemNewResponseDataMessage)
func (ConversationItemNewResponseDataUnion) AsWebSearchCall ¶
func (u ConversationItemNewResponseDataUnion) AsWebSearchCall() (v ConversationItemNewResponseDataWebSearchCall)
func (ConversationItemNewResponseDataUnion) RawJSON ¶
func (u ConversationItemNewResponseDataUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConversationItemNewResponseDataUnion) UnmarshalJSON ¶
func (r *ConversationItemNewResponseDataUnion) UnmarshalJSON(data []byte) error
type ConversationItemNewResponseDataWebSearchCall ¶
type ConversationItemNewResponseDataWebSearchCall struct {
// Unique identifier for this tool call
ID string `json:"id,required"`
// Current status of the web search operation
Status string `json:"status,required"`
// Tool call type identifier, always "web_search_call"
Type constant.WebSearchCall `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Status respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Web search tool call output message for OpenAI responses.
func (ConversationItemNewResponseDataWebSearchCall) RawJSON ¶
func (r ConversationItemNewResponseDataWebSearchCall) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConversationItemNewResponseDataWebSearchCall) UnmarshalJSON ¶
func (r *ConversationItemNewResponseDataWebSearchCall) UnmarshalJSON(data []byte) error
type ConversationItemService ¶
type ConversationItemService struct {
Options []option.RequestOption
}
ConversationItemService contains methods and other services that help with interacting with the llama-stack-client API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewConversationItemService method instead.
func NewConversationItemService ¶
func NewConversationItemService(opts ...option.RequestOption) (r ConversationItemService)
NewConversationItemService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ConversationItemService) Get ¶
func (r *ConversationItemService) Get(ctx context.Context, itemID string, query ConversationItemGetParams, opts ...option.RequestOption) (res *ConversationItemGetResponseUnion, err error)
Retrieve an item. Retrieve a conversation item.
func (*ConversationItemService) List ¶
func (r *ConversationItemService) List(ctx context.Context, conversationID string, query ConversationItemListParams, opts ...option.RequestOption) (res *pagination.OpenAICursorPage[ConversationItemListResponseUnion], err error)
List items. List items in the conversation.
func (*ConversationItemService) ListAutoPaging ¶
func (r *ConversationItemService) ListAutoPaging(ctx context.Context, conversationID string, query ConversationItemListParams, opts ...option.RequestOption) *pagination.OpenAICursorPageAutoPager[ConversationItemListResponseUnion]
List items. List items in the conversation.
func (*ConversationItemService) New ¶
func (r *ConversationItemService) New(ctx context.Context, conversationID string, body ConversationItemNewParams, opts ...option.RequestOption) (res *ConversationItemNewResponse, err error)
Create items. Create items in the conversation.
type ConversationNewParams ¶
type ConversationNewParams struct {
// Initial items to include in the conversation context.
Items []ConversationNewParamsItemUnion `json:"items,omitzero"`
// Set of key-value pairs that can be attached to an object.
Metadata map[string]string `json:"metadata,omitzero"`
// contains filtered or unexported fields
}
func (ConversationNewParams) MarshalJSON ¶
func (r ConversationNewParams) MarshalJSON() (data []byte, err error)
func (*ConversationNewParams) UnmarshalJSON ¶
func (r *ConversationNewParams) UnmarshalJSON(data []byte) error
type ConversationNewParamsItemFileSearchCall ¶
type ConversationNewParamsItemFileSearchCall struct {
// Unique identifier for this tool call
ID string `json:"id,required"`
// List of search queries executed
Queries []string `json:"queries,omitzero,required"`
// Current status of the file search operation
Status string `json:"status,required"`
// (Optional) Search results returned by the file search operation
Results []ConversationNewParamsItemFileSearchCallResult `json:"results,omitzero"`
// Tool call type identifier, always "file_search_call"
//
// This field can be elided, and will marshal its zero value as "file_search_call".
Type constant.FileSearchCall `json:"type,required"`
// contains filtered or unexported fields
}
File search tool call output message for OpenAI responses.
The properties ID, Queries, Status, Type are required.
func (ConversationNewParamsItemFileSearchCall) MarshalJSON ¶
func (r ConversationNewParamsItemFileSearchCall) MarshalJSON() (data []byte, err error)
func (*ConversationNewParamsItemFileSearchCall) UnmarshalJSON ¶
func (r *ConversationNewParamsItemFileSearchCall) UnmarshalJSON(data []byte) error
type ConversationNewParamsItemFileSearchCallResult ¶
type ConversationNewParamsItemFileSearchCallResult struct {
// (Optional) Key-value attributes associated with the file
Attributes map[string]ConversationNewParamsItemFileSearchCallResultAttributeUnion `json:"attributes,omitzero,required"`
// Unique identifier of the file containing the result
FileID string `json:"file_id,required"`
// Name of the file containing the result
Filename string `json:"filename,required"`
// Relevance score for this search result (between 0 and 1)
Score float64 `json:"score,required"`
// Text content of the search result
Text string `json:"text,required"`
// contains filtered or unexported fields
}
Search results returned by the file search operation.
The properties Attributes, FileID, Filename, Score, Text are required.
func (ConversationNewParamsItemFileSearchCallResult) MarshalJSON ¶
func (r ConversationNewParamsItemFileSearchCallResult) MarshalJSON() (data []byte, err error)
func (*ConversationNewParamsItemFileSearchCallResult) UnmarshalJSON ¶
func (r *ConversationNewParamsItemFileSearchCallResult) UnmarshalJSON(data []byte) error
type ConversationNewParamsItemFileSearchCallResultAttributeUnion ¶
type ConversationNewParamsItemFileSearchCallResultAttributeUnion 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 (ConversationNewParamsItemFileSearchCallResultAttributeUnion) MarshalJSON ¶
func (u ConversationNewParamsItemFileSearchCallResultAttributeUnion) MarshalJSON() ([]byte, error)
func (*ConversationNewParamsItemFileSearchCallResultAttributeUnion) UnmarshalJSON ¶
func (u *ConversationNewParamsItemFileSearchCallResultAttributeUnion) UnmarshalJSON(data []byte) error
type ConversationNewParamsItemFunctionCall ¶
type ConversationNewParamsItemFunctionCall struct {
// JSON string containing the function arguments
Arguments string `json:"arguments,required"`
// Unique identifier for the function call
CallID string `json:"call_id,required"`
// Name of the function being called
Name string `json:"name,required"`
// (Optional) Additional identifier for the tool call
ID param.Opt[string] `json:"id,omitzero"`
// (Optional) Current status of the function call execution
Status param.Opt[string] `json:"status,omitzero"`
// Tool call type identifier, always "function_call"
//
// This field can be elided, and will marshal its zero value as "function_call".
Type constant.FunctionCall `json:"type,required"`
// contains filtered or unexported fields
}
Function tool call output message for OpenAI responses.
The properties Arguments, CallID, Name, Type are required.
func (ConversationNewParamsItemFunctionCall) MarshalJSON ¶
func (r ConversationNewParamsItemFunctionCall) MarshalJSON() (data []byte, err error)
func (*ConversationNewParamsItemFunctionCall) UnmarshalJSON ¶
func (r *ConversationNewParamsItemFunctionCall) UnmarshalJSON(data []byte) error
type ConversationNewParamsItemFunctionCallOutput ¶
type ConversationNewParamsItemFunctionCallOutput struct {
CallID string `json:"call_id,required"`
Output string `json:"output,required"`
ID param.Opt[string] `json:"id,omitzero"`
Status param.Opt[string] `json:"status,omitzero"`
// This field can be elided, and will marshal its zero value as
// "function_call_output".
Type constant.FunctionCallOutput `json:"type,required"`
// contains filtered or unexported fields
}
This represents the output of a function call that gets passed back to the model.
The properties CallID, Output, Type are required.
func (ConversationNewParamsItemFunctionCallOutput) MarshalJSON ¶
func (r ConversationNewParamsItemFunctionCallOutput) MarshalJSON() (data []byte, err error)
func (*ConversationNewParamsItemFunctionCallOutput) UnmarshalJSON ¶
func (r *ConversationNewParamsItemFunctionCallOutput) UnmarshalJSON(data []byte) error
type ConversationNewParamsItemMcpApprovalRequest ¶
type ConversationNewParamsItemMcpApprovalRequest struct {
ID string `json:"id,required"`
Arguments string `json:"arguments,required"`
Name string `json:"name,required"`
ServerLabel string `json:"server_label,required"`
// This field can be elided, and will marshal its zero value as
// "mcp_approval_request".
Type constant.McpApprovalRequest `json:"type,required"`
// contains filtered or unexported fields
}
A request for human approval of a tool invocation.
The properties ID, Arguments, Name, ServerLabel, Type are required.
func (ConversationNewParamsItemMcpApprovalRequest) MarshalJSON ¶
func (r ConversationNewParamsItemMcpApprovalRequest) MarshalJSON() (data []byte, err error)
func (*ConversationNewParamsItemMcpApprovalRequest) UnmarshalJSON ¶
func (r *ConversationNewParamsItemMcpApprovalRequest) UnmarshalJSON(data []byte) error
type ConversationNewParamsItemMcpApprovalResponse ¶
type ConversationNewParamsItemMcpApprovalResponse struct {
ApprovalRequestID string `json:"approval_request_id,required"`
Approve bool `json:"approve,required"`
ID param.Opt[string] `json:"id,omitzero"`
Reason param.Opt[string] `json:"reason,omitzero"`
// This field can be elided, and will marshal its zero value as
// "mcp_approval_response".
Type constant.McpApprovalResponse `json:"type,required"`
// contains filtered or unexported fields
}
A response to an MCP approval request.
The properties ApprovalRequestID, Approve, Type are required.
func (ConversationNewParamsItemMcpApprovalResponse) MarshalJSON ¶
func (r ConversationNewParamsItemMcpApprovalResponse) MarshalJSON() (data []byte, err error)
func (*ConversationNewParamsItemMcpApprovalResponse) UnmarshalJSON ¶
func (r *ConversationNewParamsItemMcpApprovalResponse) UnmarshalJSON(data []byte) error
type ConversationNewParamsItemMcpCall ¶
type ConversationNewParamsItemMcpCall struct {
// Unique identifier for this MCP call
ID string `json:"id,required"`
// JSON string containing the MCP call arguments
Arguments string `json:"arguments,required"`
// Name of the MCP method being called
Name string `json:"name,required"`
// Label identifying the MCP server handling the call
ServerLabel string `json:"server_label,required"`
// (Optional) Error message if the MCP call failed
Error param.Opt[string] `json:"error,omitzero"`
// (Optional) Output result from the successful MCP call
Output param.Opt[string] `json:"output,omitzero"`
// Tool call type identifier, always "mcp_call"
//
// This field can be elided, and will marshal its zero value as "mcp_call".
Type constant.McpCall `json:"type,required"`
// contains filtered or unexported fields
}
Model Context Protocol (MCP) call output message for OpenAI responses.
The properties ID, Arguments, Name, ServerLabel, Type are required.
func (ConversationNewParamsItemMcpCall) MarshalJSON ¶
func (r ConversationNewParamsItemMcpCall) MarshalJSON() (data []byte, err error)
func (*ConversationNewParamsItemMcpCall) UnmarshalJSON ¶
func (r *ConversationNewParamsItemMcpCall) UnmarshalJSON(data []byte) error
type ConversationNewParamsItemMcpListTools ¶
type ConversationNewParamsItemMcpListTools struct {
// Unique identifier for this MCP list tools operation
ID string `json:"id,required"`
// Label identifying the MCP server providing the tools
ServerLabel string `json:"server_label,required"`
// List of available tools provided by the MCP server
Tools []ConversationNewParamsItemMcpListToolsTool `json:"tools,omitzero,required"`
// Tool call type identifier, always "mcp_list_tools"
//
// This field can be elided, and will marshal its zero value as "mcp_list_tools".
Type constant.McpListTools `json:"type,required"`
// contains filtered or unexported fields
}
MCP list tools output message containing available tools from an MCP server.
The properties ID, ServerLabel, Tools, Type are required.
func (ConversationNewParamsItemMcpListTools) MarshalJSON ¶
func (r ConversationNewParamsItemMcpListTools) MarshalJSON() (data []byte, err error)
func (*ConversationNewParamsItemMcpListTools) UnmarshalJSON ¶
func (r *ConversationNewParamsItemMcpListTools) UnmarshalJSON(data []byte) error
type ConversationNewParamsItemMcpListToolsTool ¶
type ConversationNewParamsItemMcpListToolsTool struct {
// JSON schema defining the tool's input parameters
InputSchema map[string]ConversationNewParamsItemMcpListToolsToolInputSchemaUnion `json:"input_schema,omitzero,required"`
// Name of the tool
Name string `json:"name,required"`
// (Optional) Description of what the tool does
Description param.Opt[string] `json:"description,omitzero"`
// contains filtered or unexported fields
}
Tool definition returned by MCP list tools operation.
The properties InputSchema, Name are required.
func (ConversationNewParamsItemMcpListToolsTool) MarshalJSON ¶
func (r ConversationNewParamsItemMcpListToolsTool) MarshalJSON() (data []byte, err error)
func (*ConversationNewParamsItemMcpListToolsTool) UnmarshalJSON ¶
func (r *ConversationNewParamsItemMcpListToolsTool) UnmarshalJSON(data []byte) error
type ConversationNewParamsItemMcpListToolsToolInputSchemaUnion ¶
type ConversationNewParamsItemMcpListToolsToolInputSchemaUnion 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 (ConversationNewParamsItemMcpListToolsToolInputSchemaUnion) MarshalJSON ¶
func (u ConversationNewParamsItemMcpListToolsToolInputSchemaUnion) MarshalJSON() ([]byte, error)
func (*ConversationNewParamsItemMcpListToolsToolInputSchemaUnion) UnmarshalJSON ¶
func (u *ConversationNewParamsItemMcpListToolsToolInputSchemaUnion) UnmarshalJSON(data []byte) error
type ConversationNewParamsItemMessage ¶
type ConversationNewParamsItemMessage struct {
Content ConversationNewParamsItemMessageContentUnion `json:"content,omitzero,required"`
// Any of "system", "developer", "user", "assistant".
Role ConversationNewParamsItemMessageRole `json:"role,omitzero,required"`
ID param.Opt[string] `json:"id,omitzero"`
Status param.Opt[string] `json:"status,omitzero"`
// This field can be elided, and will marshal its zero value as "message".
Type constant.Message `json:"type,required"`
// contains filtered or unexported fields
}
Corresponds to the various Message types in the Responses API. They are all under one type because the Responses API gives them all the same "type" value, and there is no way to tell them apart in certain scenarios.
The properties Content, Role, Type are required.
func (ConversationNewParamsItemMessage) MarshalJSON ¶
func (r ConversationNewParamsItemMessage) MarshalJSON() (data []byte, err error)
func (*ConversationNewParamsItemMessage) UnmarshalJSON ¶
func (r *ConversationNewParamsItemMessage) UnmarshalJSON(data []byte) error
type ConversationNewParamsItemMessageContentArrayItemInputFile ¶
type ConversationNewParamsItemMessageContentArrayItemInputFile struct {
// The data of the file to be sent to the model.
FileData param.Opt[string] `json:"file_data,omitzero"`
// (Optional) The ID of the file to be sent to the model.
FileID param.Opt[string] `json:"file_id,omitzero"`
// The URL of the file to be sent to the model.
FileURL param.Opt[string] `json:"file_url,omitzero"`
// The name of the file to be sent to the model.
Filename param.Opt[string] `json:"filename,omitzero"`
// The type of the input item. Always `input_file`.
//
// This field can be elided, and will marshal its zero value as "input_file".
Type constant.InputFile `json:"type,required"`
// contains filtered or unexported fields
}
File content for input messages in OpenAI response format.
The property Type is required.
func (ConversationNewParamsItemMessageContentArrayItemInputFile) MarshalJSON ¶
func (r ConversationNewParamsItemMessageContentArrayItemInputFile) MarshalJSON() (data []byte, err error)
func (*ConversationNewParamsItemMessageContentArrayItemInputFile) UnmarshalJSON ¶
func (r *ConversationNewParamsItemMessageContentArrayItemInputFile) UnmarshalJSON(data []byte) error
type ConversationNewParamsItemMessageContentArrayItemInputImage ¶
type ConversationNewParamsItemMessageContentArrayItemInputImage struct {
// Level of detail for image processing, can be "low", "high", or "auto"
//
// Any of "low", "high", "auto".
Detail ConversationNewParamsItemMessageContentArrayItemInputImageDetail `json:"detail,omitzero,required"`
// (Optional) The ID of the file to be sent to the model.
FileID param.Opt[string] `json:"file_id,omitzero"`
// (Optional) URL of the image content
ImageURL param.Opt[string] `json:"image_url,omitzero"`
// Content type identifier, always "input_image"
//
// This field can be elided, and will marshal its zero value as "input_image".
Type constant.InputImage `json:"type,required"`
// contains filtered or unexported fields
}
Image content for input messages in OpenAI response format.
The properties Detail, Type are required.
func (ConversationNewParamsItemMessageContentArrayItemInputImage) MarshalJSON ¶
func (r ConversationNewParamsItemMessageContentArrayItemInputImage) MarshalJSON() (data []byte, err error)
func (*ConversationNewParamsItemMessageContentArrayItemInputImage) UnmarshalJSON ¶
func (r *ConversationNewParamsItemMessageContentArrayItemInputImage) UnmarshalJSON(data []byte) error
type ConversationNewParamsItemMessageContentArrayItemInputImageDetail ¶
type ConversationNewParamsItemMessageContentArrayItemInputImageDetail string
Level of detail for image processing, can be "low", "high", or "auto"
const ( ConversationNewParamsItemMessageContentArrayItemInputImageDetailLow ConversationNewParamsItemMessageContentArrayItemInputImageDetail = "low" ConversationNewParamsItemMessageContentArrayItemInputImageDetailHigh ConversationNewParamsItemMessageContentArrayItemInputImageDetail = "high" ConversationNewParamsItemMessageContentArrayItemInputImageDetailAuto ConversationNewParamsItemMessageContentArrayItemInputImageDetail = "auto" )
type ConversationNewParamsItemMessageContentArrayItemInputText ¶
type ConversationNewParamsItemMessageContentArrayItemInputText struct {
// The text content of the input message
Text string `json:"text,required"`
// Content type identifier, always "input_text"
//
// This field can be elided, and will marshal its zero value as "input_text".
Type constant.InputText `json:"type,required"`
// contains filtered or unexported fields
}
Text content for input messages in OpenAI response format.
The properties Text, Type are required.
func (ConversationNewParamsItemMessageContentArrayItemInputText) MarshalJSON ¶
func (r ConversationNewParamsItemMessageContentArrayItemInputText) MarshalJSON() (data []byte, err error)
func (*ConversationNewParamsItemMessageContentArrayItemInputText) UnmarshalJSON ¶
func (r *ConversationNewParamsItemMessageContentArrayItemInputText) UnmarshalJSON(data []byte) error
type ConversationNewParamsItemMessageContentArrayItemUnion ¶
type ConversationNewParamsItemMessageContentArrayItemUnion struct {
OfInputText *ConversationNewParamsItemMessageContentArrayItemInputText `json:",omitzero,inline"`
OfInputImage *ConversationNewParamsItemMessageContentArrayItemInputImage `json:",omitzero,inline"`
OfInputFile *ConversationNewParamsItemMessageContentArrayItemInputFile `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 (ConversationNewParamsItemMessageContentArrayItemUnion) GetDetail ¶
func (u ConversationNewParamsItemMessageContentArrayItemUnion) GetDetail() *string
Returns a pointer to the underlying variant's property, if present.
func (ConversationNewParamsItemMessageContentArrayItemUnion) GetFileData ¶
func (u ConversationNewParamsItemMessageContentArrayItemUnion) GetFileData() *string
Returns a pointer to the underlying variant's property, if present.
func (ConversationNewParamsItemMessageContentArrayItemUnion) GetFileID ¶
func (u ConversationNewParamsItemMessageContentArrayItemUnion) GetFileID() *string
Returns a pointer to the underlying variant's property, if present.
func (ConversationNewParamsItemMessageContentArrayItemUnion) GetFileURL ¶
func (u ConversationNewParamsItemMessageContentArrayItemUnion) GetFileURL() *string
Returns a pointer to the underlying variant's property, if present.
func (ConversationNewParamsItemMessageContentArrayItemUnion) GetFilename ¶
func (u ConversationNewParamsItemMessageContentArrayItemUnion) GetFilename() *string
Returns a pointer to the underlying variant's property, if present.
func (ConversationNewParamsItemMessageContentArrayItemUnion) GetImageURL ¶
func (u ConversationNewParamsItemMessageContentArrayItemUnion) GetImageURL() *string
Returns a pointer to the underlying variant's property, if present.
func (ConversationNewParamsItemMessageContentArrayItemUnion) GetText ¶
func (u ConversationNewParamsItemMessageContentArrayItemUnion) GetText() *string
Returns a pointer to the underlying variant's property, if present.
func (ConversationNewParamsItemMessageContentArrayItemUnion) GetType ¶
func (u ConversationNewParamsItemMessageContentArrayItemUnion) GetType() *string
Returns a pointer to the underlying variant's property, if present.
func (ConversationNewParamsItemMessageContentArrayItemUnion) MarshalJSON ¶
func (u ConversationNewParamsItemMessageContentArrayItemUnion) MarshalJSON() ([]byte, error)
func (*ConversationNewParamsItemMessageContentArrayItemUnion) UnmarshalJSON ¶
func (u *ConversationNewParamsItemMessageContentArrayItemUnion) UnmarshalJSON(data []byte) error
type ConversationNewParamsItemMessageContentUnion ¶
type ConversationNewParamsItemMessageContentUnion struct {
OfString param.Opt[string] `json:",omitzero,inline"`
OfConversationNewsItemMessageContentArray []ConversationNewParamsItemMessageContentArrayItemUnion `json:",omitzero,inline"`
OfVariant2 []ConversationNewParamsItemMessageContentArrayItemUnion `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 (ConversationNewParamsItemMessageContentUnion) MarshalJSON ¶
func (u ConversationNewParamsItemMessageContentUnion) MarshalJSON() ([]byte, error)
func (*ConversationNewParamsItemMessageContentUnion) UnmarshalJSON ¶
func (u *ConversationNewParamsItemMessageContentUnion) UnmarshalJSON(data []byte) error
type ConversationNewParamsItemMessageRole ¶
type ConversationNewParamsItemMessageRole string
const ( ConversationNewParamsItemMessageRoleSystem ConversationNewParamsItemMessageRole = "system" ConversationNewParamsItemMessageRoleDeveloper ConversationNewParamsItemMessageRole = "developer" ConversationNewParamsItemMessageRoleUser ConversationNewParamsItemMessageRole = "user" ConversationNewParamsItemMessageRoleAssistant ConversationNewParamsItemMessageRole = "assistant" )
type ConversationNewParamsItemUnion ¶
type ConversationNewParamsItemUnion struct {
OfMessage *ConversationNewParamsItemMessage `json:",omitzero,inline"`
OfWebSearchCall *ConversationNewParamsItemWebSearchCall `json:",omitzero,inline"`
OfFileSearchCall *ConversationNewParamsItemFileSearchCall `json:",omitzero,inline"`
OfFunctionCall *ConversationNewParamsItemFunctionCall `json:",omitzero,inline"`
OfFunctionCallOutput *ConversationNewParamsItemFunctionCallOutput `json:",omitzero,inline"`
OfMcpApprovalRequest *ConversationNewParamsItemMcpApprovalRequest `json:",omitzero,inline"`
OfMcpApprovalResponse *ConversationNewParamsItemMcpApprovalResponse `json:",omitzero,inline"`
OfMcpCall *ConversationNewParamsItemMcpCall `json:",omitzero,inline"`
OfMcpListTools *ConversationNewParamsItemMcpListTools `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 (ConversationNewParamsItemUnion) GetApprovalRequestID ¶
func (u ConversationNewParamsItemUnion) GetApprovalRequestID() *string
Returns a pointer to the underlying variant's property, if present.
func (ConversationNewParamsItemUnion) GetApprove ¶
func (u ConversationNewParamsItemUnion) GetApprove() *bool
Returns a pointer to the underlying variant's property, if present.
func (ConversationNewParamsItemUnion) GetArguments ¶
func (u ConversationNewParamsItemUnion) GetArguments() *string
Returns a pointer to the underlying variant's property, if present.
func (ConversationNewParamsItemUnion) GetCallID ¶
func (u ConversationNewParamsItemUnion) GetCallID() *string
Returns a pointer to the underlying variant's property, if present.
func (ConversationNewParamsItemUnion) GetContent ¶
func (u ConversationNewParamsItemUnion) GetContent() *ConversationNewParamsItemMessageContentUnion
Returns a pointer to the underlying variant's property, if present.
func (ConversationNewParamsItemUnion) GetError ¶
func (u ConversationNewParamsItemUnion) GetError() *string
Returns a pointer to the underlying variant's property, if present.
func (ConversationNewParamsItemUnion) GetID ¶
func (u ConversationNewParamsItemUnion) GetID() *string
Returns a pointer to the underlying variant's property, if present.
func (ConversationNewParamsItemUnion) GetName ¶
func (u ConversationNewParamsItemUnion) GetName() *string
Returns a pointer to the underlying variant's property, if present.
func (ConversationNewParamsItemUnion) GetOutput ¶
func (u ConversationNewParamsItemUnion) GetOutput() *string
Returns a pointer to the underlying variant's property, if present.
func (ConversationNewParamsItemUnion) GetQueries ¶
func (u ConversationNewParamsItemUnion) GetQueries() []string
Returns a pointer to the underlying variant's property, if present.
func (ConversationNewParamsItemUnion) GetReason ¶
func (u ConversationNewParamsItemUnion) GetReason() *string
Returns a pointer to the underlying variant's property, if present.
func (ConversationNewParamsItemUnion) GetResults ¶
func (u ConversationNewParamsItemUnion) GetResults() []ConversationNewParamsItemFileSearchCallResult
Returns a pointer to the underlying variant's property, if present.
func (ConversationNewParamsItemUnion) GetRole ¶
func (u ConversationNewParamsItemUnion) GetRole() *string
Returns a pointer to the underlying variant's property, if present.
func (ConversationNewParamsItemUnion) GetServerLabel ¶
func (u ConversationNewParamsItemUnion) GetServerLabel() *string
Returns a pointer to the underlying variant's property, if present.
func (ConversationNewParamsItemUnion) GetStatus ¶
func (u ConversationNewParamsItemUnion) GetStatus() *string
Returns a pointer to the underlying variant's property, if present.
func (ConversationNewParamsItemUnion) GetTools ¶
func (u ConversationNewParamsItemUnion) GetTools() []ConversationNewParamsItemMcpListToolsTool
Returns a pointer to the underlying variant's property, if present.
func (ConversationNewParamsItemUnion) GetType ¶
func (u ConversationNewParamsItemUnion) GetType() *string
Returns a pointer to the underlying variant's property, if present.
func (ConversationNewParamsItemUnion) MarshalJSON ¶
func (u ConversationNewParamsItemUnion) MarshalJSON() ([]byte, error)
func (*ConversationNewParamsItemUnion) UnmarshalJSON ¶
func (u *ConversationNewParamsItemUnion) UnmarshalJSON(data []byte) error
type ConversationNewParamsItemWebSearchCall ¶
type ConversationNewParamsItemWebSearchCall struct {
// Unique identifier for this tool call
ID string `json:"id,required"`
// Current status of the web search operation
Status string `json:"status,required"`
// Tool call type identifier, always "web_search_call"
//
// This field can be elided, and will marshal its zero value as "web_search_call".
Type constant.WebSearchCall `json:"type,required"`
// contains filtered or unexported fields
}
Web search tool call output message for OpenAI responses.
The properties ID, Status, Type are required.
func (ConversationNewParamsItemWebSearchCall) MarshalJSON ¶
func (r ConversationNewParamsItemWebSearchCall) MarshalJSON() (data []byte, err error)
func (*ConversationNewParamsItemWebSearchCall) UnmarshalJSON ¶
func (r *ConversationNewParamsItemWebSearchCall) UnmarshalJSON(data []byte) error
type ConversationObject ¶
type ConversationObject struct {
ID string `json:"id,required"`
CreatedAt int64 `json:"created_at,required"`
Object constant.Conversation `json:"object,required"`
Items []any `json:"items"`
Metadata map[string]string `json:"metadata"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
Object respjson.Field
Items respjson.Field
Metadata respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
OpenAI-compatible conversation object.
func (ConversationObject) RawJSON ¶
func (r ConversationObject) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConversationObject) UnmarshalJSON ¶
func (r *ConversationObject) UnmarshalJSON(data []byte) error
type ConversationService ¶
type ConversationService struct {
Options []option.RequestOption
Items ConversationItemService
}
ConversationService contains methods and other services that help with interacting with the llama-stack-client API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewConversationService method instead.
func NewConversationService ¶
func NewConversationService(opts ...option.RequestOption) (r ConversationService)
NewConversationService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ConversationService) Delete ¶
func (r *ConversationService) Delete(ctx context.Context, conversationID string, opts ...option.RequestOption) (res *ConversationDeleteResponse, err error)
Delete a conversation. Delete a conversation with the given ID.
func (*ConversationService) Get ¶
func (r *ConversationService) Get(ctx context.Context, conversationID string, opts ...option.RequestOption) (res *ConversationObject, err error)
Retrieve a conversation. Get a conversation with the given ID.
func (*ConversationService) New ¶
func (r *ConversationService) New(ctx context.Context, body ConversationNewParams, opts ...option.RequestOption) (res *ConversationObject, err error)
Create a conversation. Create a conversation.
func (*ConversationService) Update ¶
func (r *ConversationService) Update(ctx context.Context, conversationID string, body ConversationUpdateParams, opts ...option.RequestOption) (res *ConversationObject, err error)
Update a conversation. Update a conversation's metadata with the given ID.
type ConversationUpdateParams ¶
type ConversationUpdateParams struct {
// Set of key-value pairs that can be attached to an object.
Metadata map[string]string `json:"metadata,omitzero,required"`
// contains filtered or unexported fields
}
func (ConversationUpdateParams) MarshalJSON ¶
func (r ConversationUpdateParams) MarshalJSON() (data []byte, err error)
func (*ConversationUpdateParams) UnmarshalJSON ¶
func (r *ConversationUpdateParams) UnmarshalJSON(data []byte) error
type CreateEmbeddingsResponse ¶
type CreateEmbeddingsResponse struct {
// List of embedding data objects
Data []CreateEmbeddingsResponseData `json:"data,required"`
// The model that was used to generate the embeddings
Model string `json:"model,required"`
// The object type, which will be "list"
Object constant.List `json:"object,required"`
// Usage information
Usage CreateEmbeddingsResponseUsage `json:"usage,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Model respjson.Field
Object respjson.Field
Usage respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Response from an OpenAI-compatible embeddings request.
func (CreateEmbeddingsResponse) RawJSON ¶
func (r CreateEmbeddingsResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*CreateEmbeddingsResponse) UnmarshalJSON ¶
func (r *CreateEmbeddingsResponse) UnmarshalJSON(data []byte) error
type CreateEmbeddingsResponseData ¶
type CreateEmbeddingsResponseData struct {
// The embedding vector as a list of floats (when encoding_format="float") or as a
// base64-encoded string (when encoding_format="base64")
Embedding CreateEmbeddingsResponseDataEmbeddingUnion `json:"embedding,required"`
// The index of the embedding in the input list
Index int64 `json:"index,required"`
// The object type, which will be "embedding"
Object constant.Embedding `json:"object,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Embedding respjson.Field
Index respjson.Field
Object respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A single embedding data object from an OpenAI-compatible embeddings response.
func (CreateEmbeddingsResponseData) RawJSON ¶
func (r CreateEmbeddingsResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*CreateEmbeddingsResponseData) UnmarshalJSON ¶
func (r *CreateEmbeddingsResponseData) UnmarshalJSON(data []byte) error
type CreateEmbeddingsResponseDataEmbeddingUnion ¶
type CreateEmbeddingsResponseDataEmbeddingUnion struct {
// This field will be present if the value is a [[]float64] instead of an object.
OfFloatArray []float64 `json:",inline"`
// This field will be present if the value is a [string] instead of an object.
OfString string `json:",inline"`
JSON struct {
OfFloatArray respjson.Field
OfString respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
CreateEmbeddingsResponseDataEmbeddingUnion contains all possible properties and values from [[]float64], [string].
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: OfFloatArray OfString]
func (CreateEmbeddingsResponseDataEmbeddingUnion) AsFloatArray ¶
func (u CreateEmbeddingsResponseDataEmbeddingUnion) AsFloatArray() (v []float64)
func (CreateEmbeddingsResponseDataEmbeddingUnion) AsString ¶
func (u CreateEmbeddingsResponseDataEmbeddingUnion) AsString() (v string)
func (CreateEmbeddingsResponseDataEmbeddingUnion) RawJSON ¶
func (u CreateEmbeddingsResponseDataEmbeddingUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*CreateEmbeddingsResponseDataEmbeddingUnion) UnmarshalJSON ¶
func (r *CreateEmbeddingsResponseDataEmbeddingUnion) UnmarshalJSON(data []byte) error
type CreateEmbeddingsResponseUsage ¶
type CreateEmbeddingsResponseUsage struct {
// The number of tokens in the input
PromptTokens int64 `json:"prompt_tokens,required"`
// The total number of tokens used
TotalTokens int64 `json:"total_tokens,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
PromptTokens respjson.Field
TotalTokens respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Usage information
func (CreateEmbeddingsResponseUsage) RawJSON ¶
func (r CreateEmbeddingsResponseUsage) RawJSON() string
Returns the unmodified JSON received from the API
func (*CreateEmbeddingsResponseUsage) UnmarshalJSON ¶
func (r *CreateEmbeddingsResponseUsage) UnmarshalJSON(data []byte) error
type CreateResponse ¶
type CreateResponse struct {
// The unique identifier for the moderation request.
ID string `json:"id,required"`
// The model used to generate the moderation results.
Model string `json:"model,required"`
// A list of moderation objects
Results []CreateResponseResult `json:"results,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Model respjson.Field
Results respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A moderation object.
func (CreateResponse) RawJSON ¶
func (r CreateResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*CreateResponse) UnmarshalJSON ¶
func (r *CreateResponse) UnmarshalJSON(data []byte) error
type CreateResponseResult ¶
type CreateResponseResult struct {
// Whether any of the below categories are flagged.
Flagged bool `json:"flagged,required"`
Metadata map[string]CreateResponseResultMetadataUnion `json:"metadata,required"`
// A list of the categories, and whether they are flagged or not.
Categories map[string]bool `json:"categories"`
// A list of the categories along with the input type(s) that the score applies to.
CategoryAppliedInputTypes map[string][]string `json:"category_applied_input_types"`
// A list of the categories along with their scores as predicted by model.
CategoryScores map[string]float64 `json:"category_scores"`
UserMessage string `json:"user_message"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Flagged respjson.Field
Metadata respjson.Field
Categories respjson.Field
CategoryAppliedInputTypes respjson.Field
CategoryScores respjson.Field
UserMessage respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A moderation object.
func (CreateResponseResult) RawJSON ¶
func (r CreateResponseResult) RawJSON() string
Returns the unmodified JSON received from the API
func (*CreateResponseResult) UnmarshalJSON ¶
func (r *CreateResponseResult) UnmarshalJSON(data []byte) error
type CreateResponseResultMetadataUnion ¶
type CreateResponseResultMetadataUnion 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:"-"`
}
CreateResponseResultMetadataUnion 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 (CreateResponseResultMetadataUnion) AsAnyArray ¶
func (u CreateResponseResultMetadataUnion) AsAnyArray() (v []any)
func (CreateResponseResultMetadataUnion) AsBool ¶
func (u CreateResponseResultMetadataUnion) AsBool() (v bool)
func (CreateResponseResultMetadataUnion) AsFloat ¶
func (u CreateResponseResultMetadataUnion) AsFloat() (v float64)
func (CreateResponseResultMetadataUnion) AsString ¶
func (u CreateResponseResultMetadataUnion) AsString() (v string)
func (CreateResponseResultMetadataUnion) RawJSON ¶
func (u CreateResponseResultMetadataUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*CreateResponseResultMetadataUnion) UnmarshalJSON ¶
func (r *CreateResponseResultMetadataUnion) UnmarshalJSON(data []byte) error
type DeleteFileResponse ¶
type DeleteFileResponse struct {
// The file identifier that was deleted
ID string `json:"id,required"`
// Whether the file was successfully deleted
Deleted bool `json:"deleted,required"`
// The object type, which is always "file"
Object constant.File `json:"object,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Deleted respjson.Field
Object respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Response for deleting a file in OpenAI Files API.
func (DeleteFileResponse) RawJSON ¶
func (r DeleteFileResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*DeleteFileResponse) UnmarshalJSON ¶
func (r *DeleteFileResponse) UnmarshalJSON(data []byte) error
type EmbeddingNewParams ¶
type EmbeddingNewParams struct {
// Input text to embed, encoded as a string or array of strings. To embed multiple
// inputs in a single request, pass an array of strings.
Input EmbeddingNewParamsInputUnion `json:"input,omitzero,required"`
// The identifier of the model to use. The model must be an embedding model
// registered with Llama Stack and available via the /models endpoint.
Model string `json:"model,required"`
// (Optional) The number of dimensions the resulting output embeddings should have.
// Only supported in text-embedding-3 and later models.
Dimensions param.Opt[int64] `json:"dimensions,omitzero"`
// (Optional) The format to return the embeddings in. Can be either "float" or
// "base64". Defaults to "float".
EncodingFormat param.Opt[string] `json:"encoding_format,omitzero"`
// (Optional) A unique identifier representing your end-user, which can help OpenAI
// to monitor and detect abuse.
User param.Opt[string] `json:"user,omitzero"`
// contains filtered or unexported fields
}
func (EmbeddingNewParams) MarshalJSON ¶
func (r EmbeddingNewParams) MarshalJSON() (data []byte, err error)
func (*EmbeddingNewParams) UnmarshalJSON ¶
func (r *EmbeddingNewParams) UnmarshalJSON(data []byte) error
type EmbeddingNewParamsInputUnion ¶
type EmbeddingNewParamsInputUnion struct {
OfString param.Opt[string] `json:",omitzero,inline"`
OfStringArray []string `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 (EmbeddingNewParamsInputUnion) MarshalJSON ¶
func (u EmbeddingNewParamsInputUnion) MarshalJSON() ([]byte, error)
func (*EmbeddingNewParamsInputUnion) UnmarshalJSON ¶
func (u *EmbeddingNewParamsInputUnion) UnmarshalJSON(data []byte) error
type EmbeddingService ¶
type EmbeddingService struct {
Options []option.RequestOption
}
EmbeddingService contains methods and other services that help with interacting with the llama-stack-client API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewEmbeddingService method instead.
func NewEmbeddingService ¶
func NewEmbeddingService(opts ...option.RequestOption) (r EmbeddingService)
NewEmbeddingService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*EmbeddingService) New ¶
func (r *EmbeddingService) New(ctx context.Context, body EmbeddingNewParams, opts ...option.RequestOption) (res *CreateEmbeddingsResponse, err error)
Create embeddings. Generate OpenAI-compatible embeddings for the given input using the specified model.
type EvaluateResponse ¶
type EvaluateResponse struct {
// The generations from the evaluation.
Generations []map[string]EvaluateResponseGenerationUnion `json:"generations,required"`
// The scores from the evaluation.
Scores map[string]ScoringResult `json:"scores,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Generations respjson.Field
Scores respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The response from an evaluation.
func (EvaluateResponse) RawJSON ¶
func (r EvaluateResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*EvaluateResponse) UnmarshalJSON ¶
func (r *EvaluateResponse) UnmarshalJSON(data []byte) error
type EvaluateResponseGenerationUnion ¶
type EvaluateResponseGenerationUnion 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:"-"`
}
EvaluateResponseGenerationUnion 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 (EvaluateResponseGenerationUnion) AsAnyArray ¶
func (u EvaluateResponseGenerationUnion) AsAnyArray() (v []any)
func (EvaluateResponseGenerationUnion) AsBool ¶
func (u EvaluateResponseGenerationUnion) AsBool() (v bool)
func (EvaluateResponseGenerationUnion) AsFloat ¶
func (u EvaluateResponseGenerationUnion) AsFloat() (v float64)
func (EvaluateResponseGenerationUnion) AsString ¶
func (u EvaluateResponseGenerationUnion) AsString() (v string)
func (EvaluateResponseGenerationUnion) RawJSON ¶
func (u EvaluateResponseGenerationUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*EvaluateResponseGenerationUnion) UnmarshalJSON ¶
func (r *EvaluateResponseGenerationUnion) UnmarshalJSON(data []byte) error
type File ¶
type File struct {
// The file identifier, which can be referenced in the API endpoints
ID string `json:"id,required"`
// The size of the file, in bytes
Bytes int64 `json:"bytes,required"`
// The Unix timestamp (in seconds) for when the file was created
CreatedAt int64 `json:"created_at,required"`
// The Unix timestamp (in seconds) for when the file expires
ExpiresAt int64 `json:"expires_at,required"`
// The name of the file
Filename string `json:"filename,required"`
// The object type, which is always "file"
Object constant.File `json:"object,required"`
// The intended purpose of the file
//
// Any of "assistants", "batch".
Purpose FilePurpose `json:"purpose,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Bytes respjson.Field
CreatedAt respjson.Field
ExpiresAt respjson.Field
Filename respjson.Field
Object respjson.Field
Purpose respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
OpenAI File object as defined in the OpenAI Files API.
func (*File) UnmarshalJSON ¶
type FileContentResponse ¶
type FileContentResponse = any
type FileListParams ¶
type FileListParams struct {
// A cursor for use in pagination. `after` is an object ID that defines your place
// in the list. For instance, if you make a list request and receive 100 objects,
// ending with obj_foo, your subsequent call can include after=obj_foo in order to
// fetch the next page of the list.
After param.Opt[string] `query:"after,omitzero" json:"-"`
// A limit on the number of objects to be returned. Limit can range between 1 and
// 10,000, and the default is 10,000.
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Sort order by the `created_at` timestamp of the objects. `asc` for ascending
// order and `desc` for descending order.
//
// Any of "asc", "desc".
Order FileListParamsOrder `query:"order,omitzero" json:"-"`
// Only return files with the given purpose.
//
// Any of "assistants", "batch".
Purpose FileListParamsPurpose `query:"purpose,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (FileListParams) URLQuery ¶
func (r FileListParams) URLQuery() (v url.Values, err error)
URLQuery serializes FileListParams's query parameters as `url.Values`.
type FileListParamsOrder ¶
type FileListParamsOrder string
Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.
const ( FileListParamsOrderAsc FileListParamsOrder = "asc" FileListParamsOrderDesc FileListParamsOrder = "desc" )
type FileListParamsPurpose ¶
type FileListParamsPurpose string
Only return files with the given purpose.
const ( FileListParamsPurposeAssistants FileListParamsPurpose = "assistants" FileListParamsPurposeBatch FileListParamsPurpose = "batch" )
type FileNewParams ¶
type FileNewParams struct {
File io.Reader `json:"file,omitzero,required" format:"binary"`
// Valid purpose values for OpenAI Files API.
//
// Any of "assistants", "batch".
Purpose FileNewParamsPurpose `json:"purpose,omitzero,required"`
// Control expiration of uploaded files. Params:
//
// - anchor, must be "created_at"
// - seconds, must be int between 3600 and 2592000 (1 hour to 30 days)
ExpiresAfter FileNewParamsExpiresAfter `json:"expires_after,omitzero"`
// contains filtered or unexported fields
}
func (FileNewParams) MarshalMultipart ¶
func (r FileNewParams) MarshalMultipart() (data []byte, contentType string, err error)
type FileNewParamsExpiresAfter ¶
type FileNewParamsExpiresAfter struct {
Seconds int64 `json:"seconds,required"`
// This field can be elided, and will marshal its zero value as "created_at".
Anchor constant.CreatedAt `json:"anchor,required"`
// contains filtered or unexported fields
}
Control expiration of uploaded files. Params:
- anchor, must be "created_at" - seconds, must be int between 3600 and 2592000 (1 hour to 30 days)
The properties Anchor, Seconds are required.
func (FileNewParamsExpiresAfter) MarshalJSON ¶
func (r FileNewParamsExpiresAfter) MarshalJSON() (data []byte, err error)
func (*FileNewParamsExpiresAfter) UnmarshalJSON ¶
func (r *FileNewParamsExpiresAfter) UnmarshalJSON(data []byte) error
type FileNewParamsPurpose ¶
type FileNewParamsPurpose string
Valid purpose values for OpenAI Files API.
const ( FileNewParamsPurposeAssistants FileNewParamsPurpose = "assistants" FileNewParamsPurposeBatch FileNewParamsPurpose = "batch" )
type FilePurpose ¶
type FilePurpose string
The intended purpose of the file
const ( FilePurposeAssistants FilePurpose = "assistants" FilePurposeBatch FilePurpose = "batch" )
type FileService ¶
type FileService struct {
Options []option.RequestOption
}
FileService contains methods and other services that help with interacting with the llama-stack-client API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewFileService method instead.
func NewFileService ¶
func NewFileService(opts ...option.RequestOption) (r FileService)
NewFileService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*FileService) Content ¶
func (r *FileService) Content(ctx context.Context, fileID string, opts ...option.RequestOption) (res *FileContentResponse, err error)
Retrieve file content. Returns the contents of the specified file.
func (*FileService) Delete ¶
func (r *FileService) Delete(ctx context.Context, fileID string, opts ...option.RequestOption) (res *DeleteFileResponse, err error)
Delete file.
func (*FileService) Get ¶
func (r *FileService) Get(ctx context.Context, fileID string, opts ...option.RequestOption) (res *File, err error)
Retrieve file. Returns information about a specific file.
func (*FileService) List ¶
func (r *FileService) List(ctx context.Context, query FileListParams, opts ...option.RequestOption) (res *pagination.OpenAICursorPage[File], err error)
List files. Returns a list of files that belong to the user's organization.
func (*FileService) ListAutoPaging ¶
func (r *FileService) ListAutoPaging(ctx context.Context, query FileListParams, opts ...option.RequestOption) *pagination.OpenAICursorPageAutoPager[File]
List files. Returns a list of files that belong to the user's organization.
func (*FileService) New ¶
func (r *FileService) New(ctx context.Context, body FileNewParams, opts ...option.RequestOption) (res *File, err error)
Upload file. Upload a file that can be used across various endpoints.
The file upload should be a multipart form request with:
- file: The File object (not file name) to be uploaded. - purpose: The intended purpose of the uploaded file. - expires_after: Optional form values describing expiration for the file.
type HealthInfo ¶
type HealthInfo struct {
// Current health status of the service
//
// Any of "OK", "Error", "Not Implemented".
Status HealthInfoStatus `json:"status,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Health status information for the service.
func (HealthInfo) RawJSON ¶
func (r HealthInfo) RawJSON() string
Returns the unmodified JSON received from the API
func (*HealthInfo) UnmarshalJSON ¶
func (r *HealthInfo) UnmarshalJSON(data []byte) error
type HealthInfoStatus ¶
type HealthInfoStatus string
Current health status of the service
const ( HealthInfoStatusOk HealthInfoStatus = "OK" HealthInfoStatusError HealthInfoStatus = "Error" HealthInfoStatusNotImplemented HealthInfoStatus = "Not Implemented" )
type InspectService ¶
type InspectService struct {
Options []option.RequestOption
}
InspectService contains methods and other services that help with interacting with the llama-stack-client API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewInspectService method instead.
func NewInspectService ¶
func NewInspectService(opts ...option.RequestOption) (r InspectService)
NewInspectService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*InspectService) Health ¶
func (r *InspectService) Health(ctx context.Context, opts ...option.RequestOption) (res *HealthInfo, err error)
Get health status. Get the current health status of the service.
func (*InspectService) Version ¶
func (r *InspectService) Version(ctx context.Context, opts ...option.RequestOption) (res *VersionInfo, err error)
Get version. Get the version of the service.
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 ¶
func (r InterleavedContentImageContentItem) RawJSON() string
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 ¶
func (r InterleavedContentImageContentItemImage) RawJSON() string
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 ¶
func (r InterleavedContentImageContentItemImageURL) RawJSON() string
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 ¶
func (r *InterleavedContentImageContentItemImageURLParam) UnmarshalJSON(data []byte) error
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 ¶
func (r InterleavedContentItemImageImage) RawJSON() string
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 ¶
func (r InterleavedContentItemImageImageURL) RawJSON() string
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 llamastackclient.InterleavedContentItemImage:
case llamastackclient.InterleavedContentItemText:
default:
fmt.Errorf("no variant present")
}
func (InterleavedContentItemUnion) AsImage ¶
func (u InterleavedContentItemUnion) AsImage() (v InterleavedContentItemImage)
func (InterleavedContentItemUnion) AsText ¶
func (u InterleavedContentItemUnion) AsText() (v InterleavedContentItemText)
func (InterleavedContentItemUnion) RawJSON ¶
func (u InterleavedContentItemUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (InterleavedContentItemUnion) ToParam ¶
func (r InterleavedContentItemUnion) ToParam() InterleavedContentItemUnionParam
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 InterleavedContentItemParamOfImage ¶
func InterleavedContentItemParamOfImage(image InterleavedContentItemImageImageParam) InterleavedContentItemUnionParam
func InterleavedContentItemParamOfText ¶
func InterleavedContentItemParamOfText(text string) InterleavedContentItemUnionParam
func (InterleavedContentItemUnionParam) GetImage ¶
func (u InterleavedContentItemUnionParam) GetImage() *InterleavedContentItemImageImageParam
Returns a pointer to the underlying variant's property, if present.
func (InterleavedContentItemUnionParam) GetText ¶
func (u InterleavedContentItemUnionParam) GetText() *string
Returns a pointer to the underlying variant's property, if present.
func (InterleavedContentItemUnionParam) GetType ¶
func (u InterleavedContentItemUnionParam) GetType() *string
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 ¶
func (r InterleavedContentTextContentItem) RawJSON() string
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 (u InterleavedContentUnion) AsImageContentItem() (v InterleavedContentImageContentItem)
func (InterleavedContentUnion) AsInterleavedContentItemArray ¶
func (u InterleavedContentUnion) AsInterleavedContentItemArray() (v []InterleavedContentItemUnion)
func (InterleavedContentUnion) AsString ¶
func (u InterleavedContentUnion) AsString() (v string)
func (InterleavedContentUnion) AsTextContentItem ¶
func (u InterleavedContentUnion) AsTextContentItem() (v InterleavedContentTextContentItem)
func (InterleavedContentUnion) RawJSON ¶
func (u InterleavedContentUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (InterleavedContentUnion) ToParam ¶
func (r InterleavedContentUnion) ToParam() InterleavedContentUnionParam
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 InterleavedContentParamOfImageContentItem ¶
func InterleavedContentParamOfImageContentItem(image InterleavedContentImageContentItemImageParam) InterleavedContentUnionParam
func InterleavedContentParamOfTextContentItem ¶
func InterleavedContentParamOfTextContentItem(text string) InterleavedContentUnionParam
func (InterleavedContentUnionParam) GetImage ¶
func (u InterleavedContentUnionParam) GetImage() *InterleavedContentImageContentItemImageParam
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 Job ¶
type Job struct {
// Unique identifier for the job
JobID string `json:"job_id,required"`
// Current execution status of the job
//
// Any of "completed", "in_progress", "failed", "scheduled", "cancelled".
Status JobStatus `json:"status,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
JobID respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A job execution instance with status tracking.
func (*Job) UnmarshalJSON ¶
type ListBenchmarksResponse ¶
type ListBenchmarksResponse struct {
Data []Benchmark `json:"data,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ListBenchmarksResponse) RawJSON ¶
func (r ListBenchmarksResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ListBenchmarksResponse) UnmarshalJSON ¶
func (r *ListBenchmarksResponse) UnmarshalJSON(data []byte) error
type ListDatasetsResponse ¶
type ListDatasetsResponse struct {
// List of datasets
Data []ListDatasetsResponseData `json:"data,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Response from listing datasets.
func (ListDatasetsResponse) RawJSON ¶
func (r ListDatasetsResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ListDatasetsResponse) UnmarshalJSON ¶
func (r *ListDatasetsResponse) UnmarshalJSON(data []byte) error
type ListDatasetsResponseData ¶
type ListDatasetsResponseData struct {
Identifier string `json:"identifier,required"`
// Additional metadata for the dataset
Metadata map[string]ListDatasetsResponseDataMetadataUnion `json:"metadata,required"`
ProviderID string `json:"provider_id,required"`
// Purpose of the dataset indicating its intended use
//
// Any of "post-training/messages", "eval/question-answer", "eval/messages-answer".
Purpose string `json:"purpose,required"`
// Data source configuration for the dataset
Source ListDatasetsResponseDataSourceUnion `json:"source,required"`
// Type of resource, always 'dataset' for datasets
Type constant.Dataset `json:"type,required"`
ProviderResourceID string `json:"provider_resource_id"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Identifier respjson.Field
Metadata respjson.Field
ProviderID respjson.Field
Purpose respjson.Field
Source respjson.Field
Type respjson.Field
ProviderResourceID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Dataset resource for storing and accessing training or evaluation data.
func (ListDatasetsResponseData) RawJSON ¶
func (r ListDatasetsResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*ListDatasetsResponseData) UnmarshalJSON ¶
func (r *ListDatasetsResponseData) UnmarshalJSON(data []byte) error
type ListDatasetsResponseDataMetadataUnion ¶
type ListDatasetsResponseDataMetadataUnion 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:"-"`
}
ListDatasetsResponseDataMetadataUnion 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 (ListDatasetsResponseDataMetadataUnion) AsAnyArray ¶
func (u ListDatasetsResponseDataMetadataUnion) AsAnyArray() (v []any)
func (ListDatasetsResponseDataMetadataUnion) AsBool ¶
func (u ListDatasetsResponseDataMetadataUnion) AsBool() (v bool)
func (ListDatasetsResponseDataMetadataUnion) AsFloat ¶
func (u ListDatasetsResponseDataMetadataUnion) AsFloat() (v float64)
func (ListDatasetsResponseDataMetadataUnion) AsString ¶
func (u ListDatasetsResponseDataMetadataUnion) AsString() (v string)
func (ListDatasetsResponseDataMetadataUnion) RawJSON ¶
func (u ListDatasetsResponseDataMetadataUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ListDatasetsResponseDataMetadataUnion) UnmarshalJSON ¶
func (r *ListDatasetsResponseDataMetadataUnion) UnmarshalJSON(data []byte) error
type ListDatasetsResponseDataSourceRows ¶
type ListDatasetsResponseDataSourceRows struct {
// The dataset is stored in rows. E.g. - [ {"messages": [{"role": "user",
// "content": "Hello, world!"}, {"role": "assistant", "content": "Hello, world!"}]}
// ]
Rows []map[string]ListDatasetsResponseDataSourceRowsRowUnion `json:"rows,required"`
Type constant.Rows `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Rows respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A dataset stored in rows.
func (ListDatasetsResponseDataSourceRows) RawJSON ¶
func (r ListDatasetsResponseDataSourceRows) RawJSON() string
Returns the unmodified JSON received from the API
func (*ListDatasetsResponseDataSourceRows) UnmarshalJSON ¶
func (r *ListDatasetsResponseDataSourceRows) UnmarshalJSON(data []byte) error
type ListDatasetsResponseDataSourceRowsRowUnion ¶
type ListDatasetsResponseDataSourceRowsRowUnion 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:"-"`
}
ListDatasetsResponseDataSourceRowsRowUnion 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 (ListDatasetsResponseDataSourceRowsRowUnion) AsAnyArray ¶
func (u ListDatasetsResponseDataSourceRowsRowUnion) AsAnyArray() (v []any)
func (ListDatasetsResponseDataSourceRowsRowUnion) AsBool ¶
func (u ListDatasetsResponseDataSourceRowsRowUnion) AsBool() (v bool)
func (ListDatasetsResponseDataSourceRowsRowUnion) AsFloat ¶
func (u ListDatasetsResponseDataSourceRowsRowUnion) AsFloat() (v float64)
func (ListDatasetsResponseDataSourceRowsRowUnion) AsString ¶
func (u ListDatasetsResponseDataSourceRowsRowUnion) AsString() (v string)
func (ListDatasetsResponseDataSourceRowsRowUnion) RawJSON ¶
func (u ListDatasetsResponseDataSourceRowsRowUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ListDatasetsResponseDataSourceRowsRowUnion) UnmarshalJSON ¶
func (r *ListDatasetsResponseDataSourceRowsRowUnion) UnmarshalJSON(data []byte) error
type ListDatasetsResponseDataSourceUnion ¶
type ListDatasetsResponseDataSourceUnion struct {
// Any of "uri", "rows".
Type string `json:"type"`
// This field is from variant [ListDatasetsResponseDataSourceUri].
Uri string `json:"uri"`
// This field is from variant [ListDatasetsResponseDataSourceRows].
Rows []map[string]ListDatasetsResponseDataSourceRowsRowUnion `json:"rows"`
JSON struct {
Type respjson.Field
Uri respjson.Field
Rows respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ListDatasetsResponseDataSourceUnion contains all possible properties and values from ListDatasetsResponseDataSourceUri, ListDatasetsResponseDataSourceRows.
Use the ListDatasetsResponseDataSourceUnion.AsAny method to switch on the variant.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (ListDatasetsResponseDataSourceUnion) AsAny ¶
func (u ListDatasetsResponseDataSourceUnion) AsAny() anyListDatasetsResponseDataSource
Use the following switch statement to find the correct variant
switch variant := ListDatasetsResponseDataSourceUnion.AsAny().(type) {
case llamastackclient.ListDatasetsResponseDataSourceUri:
case llamastackclient.ListDatasetsResponseDataSourceRows:
default:
fmt.Errorf("no variant present")
}
func (ListDatasetsResponseDataSourceUnion) AsRows ¶
func (u ListDatasetsResponseDataSourceUnion) AsRows() (v ListDatasetsResponseDataSourceRows)
func (ListDatasetsResponseDataSourceUnion) AsUri ¶
func (u ListDatasetsResponseDataSourceUnion) AsUri() (v ListDatasetsResponseDataSourceUri)
func (ListDatasetsResponseDataSourceUnion) RawJSON ¶
func (u ListDatasetsResponseDataSourceUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ListDatasetsResponseDataSourceUnion) UnmarshalJSON ¶
func (r *ListDatasetsResponseDataSourceUnion) UnmarshalJSON(data []byte) error
type ListDatasetsResponseDataSourceUri ¶
type ListDatasetsResponseDataSourceUri struct {
Type constant.Uri `json:"type,required"`
// The dataset can be obtained from a URI. E.g. -
// "https://mywebsite.com/mydata.jsonl" - "lsfs://mydata.jsonl" -
// "data:csv;base64,{base64_content}"
Uri string `json:"uri,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Type respjson.Field
Uri respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A dataset that can be obtained from a URI.
func (ListDatasetsResponseDataSourceUri) RawJSON ¶
func (r ListDatasetsResponseDataSourceUri) RawJSON() string
Returns the unmodified JSON received from the API
func (*ListDatasetsResponseDataSourceUri) UnmarshalJSON ¶
func (r *ListDatasetsResponseDataSourceUri) UnmarshalJSON(data []byte) error
type ListFilesResponse ¶
type ListFilesResponse struct {
// List of file objects
Data []File `json:"data,required"`
// ID of the first file in the list for pagination
FirstID string `json:"first_id,required"`
// Whether there are more files available beyond this page
HasMore bool `json:"has_more,required"`
// ID of the last file in the list for pagination
LastID string `json:"last_id,required"`
// The object type, which is always "list"
Object constant.List `json:"object,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
FirstID respjson.Field
HasMore respjson.Field
LastID respjson.Field
Object respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Response for listing files in OpenAI Files API.
func (ListFilesResponse) RawJSON ¶
func (r ListFilesResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ListFilesResponse) UnmarshalJSON ¶
func (r *ListFilesResponse) UnmarshalJSON(data []byte) error
type ListModelsResponse ¶
type ListModelsResponse struct {
Data []Model `json:"data,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ListModelsResponse) RawJSON ¶
func (r ListModelsResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ListModelsResponse) UnmarshalJSON ¶
func (r *ListModelsResponse) UnmarshalJSON(data []byte) error
type ListPostTrainingJobsResponse ¶
type ListPostTrainingJobsResponse struct {
Data []ListPostTrainingJobsResponseData `json:"data,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ListPostTrainingJobsResponse) RawJSON ¶
func (r ListPostTrainingJobsResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ListPostTrainingJobsResponse) UnmarshalJSON ¶
func (r *ListPostTrainingJobsResponse) UnmarshalJSON(data []byte) error
type ListPostTrainingJobsResponseData ¶
type ListPostTrainingJobsResponseData struct {
JobUuid string `json:"job_uuid,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
JobUuid respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ListPostTrainingJobsResponseData) RawJSON ¶
func (r ListPostTrainingJobsResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*ListPostTrainingJobsResponseData) UnmarshalJSON ¶
func (r *ListPostTrainingJobsResponseData) UnmarshalJSON(data []byte) error
type ListPromptsResponse ¶
type ListPromptsResponse struct {
Data []Prompt `json:"data,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Response model to list prompts.
func (ListPromptsResponse) RawJSON ¶
func (r ListPromptsResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ListPromptsResponse) UnmarshalJSON ¶
func (r *ListPromptsResponse) UnmarshalJSON(data []byte) error
type ListProvidersResponse ¶
type ListProvidersResponse struct {
// List of provider information objects
Data []ProviderInfo `json:"data,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Response containing a list of all available providers.
func (ListProvidersResponse) RawJSON ¶
func (r ListProvidersResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ListProvidersResponse) UnmarshalJSON ¶
func (r *ListProvidersResponse) UnmarshalJSON(data []byte) error
type ListRoutesResponse ¶
type ListRoutesResponse struct {
// List of available route information objects
Data []RouteInfo `json:"data,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Response containing a list of all available API routes.
func (ListRoutesResponse) RawJSON ¶
func (r ListRoutesResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ListRoutesResponse) UnmarshalJSON ¶
func (r *ListRoutesResponse) UnmarshalJSON(data []byte) error
type ListScoringFunctionsResponse ¶
type ListScoringFunctionsResponse struct {
Data []ScoringFn `json:"data,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ListScoringFunctionsResponse) RawJSON ¶
func (r ListScoringFunctionsResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ListScoringFunctionsResponse) UnmarshalJSON ¶
func (r *ListScoringFunctionsResponse) UnmarshalJSON(data []byte) error
type ListShieldsResponse ¶
type ListShieldsResponse struct {
Data []Shield `json:"data,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ListShieldsResponse) RawJSON ¶
func (r ListShieldsResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ListShieldsResponse) UnmarshalJSON ¶
func (r *ListShieldsResponse) UnmarshalJSON(data []byte) error
type ListToolGroupsResponse ¶
type ListToolGroupsResponse struct {
// List of tool groups
Data []ToolGroup `json:"data,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Response containing a list of tool groups.
func (ListToolGroupsResponse) RawJSON ¶
func (r ListToolGroupsResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ListToolGroupsResponse) UnmarshalJSON ¶
func (r *ListToolGroupsResponse) UnmarshalJSON(data []byte) error
type ListVectorStoreFilesInBatchResponse ¶
type ListVectorStoreFilesInBatchResponse struct {
// List of vector store file objects in the batch
Data []VectorStoreFile `json:"data,required"`
// Whether there are more files available beyond this page
HasMore bool `json:"has_more,required"`
// Object type identifier, always "list"
Object string `json:"object,required"`
// (Optional) ID of the first file in the list for pagination
FirstID string `json:"first_id"`
// (Optional) ID of the last file in the list for pagination
LastID string `json:"last_id"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
HasMore respjson.Field
Object respjson.Field
FirstID respjson.Field
LastID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Response from listing files in a vector store file batch.
func (ListVectorStoreFilesInBatchResponse) RawJSON ¶
func (r ListVectorStoreFilesInBatchResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ListVectorStoreFilesInBatchResponse) UnmarshalJSON ¶
func (r *ListVectorStoreFilesInBatchResponse) UnmarshalJSON(data []byte) error
type ListVectorStoresResponse ¶
type ListVectorStoresResponse struct {
// List of vector store objects
Data []VectorStore `json:"data,required"`
// Whether there are more vector stores available beyond this page
HasMore bool `json:"has_more,required"`
// Object type identifier, always "list"
Object string `json:"object,required"`
// (Optional) ID of the first vector store in the list for pagination
FirstID string `json:"first_id"`
// (Optional) ID of the last vector store in the list for pagination
LastID string `json:"last_id"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
HasMore respjson.Field
Object respjson.Field
FirstID respjson.Field
LastID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Response from listing vector stores.
func (ListVectorStoresResponse) RawJSON ¶
func (r ListVectorStoresResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ListVectorStoresResponse) UnmarshalJSON ¶
func (r *ListVectorStoresResponse) UnmarshalJSON(data []byte) error
type Model ¶
type Model struct {
ID string `json:"id,required"`
Created int64 `json:"created,required"`
Object constant.Model `json:"object,required"`
OwnedBy string `json:"owned_by,required"`
CustomMetadata map[string]ModelCustomMetadataUnion `json:"custom_metadata"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Created respjson.Field
Object respjson.Field
OwnedBy respjson.Field
CustomMetadata respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A model from OpenAI.
func (*Model) UnmarshalJSON ¶
type ModelCustomMetadataUnion ¶
type ModelCustomMetadataUnion 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:"-"`
}
ModelCustomMetadataUnion 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 (ModelCustomMetadataUnion) AsAnyArray ¶
func (u ModelCustomMetadataUnion) AsAnyArray() (v []any)
func (ModelCustomMetadataUnion) AsBool ¶
func (u ModelCustomMetadataUnion) AsBool() (v bool)
func (ModelCustomMetadataUnion) AsFloat ¶
func (u ModelCustomMetadataUnion) AsFloat() (v float64)
func (ModelCustomMetadataUnion) AsString ¶
func (u ModelCustomMetadataUnion) AsString() (v string)
func (ModelCustomMetadataUnion) RawJSON ¶
func (u ModelCustomMetadataUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ModelCustomMetadataUnion) UnmarshalJSON ¶
func (r *ModelCustomMetadataUnion) UnmarshalJSON(data []byte) error
type ModelGetResponse ¶
type ModelGetResponse struct {
// Unique identifier for this resource in llama stack
Identifier string `json:"identifier,required"`
// Any additional metadata for this model
Metadata map[string]ModelGetResponseMetadataUnion `json:"metadata,required"`
// The type of model (LLM or embedding model)
//
// Any of "llm", "embedding", "rerank".
ModelType ModelGetResponseModelType `json:"model_type,required"`
// ID of the provider that owns this resource
ProviderID string `json:"provider_id,required"`
// The resource type, always 'model' for model resources
Type constant.Model `json:"type,required"`
// Unique identifier for this resource in the provider
ProviderResourceID string `json:"provider_resource_id"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Identifier respjson.Field
Metadata respjson.Field
ModelType respjson.Field
ProviderID respjson.Field
Type respjson.Field
ProviderResourceID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A model resource representing an AI model registered in Llama Stack.
func (ModelGetResponse) RawJSON ¶
func (r ModelGetResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ModelGetResponse) UnmarshalJSON ¶
func (r *ModelGetResponse) UnmarshalJSON(data []byte) error
type ModelGetResponseMetadataUnion ¶
type ModelGetResponseMetadataUnion 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:"-"`
}
ModelGetResponseMetadataUnion 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 (ModelGetResponseMetadataUnion) AsAnyArray ¶
func (u ModelGetResponseMetadataUnion) AsAnyArray() (v []any)
func (ModelGetResponseMetadataUnion) AsBool ¶
func (u ModelGetResponseMetadataUnion) AsBool() (v bool)
func (ModelGetResponseMetadataUnion) AsFloat ¶
func (u ModelGetResponseMetadataUnion) AsFloat() (v float64)
func (ModelGetResponseMetadataUnion) AsString ¶
func (u ModelGetResponseMetadataUnion) AsString() (v string)
func (ModelGetResponseMetadataUnion) RawJSON ¶
func (u ModelGetResponseMetadataUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ModelGetResponseMetadataUnion) UnmarshalJSON ¶
func (r *ModelGetResponseMetadataUnion) UnmarshalJSON(data []byte) error
type ModelGetResponseModelType ¶
type ModelGetResponseModelType string
The type of model (LLM or embedding model)
const ( ModelGetResponseModelTypeLlm ModelGetResponseModelType = "llm" ModelGetResponseModelTypeEmbedding ModelGetResponseModelType = "embedding" ModelGetResponseModelTypeRerank ModelGetResponseModelType = "rerank" )
type ModelOpenAIService ¶
type ModelOpenAIService struct {
Options []option.RequestOption
}
ModelOpenAIService contains methods and other services that help with interacting with the llama-stack-client API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewModelOpenAIService method instead.
func NewModelOpenAIService ¶
func NewModelOpenAIService(opts ...option.RequestOption) (r ModelOpenAIService)
NewModelOpenAIService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ModelOpenAIService) List ¶
func (r *ModelOpenAIService) List(ctx context.Context, opts ...option.RequestOption) (res *[]Model, err error)
List models using the OpenAI API.
type ModelRegisterParams ¶
type ModelRegisterParams struct {
// The identifier of the model to register.
ModelID string `json:"model_id,required"`
// The identifier of the provider.
ProviderID param.Opt[string] `json:"provider_id,omitzero"`
// The identifier of the model in the provider.
ProviderModelID param.Opt[string] `json:"provider_model_id,omitzero"`
// Any additional metadata for this model.
Metadata map[string]ModelRegisterParamsMetadataUnion `json:"metadata,omitzero"`
// The type of model to register.
//
// Any of "llm", "embedding", "rerank".
ModelType ModelRegisterParamsModelType `json:"model_type,omitzero"`
// contains filtered or unexported fields
}
func (ModelRegisterParams) MarshalJSON ¶
func (r ModelRegisterParams) MarshalJSON() (data []byte, err error)
func (*ModelRegisterParams) UnmarshalJSON ¶
func (r *ModelRegisterParams) UnmarshalJSON(data []byte) error
type ModelRegisterParamsMetadataUnion ¶
type ModelRegisterParamsMetadataUnion 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 (ModelRegisterParamsMetadataUnion) MarshalJSON ¶
func (u ModelRegisterParamsMetadataUnion) MarshalJSON() ([]byte, error)
func (*ModelRegisterParamsMetadataUnion) UnmarshalJSON ¶
func (u *ModelRegisterParamsMetadataUnion) UnmarshalJSON(data []byte) error
type ModelRegisterParamsModelType ¶
type ModelRegisterParamsModelType string
The type of model to register.
const ( ModelRegisterParamsModelTypeLlm ModelRegisterParamsModelType = "llm" ModelRegisterParamsModelTypeEmbedding ModelRegisterParamsModelType = "embedding" ModelRegisterParamsModelTypeRerank ModelRegisterParamsModelType = "rerank" )
type ModelRegisterResponse ¶
type ModelRegisterResponse struct {
// Unique identifier for this resource in llama stack
Identifier string `json:"identifier,required"`
// Any additional metadata for this model
Metadata map[string]ModelRegisterResponseMetadataUnion `json:"metadata,required"`
// The type of model (LLM or embedding model)
//
// Any of "llm", "embedding", "rerank".
ModelType ModelRegisterResponseModelType `json:"model_type,required"`
// ID of the provider that owns this resource
ProviderID string `json:"provider_id,required"`
// The resource type, always 'model' for model resources
Type constant.Model `json:"type,required"`
// Unique identifier for this resource in the provider
ProviderResourceID string `json:"provider_resource_id"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Identifier respjson.Field
Metadata respjson.Field
ModelType respjson.Field
ProviderID respjson.Field
Type respjson.Field
ProviderResourceID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A model resource representing an AI model registered in Llama Stack.
func (ModelRegisterResponse) RawJSON ¶
func (r ModelRegisterResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ModelRegisterResponse) UnmarshalJSON ¶
func (r *ModelRegisterResponse) UnmarshalJSON(data []byte) error
type ModelRegisterResponseMetadataUnion ¶
type ModelRegisterResponseMetadataUnion 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:"-"`
}
ModelRegisterResponseMetadataUnion 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 (ModelRegisterResponseMetadataUnion) AsAnyArray ¶
func (u ModelRegisterResponseMetadataUnion) AsAnyArray() (v []any)
func (ModelRegisterResponseMetadataUnion) AsBool ¶
func (u ModelRegisterResponseMetadataUnion) AsBool() (v bool)
func (ModelRegisterResponseMetadataUnion) AsFloat ¶
func (u ModelRegisterResponseMetadataUnion) AsFloat() (v float64)
func (ModelRegisterResponseMetadataUnion) AsString ¶
func (u ModelRegisterResponseMetadataUnion) AsString() (v string)
func (ModelRegisterResponseMetadataUnion) RawJSON ¶
func (u ModelRegisterResponseMetadataUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ModelRegisterResponseMetadataUnion) UnmarshalJSON ¶
func (r *ModelRegisterResponseMetadataUnion) UnmarshalJSON(data []byte) error
type ModelRegisterResponseModelType ¶
type ModelRegisterResponseModelType string
The type of model (LLM or embedding model)
const ( ModelRegisterResponseModelTypeLlm ModelRegisterResponseModelType = "llm" ModelRegisterResponseModelTypeEmbedding ModelRegisterResponseModelType = "embedding" ModelRegisterResponseModelTypeRerank ModelRegisterResponseModelType = "rerank" )
type ModelService ¶
type ModelService struct {
Options []option.RequestOption
OpenAI ModelOpenAIService
}
ModelService contains methods and other services that help with interacting with the llama-stack-client API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewModelService method instead.
func NewModelService ¶
func NewModelService(opts ...option.RequestOption) (r ModelService)
NewModelService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ModelService) Get ¶
func (r *ModelService) Get(ctx context.Context, modelID string, opts ...option.RequestOption) (res *ModelGetResponse, err error)
Get model. Get a model by its identifier.
func (*ModelService) List ¶
func (r *ModelService) List(ctx context.Context, opts ...option.RequestOption) (res *[]Model, err error)
List models using the OpenAI API.
func (*ModelService) Register
deprecated
func (r *ModelService) Register(ctx context.Context, body ModelRegisterParams, opts ...option.RequestOption) (res *ModelRegisterResponse, err error)
Register model. Register a model.
Deprecated: deprecated
func (*ModelService) Unregister
deprecated
func (r *ModelService) Unregister(ctx context.Context, modelID string, opts ...option.RequestOption) (err error)
Unregister model. Unregister a model.
Deprecated: deprecated
type ModerationNewParams ¶
type ModerationNewParams struct {
// Input (or inputs) to classify. Can be a single string, an array of strings, or
// an array of multi-modal input objects similar to other models.
Input ModerationNewParamsInputUnion `json:"input,omitzero,required"`
// (Optional) The content moderation model you would like to use.
Model param.Opt[string] `json:"model,omitzero"`
// contains filtered or unexported fields
}
func (ModerationNewParams) MarshalJSON ¶
func (r ModerationNewParams) MarshalJSON() (data []byte, err error)
func (*ModerationNewParams) UnmarshalJSON ¶
func (r *ModerationNewParams) UnmarshalJSON(data []byte) error
type ModerationNewParamsInputUnion ¶
type ModerationNewParamsInputUnion struct {
OfString param.Opt[string] `json:",omitzero,inline"`
OfStringArray []string `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 (ModerationNewParamsInputUnion) MarshalJSON ¶
func (u ModerationNewParamsInputUnion) MarshalJSON() ([]byte, error)
func (*ModerationNewParamsInputUnion) UnmarshalJSON ¶
func (u *ModerationNewParamsInputUnion) UnmarshalJSON(data []byte) error
type ModerationService ¶
type ModerationService struct {
Options []option.RequestOption
}
ModerationService contains methods and other services that help with interacting with the llama-stack-client API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewModerationService method instead.
func NewModerationService ¶
func NewModerationService(opts ...option.RequestOption) (r ModerationService)
NewModerationService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ModerationService) New ¶
func (r *ModerationService) New(ctx context.Context, body ModerationNewParams, opts ...option.RequestOption) (res *CreateResponse, err error)
Create moderation. Classifies if text and/or image inputs are potentially harmful.
type PostTrainingJob ¶
type PostTrainingJob struct {
JobUuid string `json:"job_uuid,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
JobUuid respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (PostTrainingJob) RawJSON ¶
func (r PostTrainingJob) RawJSON() string
Returns the unmodified JSON received from the API
func (*PostTrainingJob) UnmarshalJSON ¶
func (r *PostTrainingJob) UnmarshalJSON(data []byte) error
type Prompt ¶
type Prompt struct {
// Boolean indicating whether this version is the default version for this prompt
IsDefault bool `json:"is_default,required"`
// Unique identifier formatted as 'pmpt\_<48-digit-hash>'
PromptID string `json:"prompt_id,required"`
// List of prompt variable names that can be used in the prompt template
Variables []string `json:"variables,required"`
// Version (integer starting at 1, incremented on save)
Version int64 `json:"version,required"`
// The system prompt text with variable placeholders. Variables are only supported
// when using the Responses API.
Prompt string `json:"prompt"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
IsDefault respjson.Field
PromptID respjson.Field
Variables respjson.Field
Version respjson.Field
Prompt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A prompt resource representing a stored OpenAI Compatible prompt template in Llama Stack.
func (*Prompt) UnmarshalJSON ¶
type PromptGetParams ¶
type PromptGetParams struct {
// The version of the prompt to get (defaults to latest).
Version param.Opt[int64] `query:"version,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (PromptGetParams) URLQuery ¶
func (r PromptGetParams) URLQuery() (v url.Values, err error)
URLQuery serializes PromptGetParams's query parameters as `url.Values`.
type PromptNewParams ¶
type PromptNewParams struct {
// The prompt text content with variable placeholders.
Prompt string `json:"prompt,required"`
// List of variable names that can be used in the prompt template.
Variables []string `json:"variables,omitzero"`
// contains filtered or unexported fields
}
func (PromptNewParams) MarshalJSON ¶
func (r PromptNewParams) MarshalJSON() (data []byte, err error)
func (*PromptNewParams) UnmarshalJSON ¶
func (r *PromptNewParams) UnmarshalJSON(data []byte) error
type PromptService ¶
type PromptService struct {
Options []option.RequestOption
Versions PromptVersionService
}
PromptService contains methods and other services that help with interacting with the llama-stack-client API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewPromptService method instead.
func NewPromptService ¶
func NewPromptService(opts ...option.RequestOption) (r PromptService)
NewPromptService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*PromptService) Delete ¶
func (r *PromptService) Delete(ctx context.Context, promptID string, opts ...option.RequestOption) (err error)
Delete prompt. Delete a prompt.
func (*PromptService) Get ¶
func (r *PromptService) Get(ctx context.Context, promptID string, query PromptGetParams, opts ...option.RequestOption) (res *Prompt, err error)
Get prompt. Get a prompt by its identifier and optional version.
func (*PromptService) List ¶
func (r *PromptService) List(ctx context.Context, opts ...option.RequestOption) (res *[]Prompt, err error)
List all prompts.
func (*PromptService) New ¶
func (r *PromptService) New(ctx context.Context, body PromptNewParams, opts ...option.RequestOption) (res *Prompt, err error)
Create prompt. Create a new prompt.
func (*PromptService) SetDefaultVersion ¶
func (r *PromptService) SetDefaultVersion(ctx context.Context, promptID string, body PromptSetDefaultVersionParams, opts ...option.RequestOption) (res *Prompt, err error)
Set prompt version. Set which version of a prompt should be the default in get_prompt (latest).
func (*PromptService) Update ¶
func (r *PromptService) Update(ctx context.Context, promptID string, body PromptUpdateParams, opts ...option.RequestOption) (res *Prompt, err error)
Update prompt. Update an existing prompt (increments version).
type PromptSetDefaultVersionParams ¶
type PromptSetDefaultVersionParams struct {
// The version to set as default.
Version int64 `json:"version,required"`
// contains filtered or unexported fields
}
func (PromptSetDefaultVersionParams) MarshalJSON ¶
func (r PromptSetDefaultVersionParams) MarshalJSON() (data []byte, err error)
func (*PromptSetDefaultVersionParams) UnmarshalJSON ¶
func (r *PromptSetDefaultVersionParams) UnmarshalJSON(data []byte) error
type PromptUpdateParams ¶
type PromptUpdateParams struct {
// The updated prompt text content.
Prompt string `json:"prompt,required"`
// Set the new version as the default (default=True).
SetAsDefault bool `json:"set_as_default,required"`
// The current version of the prompt being updated.
Version int64 `json:"version,required"`
// Updated list of variable names that can be used in the prompt template.
Variables []string `json:"variables,omitzero"`
// contains filtered or unexported fields
}
func (PromptUpdateParams) MarshalJSON ¶
func (r PromptUpdateParams) MarshalJSON() (data []byte, err error)
func (*PromptUpdateParams) UnmarshalJSON ¶
func (r *PromptUpdateParams) UnmarshalJSON(data []byte) error
type PromptVersionService ¶
type PromptVersionService struct {
Options []option.RequestOption
}
PromptVersionService contains methods and other services that help with interacting with the llama-stack-client API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewPromptVersionService method instead.
func NewPromptVersionService ¶
func NewPromptVersionService(opts ...option.RequestOption) (r PromptVersionService)
NewPromptVersionService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*PromptVersionService) List ¶
func (r *PromptVersionService) List(ctx context.Context, promptID string, opts ...option.RequestOption) (res *[]Prompt, err error)
List prompt versions. List all versions of a specific prompt.
type ProviderInfo ¶
type ProviderInfo struct {
// The API name this provider implements
API string `json:"api,required"`
// Configuration parameters for the provider
Config map[string]ProviderInfoConfigUnion `json:"config,required"`
// Current health status of the provider
Health map[string]ProviderInfoHealthUnion `json:"health,required"`
// Unique identifier for the provider
ProviderID string `json:"provider_id,required"`
// The type of provider implementation
ProviderType string `json:"provider_type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
API respjson.Field
Config respjson.Field
Health respjson.Field
ProviderID respjson.Field
ProviderType respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Information about a registered provider including its configuration and health status.
func (ProviderInfo) RawJSON ¶
func (r ProviderInfo) RawJSON() string
Returns the unmodified JSON received from the API
func (*ProviderInfo) UnmarshalJSON ¶
func (r *ProviderInfo) UnmarshalJSON(data []byte) error
type ProviderInfoConfigUnion ¶
type ProviderInfoConfigUnion 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:"-"`
}
ProviderInfoConfigUnion 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 (ProviderInfoConfigUnion) AsAnyArray ¶
func (u ProviderInfoConfigUnion) AsAnyArray() (v []any)
func (ProviderInfoConfigUnion) AsBool ¶
func (u ProviderInfoConfigUnion) AsBool() (v bool)
func (ProviderInfoConfigUnion) AsFloat ¶
func (u ProviderInfoConfigUnion) AsFloat() (v float64)
func (ProviderInfoConfigUnion) AsString ¶
func (u ProviderInfoConfigUnion) AsString() (v string)
func (ProviderInfoConfigUnion) RawJSON ¶
func (u ProviderInfoConfigUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ProviderInfoConfigUnion) UnmarshalJSON ¶
func (r *ProviderInfoConfigUnion) UnmarshalJSON(data []byte) error
type ProviderInfoHealthUnion ¶
type ProviderInfoHealthUnion 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:"-"`
}
ProviderInfoHealthUnion 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 (ProviderInfoHealthUnion) AsAnyArray ¶
func (u ProviderInfoHealthUnion) AsAnyArray() (v []any)
func (ProviderInfoHealthUnion) AsBool ¶
func (u ProviderInfoHealthUnion) AsBool() (v bool)
func (ProviderInfoHealthUnion) AsFloat ¶
func (u ProviderInfoHealthUnion) AsFloat() (v float64)
func (ProviderInfoHealthUnion) AsString ¶
func (u ProviderInfoHealthUnion) AsString() (v string)
func (ProviderInfoHealthUnion) RawJSON ¶
func (u ProviderInfoHealthUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ProviderInfoHealthUnion) UnmarshalJSON ¶
func (r *ProviderInfoHealthUnion) UnmarshalJSON(data []byte) error
type ProviderService ¶
type ProviderService struct {
Options []option.RequestOption
}
ProviderService contains methods and other services that help with interacting with the llama-stack-client API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewProviderService method instead.
func NewProviderService ¶
func NewProviderService(opts ...option.RequestOption) (r ProviderService)
NewProviderService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ProviderService) Get ¶
func (r *ProviderService) Get(ctx context.Context, providerID string, opts ...option.RequestOption) (res *ProviderInfo, err error)
Get provider. Get detailed information about a specific provider.
func (*ProviderService) List ¶
func (r *ProviderService) List(ctx context.Context, opts ...option.RequestOption) (res *[]ProviderInfo, err error)
List providers. List all available providers.
type QueryChunksResponse ¶
type QueryChunksResponse struct {
// List of content chunks returned from the query
Chunks []QueryChunksResponseChunk `json:"chunks,required"`
// Relevance scores corresponding to each returned chunk
Scores []float64 `json:"scores,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Chunks respjson.Field
Scores respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Response from querying chunks in a vector database.
func (QueryChunksResponse) RawJSON ¶
func (r QueryChunksResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*QueryChunksResponse) UnmarshalJSON ¶
func (r *QueryChunksResponse) UnmarshalJSON(data []byte) error
type QueryChunksResponseChunk ¶
type QueryChunksResponseChunk struct {
// Unique identifier for the chunk. Must be provided explicitly.
ChunkID string `json:"chunk_id,required"`
// The content of the chunk, which can be interleaved text, images, or other types.
Content InterleavedContentUnion `json:"content,required"`
// Metadata associated with the chunk that will be used in the model context during
// inference.
Metadata map[string]QueryChunksResponseChunkMetadataUnion `json:"metadata,required"`
// Metadata for the chunk that will NOT be used in the context during inference.
// The `chunk_metadata` is required backend functionality.
ChunkMetadata QueryChunksResponseChunkChunkMetadata `json:"chunk_metadata"`
// Optional embedding for the chunk. If not provided, it will be computed later.
Embedding []float64 `json:"embedding"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ChunkID respjson.Field
Content respjson.Field
Metadata respjson.Field
ChunkMetadata respjson.Field
Embedding respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A chunk of content that can be inserted into a vector database.
func (QueryChunksResponseChunk) RawJSON ¶
func (r QueryChunksResponseChunk) RawJSON() string
Returns the unmodified JSON received from the API
func (*QueryChunksResponseChunk) UnmarshalJSON ¶
func (r *QueryChunksResponseChunk) UnmarshalJSON(data []byte) error
type QueryChunksResponseChunkChunkMetadata ¶
type QueryChunksResponseChunkChunkMetadata struct {
// The dimension of the embedding vector for the chunk.
ChunkEmbeddingDimension int64 `json:"chunk_embedding_dimension"`
// The embedding model used to create the chunk's embedding.
ChunkEmbeddingModel string `json:"chunk_embedding_model"`
// The ID of the chunk. If not set, it will be generated based on the document ID
// and content.
ChunkID string `json:"chunk_id"`
// The tokenizer used to create the chunk. Default is Tiktoken.
ChunkTokenizer string `json:"chunk_tokenizer"`
// The window of the chunk, which can be used to group related chunks together.
ChunkWindow string `json:"chunk_window"`
// The number of tokens in the content of the chunk.
ContentTokenCount int64 `json:"content_token_count"`
// An optional timestamp indicating when the chunk was created.
CreatedTimestamp int64 `json:"created_timestamp"`
// The ID of the document this chunk belongs to.
DocumentID string `json:"document_id"`
// The number of tokens in the metadata of the chunk.
MetadataTokenCount int64 `json:"metadata_token_count"`
// The source of the content, such as a URL, file path, or other identifier.
Source string `json:"source"`
// An optional timestamp indicating when the chunk was last updated.
UpdatedTimestamp int64 `json:"updated_timestamp"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ChunkEmbeddingDimension respjson.Field
ChunkEmbeddingModel respjson.Field
ChunkID respjson.Field
ChunkTokenizer respjson.Field
ChunkWindow respjson.Field
ContentTokenCount respjson.Field
CreatedTimestamp respjson.Field
DocumentID respjson.Field
MetadataTokenCount respjson.Field
Source respjson.Field
UpdatedTimestamp respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Metadata for the chunk that will NOT be used in the context during inference. The `chunk_metadata` is required backend functionality.
func (QueryChunksResponseChunkChunkMetadata) RawJSON ¶
func (r QueryChunksResponseChunkChunkMetadata) RawJSON() string
Returns the unmodified JSON received from the API
func (*QueryChunksResponseChunkChunkMetadata) UnmarshalJSON ¶
func (r *QueryChunksResponseChunkChunkMetadata) UnmarshalJSON(data []byte) error
type QueryChunksResponseChunkMetadataUnion ¶
type QueryChunksResponseChunkMetadataUnion 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:"-"`
}
QueryChunksResponseChunkMetadataUnion 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 (QueryChunksResponseChunkMetadataUnion) AsAnyArray ¶
func (u QueryChunksResponseChunkMetadataUnion) AsAnyArray() (v []any)
func (QueryChunksResponseChunkMetadataUnion) AsBool ¶
func (u QueryChunksResponseChunkMetadataUnion) AsBool() (v bool)
func (QueryChunksResponseChunkMetadataUnion) AsFloat ¶
func (u QueryChunksResponseChunkMetadataUnion) AsFloat() (v float64)
func (QueryChunksResponseChunkMetadataUnion) AsString ¶
func (u QueryChunksResponseChunkMetadataUnion) AsString() (v string)
func (QueryChunksResponseChunkMetadataUnion) RawJSON ¶
func (u QueryChunksResponseChunkMetadataUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*QueryChunksResponseChunkMetadataUnion) UnmarshalJSON ¶
func (r *QueryChunksResponseChunkMetadataUnion) UnmarshalJSON(data []byte) error
type ResponseDeleteResponse ¶
type ResponseDeleteResponse struct {
// Unique identifier of the deleted response
ID string `json:"id,required"`
// Deletion confirmation flag, always True
Deleted bool `json:"deleted,required"`
// Object type identifier, always "response"
Object constant.Response `json:"object,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Deleted respjson.Field
Object respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Response object confirming deletion of an OpenAI response.
func (ResponseDeleteResponse) RawJSON ¶
func (r ResponseDeleteResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseDeleteResponse) UnmarshalJSON ¶
func (r *ResponseDeleteResponse) UnmarshalJSON(data []byte) error
type ResponseInputItemListParams ¶
type ResponseInputItemListParams struct {
// An item ID to list items after, used for pagination.
After param.Opt[string] `query:"after,omitzero" json:"-"`
// An item ID to list items before, used for pagination.
Before param.Opt[string] `query:"before,omitzero" json:"-"`
// A limit on the number of objects to be returned. Limit can range between 1 and
// 100, and the default is 20.
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Additional fields to include in the response.
Include []string `query:"include,omitzero" json:"-"`
// The order to return the input items in. Default is desc.
//
// Any of "asc", "desc".
Order ResponseInputItemListParamsOrder `query:"order,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (ResponseInputItemListParams) URLQuery ¶
func (r ResponseInputItemListParams) URLQuery() (v url.Values, err error)
URLQuery serializes ResponseInputItemListParams's query parameters as `url.Values`.
type ResponseInputItemListParamsOrder ¶
type ResponseInputItemListParamsOrder string
The order to return the input items in. Default is desc.
const ( ResponseInputItemListParamsOrderAsc ResponseInputItemListParamsOrder = "asc" ResponseInputItemListParamsOrderDesc ResponseInputItemListParamsOrder = "desc" )
type ResponseInputItemListResponse ¶
type ResponseInputItemListResponse struct {
// List of input items
Data []ResponseInputItemListResponseDataUnion `json:"data,required"`
// Object type identifier, always "list"
Object constant.List `json:"object,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Object respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
List container for OpenAI response input items.
func (ResponseInputItemListResponse) RawJSON ¶
func (r ResponseInputItemListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseInputItemListResponse) UnmarshalJSON ¶
func (r *ResponseInputItemListResponse) UnmarshalJSON(data []byte) error
type ResponseInputItemListResponseDataOpenAIResponseInputFunctionToolCallOutput ¶
type ResponseInputItemListResponseDataOpenAIResponseInputFunctionToolCallOutput struct {
CallID string `json:"call_id,required"`
Output string `json:"output,required"`
Type constant.FunctionCallOutput `json:"type,required"`
ID string `json:"id"`
Status string `json:"status"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CallID respjson.Field
Output respjson.Field
Type respjson.Field
ID respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
This represents the output of a function call that gets passed back to the model.
func (ResponseInputItemListResponseDataOpenAIResponseInputFunctionToolCallOutput) RawJSON ¶
func (r ResponseInputItemListResponseDataOpenAIResponseInputFunctionToolCallOutput) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseInputItemListResponseDataOpenAIResponseInputFunctionToolCallOutput) UnmarshalJSON ¶
func (r *ResponseInputItemListResponseDataOpenAIResponseInputFunctionToolCallOutput) UnmarshalJSON(data []byte) error
type ResponseInputItemListResponseDataOpenAIResponseMcpApprovalRequest ¶
type ResponseInputItemListResponseDataOpenAIResponseMcpApprovalRequest struct {
ID string `json:"id,required"`
Arguments string `json:"arguments,required"`
Name string `json:"name,required"`
ServerLabel string `json:"server_label,required"`
Type constant.McpApprovalRequest `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Arguments respjson.Field
Name respjson.Field
ServerLabel respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A request for human approval of a tool invocation.
func (ResponseInputItemListResponseDataOpenAIResponseMcpApprovalRequest) RawJSON ¶
func (r ResponseInputItemListResponseDataOpenAIResponseMcpApprovalRequest) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseInputItemListResponseDataOpenAIResponseMcpApprovalRequest) UnmarshalJSON ¶
func (r *ResponseInputItemListResponseDataOpenAIResponseMcpApprovalRequest) UnmarshalJSON(data []byte) error
type ResponseInputItemListResponseDataOpenAIResponseMcpApprovalResponse ¶
type ResponseInputItemListResponseDataOpenAIResponseMcpApprovalResponse struct {
ApprovalRequestID string `json:"approval_request_id,required"`
Approve bool `json:"approve,required"`
Type constant.McpApprovalResponse `json:"type,required"`
ID string `json:"id"`
Reason string `json:"reason"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ApprovalRequestID respjson.Field
Approve respjson.Field
Type respjson.Field
ID respjson.Field
Reason respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A response to an MCP approval request.
func (ResponseInputItemListResponseDataOpenAIResponseMcpApprovalResponse) RawJSON ¶
func (r ResponseInputItemListResponseDataOpenAIResponseMcpApprovalResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseInputItemListResponseDataOpenAIResponseMcpApprovalResponse) UnmarshalJSON ¶
func (r *ResponseInputItemListResponseDataOpenAIResponseMcpApprovalResponse) UnmarshalJSON(data []byte) error
type ResponseInputItemListResponseDataOpenAIResponseMessage ¶
type ResponseInputItemListResponseDataOpenAIResponseMessage struct {
Content ResponseInputItemListResponseDataOpenAIResponseMessageContentUnion `json:"content,required"`
// Any of "system", "developer", "user", "assistant".
Role ResponseInputItemListResponseDataOpenAIResponseMessageRole `json:"role,required"`
Type constant.Message `json:"type,required"`
ID string `json:"id"`
Status string `json:"status"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Content respjson.Field
Role respjson.Field
Type respjson.Field
ID respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Corresponds to the various Message types in the Responses API. They are all under one type because the Responses API gives them all the same "type" value, and there is no way to tell them apart in certain scenarios.
func (ResponseInputItemListResponseDataOpenAIResponseMessage) RawJSON ¶
func (r ResponseInputItemListResponseDataOpenAIResponseMessage) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseInputItemListResponseDataOpenAIResponseMessage) UnmarshalJSON ¶
func (r *ResponseInputItemListResponseDataOpenAIResponseMessage) UnmarshalJSON(data []byte) error
type ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemDetail ¶
type ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemDetail string
Level of detail for image processing, can be "low", "high", or "auto"
const ( ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemDetailLow ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemDetail = "low" ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemDetailHigh ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemDetail = "high" ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemDetailAuto ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemDetail = "auto" )
type ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemInputFile ¶
type ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemInputFile struct {
// The type of the input item. Always `input_file`.
Type constant.InputFile `json:"type,required"`
// The data of the file to be sent to the model.
FileData string `json:"file_data"`
// (Optional) The ID of the file to be sent to the model.
FileID string `json:"file_id"`
// The URL of the file to be sent to the model.
FileURL string `json:"file_url"`
// The name of the file to be sent to the model.
Filename string `json:"filename"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Type respjson.Field
FileData respjson.Field
FileID respjson.Field
FileURL respjson.Field
Filename respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
File content for input messages in OpenAI response format.
func (ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemInputFile) RawJSON ¶
func (r ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemInputFile) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemInputFile) UnmarshalJSON ¶
func (r *ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemInputFile) UnmarshalJSON(data []byte) error
type ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemInputImage ¶
type ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemInputImage struct {
// Level of detail for image processing, can be "low", "high", or "auto"
//
// Any of "low", "high", "auto".
Detail ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemInputImageDetail `json:"detail,required"`
// Content type identifier, always "input_image"
Type constant.InputImage `json:"type,required"`
// (Optional) The ID of the file to be sent to the model.
FileID string `json:"file_id"`
// (Optional) URL of the image content
ImageURL string `json:"image_url"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Detail respjson.Field
Type respjson.Field
FileID respjson.Field
ImageURL respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Image content for input messages in OpenAI response format.
func (ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemInputImage) RawJSON ¶
func (r ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemInputImage) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemInputImage) UnmarshalJSON ¶
func (r *ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemInputImage) UnmarshalJSON(data []byte) error
type ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemInputImageDetail ¶
type ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemInputImageDetail string
Level of detail for image processing, can be "low", "high", or "auto"
const ( ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemInputImageDetailLow ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemInputImageDetail = "low" ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemInputImageDetailHigh ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemInputImageDetail = "high" ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemInputImageDetailAuto ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemInputImageDetail = "auto" )
type ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemInputText ¶
type ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemInputText struct {
// The text content of the input message
Text string `json:"text,required"`
// Content type identifier, always "input_text"
Type constant.InputText `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:"-"`
}
Text content for input messages in OpenAI response format.
func (ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemInputText) RawJSON ¶
func (r ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemInputText) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemInputText) UnmarshalJSON ¶
func (r *ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemInputText) UnmarshalJSON(data []byte) error
type ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemUnion ¶
type ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemUnion struct {
// This field is from variant
// [ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemInputText].
Text string `json:"text"`
// Any of "input_text", "input_image", "input_file".
Type string `json:"type"`
// This field is from variant
// [ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemInputImage].
Detail ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemInputImageDetail `json:"detail"`
FileID string `json:"file_id"`
// This field is from variant
// [ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemInputImage].
ImageURL string `json:"image_url"`
// This field is from variant
// [ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemInputFile].
FileData string `json:"file_data"`
// This field is from variant
// [ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemInputFile].
FileURL string `json:"file_url"`
// This field is from variant
// [ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemInputFile].
Filename string `json:"filename"`
JSON struct {
Text respjson.Field
Type respjson.Field
Detail respjson.Field
FileID respjson.Field
ImageURL respjson.Field
FileData respjson.Field
FileURL respjson.Field
Filename respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemUnion contains all possible properties and values from ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemInputText, ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemInputImage, ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemInputFile.
Use the ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemUnion.AsAny method to switch on the variant.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemUnion) AsAny ¶
func (u ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemUnion) AsAny() anyResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItem
Use the following switch statement to find the correct variant
switch variant := ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemUnion.AsAny().(type) {
case llamastackclient.ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemInputText:
case llamastackclient.ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemInputImage:
case llamastackclient.ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemInputFile:
default:
fmt.Errorf("no variant present")
}
func (ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemUnion) AsInputFile ¶
func (ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemUnion) AsInputImage ¶
func (ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemUnion) AsInputText ¶
func (ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemUnion) RawJSON ¶
func (u ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemUnion) UnmarshalJSON ¶
func (r *ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemUnion) UnmarshalJSON(data []byte) error
type ResponseInputItemListResponseDataOpenAIResponseMessageContentUnion ¶
type ResponseInputItemListResponseDataOpenAIResponseMessageContentUnion 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
// [[]ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemUnion]
// instead of an object.
OfVariant2 []ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemUnion `json:",inline"`
JSON struct {
OfString respjson.Field
OfVariant2 respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ResponseInputItemListResponseDataOpenAIResponseMessageContentUnion contains all possible properties and values from [string], [[]ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemUnion], [[]ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemUnion].
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 OfVariant2]
func (ResponseInputItemListResponseDataOpenAIResponseMessageContentUnion) AsResponseInputItemListResponseDataOpenAIResponseMessageContentArray ¶
func (u ResponseInputItemListResponseDataOpenAIResponseMessageContentUnion) AsResponseInputItemListResponseDataOpenAIResponseMessageContentArray() (v []ResponseInputItemListResponseDataOpenAIResponseMessageContentArrayItemUnion)
func (ResponseInputItemListResponseDataOpenAIResponseMessageContentUnion) AsString ¶
func (u ResponseInputItemListResponseDataOpenAIResponseMessageContentUnion) AsString() (v string)
func (ResponseInputItemListResponseDataOpenAIResponseMessageContentUnion) AsVariant2 ¶
func (ResponseInputItemListResponseDataOpenAIResponseMessageContentUnion) RawJSON ¶
func (u ResponseInputItemListResponseDataOpenAIResponseMessageContentUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseInputItemListResponseDataOpenAIResponseMessageContentUnion) UnmarshalJSON ¶
func (r *ResponseInputItemListResponseDataOpenAIResponseMessageContentUnion) UnmarshalJSON(data []byte) error
type ResponseInputItemListResponseDataOpenAIResponseMessageRole ¶
type ResponseInputItemListResponseDataOpenAIResponseMessageRole string
const ( ResponseInputItemListResponseDataOpenAIResponseMessageRoleSystem ResponseInputItemListResponseDataOpenAIResponseMessageRole = "system" ResponseInputItemListResponseDataOpenAIResponseMessageRoleDeveloper ResponseInputItemListResponseDataOpenAIResponseMessageRole = "developer" ResponseInputItemListResponseDataOpenAIResponseMessageRoleUser ResponseInputItemListResponseDataOpenAIResponseMessageRole = "user" ResponseInputItemListResponseDataOpenAIResponseMessageRoleAssistant ResponseInputItemListResponseDataOpenAIResponseMessageRole = "assistant" )
type ResponseInputItemListResponseDataOpenAIResponseOutputMessageFileSearchToolCall ¶
type ResponseInputItemListResponseDataOpenAIResponseOutputMessageFileSearchToolCall struct {
// Unique identifier for this tool call
ID string `json:"id,required"`
// List of search queries executed
Queries []string `json:"queries,required"`
// Current status of the file search operation
Status string `json:"status,required"`
// Tool call type identifier, always "file_search_call"
Type constant.FileSearchCall `json:"type,required"`
// (Optional) Search results returned by the file search operation
Results []ResponseInputItemListResponseDataOpenAIResponseOutputMessageFileSearchToolCallResult `json:"results"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Queries respjson.Field
Status respjson.Field
Type respjson.Field
Results respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
File search tool call output message for OpenAI responses.
func (ResponseInputItemListResponseDataOpenAIResponseOutputMessageFileSearchToolCall) RawJSON ¶
func (r ResponseInputItemListResponseDataOpenAIResponseOutputMessageFileSearchToolCall) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseInputItemListResponseDataOpenAIResponseOutputMessageFileSearchToolCall) UnmarshalJSON ¶
func (r *ResponseInputItemListResponseDataOpenAIResponseOutputMessageFileSearchToolCall) UnmarshalJSON(data []byte) error
type ResponseInputItemListResponseDataOpenAIResponseOutputMessageFileSearchToolCallResult ¶
type ResponseInputItemListResponseDataOpenAIResponseOutputMessageFileSearchToolCallResult struct {
// (Optional) Key-value attributes associated with the file
Attributes map[string]ResponseInputItemListResponseDataOpenAIResponseOutputMessageFileSearchToolCallResultAttributeUnion `json:"attributes,required"`
// Unique identifier of the file containing the result
FileID string `json:"file_id,required"`
// Name of the file containing the result
Filename string `json:"filename,required"`
// Relevance score for this search result (between 0 and 1)
Score float64 `json:"score,required"`
// Text content of the search result
Text string `json:"text,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Attributes respjson.Field
FileID respjson.Field
Filename respjson.Field
Score respjson.Field
Text respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Search results returned by the file search operation.
func (ResponseInputItemListResponseDataOpenAIResponseOutputMessageFileSearchToolCallResult) RawJSON ¶
func (r ResponseInputItemListResponseDataOpenAIResponseOutputMessageFileSearchToolCallResult) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseInputItemListResponseDataOpenAIResponseOutputMessageFileSearchToolCallResult) UnmarshalJSON ¶
func (r *ResponseInputItemListResponseDataOpenAIResponseOutputMessageFileSearchToolCallResult) UnmarshalJSON(data []byte) error
type ResponseInputItemListResponseDataOpenAIResponseOutputMessageFileSearchToolCallResultAttributeUnion ¶
type ResponseInputItemListResponseDataOpenAIResponseOutputMessageFileSearchToolCallResultAttributeUnion 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:"-"`
}
ResponseInputItemListResponseDataOpenAIResponseOutputMessageFileSearchToolCallResultAttributeUnion 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 (ResponseInputItemListResponseDataOpenAIResponseOutputMessageFileSearchToolCallResultAttributeUnion) AsAnyArray ¶
func (u ResponseInputItemListResponseDataOpenAIResponseOutputMessageFileSearchToolCallResultAttributeUnion) AsAnyArray() (v []any)
func (ResponseInputItemListResponseDataOpenAIResponseOutputMessageFileSearchToolCallResultAttributeUnion) AsBool ¶
func (ResponseInputItemListResponseDataOpenAIResponseOutputMessageFileSearchToolCallResultAttributeUnion) AsFloat ¶
func (ResponseInputItemListResponseDataOpenAIResponseOutputMessageFileSearchToolCallResultAttributeUnion) AsString ¶
func (ResponseInputItemListResponseDataOpenAIResponseOutputMessageFileSearchToolCallResultAttributeUnion) RawJSON ¶
func (u ResponseInputItemListResponseDataOpenAIResponseOutputMessageFileSearchToolCallResultAttributeUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseInputItemListResponseDataOpenAIResponseOutputMessageFileSearchToolCallResultAttributeUnion) UnmarshalJSON ¶
func (r *ResponseInputItemListResponseDataOpenAIResponseOutputMessageFileSearchToolCallResultAttributeUnion) UnmarshalJSON(data []byte) error
type ResponseInputItemListResponseDataOpenAIResponseOutputMessageFunctionToolCall ¶
type ResponseInputItemListResponseDataOpenAIResponseOutputMessageFunctionToolCall struct {
// JSON string containing the function arguments
Arguments string `json:"arguments,required"`
// Unique identifier for the function call
CallID string `json:"call_id,required"`
// Name of the function being called
Name string `json:"name,required"`
// Tool call type identifier, always "function_call"
Type constant.FunctionCall `json:"type,required"`
// (Optional) Additional identifier for the tool call
ID string `json:"id"`
// (Optional) Current status of the function call execution
Status string `json:"status"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Arguments respjson.Field
CallID respjson.Field
Name respjson.Field
Type respjson.Field
ID respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Function tool call output message for OpenAI responses.
func (ResponseInputItemListResponseDataOpenAIResponseOutputMessageFunctionToolCall) RawJSON ¶
func (r ResponseInputItemListResponseDataOpenAIResponseOutputMessageFunctionToolCall) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseInputItemListResponseDataOpenAIResponseOutputMessageFunctionToolCall) UnmarshalJSON ¶
func (r *ResponseInputItemListResponseDataOpenAIResponseOutputMessageFunctionToolCall) UnmarshalJSON(data []byte) error
type ResponseInputItemListResponseDataOpenAIResponseOutputMessageMcpCall ¶
type ResponseInputItemListResponseDataOpenAIResponseOutputMessageMcpCall struct {
// Unique identifier for this MCP call
ID string `json:"id,required"`
// JSON string containing the MCP call arguments
Arguments string `json:"arguments,required"`
// Name of the MCP method being called
Name string `json:"name,required"`
// Label identifying the MCP server handling the call
ServerLabel string `json:"server_label,required"`
// Tool call type identifier, always "mcp_call"
Type constant.McpCall `json:"type,required"`
// (Optional) Error message if the MCP call failed
Error string `json:"error"`
// (Optional) Output result from the successful MCP call
Output string `json:"output"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Arguments respjson.Field
Name respjson.Field
ServerLabel respjson.Field
Type respjson.Field
Error respjson.Field
Output respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Model Context Protocol (MCP) call output message for OpenAI responses.
func (ResponseInputItemListResponseDataOpenAIResponseOutputMessageMcpCall) RawJSON ¶
func (r ResponseInputItemListResponseDataOpenAIResponseOutputMessageMcpCall) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseInputItemListResponseDataOpenAIResponseOutputMessageMcpCall) UnmarshalJSON ¶
func (r *ResponseInputItemListResponseDataOpenAIResponseOutputMessageMcpCall) UnmarshalJSON(data []byte) error
type ResponseInputItemListResponseDataOpenAIResponseOutputMessageMcpListTools ¶
type ResponseInputItemListResponseDataOpenAIResponseOutputMessageMcpListTools struct {
// Unique identifier for this MCP list tools operation
ID string `json:"id,required"`
// Label identifying the MCP server providing the tools
ServerLabel string `json:"server_label,required"`
// List of available tools provided by the MCP server
Tools []ResponseInputItemListResponseDataOpenAIResponseOutputMessageMcpListToolsTool `json:"tools,required"`
// Tool call type identifier, always "mcp_list_tools"
Type constant.McpListTools `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
ServerLabel respjson.Field
Tools respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
MCP list tools output message containing available tools from an MCP server.
func (ResponseInputItemListResponseDataOpenAIResponseOutputMessageMcpListTools) RawJSON ¶
func (r ResponseInputItemListResponseDataOpenAIResponseOutputMessageMcpListTools) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseInputItemListResponseDataOpenAIResponseOutputMessageMcpListTools) UnmarshalJSON ¶
func (r *ResponseInputItemListResponseDataOpenAIResponseOutputMessageMcpListTools) UnmarshalJSON(data []byte) error
type ResponseInputItemListResponseDataOpenAIResponseOutputMessageMcpListToolsTool ¶
type ResponseInputItemListResponseDataOpenAIResponseOutputMessageMcpListToolsTool struct {
// JSON schema defining the tool's input parameters
InputSchema map[string]ResponseInputItemListResponseDataOpenAIResponseOutputMessageMcpListToolsToolInputSchemaUnion `json:"input_schema,required"`
// Name of the tool
Name string `json:"name,required"`
// (Optional) Description of what the tool does
Description string `json:"description"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
InputSchema respjson.Field
Name respjson.Field
Description respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Tool definition returned by MCP list tools operation.
func (ResponseInputItemListResponseDataOpenAIResponseOutputMessageMcpListToolsTool) RawJSON ¶
func (r ResponseInputItemListResponseDataOpenAIResponseOutputMessageMcpListToolsTool) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseInputItemListResponseDataOpenAIResponseOutputMessageMcpListToolsTool) UnmarshalJSON ¶
func (r *ResponseInputItemListResponseDataOpenAIResponseOutputMessageMcpListToolsTool) UnmarshalJSON(data []byte) error
type ResponseInputItemListResponseDataOpenAIResponseOutputMessageMcpListToolsToolInputSchemaUnion ¶
type ResponseInputItemListResponseDataOpenAIResponseOutputMessageMcpListToolsToolInputSchemaUnion 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:"-"`
}
ResponseInputItemListResponseDataOpenAIResponseOutputMessageMcpListToolsToolInputSchemaUnion 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 (ResponseInputItemListResponseDataOpenAIResponseOutputMessageMcpListToolsToolInputSchemaUnion) AsAnyArray ¶
func (u ResponseInputItemListResponseDataOpenAIResponseOutputMessageMcpListToolsToolInputSchemaUnion) AsAnyArray() (v []any)
func (ResponseInputItemListResponseDataOpenAIResponseOutputMessageMcpListToolsToolInputSchemaUnion) AsBool ¶
func (ResponseInputItemListResponseDataOpenAIResponseOutputMessageMcpListToolsToolInputSchemaUnion) AsFloat ¶
func (ResponseInputItemListResponseDataOpenAIResponseOutputMessageMcpListToolsToolInputSchemaUnion) AsString ¶
func (u ResponseInputItemListResponseDataOpenAIResponseOutputMessageMcpListToolsToolInputSchemaUnion) AsString() (v string)
func (ResponseInputItemListResponseDataOpenAIResponseOutputMessageMcpListToolsToolInputSchemaUnion) RawJSON ¶
func (u ResponseInputItemListResponseDataOpenAIResponseOutputMessageMcpListToolsToolInputSchemaUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseInputItemListResponseDataOpenAIResponseOutputMessageMcpListToolsToolInputSchemaUnion) UnmarshalJSON ¶
func (r *ResponseInputItemListResponseDataOpenAIResponseOutputMessageMcpListToolsToolInputSchemaUnion) UnmarshalJSON(data []byte) error
type ResponseInputItemListResponseDataOpenAIResponseOutputMessageWebSearchToolCall ¶
type ResponseInputItemListResponseDataOpenAIResponseOutputMessageWebSearchToolCall struct {
// Unique identifier for this tool call
ID string `json:"id,required"`
// Current status of the web search operation
Status string `json:"status,required"`
// Tool call type identifier, always "web_search_call"
Type constant.WebSearchCall `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Status respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Web search tool call output message for OpenAI responses.
func (ResponseInputItemListResponseDataOpenAIResponseOutputMessageWebSearchToolCall) RawJSON ¶
func (r ResponseInputItemListResponseDataOpenAIResponseOutputMessageWebSearchToolCall) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseInputItemListResponseDataOpenAIResponseOutputMessageWebSearchToolCall) UnmarshalJSON ¶
func (r *ResponseInputItemListResponseDataOpenAIResponseOutputMessageWebSearchToolCall) UnmarshalJSON(data []byte) error
type ResponseInputItemListResponseDataRole ¶
type ResponseInputItemListResponseDataRole string
const ( ResponseInputItemListResponseDataRoleSystem ResponseInputItemListResponseDataRole = "system" ResponseInputItemListResponseDataRoleDeveloper ResponseInputItemListResponseDataRole = "developer" ResponseInputItemListResponseDataRoleUser ResponseInputItemListResponseDataRole = "user" ResponseInputItemListResponseDataRoleAssistant ResponseInputItemListResponseDataRole = "assistant" )
type ResponseInputItemListResponseDataUnion ¶
type ResponseInputItemListResponseDataUnion struct {
// This field is from variant
// [ResponseInputItemListResponseDataOpenAIResponseMessage].
Content ResponseInputItemListResponseDataOpenAIResponseMessageContentUnion `json:"content"`
// This field is from variant
// [ResponseInputItemListResponseDataOpenAIResponseMessage].
Role ResponseInputItemListResponseDataOpenAIResponseMessageRole `json:"role"`
Type string `json:"type"`
ID string `json:"id"`
Status string `json:"status"`
// This field is from variant
// [ResponseInputItemListResponseDataOpenAIResponseOutputMessageFileSearchToolCall].
Queries []string `json:"queries"`
// This field is from variant
// [ResponseInputItemListResponseDataOpenAIResponseOutputMessageFileSearchToolCall].
Results []ResponseInputItemListResponseDataOpenAIResponseOutputMessageFileSearchToolCallResult `json:"results"`
Arguments string `json:"arguments"`
CallID string `json:"call_id"`
Name string `json:"name"`
ServerLabel string `json:"server_label"`
// This field is from variant
// [ResponseInputItemListResponseDataOpenAIResponseOutputMessageMcpCall].
Error string `json:"error"`
Output string `json:"output"`
// This field is from variant
// [ResponseInputItemListResponseDataOpenAIResponseOutputMessageMcpListTools].
Tools []ResponseInputItemListResponseDataOpenAIResponseOutputMessageMcpListToolsTool `json:"tools"`
// This field is from variant
// [ResponseInputItemListResponseDataOpenAIResponseMcpApprovalResponse].
ApprovalRequestID string `json:"approval_request_id"`
// This field is from variant
// [ResponseInputItemListResponseDataOpenAIResponseMcpApprovalResponse].
Approve bool `json:"approve"`
// This field is from variant
// [ResponseInputItemListResponseDataOpenAIResponseMcpApprovalResponse].
Reason string `json:"reason"`
JSON struct {
Content respjson.Field
Role respjson.Field
Type respjson.Field
ID respjson.Field
Status respjson.Field
Queries respjson.Field
Results respjson.Field
Arguments respjson.Field
CallID respjson.Field
Name respjson.Field
ServerLabel respjson.Field
Error respjson.Field
Output respjson.Field
Tools respjson.Field
ApprovalRequestID respjson.Field
Approve respjson.Field
Reason respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ResponseInputItemListResponseDataUnion contains all possible properties and values from ResponseInputItemListResponseDataOpenAIResponseMessage, ResponseInputItemListResponseDataOpenAIResponseOutputMessageWebSearchToolCall, ResponseInputItemListResponseDataOpenAIResponseOutputMessageFileSearchToolCall, ResponseInputItemListResponseDataOpenAIResponseOutputMessageFunctionToolCall, ResponseInputItemListResponseDataOpenAIResponseOutputMessageMcpCall, ResponseInputItemListResponseDataOpenAIResponseOutputMessageMcpListTools, ResponseInputItemListResponseDataOpenAIResponseMcpApprovalRequest, ResponseInputItemListResponseDataOpenAIResponseInputFunctionToolCallOutput, ResponseInputItemListResponseDataOpenAIResponseMcpApprovalResponse, ResponseInputItemListResponseDataOpenAIResponseMessage.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (ResponseInputItemListResponseDataUnion) AsOpenAIResponseInputFunctionToolCallOutput ¶
func (u ResponseInputItemListResponseDataUnion) AsOpenAIResponseInputFunctionToolCallOutput() (v ResponseInputItemListResponseDataOpenAIResponseInputFunctionToolCallOutput)
func (ResponseInputItemListResponseDataUnion) AsOpenAIResponseMcpApprovalRequest ¶
func (u ResponseInputItemListResponseDataUnion) AsOpenAIResponseMcpApprovalRequest() (v ResponseInputItemListResponseDataOpenAIResponseMcpApprovalRequest)
func (ResponseInputItemListResponseDataUnion) AsOpenAIResponseMcpApprovalResponse ¶
func (u ResponseInputItemListResponseDataUnion) AsOpenAIResponseMcpApprovalResponse() (v ResponseInputItemListResponseDataOpenAIResponseMcpApprovalResponse)
func (ResponseInputItemListResponseDataUnion) AsOpenAIResponseMessage ¶
func (u ResponseInputItemListResponseDataUnion) AsOpenAIResponseMessage() (v ResponseInputItemListResponseDataOpenAIResponseMessage)
func (ResponseInputItemListResponseDataUnion) AsOpenAIResponseOutputMessageFileSearchToolCall ¶
func (u ResponseInputItemListResponseDataUnion) AsOpenAIResponseOutputMessageFileSearchToolCall() (v ResponseInputItemListResponseDataOpenAIResponseOutputMessageFileSearchToolCall)
func (ResponseInputItemListResponseDataUnion) AsOpenAIResponseOutputMessageFunctionToolCall ¶
func (u ResponseInputItemListResponseDataUnion) AsOpenAIResponseOutputMessageFunctionToolCall() (v ResponseInputItemListResponseDataOpenAIResponseOutputMessageFunctionToolCall)
func (ResponseInputItemListResponseDataUnion) AsOpenAIResponseOutputMessageMcpCall ¶
func (u ResponseInputItemListResponseDataUnion) AsOpenAIResponseOutputMessageMcpCall() (v ResponseInputItemListResponseDataOpenAIResponseOutputMessageMcpCall)
func (ResponseInputItemListResponseDataUnion) AsOpenAIResponseOutputMessageMcpListTools ¶
func (u ResponseInputItemListResponseDataUnion) AsOpenAIResponseOutputMessageMcpListTools() (v ResponseInputItemListResponseDataOpenAIResponseOutputMessageMcpListTools)
func (ResponseInputItemListResponseDataUnion) AsOpenAIResponseOutputMessageWebSearchToolCall ¶
func (u ResponseInputItemListResponseDataUnion) AsOpenAIResponseOutputMessageWebSearchToolCall() (v ResponseInputItemListResponseDataOpenAIResponseOutputMessageWebSearchToolCall)
func (ResponseInputItemListResponseDataUnion) AsResponseInputItemListResponseDataOpenAIResponseMessage ¶
func (u ResponseInputItemListResponseDataUnion) AsResponseInputItemListResponseDataOpenAIResponseMessage() (v ResponseInputItemListResponseDataOpenAIResponseMessage)
func (ResponseInputItemListResponseDataUnion) RawJSON ¶
func (u ResponseInputItemListResponseDataUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseInputItemListResponseDataUnion) UnmarshalJSON ¶
func (r *ResponseInputItemListResponseDataUnion) UnmarshalJSON(data []byte) error
type ResponseInputItemService ¶
type ResponseInputItemService struct {
Options []option.RequestOption
}
ResponseInputItemService contains methods and other services that help with interacting with the llama-stack-client API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewResponseInputItemService method instead.
func NewResponseInputItemService ¶
func NewResponseInputItemService(opts ...option.RequestOption) (r ResponseInputItemService)
NewResponseInputItemService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ResponseInputItemService) List ¶
func (r *ResponseInputItemService) List(ctx context.Context, responseID string, query ResponseInputItemListParams, opts ...option.RequestOption) (res *ResponseInputItemListResponse, err error)
List input items.
type ResponseListParams ¶
type ResponseListParams struct {
// The ID of the last response to return.
After param.Opt[string] `query:"after,omitzero" json:"-"`
// The number of responses to return.
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// The model to filter responses by.
Model param.Opt[string] `query:"model,omitzero" json:"-"`
// The order to sort responses by when sorted by created_at ('asc' or 'desc').
//
// Any of "asc", "desc".
Order ResponseListParamsOrder `query:"order,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (ResponseListParams) URLQuery ¶
func (r ResponseListParams) URLQuery() (v url.Values, err error)
URLQuery serializes ResponseListParams's query parameters as `url.Values`.
type ResponseListParamsOrder ¶
type ResponseListParamsOrder string
The order to sort responses by when sorted by created_at ('asc' or 'desc').
const ( ResponseListParamsOrderAsc ResponseListParamsOrder = "asc" ResponseListParamsOrderDesc ResponseListParamsOrder = "desc" )
type ResponseListResponse ¶
type ResponseListResponse struct {
// Unique identifier for this response
ID string `json:"id,required"`
// Unix timestamp when the response was created
CreatedAt int64 `json:"created_at,required"`
// List of input items that led to this response
Input []ResponseListResponseInputUnion `json:"input,required"`
// Model identifier used for generation
Model string `json:"model,required"`
// Object type identifier, always "response"
Object constant.Response `json:"object,required"`
// List of generated output items (messages, tool calls, etc.)
Output []ResponseListResponseOutputUnion `json:"output,required"`
// Whether tool calls can be executed in parallel
ParallelToolCalls bool `json:"parallel_tool_calls,required"`
// Current status of the response generation
Status string `json:"status,required"`
// Text formatting configuration for the response
Text ResponseListResponseText `json:"text,required"`
// (Optional) Error details if the response generation failed
Error ResponseListResponseError `json:"error"`
// (Optional) System message inserted into the model's context
Instructions string `json:"instructions"`
// (Optional) Max number of total calls to built-in tools that can be processed in
// a response
MaxToolCalls int64 `json:"max_tool_calls"`
// (Optional) ID of the previous response in a conversation
PreviousResponseID string `json:"previous_response_id"`
// (Optional) Reference to a prompt template and its variables.
Prompt ResponseListResponsePrompt `json:"prompt"`
// (Optional) Sampling temperature used for generation
Temperature float64 `json:"temperature"`
// (Optional) An array of tools the model may call while generating a response.
Tools []ResponseListResponseToolUnion `json:"tools"`
// (Optional) Nucleus sampling parameter used for generation
TopP float64 `json:"top_p"`
// (Optional) Truncation strategy applied to the response
Truncation string `json:"truncation"`
// (Optional) Token usage information for the response
Usage ResponseListResponseUsage `json:"usage"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
Input respjson.Field
Model respjson.Field
Object respjson.Field
Output respjson.Field
ParallelToolCalls respjson.Field
Status respjson.Field
Text respjson.Field
Error respjson.Field
Instructions respjson.Field
MaxToolCalls respjson.Field
PreviousResponseID respjson.Field
Prompt respjson.Field
Temperature respjson.Field
Tools respjson.Field
TopP respjson.Field
Truncation respjson.Field
Usage respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
OpenAI response object extended with input context information.
func (ResponseListResponse) RawJSON ¶
func (r ResponseListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseListResponse) UnmarshalJSON ¶
func (r *ResponseListResponse) UnmarshalJSON(data []byte) error
type ResponseListResponseError ¶
type ResponseListResponseError struct {
// Error code identifying the type of failure
Code string `json:"code,required"`
// Human-readable error message describing the failure
Message string `json:"message,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Code respjson.Field
Message respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
(Optional) Error details if the response generation failed
func (ResponseListResponseError) RawJSON ¶
func (r ResponseListResponseError) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseListResponseError) UnmarshalJSON ¶
func (r *ResponseListResponseError) UnmarshalJSON(data []byte) error
type ResponseListResponseInputOpenAIResponseInputFunctionToolCallOutput ¶
type ResponseListResponseInputOpenAIResponseInputFunctionToolCallOutput struct {
CallID string `json:"call_id,required"`
Output string `json:"output,required"`
Type constant.FunctionCallOutput `json:"type,required"`
ID string `json:"id"`
Status string `json:"status"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CallID respjson.Field
Output respjson.Field
Type respjson.Field
ID respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
This represents the output of a function call that gets passed back to the model.
func (ResponseListResponseInputOpenAIResponseInputFunctionToolCallOutput) RawJSON ¶
func (r ResponseListResponseInputOpenAIResponseInputFunctionToolCallOutput) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseListResponseInputOpenAIResponseInputFunctionToolCallOutput) UnmarshalJSON ¶
func (r *ResponseListResponseInputOpenAIResponseInputFunctionToolCallOutput) UnmarshalJSON(data []byte) error
type ResponseListResponseInputOpenAIResponseMcpApprovalRequest ¶
type ResponseListResponseInputOpenAIResponseMcpApprovalRequest struct {
ID string `json:"id,required"`
Arguments string `json:"arguments,required"`
Name string `json:"name,required"`
ServerLabel string `json:"server_label,required"`
Type constant.McpApprovalRequest `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Arguments respjson.Field
Name respjson.Field
ServerLabel respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A request for human approval of a tool invocation.
func (ResponseListResponseInputOpenAIResponseMcpApprovalRequest) RawJSON ¶
func (r ResponseListResponseInputOpenAIResponseMcpApprovalRequest) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseListResponseInputOpenAIResponseMcpApprovalRequest) UnmarshalJSON ¶
func (r *ResponseListResponseInputOpenAIResponseMcpApprovalRequest) UnmarshalJSON(data []byte) error
type ResponseListResponseInputOpenAIResponseMcpApprovalResponse ¶
type ResponseListResponseInputOpenAIResponseMcpApprovalResponse struct {
ApprovalRequestID string `json:"approval_request_id,required"`
Approve bool `json:"approve,required"`
Type constant.McpApprovalResponse `json:"type,required"`
ID string `json:"id"`
Reason string `json:"reason"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ApprovalRequestID respjson.Field
Approve respjson.Field
Type respjson.Field
ID respjson.Field
Reason respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A response to an MCP approval request.
func (ResponseListResponseInputOpenAIResponseMcpApprovalResponse) RawJSON ¶
func (r ResponseListResponseInputOpenAIResponseMcpApprovalResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseListResponseInputOpenAIResponseMcpApprovalResponse) UnmarshalJSON ¶
func (r *ResponseListResponseInputOpenAIResponseMcpApprovalResponse) UnmarshalJSON(data []byte) error
type ResponseListResponseInputOpenAIResponseMessage ¶
type ResponseListResponseInputOpenAIResponseMessage struct {
Content ResponseListResponseInputOpenAIResponseMessageContentUnion `json:"content,required"`
// Any of "system", "developer", "user", "assistant".
Role ResponseListResponseInputOpenAIResponseMessageRole `json:"role,required"`
Type constant.Message `json:"type,required"`
ID string `json:"id"`
Status string `json:"status"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Content respjson.Field
Role respjson.Field
Type respjson.Field
ID respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Corresponds to the various Message types in the Responses API. They are all under one type because the Responses API gives them all the same "type" value, and there is no way to tell them apart in certain scenarios.
func (ResponseListResponseInputOpenAIResponseMessage) RawJSON ¶
func (r ResponseListResponseInputOpenAIResponseMessage) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseListResponseInputOpenAIResponseMessage) UnmarshalJSON ¶
func (r *ResponseListResponseInputOpenAIResponseMessage) UnmarshalJSON(data []byte) error
type ResponseListResponseInputOpenAIResponseMessageContentArrayItemDetail ¶
type ResponseListResponseInputOpenAIResponseMessageContentArrayItemDetail string
Level of detail for image processing, can be "low", "high", or "auto"
const ( ResponseListResponseInputOpenAIResponseMessageContentArrayItemDetailLow ResponseListResponseInputOpenAIResponseMessageContentArrayItemDetail = "low" ResponseListResponseInputOpenAIResponseMessageContentArrayItemDetailHigh ResponseListResponseInputOpenAIResponseMessageContentArrayItemDetail = "high" ResponseListResponseInputOpenAIResponseMessageContentArrayItemDetailAuto ResponseListResponseInputOpenAIResponseMessageContentArrayItemDetail = "auto" )
type ResponseListResponseInputOpenAIResponseMessageContentArrayItemInputFile ¶
type ResponseListResponseInputOpenAIResponseMessageContentArrayItemInputFile struct {
// The type of the input item. Always `input_file`.
Type constant.InputFile `json:"type,required"`
// The data of the file to be sent to the model.
FileData string `json:"file_data"`
// (Optional) The ID of the file to be sent to the model.
FileID string `json:"file_id"`
// The URL of the file to be sent to the model.
FileURL string `json:"file_url"`
// The name of the file to be sent to the model.
Filename string `json:"filename"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Type respjson.Field
FileData respjson.Field
FileID respjson.Field
FileURL respjson.Field
Filename respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
File content for input messages in OpenAI response format.
func (ResponseListResponseInputOpenAIResponseMessageContentArrayItemInputFile) RawJSON ¶
func (r ResponseListResponseInputOpenAIResponseMessageContentArrayItemInputFile) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseListResponseInputOpenAIResponseMessageContentArrayItemInputFile) UnmarshalJSON ¶
func (r *ResponseListResponseInputOpenAIResponseMessageContentArrayItemInputFile) UnmarshalJSON(data []byte) error
type ResponseListResponseInputOpenAIResponseMessageContentArrayItemInputImage ¶
type ResponseListResponseInputOpenAIResponseMessageContentArrayItemInputImage struct {
// Level of detail for image processing, can be "low", "high", or "auto"
//
// Any of "low", "high", "auto".
Detail ResponseListResponseInputOpenAIResponseMessageContentArrayItemInputImageDetail `json:"detail,required"`
// Content type identifier, always "input_image"
Type constant.InputImage `json:"type,required"`
// (Optional) The ID of the file to be sent to the model.
FileID string `json:"file_id"`
// (Optional) URL of the image content
ImageURL string `json:"image_url"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Detail respjson.Field
Type respjson.Field
FileID respjson.Field
ImageURL respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Image content for input messages in OpenAI response format.
func (ResponseListResponseInputOpenAIResponseMessageContentArrayItemInputImage) RawJSON ¶
func (r ResponseListResponseInputOpenAIResponseMessageContentArrayItemInputImage) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseListResponseInputOpenAIResponseMessageContentArrayItemInputImage) UnmarshalJSON ¶
func (r *ResponseListResponseInputOpenAIResponseMessageContentArrayItemInputImage) UnmarshalJSON(data []byte) error
type ResponseListResponseInputOpenAIResponseMessageContentArrayItemInputImageDetail ¶
type ResponseListResponseInputOpenAIResponseMessageContentArrayItemInputImageDetail string
Level of detail for image processing, can be "low", "high", or "auto"
const ( ResponseListResponseInputOpenAIResponseMessageContentArrayItemInputImageDetailLow ResponseListResponseInputOpenAIResponseMessageContentArrayItemInputImageDetail = "low" ResponseListResponseInputOpenAIResponseMessageContentArrayItemInputImageDetailHigh ResponseListResponseInputOpenAIResponseMessageContentArrayItemInputImageDetail = "high" ResponseListResponseInputOpenAIResponseMessageContentArrayItemInputImageDetailAuto ResponseListResponseInputOpenAIResponseMessageContentArrayItemInputImageDetail = "auto" )
type ResponseListResponseInputOpenAIResponseMessageContentArrayItemInputText ¶
type ResponseListResponseInputOpenAIResponseMessageContentArrayItemInputText struct {
// The text content of the input message
Text string `json:"text,required"`
// Content type identifier, always "input_text"
Type constant.InputText `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:"-"`
}
Text content for input messages in OpenAI response format.
func (ResponseListResponseInputOpenAIResponseMessageContentArrayItemInputText) RawJSON ¶
func (r ResponseListResponseInputOpenAIResponseMessageContentArrayItemInputText) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseListResponseInputOpenAIResponseMessageContentArrayItemInputText) UnmarshalJSON ¶
func (r *ResponseListResponseInputOpenAIResponseMessageContentArrayItemInputText) UnmarshalJSON(data []byte) error
type ResponseListResponseInputOpenAIResponseMessageContentArrayItemUnion ¶
type ResponseListResponseInputOpenAIResponseMessageContentArrayItemUnion struct {
// This field is from variant
// [ResponseListResponseInputOpenAIResponseMessageContentArrayItemInputText].
Text string `json:"text"`
// Any of "input_text", "input_image", "input_file".
Type string `json:"type"`
// This field is from variant
// [ResponseListResponseInputOpenAIResponseMessageContentArrayItemInputImage].
Detail ResponseListResponseInputOpenAIResponseMessageContentArrayItemInputImageDetail `json:"detail"`
FileID string `json:"file_id"`
// This field is from variant
// [ResponseListResponseInputOpenAIResponseMessageContentArrayItemInputImage].
ImageURL string `json:"image_url"`
// This field is from variant
// [ResponseListResponseInputOpenAIResponseMessageContentArrayItemInputFile].
FileData string `json:"file_data"`
// This field is from variant
// [ResponseListResponseInputOpenAIResponseMessageContentArrayItemInputFile].
FileURL string `json:"file_url"`
// This field is from variant
// [ResponseListResponseInputOpenAIResponseMessageContentArrayItemInputFile].
Filename string `json:"filename"`
JSON struct {
Text respjson.Field
Type respjson.Field
Detail respjson.Field
FileID respjson.Field
ImageURL respjson.Field
FileData respjson.Field
FileURL respjson.Field
Filename respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ResponseListResponseInputOpenAIResponseMessageContentArrayItemUnion contains all possible properties and values from ResponseListResponseInputOpenAIResponseMessageContentArrayItemInputText, ResponseListResponseInputOpenAIResponseMessageContentArrayItemInputImage, ResponseListResponseInputOpenAIResponseMessageContentArrayItemInputFile.
Use the ResponseListResponseInputOpenAIResponseMessageContentArrayItemUnion.AsAny method to switch on the variant.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (ResponseListResponseInputOpenAIResponseMessageContentArrayItemUnion) AsAny ¶
func (u ResponseListResponseInputOpenAIResponseMessageContentArrayItemUnion) AsAny() anyResponseListResponseInputOpenAIResponseMessageContentArrayItem
Use the following switch statement to find the correct variant
switch variant := ResponseListResponseInputOpenAIResponseMessageContentArrayItemUnion.AsAny().(type) {
case llamastackclient.ResponseListResponseInputOpenAIResponseMessageContentArrayItemInputText:
case llamastackclient.ResponseListResponseInputOpenAIResponseMessageContentArrayItemInputImage:
case llamastackclient.ResponseListResponseInputOpenAIResponseMessageContentArrayItemInputFile:
default:
fmt.Errorf("no variant present")
}
func (ResponseListResponseInputOpenAIResponseMessageContentArrayItemUnion) AsInputFile ¶
func (ResponseListResponseInputOpenAIResponseMessageContentArrayItemUnion) AsInputImage ¶
func (ResponseListResponseInputOpenAIResponseMessageContentArrayItemUnion) AsInputText ¶
func (ResponseListResponseInputOpenAIResponseMessageContentArrayItemUnion) RawJSON ¶
func (u ResponseListResponseInputOpenAIResponseMessageContentArrayItemUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseListResponseInputOpenAIResponseMessageContentArrayItemUnion) UnmarshalJSON ¶
func (r *ResponseListResponseInputOpenAIResponseMessageContentArrayItemUnion) UnmarshalJSON(data []byte) error
type ResponseListResponseInputOpenAIResponseMessageContentUnion ¶
type ResponseListResponseInputOpenAIResponseMessageContentUnion 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
// [[]ResponseListResponseInputOpenAIResponseMessageContentArrayItemUnion] instead
// of an object.
OfVariant2 []ResponseListResponseInputOpenAIResponseMessageContentArrayItemUnion `json:",inline"`
JSON struct {
OfString respjson.Field
OfVariant2 respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ResponseListResponseInputOpenAIResponseMessageContentUnion contains all possible properties and values from [string], [[]ResponseListResponseInputOpenAIResponseMessageContentArrayItemUnion], [[]ResponseListResponseInputOpenAIResponseMessageContentArrayItemUnion].
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 OfVariant2]
func (ResponseListResponseInputOpenAIResponseMessageContentUnion) AsResponseListResponseInputOpenAIResponseMessageContentArray ¶
func (u ResponseListResponseInputOpenAIResponseMessageContentUnion) AsResponseListResponseInputOpenAIResponseMessageContentArray() (v []ResponseListResponseInputOpenAIResponseMessageContentArrayItemUnion)
func (ResponseListResponseInputOpenAIResponseMessageContentUnion) AsString ¶
func (u ResponseListResponseInputOpenAIResponseMessageContentUnion) AsString() (v string)
func (ResponseListResponseInputOpenAIResponseMessageContentUnion) AsVariant2 ¶
func (ResponseListResponseInputOpenAIResponseMessageContentUnion) RawJSON ¶
func (u ResponseListResponseInputOpenAIResponseMessageContentUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseListResponseInputOpenAIResponseMessageContentUnion) UnmarshalJSON ¶
func (r *ResponseListResponseInputOpenAIResponseMessageContentUnion) UnmarshalJSON(data []byte) error
type ResponseListResponseInputOpenAIResponseMessageRole ¶
type ResponseListResponseInputOpenAIResponseMessageRole string
const ( ResponseListResponseInputOpenAIResponseMessageRoleSystem ResponseListResponseInputOpenAIResponseMessageRole = "system" ResponseListResponseInputOpenAIResponseMessageRoleDeveloper ResponseListResponseInputOpenAIResponseMessageRole = "developer" ResponseListResponseInputOpenAIResponseMessageRoleUser ResponseListResponseInputOpenAIResponseMessageRole = "user" ResponseListResponseInputOpenAIResponseMessageRoleAssistant ResponseListResponseInputOpenAIResponseMessageRole = "assistant" )
type ResponseListResponseInputOpenAIResponseOutputMessageFileSearchToolCall ¶
type ResponseListResponseInputOpenAIResponseOutputMessageFileSearchToolCall struct {
// Unique identifier for this tool call
ID string `json:"id,required"`
// List of search queries executed
Queries []string `json:"queries,required"`
// Current status of the file search operation
Status string `json:"status,required"`
// Tool call type identifier, always "file_search_call"
Type constant.FileSearchCall `json:"type,required"`
// (Optional) Search results returned by the file search operation
Results []ResponseListResponseInputOpenAIResponseOutputMessageFileSearchToolCallResult `json:"results"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Queries respjson.Field
Status respjson.Field
Type respjson.Field
Results respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
File search tool call output message for OpenAI responses.
func (ResponseListResponseInputOpenAIResponseOutputMessageFileSearchToolCall) RawJSON ¶
func (r ResponseListResponseInputOpenAIResponseOutputMessageFileSearchToolCall) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseListResponseInputOpenAIResponseOutputMessageFileSearchToolCall) UnmarshalJSON ¶
func (r *ResponseListResponseInputOpenAIResponseOutputMessageFileSearchToolCall) UnmarshalJSON(data []byte) error
type ResponseListResponseInputOpenAIResponseOutputMessageFileSearchToolCallResult ¶
type ResponseListResponseInputOpenAIResponseOutputMessageFileSearchToolCallResult struct {
// (Optional) Key-value attributes associated with the file
Attributes map[string]ResponseListResponseInputOpenAIResponseOutputMessageFileSearchToolCallResultAttributeUnion `json:"attributes,required"`
// Unique identifier of the file containing the result
FileID string `json:"file_id,required"`
// Name of the file containing the result
Filename string `json:"filename,required"`
// Relevance score for this search result (between 0 and 1)
Score float64 `json:"score,required"`
// Text content of the search result
Text string `json:"text,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Attributes respjson.Field
FileID respjson.Field
Filename respjson.Field
Score respjson.Field
Text respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Search results returned by the file search operation.
func (ResponseListResponseInputOpenAIResponseOutputMessageFileSearchToolCallResult) RawJSON ¶
func (r ResponseListResponseInputOpenAIResponseOutputMessageFileSearchToolCallResult) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseListResponseInputOpenAIResponseOutputMessageFileSearchToolCallResult) UnmarshalJSON ¶
func (r *ResponseListResponseInputOpenAIResponseOutputMessageFileSearchToolCallResult) UnmarshalJSON(data []byte) error
type ResponseListResponseInputOpenAIResponseOutputMessageFileSearchToolCallResultAttributeUnion ¶
type ResponseListResponseInputOpenAIResponseOutputMessageFileSearchToolCallResultAttributeUnion 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:"-"`
}
ResponseListResponseInputOpenAIResponseOutputMessageFileSearchToolCallResultAttributeUnion 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 (ResponseListResponseInputOpenAIResponseOutputMessageFileSearchToolCallResultAttributeUnion) AsAnyArray ¶
func (u ResponseListResponseInputOpenAIResponseOutputMessageFileSearchToolCallResultAttributeUnion) AsAnyArray() (v []any)
func (ResponseListResponseInputOpenAIResponseOutputMessageFileSearchToolCallResultAttributeUnion) AsBool ¶
func (ResponseListResponseInputOpenAIResponseOutputMessageFileSearchToolCallResultAttributeUnion) AsFloat ¶
func (ResponseListResponseInputOpenAIResponseOutputMessageFileSearchToolCallResultAttributeUnion) AsString ¶
func (u ResponseListResponseInputOpenAIResponseOutputMessageFileSearchToolCallResultAttributeUnion) AsString() (v string)
func (ResponseListResponseInputOpenAIResponseOutputMessageFileSearchToolCallResultAttributeUnion) RawJSON ¶
func (u ResponseListResponseInputOpenAIResponseOutputMessageFileSearchToolCallResultAttributeUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseListResponseInputOpenAIResponseOutputMessageFileSearchToolCallResultAttributeUnion) UnmarshalJSON ¶
func (r *ResponseListResponseInputOpenAIResponseOutputMessageFileSearchToolCallResultAttributeUnion) UnmarshalJSON(data []byte) error
type ResponseListResponseInputOpenAIResponseOutputMessageFunctionToolCall ¶
type ResponseListResponseInputOpenAIResponseOutputMessageFunctionToolCall struct {
// JSON string containing the function arguments
Arguments string `json:"arguments,required"`
// Unique identifier for the function call
CallID string `json:"call_id,required"`
// Name of the function being called
Name string `json:"name,required"`
// Tool call type identifier, always "function_call"
Type constant.FunctionCall `json:"type,required"`
// (Optional) Additional identifier for the tool call
ID string `json:"id"`
// (Optional) Current status of the function call execution
Status string `json:"status"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Arguments respjson.Field
CallID respjson.Field
Name respjson.Field
Type respjson.Field
ID respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Function tool call output message for OpenAI responses.
func (ResponseListResponseInputOpenAIResponseOutputMessageFunctionToolCall) RawJSON ¶
func (r ResponseListResponseInputOpenAIResponseOutputMessageFunctionToolCall) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseListResponseInputOpenAIResponseOutputMessageFunctionToolCall) UnmarshalJSON ¶
func (r *ResponseListResponseInputOpenAIResponseOutputMessageFunctionToolCall) UnmarshalJSON(data []byte) error
type ResponseListResponseInputOpenAIResponseOutputMessageMcpCall ¶
type ResponseListResponseInputOpenAIResponseOutputMessageMcpCall struct {
// Unique identifier for this MCP call
ID string `json:"id,required"`
// JSON string containing the MCP call arguments
Arguments string `json:"arguments,required"`
// Name of the MCP method being called
Name string `json:"name,required"`
// Label identifying the MCP server handling the call
ServerLabel string `json:"server_label,required"`
// Tool call type identifier, always "mcp_call"
Type constant.McpCall `json:"type,required"`
// (Optional) Error message if the MCP call failed
Error string `json:"error"`
// (Optional) Output result from the successful MCP call
Output string `json:"output"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Arguments respjson.Field
Name respjson.Field
ServerLabel respjson.Field
Type respjson.Field
Error respjson.Field
Output respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Model Context Protocol (MCP) call output message for OpenAI responses.
func (ResponseListResponseInputOpenAIResponseOutputMessageMcpCall) RawJSON ¶
func (r ResponseListResponseInputOpenAIResponseOutputMessageMcpCall) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseListResponseInputOpenAIResponseOutputMessageMcpCall) UnmarshalJSON ¶
func (r *ResponseListResponseInputOpenAIResponseOutputMessageMcpCall) UnmarshalJSON(data []byte) error
type ResponseListResponseInputOpenAIResponseOutputMessageMcpListTools ¶
type ResponseListResponseInputOpenAIResponseOutputMessageMcpListTools struct {
// Unique identifier for this MCP list tools operation
ID string `json:"id,required"`
// Label identifying the MCP server providing the tools
ServerLabel string `json:"server_label,required"`
// List of available tools provided by the MCP server
Tools []ResponseListResponseInputOpenAIResponseOutputMessageMcpListToolsTool `json:"tools,required"`
// Tool call type identifier, always "mcp_list_tools"
Type constant.McpListTools `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
ServerLabel respjson.Field
Tools respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
MCP list tools output message containing available tools from an MCP server.
func (ResponseListResponseInputOpenAIResponseOutputMessageMcpListTools) RawJSON ¶
func (r ResponseListResponseInputOpenAIResponseOutputMessageMcpListTools) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseListResponseInputOpenAIResponseOutputMessageMcpListTools) UnmarshalJSON ¶
func (r *ResponseListResponseInputOpenAIResponseOutputMessageMcpListTools) UnmarshalJSON(data []byte) error
type ResponseListResponseInputOpenAIResponseOutputMessageMcpListToolsTool ¶
type ResponseListResponseInputOpenAIResponseOutputMessageMcpListToolsTool struct {
// JSON schema defining the tool's input parameters
InputSchema map[string]ResponseListResponseInputOpenAIResponseOutputMessageMcpListToolsToolInputSchemaUnion `json:"input_schema,required"`
// Name of the tool
Name string `json:"name,required"`
// (Optional) Description of what the tool does
Description string `json:"description"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
InputSchema respjson.Field
Name respjson.Field
Description respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Tool definition returned by MCP list tools operation.
func (ResponseListResponseInputOpenAIResponseOutputMessageMcpListToolsTool) RawJSON ¶
func (r ResponseListResponseInputOpenAIResponseOutputMessageMcpListToolsTool) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseListResponseInputOpenAIResponseOutputMessageMcpListToolsTool) UnmarshalJSON ¶
func (r *ResponseListResponseInputOpenAIResponseOutputMessageMcpListToolsTool) UnmarshalJSON(data []byte) error
type ResponseListResponseInputOpenAIResponseOutputMessageMcpListToolsToolInputSchemaUnion ¶
type ResponseListResponseInputOpenAIResponseOutputMessageMcpListToolsToolInputSchemaUnion 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:"-"`
}
ResponseListResponseInputOpenAIResponseOutputMessageMcpListToolsToolInputSchemaUnion 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 (ResponseListResponseInputOpenAIResponseOutputMessageMcpListToolsToolInputSchemaUnion) AsAnyArray ¶
func (u ResponseListResponseInputOpenAIResponseOutputMessageMcpListToolsToolInputSchemaUnion) AsAnyArray() (v []any)
func (ResponseListResponseInputOpenAIResponseOutputMessageMcpListToolsToolInputSchemaUnion) AsBool ¶
func (u ResponseListResponseInputOpenAIResponseOutputMessageMcpListToolsToolInputSchemaUnion) AsBool() (v bool)
func (ResponseListResponseInputOpenAIResponseOutputMessageMcpListToolsToolInputSchemaUnion) AsFloat ¶
func (u ResponseListResponseInputOpenAIResponseOutputMessageMcpListToolsToolInputSchemaUnion) AsFloat() (v float64)
func (ResponseListResponseInputOpenAIResponseOutputMessageMcpListToolsToolInputSchemaUnion) AsString ¶
func (u ResponseListResponseInputOpenAIResponseOutputMessageMcpListToolsToolInputSchemaUnion) AsString() (v string)
func (ResponseListResponseInputOpenAIResponseOutputMessageMcpListToolsToolInputSchemaUnion) RawJSON ¶
func (u ResponseListResponseInputOpenAIResponseOutputMessageMcpListToolsToolInputSchemaUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseListResponseInputOpenAIResponseOutputMessageMcpListToolsToolInputSchemaUnion) UnmarshalJSON ¶
func (r *ResponseListResponseInputOpenAIResponseOutputMessageMcpListToolsToolInputSchemaUnion) UnmarshalJSON(data []byte) error
type ResponseListResponseInputOpenAIResponseOutputMessageWebSearchToolCall ¶
type ResponseListResponseInputOpenAIResponseOutputMessageWebSearchToolCall struct {
// Unique identifier for this tool call
ID string `json:"id,required"`
// Current status of the web search operation
Status string `json:"status,required"`
// Tool call type identifier, always "web_search_call"
Type constant.WebSearchCall `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Status respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Web search tool call output message for OpenAI responses.
func (ResponseListResponseInputOpenAIResponseOutputMessageWebSearchToolCall) RawJSON ¶
func (r ResponseListResponseInputOpenAIResponseOutputMessageWebSearchToolCall) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseListResponseInputOpenAIResponseOutputMessageWebSearchToolCall) UnmarshalJSON ¶
func (r *ResponseListResponseInputOpenAIResponseOutputMessageWebSearchToolCall) UnmarshalJSON(data []byte) error
type ResponseListResponseInputRole ¶
type ResponseListResponseInputRole string
const ( ResponseListResponseInputRoleSystem ResponseListResponseInputRole = "system" ResponseListResponseInputRoleDeveloper ResponseListResponseInputRole = "developer" ResponseListResponseInputRoleUser ResponseListResponseInputRole = "user" ResponseListResponseInputRoleAssistant ResponseListResponseInputRole = "assistant" )
type ResponseListResponseInputUnion ¶
type ResponseListResponseInputUnion struct {
// This field is from variant [ResponseListResponseInputOpenAIResponseMessage].
Content ResponseListResponseInputOpenAIResponseMessageContentUnion `json:"content"`
// This field is from variant [ResponseListResponseInputOpenAIResponseMessage].
Role ResponseListResponseInputOpenAIResponseMessageRole `json:"role"`
Type string `json:"type"`
ID string `json:"id"`
Status string `json:"status"`
// This field is from variant
// [ResponseListResponseInputOpenAIResponseOutputMessageFileSearchToolCall].
Queries []string `json:"queries"`
// This field is from variant
// [ResponseListResponseInputOpenAIResponseOutputMessageFileSearchToolCall].
Results []ResponseListResponseInputOpenAIResponseOutputMessageFileSearchToolCallResult `json:"results"`
Arguments string `json:"arguments"`
CallID string `json:"call_id"`
Name string `json:"name"`
ServerLabel string `json:"server_label"`
// This field is from variant
// [ResponseListResponseInputOpenAIResponseOutputMessageMcpCall].
Error string `json:"error"`
Output string `json:"output"`
// This field is from variant
// [ResponseListResponseInputOpenAIResponseOutputMessageMcpListTools].
Tools []ResponseListResponseInputOpenAIResponseOutputMessageMcpListToolsTool `json:"tools"`
// This field is from variant
// [ResponseListResponseInputOpenAIResponseMcpApprovalResponse].
ApprovalRequestID string `json:"approval_request_id"`
// This field is from variant
// [ResponseListResponseInputOpenAIResponseMcpApprovalResponse].
Approve bool `json:"approve"`
// This field is from variant
// [ResponseListResponseInputOpenAIResponseMcpApprovalResponse].
Reason string `json:"reason"`
JSON struct {
Content respjson.Field
Role respjson.Field
Type respjson.Field
ID respjson.Field
Status respjson.Field
Queries respjson.Field
Results respjson.Field
Arguments respjson.Field
CallID respjson.Field
Name respjson.Field
ServerLabel respjson.Field
Error respjson.Field
Output respjson.Field
Tools respjson.Field
ApprovalRequestID respjson.Field
Approve respjson.Field
Reason respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ResponseListResponseInputUnion contains all possible properties and values from ResponseListResponseInputOpenAIResponseMessage, ResponseListResponseInputOpenAIResponseOutputMessageWebSearchToolCall, ResponseListResponseInputOpenAIResponseOutputMessageFileSearchToolCall, ResponseListResponseInputOpenAIResponseOutputMessageFunctionToolCall, ResponseListResponseInputOpenAIResponseOutputMessageMcpCall, ResponseListResponseInputOpenAIResponseOutputMessageMcpListTools, ResponseListResponseInputOpenAIResponseMcpApprovalRequest, ResponseListResponseInputOpenAIResponseInputFunctionToolCallOutput, ResponseListResponseInputOpenAIResponseMcpApprovalResponse, ResponseListResponseInputOpenAIResponseMessage.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (ResponseListResponseInputUnion) AsOpenAIResponseInputFunctionToolCallOutput ¶
func (u ResponseListResponseInputUnion) AsOpenAIResponseInputFunctionToolCallOutput() (v ResponseListResponseInputOpenAIResponseInputFunctionToolCallOutput)
func (ResponseListResponseInputUnion) AsOpenAIResponseMcpApprovalRequest ¶
func (u ResponseListResponseInputUnion) AsOpenAIResponseMcpApprovalRequest() (v ResponseListResponseInputOpenAIResponseMcpApprovalRequest)
func (ResponseListResponseInputUnion) AsOpenAIResponseMcpApprovalResponse ¶
func (u ResponseListResponseInputUnion) AsOpenAIResponseMcpApprovalResponse() (v ResponseListResponseInputOpenAIResponseMcpApprovalResponse)
func (ResponseListResponseInputUnion) AsOpenAIResponseMessage ¶
func (u ResponseListResponseInputUnion) AsOpenAIResponseMessage() (v ResponseListResponseInputOpenAIResponseMessage)
func (ResponseListResponseInputUnion) AsOpenAIResponseOutputMessageFileSearchToolCall ¶
func (u ResponseListResponseInputUnion) AsOpenAIResponseOutputMessageFileSearchToolCall() (v ResponseListResponseInputOpenAIResponseOutputMessageFileSearchToolCall)
func (ResponseListResponseInputUnion) AsOpenAIResponseOutputMessageFunctionToolCall ¶
func (u ResponseListResponseInputUnion) AsOpenAIResponseOutputMessageFunctionToolCall() (v ResponseListResponseInputOpenAIResponseOutputMessageFunctionToolCall)
func (ResponseListResponseInputUnion) AsOpenAIResponseOutputMessageMcpCall ¶
func (u ResponseListResponseInputUnion) AsOpenAIResponseOutputMessageMcpCall() (v ResponseListResponseInputOpenAIResponseOutputMessageMcpCall)
func (ResponseListResponseInputUnion) AsOpenAIResponseOutputMessageMcpListTools ¶
func (u ResponseListResponseInputUnion) AsOpenAIResponseOutputMessageMcpListTools() (v ResponseListResponseInputOpenAIResponseOutputMessageMcpListTools)
func (ResponseListResponseInputUnion) AsOpenAIResponseOutputMessageWebSearchToolCall ¶
func (u ResponseListResponseInputUnion) AsOpenAIResponseOutputMessageWebSearchToolCall() (v ResponseListResponseInputOpenAIResponseOutputMessageWebSearchToolCall)
func (ResponseListResponseInputUnion) AsResponseListResponseInputOpenAIResponseMessage ¶
func (u ResponseListResponseInputUnion) AsResponseListResponseInputOpenAIResponseMessage() (v ResponseListResponseInputOpenAIResponseMessage)
func (ResponseListResponseInputUnion) RawJSON ¶
func (u ResponseListResponseInputUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseListResponseInputUnion) UnmarshalJSON ¶
func (r *ResponseListResponseInputUnion) UnmarshalJSON(data []byte) error
type ResponseListResponseOutputFileSearchCall ¶
type ResponseListResponseOutputFileSearchCall struct {
// Unique identifier for this tool call
ID string `json:"id,required"`
// List of search queries executed
Queries []string `json:"queries,required"`
// Current status of the file search operation
Status string `json:"status,required"`
// Tool call type identifier, always "file_search_call"
Type constant.FileSearchCall `json:"type,required"`
// (Optional) Search results returned by the file search operation
Results []ResponseListResponseOutputFileSearchCallResult `json:"results"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Queries respjson.Field
Status respjson.Field
Type respjson.Field
Results respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
File search tool call output message for OpenAI responses.
func (ResponseListResponseOutputFileSearchCall) RawJSON ¶
func (r ResponseListResponseOutputFileSearchCall) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseListResponseOutputFileSearchCall) UnmarshalJSON ¶
func (r *ResponseListResponseOutputFileSearchCall) UnmarshalJSON(data []byte) error
type ResponseListResponseOutputFileSearchCallResult ¶
type ResponseListResponseOutputFileSearchCallResult struct {
// (Optional) Key-value attributes associated with the file
Attributes map[string]ResponseListResponseOutputFileSearchCallResultAttributeUnion `json:"attributes,required"`
// Unique identifier of the file containing the result
FileID string `json:"file_id,required"`
// Name of the file containing the result
Filename string `json:"filename,required"`
// Relevance score for this search result (between 0 and 1)
Score float64 `json:"score,required"`
// Text content of the search result
Text string `json:"text,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Attributes respjson.Field
FileID respjson.Field
Filename respjson.Field
Score respjson.Field
Text respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Search results returned by the file search operation.
func (ResponseListResponseOutputFileSearchCallResult) RawJSON ¶
func (r ResponseListResponseOutputFileSearchCallResult) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseListResponseOutputFileSearchCallResult) UnmarshalJSON ¶
func (r *ResponseListResponseOutputFileSearchCallResult) UnmarshalJSON(data []byte) error
type ResponseListResponseOutputFileSearchCallResultAttributeUnion ¶
type ResponseListResponseOutputFileSearchCallResultAttributeUnion 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:"-"`
}
ResponseListResponseOutputFileSearchCallResultAttributeUnion 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 (ResponseListResponseOutputFileSearchCallResultAttributeUnion) AsAnyArray ¶
func (u ResponseListResponseOutputFileSearchCallResultAttributeUnion) AsAnyArray() (v []any)
func (ResponseListResponseOutputFileSearchCallResultAttributeUnion) AsBool ¶
func (u ResponseListResponseOutputFileSearchCallResultAttributeUnion) AsBool() (v bool)
func (ResponseListResponseOutputFileSearchCallResultAttributeUnion) AsFloat ¶
func (u ResponseListResponseOutputFileSearchCallResultAttributeUnion) AsFloat() (v float64)
func (ResponseListResponseOutputFileSearchCallResultAttributeUnion) AsString ¶
func (u ResponseListResponseOutputFileSearchCallResultAttributeUnion) AsString() (v string)
func (ResponseListResponseOutputFileSearchCallResultAttributeUnion) RawJSON ¶
func (u ResponseListResponseOutputFileSearchCallResultAttributeUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseListResponseOutputFileSearchCallResultAttributeUnion) UnmarshalJSON ¶
func (r *ResponseListResponseOutputFileSearchCallResultAttributeUnion) UnmarshalJSON(data []byte) error
type ResponseListResponseOutputFunctionCall ¶
type ResponseListResponseOutputFunctionCall struct {
// JSON string containing the function arguments
Arguments string `json:"arguments,required"`
// Unique identifier for the function call
CallID string `json:"call_id,required"`
// Name of the function being called
Name string `json:"name,required"`
// Tool call type identifier, always "function_call"
Type constant.FunctionCall `json:"type,required"`
// (Optional) Additional identifier for the tool call
ID string `json:"id"`
// (Optional) Current status of the function call execution
Status string `json:"status"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Arguments respjson.Field
CallID respjson.Field
Name respjson.Field
Type respjson.Field
ID respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Function tool call output message for OpenAI responses.
func (ResponseListResponseOutputFunctionCall) RawJSON ¶
func (r ResponseListResponseOutputFunctionCall) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseListResponseOutputFunctionCall) UnmarshalJSON ¶
func (r *ResponseListResponseOutputFunctionCall) UnmarshalJSON(data []byte) error
type ResponseListResponseOutputMcpApprovalRequest ¶
type ResponseListResponseOutputMcpApprovalRequest struct {
ID string `json:"id,required"`
Arguments string `json:"arguments,required"`
Name string `json:"name,required"`
ServerLabel string `json:"server_label,required"`
Type constant.McpApprovalRequest `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Arguments respjson.Field
Name respjson.Field
ServerLabel respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A request for human approval of a tool invocation.
func (ResponseListResponseOutputMcpApprovalRequest) RawJSON ¶
func (r ResponseListResponseOutputMcpApprovalRequest) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseListResponseOutputMcpApprovalRequest) UnmarshalJSON ¶
func (r *ResponseListResponseOutputMcpApprovalRequest) UnmarshalJSON(data []byte) error
type ResponseListResponseOutputMcpCall ¶
type ResponseListResponseOutputMcpCall struct {
// Unique identifier for this MCP call
ID string `json:"id,required"`
// JSON string containing the MCP call arguments
Arguments string `json:"arguments,required"`
// Name of the MCP method being called
Name string `json:"name,required"`
// Label identifying the MCP server handling the call
ServerLabel string `json:"server_label,required"`
// Tool call type identifier, always "mcp_call"
Type constant.McpCall `json:"type,required"`
// (Optional) Error message if the MCP call failed
Error string `json:"error"`
// (Optional) Output result from the successful MCP call
Output string `json:"output"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Arguments respjson.Field
Name respjson.Field
ServerLabel respjson.Field
Type respjson.Field
Error respjson.Field
Output respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Model Context Protocol (MCP) call output message for OpenAI responses.
func (ResponseListResponseOutputMcpCall) RawJSON ¶
func (r ResponseListResponseOutputMcpCall) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseListResponseOutputMcpCall) UnmarshalJSON ¶
func (r *ResponseListResponseOutputMcpCall) UnmarshalJSON(data []byte) error
type ResponseListResponseOutputMcpListTools ¶
type ResponseListResponseOutputMcpListTools struct {
// Unique identifier for this MCP list tools operation
ID string `json:"id,required"`
// Label identifying the MCP server providing the tools
ServerLabel string `json:"server_label,required"`
// List of available tools provided by the MCP server
Tools []ResponseListResponseOutputMcpListToolsTool `json:"tools,required"`
// Tool call type identifier, always "mcp_list_tools"
Type constant.McpListTools `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
ServerLabel respjson.Field
Tools respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
MCP list tools output message containing available tools from an MCP server.
func (ResponseListResponseOutputMcpListTools) RawJSON ¶
func (r ResponseListResponseOutputMcpListTools) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseListResponseOutputMcpListTools) UnmarshalJSON ¶
func (r *ResponseListResponseOutputMcpListTools) UnmarshalJSON(data []byte) error
type ResponseListResponseOutputMcpListToolsTool ¶
type ResponseListResponseOutputMcpListToolsTool struct {
// JSON schema defining the tool's input parameters
InputSchema map[string]ResponseListResponseOutputMcpListToolsToolInputSchemaUnion `json:"input_schema,required"`
// Name of the tool
Name string `json:"name,required"`
// (Optional) Description of what the tool does
Description string `json:"description"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
InputSchema respjson.Field
Name respjson.Field
Description respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Tool definition returned by MCP list tools operation.
func (ResponseListResponseOutputMcpListToolsTool) RawJSON ¶
func (r ResponseListResponseOutputMcpListToolsTool) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseListResponseOutputMcpListToolsTool) UnmarshalJSON ¶
func (r *ResponseListResponseOutputMcpListToolsTool) UnmarshalJSON(data []byte) error
type ResponseListResponseOutputMcpListToolsToolInputSchemaUnion ¶
type ResponseListResponseOutputMcpListToolsToolInputSchemaUnion 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:"-"`
}
ResponseListResponseOutputMcpListToolsToolInputSchemaUnion 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 (ResponseListResponseOutputMcpListToolsToolInputSchemaUnion) AsAnyArray ¶
func (u ResponseListResponseOutputMcpListToolsToolInputSchemaUnion) AsAnyArray() (v []any)
func (ResponseListResponseOutputMcpListToolsToolInputSchemaUnion) AsBool ¶
func (u ResponseListResponseOutputMcpListToolsToolInputSchemaUnion) AsBool() (v bool)
func (ResponseListResponseOutputMcpListToolsToolInputSchemaUnion) AsFloat ¶
func (u ResponseListResponseOutputMcpListToolsToolInputSchemaUnion) AsFloat() (v float64)
func (ResponseListResponseOutputMcpListToolsToolInputSchemaUnion) AsString ¶
func (u ResponseListResponseOutputMcpListToolsToolInputSchemaUnion) AsString() (v string)
func (ResponseListResponseOutputMcpListToolsToolInputSchemaUnion) RawJSON ¶
func (u ResponseListResponseOutputMcpListToolsToolInputSchemaUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseListResponseOutputMcpListToolsToolInputSchemaUnion) UnmarshalJSON ¶
func (r *ResponseListResponseOutputMcpListToolsToolInputSchemaUnion) UnmarshalJSON(data []byte) error
type ResponseListResponseOutputMessage ¶
type ResponseListResponseOutputMessage struct {
Content ResponseListResponseOutputMessageContentUnion `json:"content,required"`
// Any of "system", "developer", "user", "assistant".
Role ResponseListResponseOutputMessageRole `json:"role,required"`
Type constant.Message `json:"type,required"`
ID string `json:"id"`
Status string `json:"status"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Content respjson.Field
Role respjson.Field
Type respjson.Field
ID respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Corresponds to the various Message types in the Responses API. They are all under one type because the Responses API gives them all the same "type" value, and there is no way to tell them apart in certain scenarios.
func (ResponseListResponseOutputMessage) RawJSON ¶
func (r ResponseListResponseOutputMessage) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseListResponseOutputMessage) UnmarshalJSON ¶
func (r *ResponseListResponseOutputMessage) UnmarshalJSON(data []byte) error
type ResponseListResponseOutputMessageContentArrayItemDetail ¶
type ResponseListResponseOutputMessageContentArrayItemDetail string
Level of detail for image processing, can be "low", "high", or "auto"
const ( ResponseListResponseOutputMessageContentArrayItemDetailLow ResponseListResponseOutputMessageContentArrayItemDetail = "low" ResponseListResponseOutputMessageContentArrayItemDetailHigh ResponseListResponseOutputMessageContentArrayItemDetail = "high" ResponseListResponseOutputMessageContentArrayItemDetailAuto ResponseListResponseOutputMessageContentArrayItemDetail = "auto" )
type ResponseListResponseOutputMessageContentArrayItemInputFile ¶
type ResponseListResponseOutputMessageContentArrayItemInputFile struct {
// The type of the input item. Always `input_file`.
Type constant.InputFile `json:"type,required"`
// The data of the file to be sent to the model.
FileData string `json:"file_data"`
// (Optional) The ID of the file to be sent to the model.
FileID string `json:"file_id"`
// The URL of the file to be sent to the model.
FileURL string `json:"file_url"`
// The name of the file to be sent to the model.
Filename string `json:"filename"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Type respjson.Field
FileData respjson.Field
FileID respjson.Field
FileURL respjson.Field
Filename respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
File content for input messages in OpenAI response format.
func (ResponseListResponseOutputMessageContentArrayItemInputFile) RawJSON ¶
func (r ResponseListResponseOutputMessageContentArrayItemInputFile) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseListResponseOutputMessageContentArrayItemInputFile) UnmarshalJSON ¶
func (r *ResponseListResponseOutputMessageContentArrayItemInputFile) UnmarshalJSON(data []byte) error
type ResponseListResponseOutputMessageContentArrayItemInputImage ¶
type ResponseListResponseOutputMessageContentArrayItemInputImage struct {
// Level of detail for image processing, can be "low", "high", or "auto"
//
// Any of "low", "high", "auto".
Detail ResponseListResponseOutputMessageContentArrayItemInputImageDetail `json:"detail,required"`
// Content type identifier, always "input_image"
Type constant.InputImage `json:"type,required"`
// (Optional) The ID of the file to be sent to the model.
FileID string `json:"file_id"`
// (Optional) URL of the image content
ImageURL string `json:"image_url"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Detail respjson.Field
Type respjson.Field
FileID respjson.Field
ImageURL respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Image content for input messages in OpenAI response format.
func (ResponseListResponseOutputMessageContentArrayItemInputImage) RawJSON ¶
func (r ResponseListResponseOutputMessageContentArrayItemInputImage) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseListResponseOutputMessageContentArrayItemInputImage) UnmarshalJSON ¶
func (r *ResponseListResponseOutputMessageContentArrayItemInputImage) UnmarshalJSON(data []byte) error
type ResponseListResponseOutputMessageContentArrayItemInputImageDetail ¶
type ResponseListResponseOutputMessageContentArrayItemInputImageDetail string
Level of detail for image processing, can be "low", "high", or "auto"
const ( ResponseListResponseOutputMessageContentArrayItemInputImageDetailLow ResponseListResponseOutputMessageContentArrayItemInputImageDetail = "low" ResponseListResponseOutputMessageContentArrayItemInputImageDetailHigh ResponseListResponseOutputMessageContentArrayItemInputImageDetail = "high" ResponseListResponseOutputMessageContentArrayItemInputImageDetailAuto ResponseListResponseOutputMessageContentArrayItemInputImageDetail = "auto" )
type ResponseListResponseOutputMessageContentArrayItemInputText ¶
type ResponseListResponseOutputMessageContentArrayItemInputText struct {
// The text content of the input message
Text string `json:"text,required"`
// Content type identifier, always "input_text"
Type constant.InputText `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:"-"`
}
Text content for input messages in OpenAI response format.
func (ResponseListResponseOutputMessageContentArrayItemInputText) RawJSON ¶
func (r ResponseListResponseOutputMessageContentArrayItemInputText) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseListResponseOutputMessageContentArrayItemInputText) UnmarshalJSON ¶
func (r *ResponseListResponseOutputMessageContentArrayItemInputText) UnmarshalJSON(data []byte) error
type ResponseListResponseOutputMessageContentArrayItemUnion ¶
type ResponseListResponseOutputMessageContentArrayItemUnion struct {
// This field is from variant
// [ResponseListResponseOutputMessageContentArrayItemInputText].
Text string `json:"text"`
// Any of "input_text", "input_image", "input_file".
Type string `json:"type"`
// This field is from variant
// [ResponseListResponseOutputMessageContentArrayItemInputImage].
Detail ResponseListResponseOutputMessageContentArrayItemInputImageDetail `json:"detail"`
FileID string `json:"file_id"`
// This field is from variant
// [ResponseListResponseOutputMessageContentArrayItemInputImage].
ImageURL string `json:"image_url"`
// This field is from variant
// [ResponseListResponseOutputMessageContentArrayItemInputFile].
FileData string `json:"file_data"`
// This field is from variant
// [ResponseListResponseOutputMessageContentArrayItemInputFile].
FileURL string `json:"file_url"`
// This field is from variant
// [ResponseListResponseOutputMessageContentArrayItemInputFile].
Filename string `json:"filename"`
JSON struct {
Text respjson.Field
Type respjson.Field
Detail respjson.Field
FileID respjson.Field
ImageURL respjson.Field
FileData respjson.Field
FileURL respjson.Field
Filename respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ResponseListResponseOutputMessageContentArrayItemUnion contains all possible properties and values from ResponseListResponseOutputMessageContentArrayItemInputText, ResponseListResponseOutputMessageContentArrayItemInputImage, ResponseListResponseOutputMessageContentArrayItemInputFile.
Use the ResponseListResponseOutputMessageContentArrayItemUnion.AsAny method to switch on the variant.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (ResponseListResponseOutputMessageContentArrayItemUnion) AsAny ¶
func (u ResponseListResponseOutputMessageContentArrayItemUnion) AsAny() anyResponseListResponseOutputMessageContentArrayItem
Use the following switch statement to find the correct variant
switch variant := ResponseListResponseOutputMessageContentArrayItemUnion.AsAny().(type) {
case llamastackclient.ResponseListResponseOutputMessageContentArrayItemInputText:
case llamastackclient.ResponseListResponseOutputMessageContentArrayItemInputImage:
case llamastackclient.ResponseListResponseOutputMessageContentArrayItemInputFile:
default:
fmt.Errorf("no variant present")
}
func (ResponseListResponseOutputMessageContentArrayItemUnion) AsInputFile ¶
func (u ResponseListResponseOutputMessageContentArrayItemUnion) AsInputFile() (v ResponseListResponseOutputMessageContentArrayItemInputFile)
func (ResponseListResponseOutputMessageContentArrayItemUnion) AsInputImage ¶
func (u ResponseListResponseOutputMessageContentArrayItemUnion) AsInputImage() (v ResponseListResponseOutputMessageContentArrayItemInputImage)
func (ResponseListResponseOutputMessageContentArrayItemUnion) AsInputText ¶
func (u ResponseListResponseOutputMessageContentArrayItemUnion) AsInputText() (v ResponseListResponseOutputMessageContentArrayItemInputText)
func (ResponseListResponseOutputMessageContentArrayItemUnion) RawJSON ¶
func (u ResponseListResponseOutputMessageContentArrayItemUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseListResponseOutputMessageContentArrayItemUnion) UnmarshalJSON ¶
func (r *ResponseListResponseOutputMessageContentArrayItemUnion) UnmarshalJSON(data []byte) error
type ResponseListResponseOutputMessageContentUnion ¶
type ResponseListResponseOutputMessageContentUnion 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
// [[]ResponseListResponseOutputMessageContentArrayItemUnion] instead of an object.
OfVariant2 []ResponseListResponseOutputMessageContentArrayItemUnion `json:",inline"`
JSON struct {
OfString respjson.Field
OfVariant2 respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ResponseListResponseOutputMessageContentUnion contains all possible properties and values from [string], [[]ResponseListResponseOutputMessageContentArrayItemUnion], [[]ResponseListResponseOutputMessageContentArrayItemUnion].
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 OfVariant2]
func (ResponseListResponseOutputMessageContentUnion) AsResponseListResponseOutputMessageContentArray ¶
func (u ResponseListResponseOutputMessageContentUnion) AsResponseListResponseOutputMessageContentArray() (v []ResponseListResponseOutputMessageContentArrayItemUnion)
func (ResponseListResponseOutputMessageContentUnion) AsString ¶
func (u ResponseListResponseOutputMessageContentUnion) AsString() (v string)
func (ResponseListResponseOutputMessageContentUnion) AsVariant2 ¶
func (u ResponseListResponseOutputMessageContentUnion) AsVariant2() (v []ResponseListResponseOutputMessageContentArrayItemUnion)
func (ResponseListResponseOutputMessageContentUnion) RawJSON ¶
func (u ResponseListResponseOutputMessageContentUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseListResponseOutputMessageContentUnion) UnmarshalJSON ¶
func (r *ResponseListResponseOutputMessageContentUnion) UnmarshalJSON(data []byte) error
type ResponseListResponseOutputMessageRole ¶
type ResponseListResponseOutputMessageRole string
const ( ResponseListResponseOutputMessageRoleSystem ResponseListResponseOutputMessageRole = "system" ResponseListResponseOutputMessageRoleDeveloper ResponseListResponseOutputMessageRole = "developer" ResponseListResponseOutputMessageRoleUser ResponseListResponseOutputMessageRole = "user" ResponseListResponseOutputMessageRoleAssistant ResponseListResponseOutputMessageRole = "assistant" )
type ResponseListResponseOutputRole ¶
type ResponseListResponseOutputRole string
const ( ResponseListResponseOutputRoleSystem ResponseListResponseOutputRole = "system" ResponseListResponseOutputRoleDeveloper ResponseListResponseOutputRole = "developer" ResponseListResponseOutputRoleUser ResponseListResponseOutputRole = "user" ResponseListResponseOutputRoleAssistant ResponseListResponseOutputRole = "assistant" )
type ResponseListResponseOutputUnion ¶
type ResponseListResponseOutputUnion struct {
// This field is from variant [ResponseListResponseOutputMessage].
Content ResponseListResponseOutputMessageContentUnion `json:"content"`
// This field is from variant [ResponseListResponseOutputMessage].
Role ResponseListResponseOutputMessageRole `json:"role"`
// Any of "message", "web_search_call", "file_search_call", "function_call",
// "mcp_call", "mcp_list_tools", "mcp_approval_request".
Type string `json:"type"`
ID string `json:"id"`
Status string `json:"status"`
// This field is from variant [ResponseListResponseOutputFileSearchCall].
Queries []string `json:"queries"`
// This field is from variant [ResponseListResponseOutputFileSearchCall].
Results []ResponseListResponseOutputFileSearchCallResult `json:"results"`
Arguments string `json:"arguments"`
// This field is from variant [ResponseListResponseOutputFunctionCall].
CallID string `json:"call_id"`
Name string `json:"name"`
ServerLabel string `json:"server_label"`
// This field is from variant [ResponseListResponseOutputMcpCall].
Error string `json:"error"`
// This field is from variant [ResponseListResponseOutputMcpCall].
Output string `json:"output"`
// This field is from variant [ResponseListResponseOutputMcpListTools].
Tools []ResponseListResponseOutputMcpListToolsTool `json:"tools"`
JSON struct {
Content respjson.Field
Role respjson.Field
Type respjson.Field
ID respjson.Field
Status respjson.Field
Queries respjson.Field
Results respjson.Field
Arguments respjson.Field
CallID respjson.Field
Name respjson.Field
ServerLabel respjson.Field
Error respjson.Field
Output respjson.Field
Tools respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ResponseListResponseOutputUnion contains all possible properties and values from ResponseListResponseOutputMessage, ResponseListResponseOutputWebSearchCall, ResponseListResponseOutputFileSearchCall, ResponseListResponseOutputFunctionCall, ResponseListResponseOutputMcpCall, ResponseListResponseOutputMcpListTools, ResponseListResponseOutputMcpApprovalRequest.
Use the ResponseListResponseOutputUnion.AsAny method to switch on the variant.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (ResponseListResponseOutputUnion) AsAny ¶
func (u ResponseListResponseOutputUnion) AsAny() anyResponseListResponseOutput
Use the following switch statement to find the correct variant
switch variant := ResponseListResponseOutputUnion.AsAny().(type) {
case llamastackclient.ResponseListResponseOutputMessage:
case llamastackclient.ResponseListResponseOutputWebSearchCall:
case llamastackclient.ResponseListResponseOutputFileSearchCall:
case llamastackclient.ResponseListResponseOutputFunctionCall:
case llamastackclient.ResponseListResponseOutputMcpCall:
case llamastackclient.ResponseListResponseOutputMcpListTools:
case llamastackclient.ResponseListResponseOutputMcpApprovalRequest:
default:
fmt.Errorf("no variant present")
}
func (ResponseListResponseOutputUnion) AsFileSearchCall ¶
func (u ResponseListResponseOutputUnion) AsFileSearchCall() (v ResponseListResponseOutputFileSearchCall)
func (ResponseListResponseOutputUnion) AsFunctionCall ¶
func (u ResponseListResponseOutputUnion) AsFunctionCall() (v ResponseListResponseOutputFunctionCall)
func (ResponseListResponseOutputUnion) AsMcpApprovalRequest ¶
func (u ResponseListResponseOutputUnion) AsMcpApprovalRequest() (v ResponseListResponseOutputMcpApprovalRequest)
func (ResponseListResponseOutputUnion) AsMcpCall ¶
func (u ResponseListResponseOutputUnion) AsMcpCall() (v ResponseListResponseOutputMcpCall)
func (ResponseListResponseOutputUnion) AsMcpListTools ¶
func (u ResponseListResponseOutputUnion) AsMcpListTools() (v ResponseListResponseOutputMcpListTools)
func (ResponseListResponseOutputUnion) AsMessage ¶
func (u ResponseListResponseOutputUnion) AsMessage() (v ResponseListResponseOutputMessage)
func (ResponseListResponseOutputUnion) AsWebSearchCall ¶
func (u ResponseListResponseOutputUnion) AsWebSearchCall() (v ResponseListResponseOutputWebSearchCall)
func (ResponseListResponseOutputUnion) RawJSON ¶
func (u ResponseListResponseOutputUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseListResponseOutputUnion) UnmarshalJSON ¶
func (r *ResponseListResponseOutputUnion) UnmarshalJSON(data []byte) error
type ResponseListResponseOutputWebSearchCall ¶
type ResponseListResponseOutputWebSearchCall struct {
// Unique identifier for this tool call
ID string `json:"id,required"`
// Current status of the web search operation
Status string `json:"status,required"`
// Tool call type identifier, always "web_search_call"
Type constant.WebSearchCall `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Status respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Web search tool call output message for OpenAI responses.
func (ResponseListResponseOutputWebSearchCall) RawJSON ¶
func (r ResponseListResponseOutputWebSearchCall) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseListResponseOutputWebSearchCall) UnmarshalJSON ¶
func (r *ResponseListResponseOutputWebSearchCall) UnmarshalJSON(data []byte) error
type ResponseListResponsePrompt ¶
type ResponseListResponsePrompt struct {
// Unique identifier of the prompt template
ID string `json:"id,required"`
// Dictionary of variable names to OpenAIResponseInputMessageContent structure for
// template substitution. The substitution values can either be strings, or other
// Response input types like images or files.
Variables map[string]ResponseListResponsePromptVariableUnion `json:"variables"`
// Version number of the prompt to use (defaults to latest if not specified)
Version string `json:"version"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Variables respjson.Field
Version respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
(Optional) Reference to a prompt template and its variables.
func (ResponseListResponsePrompt) RawJSON ¶
func (r ResponseListResponsePrompt) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseListResponsePrompt) UnmarshalJSON ¶
func (r *ResponseListResponsePrompt) UnmarshalJSON(data []byte) error
type ResponseListResponsePromptVariableDetail ¶
type ResponseListResponsePromptVariableDetail string
Level of detail for image processing, can be "low", "high", or "auto"
const ( ResponseListResponsePromptVariableDetailLow ResponseListResponsePromptVariableDetail = "low" ResponseListResponsePromptVariableDetailHigh ResponseListResponsePromptVariableDetail = "high" ResponseListResponsePromptVariableDetailAuto ResponseListResponsePromptVariableDetail = "auto" )
type ResponseListResponsePromptVariableInputFile ¶
type ResponseListResponsePromptVariableInputFile struct {
// The type of the input item. Always `input_file`.
Type constant.InputFile `json:"type,required"`
// The data of the file to be sent to the model.
FileData string `json:"file_data"`
// (Optional) The ID of the file to be sent to the model.
FileID string `json:"file_id"`
// The URL of the file to be sent to the model.
FileURL string `json:"file_url"`
// The name of the file to be sent to the model.
Filename string `json:"filename"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Type respjson.Field
FileData respjson.Field
FileID respjson.Field
FileURL respjson.Field
Filename respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
File content for input messages in OpenAI response format.
func (ResponseListResponsePromptVariableInputFile) RawJSON ¶
func (r ResponseListResponsePromptVariableInputFile) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseListResponsePromptVariableInputFile) UnmarshalJSON ¶
func (r *ResponseListResponsePromptVariableInputFile) UnmarshalJSON(data []byte) error
type ResponseListResponsePromptVariableInputImage ¶
type ResponseListResponsePromptVariableInputImage struct {
// Level of detail for image processing, can be "low", "high", or "auto"
//
// Any of "low", "high", "auto".
Detail ResponseListResponsePromptVariableInputImageDetail `json:"detail,required"`
// Content type identifier, always "input_image"
Type constant.InputImage `json:"type,required"`
// (Optional) The ID of the file to be sent to the model.
FileID string `json:"file_id"`
// (Optional) URL of the image content
ImageURL string `json:"image_url"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Detail respjson.Field
Type respjson.Field
FileID respjson.Field
ImageURL respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Image content for input messages in OpenAI response format.
func (ResponseListResponsePromptVariableInputImage) RawJSON ¶
func (r ResponseListResponsePromptVariableInputImage) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseListResponsePromptVariableInputImage) UnmarshalJSON ¶
func (r *ResponseListResponsePromptVariableInputImage) UnmarshalJSON(data []byte) error
type ResponseListResponsePromptVariableInputImageDetail ¶
type ResponseListResponsePromptVariableInputImageDetail string
Level of detail for image processing, can be "low", "high", or "auto"
const ( ResponseListResponsePromptVariableInputImageDetailLow ResponseListResponsePromptVariableInputImageDetail = "low" ResponseListResponsePromptVariableInputImageDetailHigh ResponseListResponsePromptVariableInputImageDetail = "high" ResponseListResponsePromptVariableInputImageDetailAuto ResponseListResponsePromptVariableInputImageDetail = "auto" )
type ResponseListResponsePromptVariableInputText ¶
type ResponseListResponsePromptVariableInputText struct {
// The text content of the input message
Text string `json:"text,required"`
// Content type identifier, always "input_text"
Type constant.InputText `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:"-"`
}
Text content for input messages in OpenAI response format.
func (ResponseListResponsePromptVariableInputText) RawJSON ¶
func (r ResponseListResponsePromptVariableInputText) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseListResponsePromptVariableInputText) UnmarshalJSON ¶
func (r *ResponseListResponsePromptVariableInputText) UnmarshalJSON(data []byte) error
type ResponseListResponsePromptVariableUnion ¶
type ResponseListResponsePromptVariableUnion struct {
// This field is from variant [ResponseListResponsePromptVariableInputText].
Text string `json:"text"`
// Any of "input_text", "input_image", "input_file".
Type string `json:"type"`
// This field is from variant [ResponseListResponsePromptVariableInputImage].
Detail ResponseListResponsePromptVariableInputImageDetail `json:"detail"`
FileID string `json:"file_id"`
// This field is from variant [ResponseListResponsePromptVariableInputImage].
ImageURL string `json:"image_url"`
// This field is from variant [ResponseListResponsePromptVariableInputFile].
FileData string `json:"file_data"`
// This field is from variant [ResponseListResponsePromptVariableInputFile].
FileURL string `json:"file_url"`
// This field is from variant [ResponseListResponsePromptVariableInputFile].
Filename string `json:"filename"`
JSON struct {
Text respjson.Field
Type respjson.Field
Detail respjson.Field
FileID respjson.Field
ImageURL respjson.Field
FileData respjson.Field
FileURL respjson.Field
Filename respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ResponseListResponsePromptVariableUnion contains all possible properties and values from ResponseListResponsePromptVariableInputText, ResponseListResponsePromptVariableInputImage, ResponseListResponsePromptVariableInputFile.
Use the ResponseListResponsePromptVariableUnion.AsAny method to switch on the variant.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (ResponseListResponsePromptVariableUnion) AsAny ¶
func (u ResponseListResponsePromptVariableUnion) AsAny() anyResponseListResponsePromptVariable
Use the following switch statement to find the correct variant
switch variant := ResponseListResponsePromptVariableUnion.AsAny().(type) {
case llamastackclient.ResponseListResponsePromptVariableInputText:
case llamastackclient.ResponseListResponsePromptVariableInputImage:
case llamastackclient.ResponseListResponsePromptVariableInputFile:
default:
fmt.Errorf("no variant present")
}
func (ResponseListResponsePromptVariableUnion) AsInputFile ¶
func (u ResponseListResponsePromptVariableUnion) AsInputFile() (v ResponseListResponsePromptVariableInputFile)
func (ResponseListResponsePromptVariableUnion) AsInputImage ¶
func (u ResponseListResponsePromptVariableUnion) AsInputImage() (v ResponseListResponsePromptVariableInputImage)
func (ResponseListResponsePromptVariableUnion) AsInputText ¶
func (u ResponseListResponsePromptVariableUnion) AsInputText() (v ResponseListResponsePromptVariableInputText)
func (ResponseListResponsePromptVariableUnion) RawJSON ¶
func (u ResponseListResponsePromptVariableUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseListResponsePromptVariableUnion) UnmarshalJSON ¶
func (r *ResponseListResponsePromptVariableUnion) UnmarshalJSON(data []byte) error
type ResponseListResponseText ¶
type ResponseListResponseText struct {
// (Optional) Text format configuration specifying output format requirements
Format ResponseListResponseTextFormat `json:"format"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Format respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Text formatting configuration for the response
func (ResponseListResponseText) RawJSON ¶
func (r ResponseListResponseText) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseListResponseText) UnmarshalJSON ¶
func (r *ResponseListResponseText) UnmarshalJSON(data []byte) error
type ResponseListResponseTextFormat ¶
type ResponseListResponseTextFormat struct {
// Must be "text", "json_schema", or "json_object" to identify the format type
//
// Any of "text", "json_schema", "json_object".
Type ResponseListResponseTextFormatType `json:"type,required"`
// (Optional) A description of the response format. Only used for json_schema.
Description string `json:"description"`
// The name of the response format. Only used for json_schema.
Name string `json:"name"`
// The JSON schema the response should conform to. In a Python SDK, this is often a
// `pydantic` model. Only used for json_schema.
Schema map[string]ResponseListResponseTextFormatSchemaUnion `json:"schema"`
// (Optional) Whether to strictly enforce the JSON schema. If true, the response
// must match the schema exactly. Only used for json_schema.
Strict bool `json:"strict"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Type respjson.Field
Description respjson.Field
Name respjson.Field
Schema respjson.Field
Strict respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
(Optional) Text format configuration specifying output format requirements
func (ResponseListResponseTextFormat) RawJSON ¶
func (r ResponseListResponseTextFormat) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseListResponseTextFormat) UnmarshalJSON ¶
func (r *ResponseListResponseTextFormat) UnmarshalJSON(data []byte) error
type ResponseListResponseTextFormatSchemaUnion ¶
type ResponseListResponseTextFormatSchemaUnion 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:"-"`
}
ResponseListResponseTextFormatSchemaUnion 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 (ResponseListResponseTextFormatSchemaUnion) AsAnyArray ¶
func (u ResponseListResponseTextFormatSchemaUnion) AsAnyArray() (v []any)
func (ResponseListResponseTextFormatSchemaUnion) AsBool ¶
func (u ResponseListResponseTextFormatSchemaUnion) AsBool() (v bool)
func (ResponseListResponseTextFormatSchemaUnion) AsFloat ¶
func (u ResponseListResponseTextFormatSchemaUnion) AsFloat() (v float64)
func (ResponseListResponseTextFormatSchemaUnion) AsString ¶
func (u ResponseListResponseTextFormatSchemaUnion) AsString() (v string)
func (ResponseListResponseTextFormatSchemaUnion) RawJSON ¶
func (u ResponseListResponseTextFormatSchemaUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseListResponseTextFormatSchemaUnion) UnmarshalJSON ¶
func (r *ResponseListResponseTextFormatSchemaUnion) UnmarshalJSON(data []byte) error
type ResponseListResponseTextFormatType ¶
type ResponseListResponseTextFormatType string
Must be "text", "json_schema", or "json_object" to identify the format type
const ( ResponseListResponseTextFormatTypeText ResponseListResponseTextFormatType = "text" ResponseListResponseTextFormatTypeJsonSchema ResponseListResponseTextFormatType = "json_schema" ResponseListResponseTextFormatTypeJsonObject ResponseListResponseTextFormatType = "json_object" )
type ResponseListResponseToolFileSearch ¶
type ResponseListResponseToolFileSearch struct {
// Tool type identifier, always "file_search"
Type constant.FileSearch `json:"type,required"`
// List of vector store identifiers to search within
VectorStoreIDs []string `json:"vector_store_ids,required"`
// (Optional) Additional filters to apply to the search
Filters map[string]ResponseListResponseToolFileSearchFilterUnion `json:"filters"`
// (Optional) Maximum number of search results to return (1-50)
MaxNumResults int64 `json:"max_num_results"`
// (Optional) Options for ranking and scoring search results
RankingOptions ResponseListResponseToolFileSearchRankingOptions `json:"ranking_options"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Type respjson.Field
VectorStoreIDs respjson.Field
Filters respjson.Field
MaxNumResults respjson.Field
RankingOptions respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
File search tool configuration for OpenAI response inputs.
func (ResponseListResponseToolFileSearch) RawJSON ¶
func (r ResponseListResponseToolFileSearch) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseListResponseToolFileSearch) UnmarshalJSON ¶
func (r *ResponseListResponseToolFileSearch) UnmarshalJSON(data []byte) error
type ResponseListResponseToolFileSearchFilterUnion ¶
type ResponseListResponseToolFileSearchFilterUnion 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:"-"`
}
ResponseListResponseToolFileSearchFilterUnion 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 (ResponseListResponseToolFileSearchFilterUnion) AsAnyArray ¶
func (u ResponseListResponseToolFileSearchFilterUnion) AsAnyArray() (v []any)
func (ResponseListResponseToolFileSearchFilterUnion) AsBool ¶
func (u ResponseListResponseToolFileSearchFilterUnion) AsBool() (v bool)
func (ResponseListResponseToolFileSearchFilterUnion) AsFloat ¶
func (u ResponseListResponseToolFileSearchFilterUnion) AsFloat() (v float64)
func (ResponseListResponseToolFileSearchFilterUnion) AsString ¶
func (u ResponseListResponseToolFileSearchFilterUnion) AsString() (v string)
func (ResponseListResponseToolFileSearchFilterUnion) RawJSON ¶
func (u ResponseListResponseToolFileSearchFilterUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseListResponseToolFileSearchFilterUnion) UnmarshalJSON ¶
func (r *ResponseListResponseToolFileSearchFilterUnion) UnmarshalJSON(data []byte) error
type ResponseListResponseToolFileSearchRankingOptions ¶
type ResponseListResponseToolFileSearchRankingOptions struct {
// (Optional) Name of the ranking algorithm to use
Ranker string `json:"ranker"`
// (Optional) Minimum relevance score threshold for results
ScoreThreshold float64 `json:"score_threshold"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Ranker respjson.Field
ScoreThreshold respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
(Optional) Options for ranking and scoring search results
func (ResponseListResponseToolFileSearchRankingOptions) RawJSON ¶
func (r ResponseListResponseToolFileSearchRankingOptions) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseListResponseToolFileSearchRankingOptions) UnmarshalJSON ¶
func (r *ResponseListResponseToolFileSearchRankingOptions) UnmarshalJSON(data []byte) error
type ResponseListResponseToolFunction ¶
type ResponseListResponseToolFunction struct {
// Name of the function that can be called
Name string `json:"name,required"`
// Tool type identifier, always "function"
Type constant.Function `json:"type,required"`
// (Optional) Description of what the function does
Description string `json:"description"`
// (Optional) JSON schema defining the function's parameters
Parameters map[string]ResponseListResponseToolFunctionParameterUnion `json:"parameters"`
// (Optional) Whether to enforce strict parameter validation
Strict bool `json:"strict"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Name respjson.Field
Type respjson.Field
Description respjson.Field
Parameters respjson.Field
Strict respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Function tool configuration for OpenAI response inputs.
func (ResponseListResponseToolFunction) RawJSON ¶
func (r ResponseListResponseToolFunction) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseListResponseToolFunction) UnmarshalJSON ¶
func (r *ResponseListResponseToolFunction) UnmarshalJSON(data []byte) error
type ResponseListResponseToolFunctionParameterUnion ¶
type ResponseListResponseToolFunctionParameterUnion 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:"-"`
}
ResponseListResponseToolFunctionParameterUnion 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 (ResponseListResponseToolFunctionParameterUnion) AsAnyArray ¶
func (u ResponseListResponseToolFunctionParameterUnion) AsAnyArray() (v []any)
func (ResponseListResponseToolFunctionParameterUnion) AsBool ¶
func (u ResponseListResponseToolFunctionParameterUnion) AsBool() (v bool)
func (ResponseListResponseToolFunctionParameterUnion) AsFloat ¶
func (u ResponseListResponseToolFunctionParameterUnion) AsFloat() (v float64)
func (ResponseListResponseToolFunctionParameterUnion) AsString ¶
func (u ResponseListResponseToolFunctionParameterUnion) AsString() (v string)
func (ResponseListResponseToolFunctionParameterUnion) RawJSON ¶
func (u ResponseListResponseToolFunctionParameterUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseListResponseToolFunctionParameterUnion) UnmarshalJSON ¶
func (r *ResponseListResponseToolFunctionParameterUnion) UnmarshalJSON(data []byte) error
type ResponseListResponseToolMcp ¶
type ResponseListResponseToolMcp struct {
// Label to identify this MCP server
ServerLabel string `json:"server_label,required"`
// Tool type identifier, always "mcp"
Type constant.Mcp `json:"type,required"`
// (Optional) Restriction on which tools can be used from this server
AllowedTools ResponseListResponseToolMcpAllowedToolsUnion `json:"allowed_tools"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ServerLabel respjson.Field
Type respjson.Field
AllowedTools respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Model Context Protocol (MCP) tool configuration for OpenAI response object.
func (ResponseListResponseToolMcp) RawJSON ¶
func (r ResponseListResponseToolMcp) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseListResponseToolMcp) UnmarshalJSON ¶
func (r *ResponseListResponseToolMcp) UnmarshalJSON(data []byte) error
type ResponseListResponseToolMcpAllowedToolsAllowedToolsFilter ¶
type ResponseListResponseToolMcpAllowedToolsAllowedToolsFilter struct {
// (Optional) List of specific tool names that are allowed
ToolNames []string `json:"tool_names"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ToolNames respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Filter configuration for restricting which MCP tools can be used.
func (ResponseListResponseToolMcpAllowedToolsAllowedToolsFilter) RawJSON ¶
func (r ResponseListResponseToolMcpAllowedToolsAllowedToolsFilter) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseListResponseToolMcpAllowedToolsAllowedToolsFilter) UnmarshalJSON ¶
func (r *ResponseListResponseToolMcpAllowedToolsAllowedToolsFilter) UnmarshalJSON(data []byte) error
type ResponseListResponseToolMcpAllowedToolsUnion ¶
type ResponseListResponseToolMcpAllowedToolsUnion struct {
// This field will be present if the value is a [[]string] instead of an object.
OfStringArray []string `json:",inline"`
// This field is from variant
// [ResponseListResponseToolMcpAllowedToolsAllowedToolsFilter].
ToolNames []string `json:"tool_names"`
JSON struct {
OfStringArray respjson.Field
ToolNames respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ResponseListResponseToolMcpAllowedToolsUnion contains all possible properties and values from [[]string], ResponseListResponseToolMcpAllowedToolsAllowedToolsFilter.
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: OfStringArray]
func (ResponseListResponseToolMcpAllowedToolsUnion) AsAllowedToolsFilter ¶
func (u ResponseListResponseToolMcpAllowedToolsUnion) AsAllowedToolsFilter() (v ResponseListResponseToolMcpAllowedToolsAllowedToolsFilter)
func (ResponseListResponseToolMcpAllowedToolsUnion) AsStringArray ¶
func (u ResponseListResponseToolMcpAllowedToolsUnion) AsStringArray() (v []string)
func (ResponseListResponseToolMcpAllowedToolsUnion) RawJSON ¶
func (u ResponseListResponseToolMcpAllowedToolsUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseListResponseToolMcpAllowedToolsUnion) UnmarshalJSON ¶
func (r *ResponseListResponseToolMcpAllowedToolsUnion) UnmarshalJSON(data []byte) error
type ResponseListResponseToolOpenAIResponseInputToolWebSearch ¶
type ResponseListResponseToolOpenAIResponseInputToolWebSearch struct {
// Web search tool type variant to use
//
// Any of "web_search", "web_search_preview", "web_search_preview_2025_03_11",
// "web_search_2025_08_26".
Type ResponseListResponseToolOpenAIResponseInputToolWebSearchType `json:"type,required"`
// (Optional) Size of search context, must be "low", "medium", or "high"
SearchContextSize string `json:"search_context_size"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Type respjson.Field
SearchContextSize respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Web search tool configuration for OpenAI response inputs.
func (ResponseListResponseToolOpenAIResponseInputToolWebSearch) RawJSON ¶
func (r ResponseListResponseToolOpenAIResponseInputToolWebSearch) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseListResponseToolOpenAIResponseInputToolWebSearch) UnmarshalJSON ¶
func (r *ResponseListResponseToolOpenAIResponseInputToolWebSearch) UnmarshalJSON(data []byte) error
type ResponseListResponseToolOpenAIResponseInputToolWebSearchType ¶
type ResponseListResponseToolOpenAIResponseInputToolWebSearchType string
Web search tool type variant to use
const ( ResponseListResponseToolOpenAIResponseInputToolWebSearchTypeWebSearch ResponseListResponseToolOpenAIResponseInputToolWebSearchType = "web_search" ResponseListResponseToolOpenAIResponseInputToolWebSearchTypeWebSearchPreview ResponseListResponseToolOpenAIResponseInputToolWebSearchType = "web_search_preview" ResponseListResponseToolOpenAIResponseInputToolWebSearchTypeWebSearchPreview2025_03_11 ResponseListResponseToolOpenAIResponseInputToolWebSearchType = "web_search_preview_2025_03_11" ResponseListResponseToolOpenAIResponseInputToolWebSearchTypeWebSearch2025_08_26 ResponseListResponseToolOpenAIResponseInputToolWebSearchType = "web_search_2025_08_26" )
type ResponseListResponseToolType ¶
type ResponseListResponseToolType string
Web search tool type variant to use
const ( ResponseListResponseToolTypeWebSearch ResponseListResponseToolType = "web_search" ResponseListResponseToolTypeWebSearchPreview ResponseListResponseToolType = "web_search_preview" ResponseListResponseToolTypeWebSearchPreview2025_03_11 ResponseListResponseToolType = "web_search_preview_2025_03_11" ResponseListResponseToolTypeWebSearch2025_08_26 ResponseListResponseToolType = "web_search_2025_08_26" ResponseListResponseToolTypeFileSearch ResponseListResponseToolType = "file_search" ResponseListResponseToolTypeFunction ResponseListResponseToolType = "function" ResponseListResponseToolTypeMcp ResponseListResponseToolType = "mcp" )
type ResponseListResponseToolUnion ¶
type ResponseListResponseToolUnion struct {
// Any of nil, "file_search", "function", "mcp".
Type string `json:"type"`
// This field is from variant
// [ResponseListResponseToolOpenAIResponseInputToolWebSearch].
SearchContextSize string `json:"search_context_size"`
// This field is from variant [ResponseListResponseToolFileSearch].
VectorStoreIDs []string `json:"vector_store_ids"`
// This field is from variant [ResponseListResponseToolFileSearch].
Filters map[string]ResponseListResponseToolFileSearchFilterUnion `json:"filters"`
// This field is from variant [ResponseListResponseToolFileSearch].
MaxNumResults int64 `json:"max_num_results"`
// This field is from variant [ResponseListResponseToolFileSearch].
RankingOptions ResponseListResponseToolFileSearchRankingOptions `json:"ranking_options"`
// This field is from variant [ResponseListResponseToolFunction].
Name string `json:"name"`
// This field is from variant [ResponseListResponseToolFunction].
Description string `json:"description"`
// This field is from variant [ResponseListResponseToolFunction].
Parameters map[string]ResponseListResponseToolFunctionParameterUnion `json:"parameters"`
// This field is from variant [ResponseListResponseToolFunction].
Strict bool `json:"strict"`
// This field is from variant [ResponseListResponseToolMcp].
ServerLabel string `json:"server_label"`
// This field is from variant [ResponseListResponseToolMcp].
AllowedTools ResponseListResponseToolMcpAllowedToolsUnion `json:"allowed_tools"`
JSON struct {
Type respjson.Field
SearchContextSize respjson.Field
VectorStoreIDs respjson.Field
Filters respjson.Field
MaxNumResults respjson.Field
RankingOptions respjson.Field
Name respjson.Field
Description respjson.Field
Parameters respjson.Field
Strict respjson.Field
ServerLabel respjson.Field
AllowedTools respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ResponseListResponseToolUnion contains all possible properties and values from ResponseListResponseToolOpenAIResponseInputToolWebSearch, ResponseListResponseToolFileSearch, ResponseListResponseToolFunction, ResponseListResponseToolMcp.
Use the [ResponseListResponseToolUnion.AsAny] method to switch on the variant.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (ResponseListResponseToolUnion) AsFileSearch ¶
func (u ResponseListResponseToolUnion) AsFileSearch() (v ResponseListResponseToolFileSearch)
func (ResponseListResponseToolUnion) AsFunction ¶
func (u ResponseListResponseToolUnion) AsFunction() (v ResponseListResponseToolFunction)
func (ResponseListResponseToolUnion) AsMcp ¶
func (u ResponseListResponseToolUnion) AsMcp() (v ResponseListResponseToolMcp)
func (ResponseListResponseToolUnion) AsOpenAIResponseInputToolWebSearch ¶
func (u ResponseListResponseToolUnion) AsOpenAIResponseInputToolWebSearch() (v ResponseListResponseToolOpenAIResponseInputToolWebSearch)
func (ResponseListResponseToolUnion) RawJSON ¶
func (u ResponseListResponseToolUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseListResponseToolUnion) UnmarshalJSON ¶
func (r *ResponseListResponseToolUnion) UnmarshalJSON(data []byte) error
type ResponseListResponseUsage ¶
type ResponseListResponseUsage struct {
// Number of tokens in the input
InputTokens int64 `json:"input_tokens,required"`
// Number of tokens in the output
OutputTokens int64 `json:"output_tokens,required"`
// Total tokens used (input + output)
TotalTokens int64 `json:"total_tokens,required"`
// Detailed breakdown of input token usage
InputTokensDetails ResponseListResponseUsageInputTokensDetails `json:"input_tokens_details"`
// Detailed breakdown of output token usage
OutputTokensDetails ResponseListResponseUsageOutputTokensDetails `json:"output_tokens_details"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
InputTokens respjson.Field
OutputTokens respjson.Field
TotalTokens respjson.Field
InputTokensDetails respjson.Field
OutputTokensDetails respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
(Optional) Token usage information for the response
func (ResponseListResponseUsage) RawJSON ¶
func (r ResponseListResponseUsage) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseListResponseUsage) UnmarshalJSON ¶
func (r *ResponseListResponseUsage) UnmarshalJSON(data []byte) error
type ResponseListResponseUsageInputTokensDetails ¶
type ResponseListResponseUsageInputTokensDetails struct {
// Number of tokens retrieved from cache
CachedTokens int64 `json:"cached_tokens"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CachedTokens respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Detailed breakdown of input token usage
func (ResponseListResponseUsageInputTokensDetails) RawJSON ¶
func (r ResponseListResponseUsageInputTokensDetails) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseListResponseUsageInputTokensDetails) UnmarshalJSON ¶
func (r *ResponseListResponseUsageInputTokensDetails) UnmarshalJSON(data []byte) error
type ResponseListResponseUsageOutputTokensDetails ¶
type ResponseListResponseUsageOutputTokensDetails struct {
// Number of tokens used for reasoning (o1/o3 models)
ReasoningTokens int64 `json:"reasoning_tokens"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ReasoningTokens respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Detailed breakdown of output token usage
func (ResponseListResponseUsageOutputTokensDetails) RawJSON ¶
func (r ResponseListResponseUsageOutputTokensDetails) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseListResponseUsageOutputTokensDetails) UnmarshalJSON ¶
func (r *ResponseListResponseUsageOutputTokensDetails) UnmarshalJSON(data []byte) error
type ResponseNewParams ¶
type ResponseNewParams struct {
// Input message(s) to create the response.
Input ResponseNewParamsInputUnion `json:"input,omitzero,required"`
// The underlying LLM used for completions.
Model string `json:"model,required"`
// (Optional) The ID of a conversation to add the response to. Must begin with
// 'conv\_'. Input and output messages will be automatically added to the
// conversation.
Conversation param.Opt[string] `json:"conversation,omitzero"`
Instructions param.Opt[string] `json:"instructions,omitzero"`
MaxInferIters param.Opt[int64] `json:"max_infer_iters,omitzero"`
// (Optional) Max number of total calls to built-in tools that can be processed in
// a response.
MaxToolCalls param.Opt[int64] `json:"max_tool_calls,omitzero"`
// (Optional) if specified, the new response will be a continuation of the previous
// response. This can be used to easily fork-off new responses from existing
// responses.
PreviousResponseID param.Opt[string] `json:"previous_response_id,omitzero"`
Store param.Opt[bool] `json:"store,omitzero"`
Temperature param.Opt[float64] `json:"temperature,omitzero"`
// (Optional) Additional fields to include in the response.
Include []string `json:"include,omitzero"`
// (Optional) Prompt object with ID, version, and variables.
Prompt ResponseNewParamsPrompt `json:"prompt,omitzero"`
// Text response configuration for OpenAI responses.
Text ResponseNewParamsText `json:"text,omitzero"`
Tools []ResponseNewParamsToolUnion `json:"tools,omitzero"`
// contains filtered or unexported fields
}
func (ResponseNewParams) MarshalJSON ¶
func (r ResponseNewParams) MarshalJSON() (data []byte, err error)
func (*ResponseNewParams) UnmarshalJSON ¶
func (r *ResponseNewParams) UnmarshalJSON(data []byte) error
type ResponseNewParamsInputArrayItemOpenAIResponseInputFunctionToolCallOutput ¶
type ResponseNewParamsInputArrayItemOpenAIResponseInputFunctionToolCallOutput struct {
CallID string `json:"call_id,required"`
Output string `json:"output,required"`
ID param.Opt[string] `json:"id,omitzero"`
Status param.Opt[string] `json:"status,omitzero"`
// This field can be elided, and will marshal its zero value as
// "function_call_output".
Type constant.FunctionCallOutput `json:"type,required"`
// contains filtered or unexported fields
}
This represents the output of a function call that gets passed back to the model.
The properties CallID, Output, Type are required.
func (ResponseNewParamsInputArrayItemOpenAIResponseInputFunctionToolCallOutput) MarshalJSON ¶
func (r ResponseNewParamsInputArrayItemOpenAIResponseInputFunctionToolCallOutput) MarshalJSON() (data []byte, err error)
func (*ResponseNewParamsInputArrayItemOpenAIResponseInputFunctionToolCallOutput) UnmarshalJSON ¶
func (r *ResponseNewParamsInputArrayItemOpenAIResponseInputFunctionToolCallOutput) UnmarshalJSON(data []byte) error
type ResponseNewParamsInputArrayItemOpenAIResponseMcpApprovalRequest ¶
type ResponseNewParamsInputArrayItemOpenAIResponseMcpApprovalRequest struct {
ID string `json:"id,required"`
Arguments string `json:"arguments,required"`
Name string `json:"name,required"`
ServerLabel string `json:"server_label,required"`
// This field can be elided, and will marshal its zero value as
// "mcp_approval_request".
Type constant.McpApprovalRequest `json:"type,required"`
// contains filtered or unexported fields
}
A request for human approval of a tool invocation.
The properties ID, Arguments, Name, ServerLabel, Type are required.
func (ResponseNewParamsInputArrayItemOpenAIResponseMcpApprovalRequest) MarshalJSON ¶
func (r ResponseNewParamsInputArrayItemOpenAIResponseMcpApprovalRequest) MarshalJSON() (data []byte, err error)
func (*ResponseNewParamsInputArrayItemOpenAIResponseMcpApprovalRequest) UnmarshalJSON ¶
func (r *ResponseNewParamsInputArrayItemOpenAIResponseMcpApprovalRequest) UnmarshalJSON(data []byte) error
type ResponseNewParamsInputArrayItemOpenAIResponseMcpApprovalResponse ¶
type ResponseNewParamsInputArrayItemOpenAIResponseMcpApprovalResponse struct {
ApprovalRequestID string `json:"approval_request_id,required"`
Approve bool `json:"approve,required"`
ID param.Opt[string] `json:"id,omitzero"`
Reason param.Opt[string] `json:"reason,omitzero"`
// This field can be elided, and will marshal its zero value as
// "mcp_approval_response".
Type constant.McpApprovalResponse `json:"type,required"`
// contains filtered or unexported fields
}
A response to an MCP approval request.
The properties ApprovalRequestID, Approve, Type are required.
func (ResponseNewParamsInputArrayItemOpenAIResponseMcpApprovalResponse) MarshalJSON ¶
func (r ResponseNewParamsInputArrayItemOpenAIResponseMcpApprovalResponse) MarshalJSON() (data []byte, err error)
func (*ResponseNewParamsInputArrayItemOpenAIResponseMcpApprovalResponse) UnmarshalJSON ¶
func (r *ResponseNewParamsInputArrayItemOpenAIResponseMcpApprovalResponse) UnmarshalJSON(data []byte) error
type ResponseNewParamsInputArrayItemOpenAIResponseMessage ¶
type ResponseNewParamsInputArrayItemOpenAIResponseMessage struct {
Content ResponseNewParamsInputArrayItemOpenAIResponseMessageContentUnion `json:"content,omitzero,required"`
// Any of "system", "developer", "user", "assistant".
Role ResponseNewParamsInputArrayItemOpenAIResponseMessageRole `json:"role,omitzero,required"`
ID param.Opt[string] `json:"id,omitzero"`
Status param.Opt[string] `json:"status,omitzero"`
// This field can be elided, and will marshal its zero value as "message".
Type constant.Message `json:"type,required"`
// contains filtered or unexported fields
}
Corresponds to the various Message types in the Responses API. They are all under one type because the Responses API gives them all the same "type" value, and there is no way to tell them apart in certain scenarios.
The properties Content, Role, Type are required.
func (ResponseNewParamsInputArrayItemOpenAIResponseMessage) MarshalJSON ¶
func (r ResponseNewParamsInputArrayItemOpenAIResponseMessage) MarshalJSON() (data []byte, err error)
func (*ResponseNewParamsInputArrayItemOpenAIResponseMessage) UnmarshalJSON ¶
func (r *ResponseNewParamsInputArrayItemOpenAIResponseMessage) UnmarshalJSON(data []byte) error
type ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemInputFile ¶
type ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemInputFile struct {
// The data of the file to be sent to the model.
FileData param.Opt[string] `json:"file_data,omitzero"`
// (Optional) The ID of the file to be sent to the model.
FileID param.Opt[string] `json:"file_id,omitzero"`
// The URL of the file to be sent to the model.
FileURL param.Opt[string] `json:"file_url,omitzero"`
// The name of the file to be sent to the model.
Filename param.Opt[string] `json:"filename,omitzero"`
// The type of the input item. Always `input_file`.
//
// This field can be elided, and will marshal its zero value as "input_file".
Type constant.InputFile `json:"type,required"`
// contains filtered or unexported fields
}
File content for input messages in OpenAI response format.
The property Type is required.
func (ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemInputFile) MarshalJSON ¶
func (r ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemInputFile) MarshalJSON() (data []byte, err error)
func (*ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemInputFile) UnmarshalJSON ¶
func (r *ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemInputFile) UnmarshalJSON(data []byte) error
type ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemInputImage ¶
type ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemInputImage struct {
// Level of detail for image processing, can be "low", "high", or "auto"
//
// Any of "low", "high", "auto".
Detail ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemInputImageDetail `json:"detail,omitzero,required"`
// (Optional) The ID of the file to be sent to the model.
FileID param.Opt[string] `json:"file_id,omitzero"`
// (Optional) URL of the image content
ImageURL param.Opt[string] `json:"image_url,omitzero"`
// Content type identifier, always "input_image"
//
// This field can be elided, and will marshal its zero value as "input_image".
Type constant.InputImage `json:"type,required"`
// contains filtered or unexported fields
}
Image content for input messages in OpenAI response format.
The properties Detail, Type are required.
func (ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemInputImage) MarshalJSON ¶
func (r ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemInputImage) MarshalJSON() (data []byte, err error)
func (*ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemInputImage) UnmarshalJSON ¶
func (r *ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemInputImage) UnmarshalJSON(data []byte) error
type ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemInputImageDetail ¶
type ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemInputImageDetail string
Level of detail for image processing, can be "low", "high", or "auto"
const ( ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemInputImageDetailLow ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemInputImageDetail = "low" ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemInputImageDetailHigh ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemInputImageDetail = "high" ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemInputImageDetailAuto ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemInputImageDetail = "auto" )
type ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemInputText ¶
type ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemInputText struct {
// The text content of the input message
Text string `json:"text,required"`
// Content type identifier, always "input_text"
//
// This field can be elided, and will marshal its zero value as "input_text".
Type constant.InputText `json:"type,required"`
// contains filtered or unexported fields
}
Text content for input messages in OpenAI response format.
The properties Text, Type are required.
func (ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemInputText) MarshalJSON ¶
func (r ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemInputText) MarshalJSON() (data []byte, err error)
func (*ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemInputText) UnmarshalJSON ¶
func (r *ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemInputText) UnmarshalJSON(data []byte) error
type ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemUnion ¶
type ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemUnion struct {
OfInputText *ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemInputText `json:",omitzero,inline"`
OfInputImage *ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemInputImage `json:",omitzero,inline"`
OfInputFile *ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemInputFile `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 (ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemUnion) GetDetail ¶
func (u ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemUnion) GetDetail() *string
Returns a pointer to the underlying variant's property, if present.
func (ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemUnion) GetFileData ¶
func (u ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemUnion) GetFileData() *string
Returns a pointer to the underlying variant's property, if present.
func (ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemUnion) GetFileID ¶
func (u ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemUnion) GetFileID() *string
Returns a pointer to the underlying variant's property, if present.
func (ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemUnion) GetFileURL ¶
func (u ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemUnion) GetFileURL() *string
Returns a pointer to the underlying variant's property, if present.
func (ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemUnion) GetFilename ¶
func (u ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemUnion) GetFilename() *string
Returns a pointer to the underlying variant's property, if present.
func (ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemUnion) GetImageURL ¶
func (u ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemUnion) GetImageURL() *string
Returns a pointer to the underlying variant's property, if present.
func (ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemUnion) GetText ¶
func (u ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemUnion) GetText() *string
Returns a pointer to the underlying variant's property, if present.
func (ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemUnion) GetType ¶
func (u ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemUnion) GetType() *string
Returns a pointer to the underlying variant's property, if present.
func (ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemUnion) MarshalJSON ¶
func (u ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemUnion) MarshalJSON() ([]byte, error)
func (*ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemUnion) UnmarshalJSON ¶
func (u *ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemUnion) UnmarshalJSON(data []byte) error
type ResponseNewParamsInputArrayItemOpenAIResponseMessageContentUnion ¶
type ResponseNewParamsInputArrayItemOpenAIResponseMessageContentUnion struct {
OfString param.Opt[string] `json:",omitzero,inline"`
OfResponseNewsInputArrayItemOpenAIResponseMessageContentArray []ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemUnion `json:",omitzero,inline"`
OfVariant2 []ResponseNewParamsInputArrayItemOpenAIResponseMessageContentArrayItemUnion `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 (ResponseNewParamsInputArrayItemOpenAIResponseMessageContentUnion) MarshalJSON ¶
func (u ResponseNewParamsInputArrayItemOpenAIResponseMessageContentUnion) MarshalJSON() ([]byte, error)
func (*ResponseNewParamsInputArrayItemOpenAIResponseMessageContentUnion) UnmarshalJSON ¶
func (u *ResponseNewParamsInputArrayItemOpenAIResponseMessageContentUnion) UnmarshalJSON(data []byte) error
type ResponseNewParamsInputArrayItemOpenAIResponseMessageRole ¶
type ResponseNewParamsInputArrayItemOpenAIResponseMessageRole string
const ( ResponseNewParamsInputArrayItemOpenAIResponseMessageRoleSystem ResponseNewParamsInputArrayItemOpenAIResponseMessageRole = "system" ResponseNewParamsInputArrayItemOpenAIResponseMessageRoleDeveloper ResponseNewParamsInputArrayItemOpenAIResponseMessageRole = "developer" ResponseNewParamsInputArrayItemOpenAIResponseMessageRoleUser ResponseNewParamsInputArrayItemOpenAIResponseMessageRole = "user" ResponseNewParamsInputArrayItemOpenAIResponseMessageRoleAssistant ResponseNewParamsInputArrayItemOpenAIResponseMessageRole = "assistant" )
type ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageFileSearchToolCall ¶
type ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageFileSearchToolCall struct {
// Unique identifier for this tool call
ID string `json:"id,required"`
// List of search queries executed
Queries []string `json:"queries,omitzero,required"`
// Current status of the file search operation
Status string `json:"status,required"`
// (Optional) Search results returned by the file search operation
Results []ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageFileSearchToolCallResult `json:"results,omitzero"`
// Tool call type identifier, always "file_search_call"
//
// This field can be elided, and will marshal its zero value as "file_search_call".
Type constant.FileSearchCall `json:"type,required"`
// contains filtered or unexported fields
}
File search tool call output message for OpenAI responses.
The properties ID, Queries, Status, Type are required.
func (ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageFileSearchToolCall) MarshalJSON ¶
func (r ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageFileSearchToolCall) MarshalJSON() (data []byte, err error)
func (*ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageFileSearchToolCall) UnmarshalJSON ¶
func (r *ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageFileSearchToolCall) UnmarshalJSON(data []byte) error
type ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageFileSearchToolCallResult ¶
type ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageFileSearchToolCallResult struct {
// (Optional) Key-value attributes associated with the file
Attributes map[string]ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageFileSearchToolCallResultAttributeUnion `json:"attributes,omitzero,required"`
// Unique identifier of the file containing the result
FileID string `json:"file_id,required"`
// Name of the file containing the result
Filename string `json:"filename,required"`
// Relevance score for this search result (between 0 and 1)
Score float64 `json:"score,required"`
// Text content of the search result
Text string `json:"text,required"`
// contains filtered or unexported fields
}
Search results returned by the file search operation.
The properties Attributes, FileID, Filename, Score, Text are required.
func (ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageFileSearchToolCallResult) MarshalJSON ¶
func (r ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageFileSearchToolCallResult) MarshalJSON() (data []byte, err error)
func (*ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageFileSearchToolCallResult) UnmarshalJSON ¶
func (r *ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageFileSearchToolCallResult) UnmarshalJSON(data []byte) error
type ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageFileSearchToolCallResultAttributeUnion ¶
type ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageFileSearchToolCallResultAttributeUnion 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 (ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageFileSearchToolCallResultAttributeUnion) MarshalJSON ¶
func (u ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageFileSearchToolCallResultAttributeUnion) MarshalJSON() ([]byte, error)
func (*ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageFileSearchToolCallResultAttributeUnion) UnmarshalJSON ¶
func (u *ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageFileSearchToolCallResultAttributeUnion) UnmarshalJSON(data []byte) error
type ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageFunctionToolCall ¶
type ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageFunctionToolCall struct {
// JSON string containing the function arguments
Arguments string `json:"arguments,required"`
// Unique identifier for the function call
CallID string `json:"call_id,required"`
// Name of the function being called
Name string `json:"name,required"`
// (Optional) Additional identifier for the tool call
ID param.Opt[string] `json:"id,omitzero"`
// (Optional) Current status of the function call execution
Status param.Opt[string] `json:"status,omitzero"`
// Tool call type identifier, always "function_call"
//
// This field can be elided, and will marshal its zero value as "function_call".
Type constant.FunctionCall `json:"type,required"`
// contains filtered or unexported fields
}
Function tool call output message for OpenAI responses.
The properties Arguments, CallID, Name, Type are required.
func (ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageFunctionToolCall) MarshalJSON ¶
func (r ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageFunctionToolCall) MarshalJSON() (data []byte, err error)
func (*ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageFunctionToolCall) UnmarshalJSON ¶
func (r *ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageFunctionToolCall) UnmarshalJSON(data []byte) error
type ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageMcpCall ¶
type ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageMcpCall struct {
// Unique identifier for this MCP call
ID string `json:"id,required"`
// JSON string containing the MCP call arguments
Arguments string `json:"arguments,required"`
// Name of the MCP method being called
Name string `json:"name,required"`
// Label identifying the MCP server handling the call
ServerLabel string `json:"server_label,required"`
// (Optional) Error message if the MCP call failed
Error param.Opt[string] `json:"error,omitzero"`
// (Optional) Output result from the successful MCP call
Output param.Opt[string] `json:"output,omitzero"`
// Tool call type identifier, always "mcp_call"
//
// This field can be elided, and will marshal its zero value as "mcp_call".
Type constant.McpCall `json:"type,required"`
// contains filtered or unexported fields
}
Model Context Protocol (MCP) call output message for OpenAI responses.
The properties ID, Arguments, Name, ServerLabel, Type are required.
func (ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageMcpCall) MarshalJSON ¶
func (r ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageMcpCall) MarshalJSON() (data []byte, err error)
func (*ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageMcpCall) UnmarshalJSON ¶
func (r *ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageMcpCall) UnmarshalJSON(data []byte) error
type ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageMcpListTools ¶
type ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageMcpListTools struct {
// Unique identifier for this MCP list tools operation
ID string `json:"id,required"`
// Label identifying the MCP server providing the tools
ServerLabel string `json:"server_label,required"`
// List of available tools provided by the MCP server
Tools []ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageMcpListToolsTool `json:"tools,omitzero,required"`
// Tool call type identifier, always "mcp_list_tools"
//
// This field can be elided, and will marshal its zero value as "mcp_list_tools".
Type constant.McpListTools `json:"type,required"`
// contains filtered or unexported fields
}
MCP list tools output message containing available tools from an MCP server.
The properties ID, ServerLabel, Tools, Type are required.
func (ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageMcpListTools) MarshalJSON ¶
func (r ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageMcpListTools) MarshalJSON() (data []byte, err error)
func (*ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageMcpListTools) UnmarshalJSON ¶
func (r *ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageMcpListTools) UnmarshalJSON(data []byte) error
type ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageMcpListToolsTool ¶
type ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageMcpListToolsTool struct {
// JSON schema defining the tool's input parameters
InputSchema map[string]ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageMcpListToolsToolInputSchemaUnion `json:"input_schema,omitzero,required"`
// Name of the tool
Name string `json:"name,required"`
// (Optional) Description of what the tool does
Description param.Opt[string] `json:"description,omitzero"`
// contains filtered or unexported fields
}
Tool definition returned by MCP list tools operation.
The properties InputSchema, Name are required.
func (ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageMcpListToolsTool) MarshalJSON ¶
func (r ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageMcpListToolsTool) MarshalJSON() (data []byte, err error)
func (*ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageMcpListToolsTool) UnmarshalJSON ¶
func (r *ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageMcpListToolsTool) UnmarshalJSON(data []byte) error
type ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageMcpListToolsToolInputSchemaUnion ¶
type ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageMcpListToolsToolInputSchemaUnion 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 (ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageMcpListToolsToolInputSchemaUnion) MarshalJSON ¶
func (u ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageMcpListToolsToolInputSchemaUnion) MarshalJSON() ([]byte, error)
func (*ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageMcpListToolsToolInputSchemaUnion) UnmarshalJSON ¶
func (u *ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageMcpListToolsToolInputSchemaUnion) UnmarshalJSON(data []byte) error
type ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageWebSearchToolCall ¶
type ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageWebSearchToolCall struct {
// Unique identifier for this tool call
ID string `json:"id,required"`
// Current status of the web search operation
Status string `json:"status,required"`
// Tool call type identifier, always "web_search_call"
//
// This field can be elided, and will marshal its zero value as "web_search_call".
Type constant.WebSearchCall `json:"type,required"`
// contains filtered or unexported fields
}
Web search tool call output message for OpenAI responses.
The properties ID, Status, Type are required.
func (ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageWebSearchToolCall) MarshalJSON ¶
func (r ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageWebSearchToolCall) MarshalJSON() (data []byte, err error)
func (*ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageWebSearchToolCall) UnmarshalJSON ¶
func (r *ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageWebSearchToolCall) UnmarshalJSON(data []byte) error
type ResponseNewParamsInputArrayItemUnion ¶
type ResponseNewParamsInputArrayItemUnion struct {
OfOpenAIResponseMessage *ResponseNewParamsInputArrayItemOpenAIResponseMessage `json:",omitzero,inline"`
OfOpenAIResponseOutputMessageWebSearchToolCall *ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageWebSearchToolCall `json:",omitzero,inline"`
OfOpenAIResponseOutputMessageFileSearchToolCall *ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageFileSearchToolCall `json:",omitzero,inline"`
OfOpenAIResponseOutputMessageFunctionToolCall *ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageFunctionToolCall `json:",omitzero,inline"`
OfOpenAIResponseOutputMessageMcpCall *ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageMcpCall `json:",omitzero,inline"`
OfOpenAIResponseOutputMessageMcpListTools *ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageMcpListTools `json:",omitzero,inline"`
OfOpenAIResponseMcpApprovalRequest *ResponseNewParamsInputArrayItemOpenAIResponseMcpApprovalRequest `json:",omitzero,inline"`
OfOpenAIResponseInputFunctionToolCallOutput *ResponseNewParamsInputArrayItemOpenAIResponseInputFunctionToolCallOutput `json:",omitzero,inline"`
OfOpenAIResponseMcpApprovalResponse *ResponseNewParamsInputArrayItemOpenAIResponseMcpApprovalResponse `json:",omitzero,inline"`
OfResponseNewsInputArrayItemOpenAIResponseMessage *ResponseNewParamsInputArrayItemOpenAIResponseMessage `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 (ResponseNewParamsInputArrayItemUnion) GetApprovalRequestID ¶
func (u ResponseNewParamsInputArrayItemUnion) GetApprovalRequestID() *string
Returns a pointer to the underlying variant's property, if present.
func (ResponseNewParamsInputArrayItemUnion) GetApprove ¶
func (u ResponseNewParamsInputArrayItemUnion) GetApprove() *bool
Returns a pointer to the underlying variant's property, if present.
func (ResponseNewParamsInputArrayItemUnion) GetArguments ¶
func (u ResponseNewParamsInputArrayItemUnion) GetArguments() *string
Returns a pointer to the underlying variant's property, if present.
func (ResponseNewParamsInputArrayItemUnion) GetCallID ¶
func (u ResponseNewParamsInputArrayItemUnion) GetCallID() *string
Returns a pointer to the underlying variant's property, if present.
func (ResponseNewParamsInputArrayItemUnion) GetContent ¶
func (u ResponseNewParamsInputArrayItemUnion) GetContent() *ResponseNewParamsInputArrayItemOpenAIResponseMessageContentUnion
Returns a pointer to the underlying variant's Content property, if present.
func (ResponseNewParamsInputArrayItemUnion) GetError ¶
func (u ResponseNewParamsInputArrayItemUnion) GetError() *string
Returns a pointer to the underlying variant's property, if present.
func (ResponseNewParamsInputArrayItemUnion) GetID ¶
func (u ResponseNewParamsInputArrayItemUnion) GetID() *string
Returns a pointer to the underlying variant's property, if present.
func (ResponseNewParamsInputArrayItemUnion) GetName ¶
func (u ResponseNewParamsInputArrayItemUnion) GetName() *string
Returns a pointer to the underlying variant's property, if present.
func (ResponseNewParamsInputArrayItemUnion) GetOutput ¶
func (u ResponseNewParamsInputArrayItemUnion) GetOutput() *string
Returns a pointer to the underlying variant's property, if present.
func (ResponseNewParamsInputArrayItemUnion) GetQueries ¶
func (u ResponseNewParamsInputArrayItemUnion) GetQueries() []string
Returns a pointer to the underlying variant's property, if present.
func (ResponseNewParamsInputArrayItemUnion) GetReason ¶
func (u ResponseNewParamsInputArrayItemUnion) GetReason() *string
Returns a pointer to the underlying variant's property, if present.
func (ResponseNewParamsInputArrayItemUnion) GetResults ¶
func (u ResponseNewParamsInputArrayItemUnion) GetResults() []ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageFileSearchToolCallResult
Returns a pointer to the underlying variant's property, if present.
func (ResponseNewParamsInputArrayItemUnion) GetRole ¶
func (u ResponseNewParamsInputArrayItemUnion) GetRole() *string
Returns a pointer to the underlying variant's property, if present.
func (ResponseNewParamsInputArrayItemUnion) GetServerLabel ¶
func (u ResponseNewParamsInputArrayItemUnion) GetServerLabel() *string
Returns a pointer to the underlying variant's property, if present.
func (ResponseNewParamsInputArrayItemUnion) GetStatus ¶
func (u ResponseNewParamsInputArrayItemUnion) GetStatus() *string
Returns a pointer to the underlying variant's property, if present.
func (ResponseNewParamsInputArrayItemUnion) GetTools ¶
func (u ResponseNewParamsInputArrayItemUnion) GetTools() []ResponseNewParamsInputArrayItemOpenAIResponseOutputMessageMcpListToolsTool
Returns a pointer to the underlying variant's property, if present.
func (ResponseNewParamsInputArrayItemUnion) GetType ¶
func (u ResponseNewParamsInputArrayItemUnion) GetType() *string
Returns a pointer to the underlying variant's property, if present.
func (ResponseNewParamsInputArrayItemUnion) MarshalJSON ¶
func (u ResponseNewParamsInputArrayItemUnion) MarshalJSON() ([]byte, error)
func (*ResponseNewParamsInputArrayItemUnion) UnmarshalJSON ¶
func (u *ResponseNewParamsInputArrayItemUnion) UnmarshalJSON(data []byte) error
type ResponseNewParamsInputUnion ¶
type ResponseNewParamsInputUnion struct {
OfString param.Opt[string] `json:",omitzero,inline"`
OfResponseNewsInputArray []ResponseNewParamsInputArrayItemUnion `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 (ResponseNewParamsInputUnion) MarshalJSON ¶
func (u ResponseNewParamsInputUnion) MarshalJSON() ([]byte, error)
func (*ResponseNewParamsInputUnion) UnmarshalJSON ¶
func (u *ResponseNewParamsInputUnion) UnmarshalJSON(data []byte) error
type ResponseNewParamsPrompt ¶
type ResponseNewParamsPrompt struct {
// Unique identifier of the prompt template
ID string `json:"id,required"`
// Version number of the prompt to use (defaults to latest if not specified)
Version param.Opt[string] `json:"version,omitzero"`
// Dictionary of variable names to OpenAIResponseInputMessageContent structure for
// template substitution. The substitution values can either be strings, or other
// Response input types like images or files.
Variables map[string]ResponseNewParamsPromptVariableUnion `json:"variables,omitzero"`
// contains filtered or unexported fields
}
(Optional) Prompt object with ID, version, and variables.
The property ID is required.
func (ResponseNewParamsPrompt) MarshalJSON ¶
func (r ResponseNewParamsPrompt) MarshalJSON() (data []byte, err error)
func (*ResponseNewParamsPrompt) UnmarshalJSON ¶
func (r *ResponseNewParamsPrompt) UnmarshalJSON(data []byte) error
type ResponseNewParamsPromptVariableInputFile ¶
type ResponseNewParamsPromptVariableInputFile struct {
// The data of the file to be sent to the model.
FileData param.Opt[string] `json:"file_data,omitzero"`
// (Optional) The ID of the file to be sent to the model.
FileID param.Opt[string] `json:"file_id,omitzero"`
// The URL of the file to be sent to the model.
FileURL param.Opt[string] `json:"file_url,omitzero"`
// The name of the file to be sent to the model.
Filename param.Opt[string] `json:"filename,omitzero"`
// The type of the input item. Always `input_file`.
//
// This field can be elided, and will marshal its zero value as "input_file".
Type constant.InputFile `json:"type,required"`
// contains filtered or unexported fields
}
File content for input messages in OpenAI response format.
The property Type is required.
func (ResponseNewParamsPromptVariableInputFile) MarshalJSON ¶
func (r ResponseNewParamsPromptVariableInputFile) MarshalJSON() (data []byte, err error)
func (*ResponseNewParamsPromptVariableInputFile) UnmarshalJSON ¶
func (r *ResponseNewParamsPromptVariableInputFile) UnmarshalJSON(data []byte) error
type ResponseNewParamsPromptVariableInputImage ¶
type ResponseNewParamsPromptVariableInputImage struct {
// Level of detail for image processing, can be "low", "high", or "auto"
//
// Any of "low", "high", "auto".
Detail ResponseNewParamsPromptVariableInputImageDetail `json:"detail,omitzero,required"`
// (Optional) The ID of the file to be sent to the model.
FileID param.Opt[string] `json:"file_id,omitzero"`
// (Optional) URL of the image content
ImageURL param.Opt[string] `json:"image_url,omitzero"`
// Content type identifier, always "input_image"
//
// This field can be elided, and will marshal its zero value as "input_image".
Type constant.InputImage `json:"type,required"`
// contains filtered or unexported fields
}
Image content for input messages in OpenAI response format.
The properties Detail, Type are required.
func (ResponseNewParamsPromptVariableInputImage) MarshalJSON ¶
func (r ResponseNewParamsPromptVariableInputImage) MarshalJSON() (data []byte, err error)
func (*ResponseNewParamsPromptVariableInputImage) UnmarshalJSON ¶
func (r *ResponseNewParamsPromptVariableInputImage) UnmarshalJSON(data []byte) error
type ResponseNewParamsPromptVariableInputImageDetail ¶
type ResponseNewParamsPromptVariableInputImageDetail string
Level of detail for image processing, can be "low", "high", or "auto"
const ( ResponseNewParamsPromptVariableInputImageDetailLow ResponseNewParamsPromptVariableInputImageDetail = "low" ResponseNewParamsPromptVariableInputImageDetailHigh ResponseNewParamsPromptVariableInputImageDetail = "high" ResponseNewParamsPromptVariableInputImageDetailAuto ResponseNewParamsPromptVariableInputImageDetail = "auto" )
type ResponseNewParamsPromptVariableInputText ¶
type ResponseNewParamsPromptVariableInputText struct {
// The text content of the input message
Text string `json:"text,required"`
// Content type identifier, always "input_text"
//
// This field can be elided, and will marshal its zero value as "input_text".
Type constant.InputText `json:"type,required"`
// contains filtered or unexported fields
}
Text content for input messages in OpenAI response format.
The properties Text, Type are required.
func (ResponseNewParamsPromptVariableInputText) MarshalJSON ¶
func (r ResponseNewParamsPromptVariableInputText) MarshalJSON() (data []byte, err error)
func (*ResponseNewParamsPromptVariableInputText) UnmarshalJSON ¶
func (r *ResponseNewParamsPromptVariableInputText) UnmarshalJSON(data []byte) error
type ResponseNewParamsPromptVariableUnion ¶
type ResponseNewParamsPromptVariableUnion struct {
OfInputText *ResponseNewParamsPromptVariableInputText `json:",omitzero,inline"`
OfInputImage *ResponseNewParamsPromptVariableInputImage `json:",omitzero,inline"`
OfInputFile *ResponseNewParamsPromptVariableInputFile `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 (ResponseNewParamsPromptVariableUnion) GetDetail ¶
func (u ResponseNewParamsPromptVariableUnion) GetDetail() *string
Returns a pointer to the underlying variant's property, if present.
func (ResponseNewParamsPromptVariableUnion) GetFileData ¶
func (u ResponseNewParamsPromptVariableUnion) GetFileData() *string
Returns a pointer to the underlying variant's property, if present.
func (ResponseNewParamsPromptVariableUnion) GetFileID ¶
func (u ResponseNewParamsPromptVariableUnion) GetFileID() *string
Returns a pointer to the underlying variant's property, if present.
func (ResponseNewParamsPromptVariableUnion) GetFileURL ¶
func (u ResponseNewParamsPromptVariableUnion) GetFileURL() *string
Returns a pointer to the underlying variant's property, if present.
func (ResponseNewParamsPromptVariableUnion) GetFilename ¶
func (u ResponseNewParamsPromptVariableUnion) GetFilename() *string
Returns a pointer to the underlying variant's property, if present.
func (ResponseNewParamsPromptVariableUnion) GetImageURL ¶
func (u ResponseNewParamsPromptVariableUnion) GetImageURL() *string
Returns a pointer to the underlying variant's property, if present.
func (ResponseNewParamsPromptVariableUnion) GetText ¶
func (u ResponseNewParamsPromptVariableUnion) GetText() *string
Returns a pointer to the underlying variant's property, if present.
func (ResponseNewParamsPromptVariableUnion) GetType ¶
func (u ResponseNewParamsPromptVariableUnion) GetType() *string
Returns a pointer to the underlying variant's property, if present.
func (ResponseNewParamsPromptVariableUnion) MarshalJSON ¶
func (u ResponseNewParamsPromptVariableUnion) MarshalJSON() ([]byte, error)
func (*ResponseNewParamsPromptVariableUnion) UnmarshalJSON ¶
func (u *ResponseNewParamsPromptVariableUnion) UnmarshalJSON(data []byte) error
type ResponseNewParamsText ¶
type ResponseNewParamsText struct {
// (Optional) Text format configuration specifying output format requirements
Format ResponseNewParamsTextFormat `json:"format,omitzero"`
// contains filtered or unexported fields
}
Text response configuration for OpenAI responses.
func (ResponseNewParamsText) MarshalJSON ¶
func (r ResponseNewParamsText) MarshalJSON() (data []byte, err error)
func (*ResponseNewParamsText) UnmarshalJSON ¶
func (r *ResponseNewParamsText) UnmarshalJSON(data []byte) error
type ResponseNewParamsTextFormat ¶
type ResponseNewParamsTextFormat struct {
// Must be "text", "json_schema", or "json_object" to identify the format type
//
// Any of "text", "json_schema", "json_object".
Type ResponseNewParamsTextFormatType `json:"type,omitzero,required"`
// (Optional) A description of the response format. Only used for json_schema.
Description param.Opt[string] `json:"description,omitzero"`
// The name of the response format. Only used for json_schema.
Name param.Opt[string] `json:"name,omitzero"`
// (Optional) Whether to strictly enforce the JSON schema. If true, the response
// must match the schema exactly. Only used for json_schema.
Strict param.Opt[bool] `json:"strict,omitzero"`
// The JSON schema the response should conform to. In a Python SDK, this is often a
// `pydantic` model. Only used for json_schema.
Schema map[string]ResponseNewParamsTextFormatSchemaUnion `json:"schema,omitzero"`
// contains filtered or unexported fields
}
(Optional) Text format configuration specifying output format requirements
The property Type is required.
func (ResponseNewParamsTextFormat) MarshalJSON ¶
func (r ResponseNewParamsTextFormat) MarshalJSON() (data []byte, err error)
func (*ResponseNewParamsTextFormat) UnmarshalJSON ¶
func (r *ResponseNewParamsTextFormat) UnmarshalJSON(data []byte) error
type ResponseNewParamsTextFormatSchemaUnion ¶
type ResponseNewParamsTextFormatSchemaUnion 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 (ResponseNewParamsTextFormatSchemaUnion) MarshalJSON ¶
func (u ResponseNewParamsTextFormatSchemaUnion) MarshalJSON() ([]byte, error)
func (*ResponseNewParamsTextFormatSchemaUnion) UnmarshalJSON ¶
func (u *ResponseNewParamsTextFormatSchemaUnion) UnmarshalJSON(data []byte) error
type ResponseNewParamsTextFormatType ¶
type ResponseNewParamsTextFormatType string
Must be "text", "json_schema", or "json_object" to identify the format type
const ( ResponseNewParamsTextFormatTypeText ResponseNewParamsTextFormatType = "text" ResponseNewParamsTextFormatTypeJsonSchema ResponseNewParamsTextFormatType = "json_schema" ResponseNewParamsTextFormatTypeJsonObject ResponseNewParamsTextFormatType = "json_object" )
type ResponseNewParamsToolFileSearch ¶
type ResponseNewParamsToolFileSearch struct {
// List of vector store identifiers to search within
VectorStoreIDs []string `json:"vector_store_ids,omitzero,required"`
// (Optional) Maximum number of search results to return (1-50)
MaxNumResults param.Opt[int64] `json:"max_num_results,omitzero"`
// (Optional) Additional filters to apply to the search
Filters map[string]ResponseNewParamsToolFileSearchFilterUnion `json:"filters,omitzero"`
// (Optional) Options for ranking and scoring search results
RankingOptions ResponseNewParamsToolFileSearchRankingOptions `json:"ranking_options,omitzero"`
// Tool type identifier, always "file_search"
//
// This field can be elided, and will marshal its zero value as "file_search".
Type constant.FileSearch `json:"type,required"`
// contains filtered or unexported fields
}
File search tool configuration for OpenAI response inputs.
The properties Type, VectorStoreIDs are required.
func (ResponseNewParamsToolFileSearch) MarshalJSON ¶
func (r ResponseNewParamsToolFileSearch) MarshalJSON() (data []byte, err error)
func (*ResponseNewParamsToolFileSearch) UnmarshalJSON ¶
func (r *ResponseNewParamsToolFileSearch) UnmarshalJSON(data []byte) error
type ResponseNewParamsToolFileSearchFilterUnion ¶
type ResponseNewParamsToolFileSearchFilterUnion 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 (ResponseNewParamsToolFileSearchFilterUnion) MarshalJSON ¶
func (u ResponseNewParamsToolFileSearchFilterUnion) MarshalJSON() ([]byte, error)
func (*ResponseNewParamsToolFileSearchFilterUnion) UnmarshalJSON ¶
func (u *ResponseNewParamsToolFileSearchFilterUnion) UnmarshalJSON(data []byte) error
type ResponseNewParamsToolFileSearchRankingOptions ¶
type ResponseNewParamsToolFileSearchRankingOptions struct {
// (Optional) Name of the ranking algorithm to use
Ranker param.Opt[string] `json:"ranker,omitzero"`
// (Optional) Minimum relevance score threshold for results
ScoreThreshold param.Opt[float64] `json:"score_threshold,omitzero"`
// contains filtered or unexported fields
}
(Optional) Options for ranking and scoring search results
func (ResponseNewParamsToolFileSearchRankingOptions) MarshalJSON ¶
func (r ResponseNewParamsToolFileSearchRankingOptions) MarshalJSON() (data []byte, err error)
func (*ResponseNewParamsToolFileSearchRankingOptions) UnmarshalJSON ¶
func (r *ResponseNewParamsToolFileSearchRankingOptions) UnmarshalJSON(data []byte) error
type ResponseNewParamsToolFunction ¶
type ResponseNewParamsToolFunction struct {
// Name of the function that can be called
Name string `json:"name,required"`
// (Optional) Description of what the function does
Description param.Opt[string] `json:"description,omitzero"`
// (Optional) Whether to enforce strict parameter validation
Strict param.Opt[bool] `json:"strict,omitzero"`
// (Optional) JSON schema defining the function's parameters
Parameters map[string]ResponseNewParamsToolFunctionParameterUnion `json:"parameters,omitzero"`
// Tool type identifier, always "function"
//
// This field can be elided, and will marshal its zero value as "function".
Type constant.Function `json:"type,required"`
// contains filtered or unexported fields
}
Function tool configuration for OpenAI response inputs.
The properties Name, Type are required.
func (ResponseNewParamsToolFunction) MarshalJSON ¶
func (r ResponseNewParamsToolFunction) MarshalJSON() (data []byte, err error)
func (*ResponseNewParamsToolFunction) UnmarshalJSON ¶
func (r *ResponseNewParamsToolFunction) UnmarshalJSON(data []byte) error
type ResponseNewParamsToolFunctionParameterUnion ¶
type ResponseNewParamsToolFunctionParameterUnion 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 (ResponseNewParamsToolFunctionParameterUnion) MarshalJSON ¶
func (u ResponseNewParamsToolFunctionParameterUnion) MarshalJSON() ([]byte, error)
func (*ResponseNewParamsToolFunctionParameterUnion) UnmarshalJSON ¶
func (u *ResponseNewParamsToolFunctionParameterUnion) UnmarshalJSON(data []byte) error
type ResponseNewParamsToolMcp ¶
type ResponseNewParamsToolMcp struct {
// Approval requirement for tool calls ("always", "never", or filter)
RequireApproval ResponseNewParamsToolMcpRequireApprovalUnion `json:"require_approval,omitzero,required"`
// Label to identify this MCP server
ServerLabel string `json:"server_label,required"`
// URL endpoint of the MCP server
ServerURL string `json:"server_url,required"`
// (Optional) OAuth access token for authenticating with the MCP server
Authorization param.Opt[string] `json:"authorization,omitzero"`
// (Optional) Restriction on which tools can be used from this server
AllowedTools ResponseNewParamsToolMcpAllowedToolsUnion `json:"allowed_tools,omitzero"`
// (Optional) HTTP headers to include when connecting to the server
Headers map[string]ResponseNewParamsToolMcpHeaderUnion `json:"headers,omitzero"`
// Tool type identifier, always "mcp"
//
// This field can be elided, and will marshal its zero value as "mcp".
Type constant.Mcp `json:"type,required"`
// contains filtered or unexported fields
}
Model Context Protocol (MCP) tool configuration for OpenAI response inputs.
The properties RequireApproval, ServerLabel, ServerURL, Type are required.
func (ResponseNewParamsToolMcp) MarshalJSON ¶
func (r ResponseNewParamsToolMcp) MarshalJSON() (data []byte, err error)
func (*ResponseNewParamsToolMcp) UnmarshalJSON ¶
func (r *ResponseNewParamsToolMcp) UnmarshalJSON(data []byte) error
type ResponseNewParamsToolMcpAllowedToolsAllowedToolsFilter ¶
type ResponseNewParamsToolMcpAllowedToolsAllowedToolsFilter struct {
// (Optional) List of specific tool names that are allowed
ToolNames []string `json:"tool_names,omitzero"`
// contains filtered or unexported fields
}
Filter configuration for restricting which MCP tools can be used.
func (ResponseNewParamsToolMcpAllowedToolsAllowedToolsFilter) MarshalJSON ¶
func (r ResponseNewParamsToolMcpAllowedToolsAllowedToolsFilter) MarshalJSON() (data []byte, err error)
func (*ResponseNewParamsToolMcpAllowedToolsAllowedToolsFilter) UnmarshalJSON ¶
func (r *ResponseNewParamsToolMcpAllowedToolsAllowedToolsFilter) UnmarshalJSON(data []byte) error
type ResponseNewParamsToolMcpAllowedToolsUnion ¶
type ResponseNewParamsToolMcpAllowedToolsUnion struct {
OfStringArray []string `json:",omitzero,inline"`
OfAllowedToolsFilter *ResponseNewParamsToolMcpAllowedToolsAllowedToolsFilter `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 (ResponseNewParamsToolMcpAllowedToolsUnion) MarshalJSON ¶
func (u ResponseNewParamsToolMcpAllowedToolsUnion) MarshalJSON() ([]byte, error)
func (*ResponseNewParamsToolMcpAllowedToolsUnion) UnmarshalJSON ¶
func (u *ResponseNewParamsToolMcpAllowedToolsUnion) UnmarshalJSON(data []byte) error
type ResponseNewParamsToolMcpHeaderUnion ¶
type ResponseNewParamsToolMcpHeaderUnion 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 (ResponseNewParamsToolMcpHeaderUnion) MarshalJSON ¶
func (u ResponseNewParamsToolMcpHeaderUnion) MarshalJSON() ([]byte, error)
func (*ResponseNewParamsToolMcpHeaderUnion) UnmarshalJSON ¶
func (u *ResponseNewParamsToolMcpHeaderUnion) UnmarshalJSON(data []byte) error
type ResponseNewParamsToolMcpRequireApprovalApprovalFilter ¶
type ResponseNewParamsToolMcpRequireApprovalApprovalFilter struct {
// (Optional) List of tool names that always require approval
Always []string `json:"always,omitzero"`
// (Optional) List of tool names that never require approval
Never []string `json:"never,omitzero"`
// contains filtered or unexported fields
}
Filter configuration for MCP tool approval requirements.
func (ResponseNewParamsToolMcpRequireApprovalApprovalFilter) MarshalJSON ¶
func (r ResponseNewParamsToolMcpRequireApprovalApprovalFilter) MarshalJSON() (data []byte, err error)
func (*ResponseNewParamsToolMcpRequireApprovalApprovalFilter) UnmarshalJSON ¶
func (r *ResponseNewParamsToolMcpRequireApprovalApprovalFilter) UnmarshalJSON(data []byte) error
type ResponseNewParamsToolMcpRequireApprovalString ¶
type ResponseNewParamsToolMcpRequireApprovalString string
const ( ResponseNewParamsToolMcpRequireApprovalStringAlways ResponseNewParamsToolMcpRequireApprovalString = "always" ResponseNewParamsToolMcpRequireApprovalStringNever ResponseNewParamsToolMcpRequireApprovalString = "never" )
type ResponseNewParamsToolMcpRequireApprovalUnion ¶
type ResponseNewParamsToolMcpRequireApprovalUnion struct {
// Check if union is this variant with
// !param.IsOmitted(union.OfResponseNewsToolMcpRequireApprovalString)
OfResponseNewsToolMcpRequireApprovalString param.Opt[ResponseNewParamsToolMcpRequireApprovalString] `json:",omitzero,inline"`
OfApprovalFilter *ResponseNewParamsToolMcpRequireApprovalApprovalFilter `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 (ResponseNewParamsToolMcpRequireApprovalUnion) MarshalJSON ¶
func (u ResponseNewParamsToolMcpRequireApprovalUnion) MarshalJSON() ([]byte, error)
func (*ResponseNewParamsToolMcpRequireApprovalUnion) UnmarshalJSON ¶
func (u *ResponseNewParamsToolMcpRequireApprovalUnion) UnmarshalJSON(data []byte) error
type ResponseNewParamsToolOpenAIResponseInputToolWebSearch ¶
type ResponseNewParamsToolOpenAIResponseInputToolWebSearch struct {
// Web search tool type variant to use
//
// Any of "web_search", "web_search_preview", "web_search_preview_2025_03_11",
// "web_search_2025_08_26".
Type ResponseNewParamsToolOpenAIResponseInputToolWebSearchType `json:"type,omitzero,required"`
// (Optional) Size of search context, must be "low", "medium", or "high"
SearchContextSize param.Opt[string] `json:"search_context_size,omitzero"`
// contains filtered or unexported fields
}
Web search tool configuration for OpenAI response inputs.
The property Type is required.
func (ResponseNewParamsToolOpenAIResponseInputToolWebSearch) MarshalJSON ¶
func (r ResponseNewParamsToolOpenAIResponseInputToolWebSearch) MarshalJSON() (data []byte, err error)
func (*ResponseNewParamsToolOpenAIResponseInputToolWebSearch) UnmarshalJSON ¶
func (r *ResponseNewParamsToolOpenAIResponseInputToolWebSearch) UnmarshalJSON(data []byte) error
type ResponseNewParamsToolOpenAIResponseInputToolWebSearchType ¶
type ResponseNewParamsToolOpenAIResponseInputToolWebSearchType string
Web search tool type variant to use
const ( ResponseNewParamsToolOpenAIResponseInputToolWebSearchTypeWebSearch ResponseNewParamsToolOpenAIResponseInputToolWebSearchType = "web_search" ResponseNewParamsToolOpenAIResponseInputToolWebSearchTypeWebSearchPreview ResponseNewParamsToolOpenAIResponseInputToolWebSearchType = "web_search_preview" ResponseNewParamsToolOpenAIResponseInputToolWebSearchTypeWebSearchPreview2025_03_11 ResponseNewParamsToolOpenAIResponseInputToolWebSearchType = "web_search_preview_2025_03_11" ResponseNewParamsToolOpenAIResponseInputToolWebSearchTypeWebSearch2025_08_26 ResponseNewParamsToolOpenAIResponseInputToolWebSearchType = "web_search_2025_08_26" )
type ResponseNewParamsToolUnion ¶
type ResponseNewParamsToolUnion struct {
OfOpenAIResponseInputToolWebSearch *ResponseNewParamsToolOpenAIResponseInputToolWebSearch `json:",omitzero,inline"`
OfFileSearch *ResponseNewParamsToolFileSearch `json:",omitzero,inline"`
OfFunction *ResponseNewParamsToolFunction `json:",omitzero,inline"`
OfMcp *ResponseNewParamsToolMcp `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 (ResponseNewParamsToolUnion) GetAllowedTools ¶
func (u ResponseNewParamsToolUnion) GetAllowedTools() *ResponseNewParamsToolMcpAllowedToolsUnion
Returns a pointer to the underlying variant's property, if present.
func (ResponseNewParamsToolUnion) GetAuthorization ¶
func (u ResponseNewParamsToolUnion) GetAuthorization() *string
Returns a pointer to the underlying variant's property, if present.
func (ResponseNewParamsToolUnion) GetDescription ¶
func (u ResponseNewParamsToolUnion) GetDescription() *string
Returns a pointer to the underlying variant's property, if present.
func (ResponseNewParamsToolUnion) GetFilters ¶
func (u ResponseNewParamsToolUnion) GetFilters() map[string]ResponseNewParamsToolFileSearchFilterUnion
Returns a pointer to the underlying variant's property, if present.
func (ResponseNewParamsToolUnion) GetHeaders ¶
func (u ResponseNewParamsToolUnion) GetHeaders() map[string]ResponseNewParamsToolMcpHeaderUnion
Returns a pointer to the underlying variant's property, if present.
func (ResponseNewParamsToolUnion) GetMaxNumResults ¶
func (u ResponseNewParamsToolUnion) GetMaxNumResults() *int64
Returns a pointer to the underlying variant's property, if present.
func (ResponseNewParamsToolUnion) GetName ¶
func (u ResponseNewParamsToolUnion) GetName() *string
Returns a pointer to the underlying variant's property, if present.
func (ResponseNewParamsToolUnion) GetParameters ¶
func (u ResponseNewParamsToolUnion) GetParameters() map[string]ResponseNewParamsToolFunctionParameterUnion
Returns a pointer to the underlying variant's property, if present.
func (ResponseNewParamsToolUnion) GetRankingOptions ¶
func (u ResponseNewParamsToolUnion) GetRankingOptions() *ResponseNewParamsToolFileSearchRankingOptions
Returns a pointer to the underlying variant's property, if present.
func (ResponseNewParamsToolUnion) GetRequireApproval ¶
func (u ResponseNewParamsToolUnion) GetRequireApproval() *ResponseNewParamsToolMcpRequireApprovalUnion
Returns a pointer to the underlying variant's property, if present.
func (ResponseNewParamsToolUnion) GetSearchContextSize ¶
func (u ResponseNewParamsToolUnion) GetSearchContextSize() *string
Returns a pointer to the underlying variant's property, if present.
func (ResponseNewParamsToolUnion) GetServerLabel ¶
func (u ResponseNewParamsToolUnion) GetServerLabel() *string
Returns a pointer to the underlying variant's property, if present.
func (ResponseNewParamsToolUnion) GetServerURL ¶
func (u ResponseNewParamsToolUnion) GetServerURL() *string
Returns a pointer to the underlying variant's property, if present.
func (ResponseNewParamsToolUnion) GetStrict ¶
func (u ResponseNewParamsToolUnion) GetStrict() *bool
Returns a pointer to the underlying variant's property, if present.
func (ResponseNewParamsToolUnion) GetType ¶
func (u ResponseNewParamsToolUnion) GetType() *string
Returns a pointer to the underlying variant's property, if present.
func (ResponseNewParamsToolUnion) GetVectorStoreIDs ¶
func (u ResponseNewParamsToolUnion) GetVectorStoreIDs() []string
Returns a pointer to the underlying variant's property, if present.
func (ResponseNewParamsToolUnion) MarshalJSON ¶
func (u ResponseNewParamsToolUnion) MarshalJSON() ([]byte, error)
func (*ResponseNewParamsToolUnion) UnmarshalJSON ¶
func (u *ResponseNewParamsToolUnion) UnmarshalJSON(data []byte) error
type ResponseObject ¶
type ResponseObject struct {
// Unique identifier for this response
ID string `json:"id,required"`
// Unix timestamp when the response was created
CreatedAt int64 `json:"created_at,required"`
// Model identifier used for generation
Model string `json:"model,required"`
// Object type identifier, always "response"
Object constant.Response `json:"object,required"`
// List of generated output items (messages, tool calls, etc.)
Output []ResponseObjectOutputUnion `json:"output,required"`
// Whether tool calls can be executed in parallel
ParallelToolCalls bool `json:"parallel_tool_calls,required"`
// Current status of the response generation
Status string `json:"status,required"`
// Text formatting configuration for the response
Text ResponseObjectText `json:"text,required"`
// (Optional) Error details if the response generation failed
Error ResponseObjectError `json:"error"`
// (Optional) System message inserted into the model's context
Instructions string `json:"instructions"`
// (Optional) Max number of total calls to built-in tools that can be processed in
// a response
MaxToolCalls int64 `json:"max_tool_calls"`
// (Optional) ID of the previous response in a conversation
PreviousResponseID string `json:"previous_response_id"`
// (Optional) Reference to a prompt template and its variables.
Prompt ResponseObjectPrompt `json:"prompt"`
// (Optional) Sampling temperature used for generation
Temperature float64 `json:"temperature"`
// (Optional) An array of tools the model may call while generating a response.
Tools []ResponseObjectToolUnion `json:"tools"`
// (Optional) Nucleus sampling parameter used for generation
TopP float64 `json:"top_p"`
// (Optional) Truncation strategy applied to the response
Truncation string `json:"truncation"`
// (Optional) Token usage information for the response
Usage ResponseObjectUsage `json:"usage"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
Model respjson.Field
Object respjson.Field
Output respjson.Field
ParallelToolCalls respjson.Field
Status respjson.Field
Text respjson.Field
Error respjson.Field
Instructions respjson.Field
MaxToolCalls respjson.Field
PreviousResponseID respjson.Field
Prompt respjson.Field
Temperature respjson.Field
Tools respjson.Field
TopP respjson.Field
Truncation respjson.Field
Usage respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Complete OpenAI response object containing generation results and metadata.
func (ResponseObject) RawJSON ¶
func (r ResponseObject) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObject) UnmarshalJSON ¶
func (r *ResponseObject) UnmarshalJSON(data []byte) error
type ResponseObjectError ¶
type ResponseObjectError struct {
// Error code identifying the type of failure
Code string `json:"code,required"`
// Human-readable error message describing the failure
Message string `json:"message,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Code respjson.Field
Message respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
(Optional) Error details if the response generation failed
func (ResponseObjectError) RawJSON ¶
func (r ResponseObjectError) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectError) UnmarshalJSON ¶
func (r *ResponseObjectError) UnmarshalJSON(data []byte) error
type ResponseObjectOutputFileSearchCall ¶
type ResponseObjectOutputFileSearchCall struct {
// Unique identifier for this tool call
ID string `json:"id,required"`
// List of search queries executed
Queries []string `json:"queries,required"`
// Current status of the file search operation
Status string `json:"status,required"`
// Tool call type identifier, always "file_search_call"
Type constant.FileSearchCall `json:"type,required"`
// (Optional) Search results returned by the file search operation
Results []ResponseObjectOutputFileSearchCallResult `json:"results"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Queries respjson.Field
Status respjson.Field
Type respjson.Field
Results respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
File search tool call output message for OpenAI responses.
func (ResponseObjectOutputFileSearchCall) RawJSON ¶
func (r ResponseObjectOutputFileSearchCall) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectOutputFileSearchCall) UnmarshalJSON ¶
func (r *ResponseObjectOutputFileSearchCall) UnmarshalJSON(data []byte) error
type ResponseObjectOutputFileSearchCallResult ¶
type ResponseObjectOutputFileSearchCallResult struct {
// (Optional) Key-value attributes associated with the file
Attributes map[string]ResponseObjectOutputFileSearchCallResultAttributeUnion `json:"attributes,required"`
// Unique identifier of the file containing the result
FileID string `json:"file_id,required"`
// Name of the file containing the result
Filename string `json:"filename,required"`
// Relevance score for this search result (between 0 and 1)
Score float64 `json:"score,required"`
// Text content of the search result
Text string `json:"text,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Attributes respjson.Field
FileID respjson.Field
Filename respjson.Field
Score respjson.Field
Text respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Search results returned by the file search operation.
func (ResponseObjectOutputFileSearchCallResult) RawJSON ¶
func (r ResponseObjectOutputFileSearchCallResult) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectOutputFileSearchCallResult) UnmarshalJSON ¶
func (r *ResponseObjectOutputFileSearchCallResult) UnmarshalJSON(data []byte) error
type ResponseObjectOutputFileSearchCallResultAttributeUnion ¶
type ResponseObjectOutputFileSearchCallResultAttributeUnion 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:"-"`
}
ResponseObjectOutputFileSearchCallResultAttributeUnion 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 (ResponseObjectOutputFileSearchCallResultAttributeUnion) AsAnyArray ¶
func (u ResponseObjectOutputFileSearchCallResultAttributeUnion) AsAnyArray() (v []any)
func (ResponseObjectOutputFileSearchCallResultAttributeUnion) AsBool ¶
func (u ResponseObjectOutputFileSearchCallResultAttributeUnion) AsBool() (v bool)
func (ResponseObjectOutputFileSearchCallResultAttributeUnion) AsFloat ¶
func (u ResponseObjectOutputFileSearchCallResultAttributeUnion) AsFloat() (v float64)
func (ResponseObjectOutputFileSearchCallResultAttributeUnion) AsString ¶
func (u ResponseObjectOutputFileSearchCallResultAttributeUnion) AsString() (v string)
func (ResponseObjectOutputFileSearchCallResultAttributeUnion) RawJSON ¶
func (u ResponseObjectOutputFileSearchCallResultAttributeUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectOutputFileSearchCallResultAttributeUnion) UnmarshalJSON ¶
func (r *ResponseObjectOutputFileSearchCallResultAttributeUnion) UnmarshalJSON(data []byte) error
type ResponseObjectOutputFunctionCall ¶
type ResponseObjectOutputFunctionCall struct {
// JSON string containing the function arguments
Arguments string `json:"arguments,required"`
// Unique identifier for the function call
CallID string `json:"call_id,required"`
// Name of the function being called
Name string `json:"name,required"`
// Tool call type identifier, always "function_call"
Type constant.FunctionCall `json:"type,required"`
// (Optional) Additional identifier for the tool call
ID string `json:"id"`
// (Optional) Current status of the function call execution
Status string `json:"status"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Arguments respjson.Field
CallID respjson.Field
Name respjson.Field
Type respjson.Field
ID respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Function tool call output message for OpenAI responses.
func (ResponseObjectOutputFunctionCall) RawJSON ¶
func (r ResponseObjectOutputFunctionCall) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectOutputFunctionCall) UnmarshalJSON ¶
func (r *ResponseObjectOutputFunctionCall) UnmarshalJSON(data []byte) error
type ResponseObjectOutputMcpApprovalRequest ¶
type ResponseObjectOutputMcpApprovalRequest struct {
ID string `json:"id,required"`
Arguments string `json:"arguments,required"`
Name string `json:"name,required"`
ServerLabel string `json:"server_label,required"`
Type constant.McpApprovalRequest `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Arguments respjson.Field
Name respjson.Field
ServerLabel respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A request for human approval of a tool invocation.
func (ResponseObjectOutputMcpApprovalRequest) RawJSON ¶
func (r ResponseObjectOutputMcpApprovalRequest) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectOutputMcpApprovalRequest) UnmarshalJSON ¶
func (r *ResponseObjectOutputMcpApprovalRequest) UnmarshalJSON(data []byte) error
type ResponseObjectOutputMcpCall ¶
type ResponseObjectOutputMcpCall struct {
// Unique identifier for this MCP call
ID string `json:"id,required"`
// JSON string containing the MCP call arguments
Arguments string `json:"arguments,required"`
// Name of the MCP method being called
Name string `json:"name,required"`
// Label identifying the MCP server handling the call
ServerLabel string `json:"server_label,required"`
// Tool call type identifier, always "mcp_call"
Type constant.McpCall `json:"type,required"`
// (Optional) Error message if the MCP call failed
Error string `json:"error"`
// (Optional) Output result from the successful MCP call
Output string `json:"output"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Arguments respjson.Field
Name respjson.Field
ServerLabel respjson.Field
Type respjson.Field
Error respjson.Field
Output respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Model Context Protocol (MCP) call output message for OpenAI responses.
func (ResponseObjectOutputMcpCall) RawJSON ¶
func (r ResponseObjectOutputMcpCall) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectOutputMcpCall) UnmarshalJSON ¶
func (r *ResponseObjectOutputMcpCall) UnmarshalJSON(data []byte) error
type ResponseObjectOutputMcpListTools ¶
type ResponseObjectOutputMcpListTools struct {
// Unique identifier for this MCP list tools operation
ID string `json:"id,required"`
// Label identifying the MCP server providing the tools
ServerLabel string `json:"server_label,required"`
// List of available tools provided by the MCP server
Tools []ResponseObjectOutputMcpListToolsTool `json:"tools,required"`
// Tool call type identifier, always "mcp_list_tools"
Type constant.McpListTools `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
ServerLabel respjson.Field
Tools respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
MCP list tools output message containing available tools from an MCP server.
func (ResponseObjectOutputMcpListTools) RawJSON ¶
func (r ResponseObjectOutputMcpListTools) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectOutputMcpListTools) UnmarshalJSON ¶
func (r *ResponseObjectOutputMcpListTools) UnmarshalJSON(data []byte) error
type ResponseObjectOutputMcpListToolsTool ¶
type ResponseObjectOutputMcpListToolsTool struct {
// JSON schema defining the tool's input parameters
InputSchema map[string]ResponseObjectOutputMcpListToolsToolInputSchemaUnion `json:"input_schema,required"`
// Name of the tool
Name string `json:"name,required"`
// (Optional) Description of what the tool does
Description string `json:"description"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
InputSchema respjson.Field
Name respjson.Field
Description respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Tool definition returned by MCP list tools operation.
func (ResponseObjectOutputMcpListToolsTool) RawJSON ¶
func (r ResponseObjectOutputMcpListToolsTool) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectOutputMcpListToolsTool) UnmarshalJSON ¶
func (r *ResponseObjectOutputMcpListToolsTool) UnmarshalJSON(data []byte) error
type ResponseObjectOutputMcpListToolsToolInputSchemaUnion ¶
type ResponseObjectOutputMcpListToolsToolInputSchemaUnion 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:"-"`
}
ResponseObjectOutputMcpListToolsToolInputSchemaUnion 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 (ResponseObjectOutputMcpListToolsToolInputSchemaUnion) AsAnyArray ¶
func (u ResponseObjectOutputMcpListToolsToolInputSchemaUnion) AsAnyArray() (v []any)
func (ResponseObjectOutputMcpListToolsToolInputSchemaUnion) AsBool ¶
func (u ResponseObjectOutputMcpListToolsToolInputSchemaUnion) AsBool() (v bool)
func (ResponseObjectOutputMcpListToolsToolInputSchemaUnion) AsFloat ¶
func (u ResponseObjectOutputMcpListToolsToolInputSchemaUnion) AsFloat() (v float64)
func (ResponseObjectOutputMcpListToolsToolInputSchemaUnion) AsString ¶
func (u ResponseObjectOutputMcpListToolsToolInputSchemaUnion) AsString() (v string)
func (ResponseObjectOutputMcpListToolsToolInputSchemaUnion) RawJSON ¶
func (u ResponseObjectOutputMcpListToolsToolInputSchemaUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectOutputMcpListToolsToolInputSchemaUnion) UnmarshalJSON ¶
func (r *ResponseObjectOutputMcpListToolsToolInputSchemaUnion) UnmarshalJSON(data []byte) error
type ResponseObjectOutputMessage ¶
type ResponseObjectOutputMessage struct {
Content ResponseObjectOutputMessageContentUnion `json:"content,required"`
// Any of "system", "developer", "user", "assistant".
Role ResponseObjectOutputMessageRole `json:"role,required"`
Type constant.Message `json:"type,required"`
ID string `json:"id"`
Status string `json:"status"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Content respjson.Field
Role respjson.Field
Type respjson.Field
ID respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Corresponds to the various Message types in the Responses API. They are all under one type because the Responses API gives them all the same "type" value, and there is no way to tell them apart in certain scenarios.
func (ResponseObjectOutputMessage) RawJSON ¶
func (r ResponseObjectOutputMessage) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectOutputMessage) UnmarshalJSON ¶
func (r *ResponseObjectOutputMessage) UnmarshalJSON(data []byte) error
type ResponseObjectOutputMessageContentArrayItemDetail ¶
type ResponseObjectOutputMessageContentArrayItemDetail string
Level of detail for image processing, can be "low", "high", or "auto"
const ( ResponseObjectOutputMessageContentArrayItemDetailLow ResponseObjectOutputMessageContentArrayItemDetail = "low" ResponseObjectOutputMessageContentArrayItemDetailHigh ResponseObjectOutputMessageContentArrayItemDetail = "high" ResponseObjectOutputMessageContentArrayItemDetailAuto ResponseObjectOutputMessageContentArrayItemDetail = "auto" )
type ResponseObjectOutputMessageContentArrayItemInputFile ¶
type ResponseObjectOutputMessageContentArrayItemInputFile struct {
// The type of the input item. Always `input_file`.
Type constant.InputFile `json:"type,required"`
// The data of the file to be sent to the model.
FileData string `json:"file_data"`
// (Optional) The ID of the file to be sent to the model.
FileID string `json:"file_id"`
// The URL of the file to be sent to the model.
FileURL string `json:"file_url"`
// The name of the file to be sent to the model.
Filename string `json:"filename"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Type respjson.Field
FileData respjson.Field
FileID respjson.Field
FileURL respjson.Field
Filename respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
File content for input messages in OpenAI response format.
func (ResponseObjectOutputMessageContentArrayItemInputFile) RawJSON ¶
func (r ResponseObjectOutputMessageContentArrayItemInputFile) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectOutputMessageContentArrayItemInputFile) UnmarshalJSON ¶
func (r *ResponseObjectOutputMessageContentArrayItemInputFile) UnmarshalJSON(data []byte) error
type ResponseObjectOutputMessageContentArrayItemInputImage ¶
type ResponseObjectOutputMessageContentArrayItemInputImage struct {
// Level of detail for image processing, can be "low", "high", or "auto"
//
// Any of "low", "high", "auto".
Detail ResponseObjectOutputMessageContentArrayItemInputImageDetail `json:"detail,required"`
// Content type identifier, always "input_image"
Type constant.InputImage `json:"type,required"`
// (Optional) The ID of the file to be sent to the model.
FileID string `json:"file_id"`
// (Optional) URL of the image content
ImageURL string `json:"image_url"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Detail respjson.Field
Type respjson.Field
FileID respjson.Field
ImageURL respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Image content for input messages in OpenAI response format.
func (ResponseObjectOutputMessageContentArrayItemInputImage) RawJSON ¶
func (r ResponseObjectOutputMessageContentArrayItemInputImage) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectOutputMessageContentArrayItemInputImage) UnmarshalJSON ¶
func (r *ResponseObjectOutputMessageContentArrayItemInputImage) UnmarshalJSON(data []byte) error
type ResponseObjectOutputMessageContentArrayItemInputImageDetail ¶
type ResponseObjectOutputMessageContentArrayItemInputImageDetail string
Level of detail for image processing, can be "low", "high", or "auto"
const ( ResponseObjectOutputMessageContentArrayItemInputImageDetailLow ResponseObjectOutputMessageContentArrayItemInputImageDetail = "low" ResponseObjectOutputMessageContentArrayItemInputImageDetailHigh ResponseObjectOutputMessageContentArrayItemInputImageDetail = "high" ResponseObjectOutputMessageContentArrayItemInputImageDetailAuto ResponseObjectOutputMessageContentArrayItemInputImageDetail = "auto" )
type ResponseObjectOutputMessageContentArrayItemInputText ¶
type ResponseObjectOutputMessageContentArrayItemInputText struct {
// The text content of the input message
Text string `json:"text,required"`
// Content type identifier, always "input_text"
Type constant.InputText `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:"-"`
}
Text content for input messages in OpenAI response format.
func (ResponseObjectOutputMessageContentArrayItemInputText) RawJSON ¶
func (r ResponseObjectOutputMessageContentArrayItemInputText) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectOutputMessageContentArrayItemInputText) UnmarshalJSON ¶
func (r *ResponseObjectOutputMessageContentArrayItemInputText) UnmarshalJSON(data []byte) error
type ResponseObjectOutputMessageContentArrayItemUnion ¶
type ResponseObjectOutputMessageContentArrayItemUnion struct {
// This field is from variant
// [ResponseObjectOutputMessageContentArrayItemInputText].
Text string `json:"text"`
// Any of "input_text", "input_image", "input_file".
Type string `json:"type"`
// This field is from variant
// [ResponseObjectOutputMessageContentArrayItemInputImage].
Detail ResponseObjectOutputMessageContentArrayItemInputImageDetail `json:"detail"`
FileID string `json:"file_id"`
// This field is from variant
// [ResponseObjectOutputMessageContentArrayItemInputImage].
ImageURL string `json:"image_url"`
// This field is from variant
// [ResponseObjectOutputMessageContentArrayItemInputFile].
FileData string `json:"file_data"`
// This field is from variant
// [ResponseObjectOutputMessageContentArrayItemInputFile].
FileURL string `json:"file_url"`
// This field is from variant
// [ResponseObjectOutputMessageContentArrayItemInputFile].
Filename string `json:"filename"`
JSON struct {
Text respjson.Field
Type respjson.Field
Detail respjson.Field
FileID respjson.Field
ImageURL respjson.Field
FileData respjson.Field
FileURL respjson.Field
Filename respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ResponseObjectOutputMessageContentArrayItemUnion contains all possible properties and values from ResponseObjectOutputMessageContentArrayItemInputText, ResponseObjectOutputMessageContentArrayItemInputImage, ResponseObjectOutputMessageContentArrayItemInputFile.
Use the ResponseObjectOutputMessageContentArrayItemUnion.AsAny method to switch on the variant.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (ResponseObjectOutputMessageContentArrayItemUnion) AsAny ¶
func (u ResponseObjectOutputMessageContentArrayItemUnion) AsAny() anyResponseObjectOutputMessageContentArrayItem
Use the following switch statement to find the correct variant
switch variant := ResponseObjectOutputMessageContentArrayItemUnion.AsAny().(type) {
case llamastackclient.ResponseObjectOutputMessageContentArrayItemInputText:
case llamastackclient.ResponseObjectOutputMessageContentArrayItemInputImage:
case llamastackclient.ResponseObjectOutputMessageContentArrayItemInputFile:
default:
fmt.Errorf("no variant present")
}
func (ResponseObjectOutputMessageContentArrayItemUnion) AsInputFile ¶
func (u ResponseObjectOutputMessageContentArrayItemUnion) AsInputFile() (v ResponseObjectOutputMessageContentArrayItemInputFile)
func (ResponseObjectOutputMessageContentArrayItemUnion) AsInputImage ¶
func (u ResponseObjectOutputMessageContentArrayItemUnion) AsInputImage() (v ResponseObjectOutputMessageContentArrayItemInputImage)
func (ResponseObjectOutputMessageContentArrayItemUnion) AsInputText ¶
func (u ResponseObjectOutputMessageContentArrayItemUnion) AsInputText() (v ResponseObjectOutputMessageContentArrayItemInputText)
func (ResponseObjectOutputMessageContentArrayItemUnion) RawJSON ¶
func (u ResponseObjectOutputMessageContentArrayItemUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectOutputMessageContentArrayItemUnion) UnmarshalJSON ¶
func (r *ResponseObjectOutputMessageContentArrayItemUnion) UnmarshalJSON(data []byte) error
type ResponseObjectOutputMessageContentUnion ¶
type ResponseObjectOutputMessageContentUnion 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
// [[]ResponseObjectOutputMessageContentArrayItemUnion] instead of an object.
OfVariant2 []ResponseObjectOutputMessageContentArrayItemUnion `json:",inline"`
JSON struct {
OfString respjson.Field
OfVariant2 respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ResponseObjectOutputMessageContentUnion contains all possible properties and values from [string], [[]ResponseObjectOutputMessageContentArrayItemUnion], [[]ResponseObjectOutputMessageContentArrayItemUnion].
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 OfVariant2]
func (ResponseObjectOutputMessageContentUnion) AsResponseObjectOutputMessageContentArray ¶
func (u ResponseObjectOutputMessageContentUnion) AsResponseObjectOutputMessageContentArray() (v []ResponseObjectOutputMessageContentArrayItemUnion)
func (ResponseObjectOutputMessageContentUnion) AsString ¶
func (u ResponseObjectOutputMessageContentUnion) AsString() (v string)
func (ResponseObjectOutputMessageContentUnion) AsVariant2 ¶
func (u ResponseObjectOutputMessageContentUnion) AsVariant2() (v []ResponseObjectOutputMessageContentArrayItemUnion)
func (ResponseObjectOutputMessageContentUnion) RawJSON ¶
func (u ResponseObjectOutputMessageContentUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectOutputMessageContentUnion) UnmarshalJSON ¶
func (r *ResponseObjectOutputMessageContentUnion) UnmarshalJSON(data []byte) error
type ResponseObjectOutputMessageRole ¶
type ResponseObjectOutputMessageRole string
const ( ResponseObjectOutputMessageRoleSystem ResponseObjectOutputMessageRole = "system" ResponseObjectOutputMessageRoleDeveloper ResponseObjectOutputMessageRole = "developer" ResponseObjectOutputMessageRoleUser ResponseObjectOutputMessageRole = "user" ResponseObjectOutputMessageRoleAssistant ResponseObjectOutputMessageRole = "assistant" )
type ResponseObjectOutputRole ¶
type ResponseObjectOutputRole string
const ( ResponseObjectOutputRoleSystem ResponseObjectOutputRole = "system" ResponseObjectOutputRoleDeveloper ResponseObjectOutputRole = "developer" ResponseObjectOutputRoleUser ResponseObjectOutputRole = "user" ResponseObjectOutputRoleAssistant ResponseObjectOutputRole = "assistant" )
type ResponseObjectOutputUnion ¶
type ResponseObjectOutputUnion struct {
// This field is from variant [ResponseObjectOutputMessage].
Content ResponseObjectOutputMessageContentUnion `json:"content"`
// This field is from variant [ResponseObjectOutputMessage].
Role ResponseObjectOutputMessageRole `json:"role"`
// Any of "message", "web_search_call", "file_search_call", "function_call",
// "mcp_call", "mcp_list_tools", "mcp_approval_request".
Type string `json:"type"`
ID string `json:"id"`
Status string `json:"status"`
// This field is from variant [ResponseObjectOutputFileSearchCall].
Queries []string `json:"queries"`
// This field is from variant [ResponseObjectOutputFileSearchCall].
Results []ResponseObjectOutputFileSearchCallResult `json:"results"`
Arguments string `json:"arguments"`
// This field is from variant [ResponseObjectOutputFunctionCall].
CallID string `json:"call_id"`
Name string `json:"name"`
ServerLabel string `json:"server_label"`
// This field is from variant [ResponseObjectOutputMcpCall].
Error string `json:"error"`
// This field is from variant [ResponseObjectOutputMcpCall].
Output string `json:"output"`
// This field is from variant [ResponseObjectOutputMcpListTools].
Tools []ResponseObjectOutputMcpListToolsTool `json:"tools"`
JSON struct {
Content respjson.Field
Role respjson.Field
Type respjson.Field
ID respjson.Field
Status respjson.Field
Queries respjson.Field
Results respjson.Field
Arguments respjson.Field
CallID respjson.Field
Name respjson.Field
ServerLabel respjson.Field
Error respjson.Field
Output respjson.Field
Tools respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ResponseObjectOutputUnion contains all possible properties and values from ResponseObjectOutputMessage, ResponseObjectOutputWebSearchCall, ResponseObjectOutputFileSearchCall, ResponseObjectOutputFunctionCall, ResponseObjectOutputMcpCall, ResponseObjectOutputMcpListTools, ResponseObjectOutputMcpApprovalRequest.
Use the ResponseObjectOutputUnion.AsAny method to switch on the variant.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (ResponseObjectOutputUnion) AsAny ¶
func (u ResponseObjectOutputUnion) AsAny() anyResponseObjectOutput
Use the following switch statement to find the correct variant
switch variant := ResponseObjectOutputUnion.AsAny().(type) {
case llamastackclient.ResponseObjectOutputMessage:
case llamastackclient.ResponseObjectOutputWebSearchCall:
case llamastackclient.ResponseObjectOutputFileSearchCall:
case llamastackclient.ResponseObjectOutputFunctionCall:
case llamastackclient.ResponseObjectOutputMcpCall:
case llamastackclient.ResponseObjectOutputMcpListTools:
case llamastackclient.ResponseObjectOutputMcpApprovalRequest:
default:
fmt.Errorf("no variant present")
}
func (ResponseObjectOutputUnion) AsFileSearchCall ¶
func (u ResponseObjectOutputUnion) AsFileSearchCall() (v ResponseObjectOutputFileSearchCall)
func (ResponseObjectOutputUnion) AsFunctionCall ¶
func (u ResponseObjectOutputUnion) AsFunctionCall() (v ResponseObjectOutputFunctionCall)
func (ResponseObjectOutputUnion) AsMcpApprovalRequest ¶
func (u ResponseObjectOutputUnion) AsMcpApprovalRequest() (v ResponseObjectOutputMcpApprovalRequest)
func (ResponseObjectOutputUnion) AsMcpCall ¶
func (u ResponseObjectOutputUnion) AsMcpCall() (v ResponseObjectOutputMcpCall)
func (ResponseObjectOutputUnion) AsMcpListTools ¶
func (u ResponseObjectOutputUnion) AsMcpListTools() (v ResponseObjectOutputMcpListTools)
func (ResponseObjectOutputUnion) AsMessage ¶
func (u ResponseObjectOutputUnion) AsMessage() (v ResponseObjectOutputMessage)
func (ResponseObjectOutputUnion) AsWebSearchCall ¶
func (u ResponseObjectOutputUnion) AsWebSearchCall() (v ResponseObjectOutputWebSearchCall)
func (ResponseObjectOutputUnion) RawJSON ¶
func (u ResponseObjectOutputUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectOutputUnion) UnmarshalJSON ¶
func (r *ResponseObjectOutputUnion) UnmarshalJSON(data []byte) error
type ResponseObjectOutputWebSearchCall ¶
type ResponseObjectOutputWebSearchCall struct {
// Unique identifier for this tool call
ID string `json:"id,required"`
// Current status of the web search operation
Status string `json:"status,required"`
// Tool call type identifier, always "web_search_call"
Type constant.WebSearchCall `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Status respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Web search tool call output message for OpenAI responses.
func (ResponseObjectOutputWebSearchCall) RawJSON ¶
func (r ResponseObjectOutputWebSearchCall) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectOutputWebSearchCall) UnmarshalJSON ¶
func (r *ResponseObjectOutputWebSearchCall) UnmarshalJSON(data []byte) error
type ResponseObjectPrompt ¶
type ResponseObjectPrompt struct {
// Unique identifier of the prompt template
ID string `json:"id,required"`
// Dictionary of variable names to OpenAIResponseInputMessageContent structure for
// template substitution. The substitution values can either be strings, or other
// Response input types like images or files.
Variables map[string]ResponseObjectPromptVariableUnion `json:"variables"`
// Version number of the prompt to use (defaults to latest if not specified)
Version string `json:"version"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Variables respjson.Field
Version respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
(Optional) Reference to a prompt template and its variables.
func (ResponseObjectPrompt) RawJSON ¶
func (r ResponseObjectPrompt) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectPrompt) UnmarshalJSON ¶
func (r *ResponseObjectPrompt) UnmarshalJSON(data []byte) error
type ResponseObjectPromptVariableDetail ¶
type ResponseObjectPromptVariableDetail string
Level of detail for image processing, can be "low", "high", or "auto"
const ( ResponseObjectPromptVariableDetailLow ResponseObjectPromptVariableDetail = "low" ResponseObjectPromptVariableDetailHigh ResponseObjectPromptVariableDetail = "high" ResponseObjectPromptVariableDetailAuto ResponseObjectPromptVariableDetail = "auto" )
type ResponseObjectPromptVariableInputFile ¶
type ResponseObjectPromptVariableInputFile struct {
// The type of the input item. Always `input_file`.
Type constant.InputFile `json:"type,required"`
// The data of the file to be sent to the model.
FileData string `json:"file_data"`
// (Optional) The ID of the file to be sent to the model.
FileID string `json:"file_id"`
// The URL of the file to be sent to the model.
FileURL string `json:"file_url"`
// The name of the file to be sent to the model.
Filename string `json:"filename"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Type respjson.Field
FileData respjson.Field
FileID respjson.Field
FileURL respjson.Field
Filename respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
File content for input messages in OpenAI response format.
func (ResponseObjectPromptVariableInputFile) RawJSON ¶
func (r ResponseObjectPromptVariableInputFile) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectPromptVariableInputFile) UnmarshalJSON ¶
func (r *ResponseObjectPromptVariableInputFile) UnmarshalJSON(data []byte) error
type ResponseObjectPromptVariableInputImage ¶
type ResponseObjectPromptVariableInputImage struct {
// Level of detail for image processing, can be "low", "high", or "auto"
//
// Any of "low", "high", "auto".
Detail ResponseObjectPromptVariableInputImageDetail `json:"detail,required"`
// Content type identifier, always "input_image"
Type constant.InputImage `json:"type,required"`
// (Optional) The ID of the file to be sent to the model.
FileID string `json:"file_id"`
// (Optional) URL of the image content
ImageURL string `json:"image_url"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Detail respjson.Field
Type respjson.Field
FileID respjson.Field
ImageURL respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Image content for input messages in OpenAI response format.
func (ResponseObjectPromptVariableInputImage) RawJSON ¶
func (r ResponseObjectPromptVariableInputImage) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectPromptVariableInputImage) UnmarshalJSON ¶
func (r *ResponseObjectPromptVariableInputImage) UnmarshalJSON(data []byte) error
type ResponseObjectPromptVariableInputImageDetail ¶
type ResponseObjectPromptVariableInputImageDetail string
Level of detail for image processing, can be "low", "high", or "auto"
const ( ResponseObjectPromptVariableInputImageDetailLow ResponseObjectPromptVariableInputImageDetail = "low" ResponseObjectPromptVariableInputImageDetailHigh ResponseObjectPromptVariableInputImageDetail = "high" ResponseObjectPromptVariableInputImageDetailAuto ResponseObjectPromptVariableInputImageDetail = "auto" )
type ResponseObjectPromptVariableInputText ¶
type ResponseObjectPromptVariableInputText struct {
// The text content of the input message
Text string `json:"text,required"`
// Content type identifier, always "input_text"
Type constant.InputText `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:"-"`
}
Text content for input messages in OpenAI response format.
func (ResponseObjectPromptVariableInputText) RawJSON ¶
func (r ResponseObjectPromptVariableInputText) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectPromptVariableInputText) UnmarshalJSON ¶
func (r *ResponseObjectPromptVariableInputText) UnmarshalJSON(data []byte) error
type ResponseObjectPromptVariableUnion ¶
type ResponseObjectPromptVariableUnion struct {
// This field is from variant [ResponseObjectPromptVariableInputText].
Text string `json:"text"`
// Any of "input_text", "input_image", "input_file".
Type string `json:"type"`
// This field is from variant [ResponseObjectPromptVariableInputImage].
Detail ResponseObjectPromptVariableInputImageDetail `json:"detail"`
FileID string `json:"file_id"`
// This field is from variant [ResponseObjectPromptVariableInputImage].
ImageURL string `json:"image_url"`
// This field is from variant [ResponseObjectPromptVariableInputFile].
FileData string `json:"file_data"`
// This field is from variant [ResponseObjectPromptVariableInputFile].
FileURL string `json:"file_url"`
// This field is from variant [ResponseObjectPromptVariableInputFile].
Filename string `json:"filename"`
JSON struct {
Text respjson.Field
Type respjson.Field
Detail respjson.Field
FileID respjson.Field
ImageURL respjson.Field
FileData respjson.Field
FileURL respjson.Field
Filename respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ResponseObjectPromptVariableUnion contains all possible properties and values from ResponseObjectPromptVariableInputText, ResponseObjectPromptVariableInputImage, ResponseObjectPromptVariableInputFile.
Use the ResponseObjectPromptVariableUnion.AsAny method to switch on the variant.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (ResponseObjectPromptVariableUnion) AsAny ¶
func (u ResponseObjectPromptVariableUnion) AsAny() anyResponseObjectPromptVariable
Use the following switch statement to find the correct variant
switch variant := ResponseObjectPromptVariableUnion.AsAny().(type) {
case llamastackclient.ResponseObjectPromptVariableInputText:
case llamastackclient.ResponseObjectPromptVariableInputImage:
case llamastackclient.ResponseObjectPromptVariableInputFile:
default:
fmt.Errorf("no variant present")
}
func (ResponseObjectPromptVariableUnion) AsInputFile ¶
func (u ResponseObjectPromptVariableUnion) AsInputFile() (v ResponseObjectPromptVariableInputFile)
func (ResponseObjectPromptVariableUnion) AsInputImage ¶
func (u ResponseObjectPromptVariableUnion) AsInputImage() (v ResponseObjectPromptVariableInputImage)
func (ResponseObjectPromptVariableUnion) AsInputText ¶
func (u ResponseObjectPromptVariableUnion) AsInputText() (v ResponseObjectPromptVariableInputText)
func (ResponseObjectPromptVariableUnion) RawJSON ¶
func (u ResponseObjectPromptVariableUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectPromptVariableUnion) UnmarshalJSON ¶
func (r *ResponseObjectPromptVariableUnion) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseCompleted ¶
type ResponseObjectStreamResponseCompleted struct {
// Completed response object
Response ResponseObject `json:"response,required"`
// Event type identifier, always "response.completed"
Type constant.ResponseCompleted `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Response respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Streaming event indicating a response has been completed.
func (ResponseObjectStreamResponseCompleted) RawJSON ¶
func (r ResponseObjectStreamResponseCompleted) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseCompleted) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseCompleted) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseContentPartAdded ¶
type ResponseObjectStreamResponseContentPartAdded struct {
// Index position of the part within the content array
ContentIndex int64 `json:"content_index,required"`
// Unique identifier of the output item containing this content part
ItemID string `json:"item_id,required"`
// Index position of the output item in the response
OutputIndex int64 `json:"output_index,required"`
// The content part that was added
Part ResponseObjectStreamResponseContentPartAddedPartUnion `json:"part,required"`
// Unique identifier of the response containing this content
ResponseID string `json:"response_id,required"`
// Sequential number for ordering streaming events
SequenceNumber int64 `json:"sequence_number,required"`
// Event type identifier, always "response.content_part.added"
Type constant.ResponseContentPartAdded `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ContentIndex respjson.Field
ItemID respjson.Field
OutputIndex respjson.Field
Part respjson.Field
ResponseID respjson.Field
SequenceNumber respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Streaming event for when a new content part is added to a response item.
func (ResponseObjectStreamResponseContentPartAdded) RawJSON ¶
func (r ResponseObjectStreamResponseContentPartAdded) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseContentPartAdded) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseContentPartAdded) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseContentPartAddedPartOutputText ¶
type ResponseObjectStreamResponseContentPartAddedPartOutputText struct {
// Structured annotations associated with the text
Annotations []ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationUnion `json:"annotations,required"`
// Text emitted for this content part
Text string `json:"text,required"`
// Content part type identifier, always "output_text"
Type constant.OutputText `json:"type,required"`
// (Optional) Token log probability details
Logprobs []map[string]ResponseObjectStreamResponseContentPartAddedPartOutputTextLogprobUnion `json:"logprobs"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Annotations respjson.Field
Text respjson.Field
Type respjson.Field
Logprobs respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Text content within a streamed response part.
func (ResponseObjectStreamResponseContentPartAddedPartOutputText) RawJSON ¶
func (r ResponseObjectStreamResponseContentPartAddedPartOutputText) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseContentPartAddedPartOutputText) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseContentPartAddedPartOutputText) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationContainerFileCitation ¶
type ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationContainerFileCitation struct {
ContainerID string `json:"container_id,required"`
EndIndex int64 `json:"end_index,required"`
FileID string `json:"file_id,required"`
Filename string `json:"filename,required"`
StartIndex int64 `json:"start_index,required"`
Type constant.ContainerFileCitation `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ContainerID respjson.Field
EndIndex respjson.Field
FileID respjson.Field
Filename respjson.Field
StartIndex respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationContainerFileCitation) RawJSON ¶
func (r ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationContainerFileCitation) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationContainerFileCitation) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationContainerFileCitation) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationFileCitation ¶
type ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationFileCitation struct {
// Unique identifier of the referenced file
FileID string `json:"file_id,required"`
// Name of the referenced file
Filename string `json:"filename,required"`
// Position index of the citation within the content
Index int64 `json:"index,required"`
// Annotation type identifier, always "file_citation"
Type constant.FileCitation `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
FileID respjson.Field
Filename respjson.Field
Index respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
File citation annotation for referencing specific files in response content.
func (ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationFileCitation) RawJSON ¶
func (r ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationFileCitation) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationFileCitation) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationFileCitation) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationFilePath ¶
type ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationFilePath struct {
FileID string `json:"file_id,required"`
Index int64 `json:"index,required"`
Type constant.FilePath `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
FileID respjson.Field
Index respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationFilePath) RawJSON ¶
func (r ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationFilePath) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationFilePath) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationFilePath) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationURLCitation ¶
type ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationURLCitation struct {
// End position of the citation span in the content
EndIndex int64 `json:"end_index,required"`
// Start position of the citation span in the content
StartIndex int64 `json:"start_index,required"`
// Title of the referenced web resource
Title string `json:"title,required"`
// Annotation type identifier, always "url_citation"
Type constant.URLCitation `json:"type,required"`
// URL of the referenced web resource
URL string `json:"url,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
EndIndex respjson.Field
StartIndex respjson.Field
Title respjson.Field
Type respjson.Field
URL respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
URL citation annotation for referencing external web resources.
func (ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationURLCitation) RawJSON ¶
func (r ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationURLCitation) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationURLCitation) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationURLCitation) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationUnion ¶
type ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationUnion struct {
FileID string `json:"file_id"`
Filename string `json:"filename"`
Index int64 `json:"index"`
// Any of "file_citation", "url_citation", "container_file_citation", "file_path".
Type string `json:"type"`
EndIndex int64 `json:"end_index"`
StartIndex int64 `json:"start_index"`
// This field is from variant
// [ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationURLCitation].
Title string `json:"title"`
// This field is from variant
// [ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationURLCitation].
URL string `json:"url"`
// This field is from variant
// [ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationContainerFileCitation].
ContainerID string `json:"container_id"`
JSON struct {
FileID respjson.Field
Filename respjson.Field
Index respjson.Field
Type respjson.Field
EndIndex respjson.Field
StartIndex respjson.Field
Title respjson.Field
URL respjson.Field
ContainerID respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationUnion contains all possible properties and values from ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationFileCitation, ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationURLCitation, ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationContainerFileCitation, ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationFilePath.
Use the ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationUnion.AsAny method to switch on the variant.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationUnion) AsAny ¶
func (u ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationUnion) AsAny() anyResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotation
Use the following switch statement to find the correct variant
switch variant := ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationUnion.AsAny().(type) {
case llamastackclient.ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationFileCitation:
case llamastackclient.ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationURLCitation:
case llamastackclient.ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationContainerFileCitation:
case llamastackclient.ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationFilePath:
default:
fmt.Errorf("no variant present")
}
func (ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationUnion) AsContainerFileCitation ¶
func (ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationUnion) AsFileCitation ¶
func (ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationUnion) AsFilePath ¶
func (ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationUnion) AsURLCitation ¶
func (ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationUnion) RawJSON ¶
func (u ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationUnion) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationUnion) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseContentPartAddedPartOutputTextLogprobUnion ¶
type ResponseObjectStreamResponseContentPartAddedPartOutputTextLogprobUnion 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:"-"`
}
ResponseObjectStreamResponseContentPartAddedPartOutputTextLogprobUnion 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 (ResponseObjectStreamResponseContentPartAddedPartOutputTextLogprobUnion) AsAnyArray ¶
func (u ResponseObjectStreamResponseContentPartAddedPartOutputTextLogprobUnion) AsAnyArray() (v []any)
func (ResponseObjectStreamResponseContentPartAddedPartOutputTextLogprobUnion) AsBool ¶
func (u ResponseObjectStreamResponseContentPartAddedPartOutputTextLogprobUnion) AsBool() (v bool)
func (ResponseObjectStreamResponseContentPartAddedPartOutputTextLogprobUnion) AsFloat ¶
func (u ResponseObjectStreamResponseContentPartAddedPartOutputTextLogprobUnion) AsFloat() (v float64)
func (ResponseObjectStreamResponseContentPartAddedPartOutputTextLogprobUnion) AsString ¶
func (u ResponseObjectStreamResponseContentPartAddedPartOutputTextLogprobUnion) AsString() (v string)
func (ResponseObjectStreamResponseContentPartAddedPartOutputTextLogprobUnion) RawJSON ¶
func (u ResponseObjectStreamResponseContentPartAddedPartOutputTextLogprobUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseContentPartAddedPartOutputTextLogprobUnion) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseContentPartAddedPartOutputTextLogprobUnion) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseContentPartAddedPartReasoningText ¶
type ResponseObjectStreamResponseContentPartAddedPartReasoningText struct {
// Reasoning text supplied by the model
Text string `json:"text,required"`
// Content part type identifier, always "reasoning_text"
Type constant.ReasoningText `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:"-"`
}
Reasoning text emitted as part of a streamed response.
func (ResponseObjectStreamResponseContentPartAddedPartReasoningText) RawJSON ¶
func (r ResponseObjectStreamResponseContentPartAddedPartReasoningText) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseContentPartAddedPartReasoningText) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseContentPartAddedPartReasoningText) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseContentPartAddedPartRefusal ¶
type ResponseObjectStreamResponseContentPartAddedPartRefusal struct {
// Refusal text supplied by the model
Refusal string `json:"refusal,required"`
// Content part type identifier, always "refusal"
Type constant.Refusal `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Refusal respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Refusal content within a streamed response part.
func (ResponseObjectStreamResponseContentPartAddedPartRefusal) RawJSON ¶
func (r ResponseObjectStreamResponseContentPartAddedPartRefusal) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseContentPartAddedPartRefusal) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseContentPartAddedPartRefusal) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseContentPartAddedPartUnion ¶
type ResponseObjectStreamResponseContentPartAddedPartUnion struct {
// This field is from variant
// [ResponseObjectStreamResponseContentPartAddedPartOutputText].
Annotations []ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationUnion `json:"annotations"`
Text string `json:"text"`
// Any of "output_text", "refusal", "reasoning_text".
Type string `json:"type"`
// This field is from variant
// [ResponseObjectStreamResponseContentPartAddedPartOutputText].
Logprobs []map[string]ResponseObjectStreamResponseContentPartAddedPartOutputTextLogprobUnion `json:"logprobs"`
// This field is from variant
// [ResponseObjectStreamResponseContentPartAddedPartRefusal].
Refusal string `json:"refusal"`
JSON struct {
Annotations respjson.Field
Text respjson.Field
Type respjson.Field
Logprobs respjson.Field
Refusal respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ResponseObjectStreamResponseContentPartAddedPartUnion contains all possible properties and values from ResponseObjectStreamResponseContentPartAddedPartOutputText, ResponseObjectStreamResponseContentPartAddedPartRefusal, ResponseObjectStreamResponseContentPartAddedPartReasoningText.
Use the ResponseObjectStreamResponseContentPartAddedPartUnion.AsAny method to switch on the variant.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (ResponseObjectStreamResponseContentPartAddedPartUnion) AsAny ¶
func (u ResponseObjectStreamResponseContentPartAddedPartUnion) AsAny() anyResponseObjectStreamResponseContentPartAddedPart
Use the following switch statement to find the correct variant
switch variant := ResponseObjectStreamResponseContentPartAddedPartUnion.AsAny().(type) {
case llamastackclient.ResponseObjectStreamResponseContentPartAddedPartOutputText:
case llamastackclient.ResponseObjectStreamResponseContentPartAddedPartRefusal:
case llamastackclient.ResponseObjectStreamResponseContentPartAddedPartReasoningText:
default:
fmt.Errorf("no variant present")
}
func (ResponseObjectStreamResponseContentPartAddedPartUnion) AsOutputText ¶
func (u ResponseObjectStreamResponseContentPartAddedPartUnion) AsOutputText() (v ResponseObjectStreamResponseContentPartAddedPartOutputText)
func (ResponseObjectStreamResponseContentPartAddedPartUnion) AsReasoningText ¶
func (u ResponseObjectStreamResponseContentPartAddedPartUnion) AsReasoningText() (v ResponseObjectStreamResponseContentPartAddedPartReasoningText)
func (ResponseObjectStreamResponseContentPartAddedPartUnion) RawJSON ¶
func (u ResponseObjectStreamResponseContentPartAddedPartUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseContentPartAddedPartUnion) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseContentPartAddedPartUnion) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseContentPartDone ¶
type ResponseObjectStreamResponseContentPartDone struct {
// Index position of the part within the content array
ContentIndex int64 `json:"content_index,required"`
// Unique identifier of the output item containing this content part
ItemID string `json:"item_id,required"`
// Index position of the output item in the response
OutputIndex int64 `json:"output_index,required"`
// The completed content part
Part ResponseObjectStreamResponseContentPartDonePartUnion `json:"part,required"`
// Unique identifier of the response containing this content
ResponseID string `json:"response_id,required"`
// Sequential number for ordering streaming events
SequenceNumber int64 `json:"sequence_number,required"`
// Event type identifier, always "response.content_part.done"
Type constant.ResponseContentPartDone `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ContentIndex respjson.Field
ItemID respjson.Field
OutputIndex respjson.Field
Part respjson.Field
ResponseID respjson.Field
SequenceNumber respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Streaming event for when a content part is completed.
func (ResponseObjectStreamResponseContentPartDone) RawJSON ¶
func (r ResponseObjectStreamResponseContentPartDone) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseContentPartDone) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseContentPartDone) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseContentPartDonePartOutputText ¶
type ResponseObjectStreamResponseContentPartDonePartOutputText struct {
// Structured annotations associated with the text
Annotations []ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationUnion `json:"annotations,required"`
// Text emitted for this content part
Text string `json:"text,required"`
// Content part type identifier, always "output_text"
Type constant.OutputText `json:"type,required"`
// (Optional) Token log probability details
Logprobs []map[string]ResponseObjectStreamResponseContentPartDonePartOutputTextLogprobUnion `json:"logprobs"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Annotations respjson.Field
Text respjson.Field
Type respjson.Field
Logprobs respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Text content within a streamed response part.
func (ResponseObjectStreamResponseContentPartDonePartOutputText) RawJSON ¶
func (r ResponseObjectStreamResponseContentPartDonePartOutputText) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseContentPartDonePartOutputText) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseContentPartDonePartOutputText) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationContainerFileCitation ¶
type ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationContainerFileCitation struct {
ContainerID string `json:"container_id,required"`
EndIndex int64 `json:"end_index,required"`
FileID string `json:"file_id,required"`
Filename string `json:"filename,required"`
StartIndex int64 `json:"start_index,required"`
Type constant.ContainerFileCitation `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ContainerID respjson.Field
EndIndex respjson.Field
FileID respjson.Field
Filename respjson.Field
StartIndex respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationContainerFileCitation) RawJSON ¶
func (r ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationContainerFileCitation) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationContainerFileCitation) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationContainerFileCitation) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationFileCitation ¶
type ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationFileCitation struct {
// Unique identifier of the referenced file
FileID string `json:"file_id,required"`
// Name of the referenced file
Filename string `json:"filename,required"`
// Position index of the citation within the content
Index int64 `json:"index,required"`
// Annotation type identifier, always "file_citation"
Type constant.FileCitation `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
FileID respjson.Field
Filename respjson.Field
Index respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
File citation annotation for referencing specific files in response content.
func (ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationFileCitation) RawJSON ¶
func (r ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationFileCitation) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationFileCitation) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationFileCitation) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationFilePath ¶
type ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationFilePath struct {
FileID string `json:"file_id,required"`
Index int64 `json:"index,required"`
Type constant.FilePath `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
FileID respjson.Field
Index respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationFilePath) RawJSON ¶
func (r ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationFilePath) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationFilePath) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationFilePath) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationURLCitation ¶
type ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationURLCitation struct {
// End position of the citation span in the content
EndIndex int64 `json:"end_index,required"`
// Start position of the citation span in the content
StartIndex int64 `json:"start_index,required"`
// Title of the referenced web resource
Title string `json:"title,required"`
// Annotation type identifier, always "url_citation"
Type constant.URLCitation `json:"type,required"`
// URL of the referenced web resource
URL string `json:"url,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
EndIndex respjson.Field
StartIndex respjson.Field
Title respjson.Field
Type respjson.Field
URL respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
URL citation annotation for referencing external web resources.
func (ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationURLCitation) RawJSON ¶
func (r ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationURLCitation) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationURLCitation) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationURLCitation) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationUnion ¶
type ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationUnion struct {
FileID string `json:"file_id"`
Filename string `json:"filename"`
Index int64 `json:"index"`
// Any of "file_citation", "url_citation", "container_file_citation", "file_path".
Type string `json:"type"`
EndIndex int64 `json:"end_index"`
StartIndex int64 `json:"start_index"`
// This field is from variant
// [ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationURLCitation].
Title string `json:"title"`
// This field is from variant
// [ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationURLCitation].
URL string `json:"url"`
// This field is from variant
// [ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationContainerFileCitation].
ContainerID string `json:"container_id"`
JSON struct {
FileID respjson.Field
Filename respjson.Field
Index respjson.Field
Type respjson.Field
EndIndex respjson.Field
StartIndex respjson.Field
Title respjson.Field
URL respjson.Field
ContainerID respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationUnion contains all possible properties and values from ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationFileCitation, ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationURLCitation, ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationContainerFileCitation, ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationFilePath.
Use the ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationUnion.AsAny method to switch on the variant.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationUnion) AsAny ¶
func (u ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationUnion) AsAny() anyResponseObjectStreamResponseContentPartDonePartOutputTextAnnotation
Use the following switch statement to find the correct variant
switch variant := ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationUnion.AsAny().(type) {
case llamastackclient.ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationFileCitation:
case llamastackclient.ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationURLCitation:
case llamastackclient.ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationContainerFileCitation:
case llamastackclient.ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationFilePath:
default:
fmt.Errorf("no variant present")
}
func (ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationUnion) AsContainerFileCitation ¶
func (u ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationUnion) AsContainerFileCitation() (v ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationContainerFileCitation)
func (ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationUnion) AsFileCitation ¶
func (ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationUnion) AsFilePath ¶
func (ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationUnion) AsURLCitation ¶
func (ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationUnion) RawJSON ¶
func (u ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationUnion) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationUnion) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseContentPartDonePartOutputTextLogprobUnion ¶
type ResponseObjectStreamResponseContentPartDonePartOutputTextLogprobUnion 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:"-"`
}
ResponseObjectStreamResponseContentPartDonePartOutputTextLogprobUnion 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 (ResponseObjectStreamResponseContentPartDonePartOutputTextLogprobUnion) AsAnyArray ¶
func (u ResponseObjectStreamResponseContentPartDonePartOutputTextLogprobUnion) AsAnyArray() (v []any)
func (ResponseObjectStreamResponseContentPartDonePartOutputTextLogprobUnion) AsBool ¶
func (u ResponseObjectStreamResponseContentPartDonePartOutputTextLogprobUnion) AsBool() (v bool)
func (ResponseObjectStreamResponseContentPartDonePartOutputTextLogprobUnion) AsFloat ¶
func (u ResponseObjectStreamResponseContentPartDonePartOutputTextLogprobUnion) AsFloat() (v float64)
func (ResponseObjectStreamResponseContentPartDonePartOutputTextLogprobUnion) AsString ¶
func (u ResponseObjectStreamResponseContentPartDonePartOutputTextLogprobUnion) AsString() (v string)
func (ResponseObjectStreamResponseContentPartDonePartOutputTextLogprobUnion) RawJSON ¶
func (u ResponseObjectStreamResponseContentPartDonePartOutputTextLogprobUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseContentPartDonePartOutputTextLogprobUnion) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseContentPartDonePartOutputTextLogprobUnion) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseContentPartDonePartReasoningText ¶
type ResponseObjectStreamResponseContentPartDonePartReasoningText struct {
// Reasoning text supplied by the model
Text string `json:"text,required"`
// Content part type identifier, always "reasoning_text"
Type constant.ReasoningText `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:"-"`
}
Reasoning text emitted as part of a streamed response.
func (ResponseObjectStreamResponseContentPartDonePartReasoningText) RawJSON ¶
func (r ResponseObjectStreamResponseContentPartDonePartReasoningText) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseContentPartDonePartReasoningText) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseContentPartDonePartReasoningText) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseContentPartDonePartRefusal ¶
type ResponseObjectStreamResponseContentPartDonePartRefusal struct {
// Refusal text supplied by the model
Refusal string `json:"refusal,required"`
// Content part type identifier, always "refusal"
Type constant.Refusal `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Refusal respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Refusal content within a streamed response part.
func (ResponseObjectStreamResponseContentPartDonePartRefusal) RawJSON ¶
func (r ResponseObjectStreamResponseContentPartDonePartRefusal) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseContentPartDonePartRefusal) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseContentPartDonePartRefusal) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseContentPartDonePartUnion ¶
type ResponseObjectStreamResponseContentPartDonePartUnion struct {
// This field is from variant
// [ResponseObjectStreamResponseContentPartDonePartOutputText].
Annotations []ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationUnion `json:"annotations"`
Text string `json:"text"`
// Any of "output_text", "refusal", "reasoning_text".
Type string `json:"type"`
// This field is from variant
// [ResponseObjectStreamResponseContentPartDonePartOutputText].
Logprobs []map[string]ResponseObjectStreamResponseContentPartDonePartOutputTextLogprobUnion `json:"logprobs"`
// This field is from variant
// [ResponseObjectStreamResponseContentPartDonePartRefusal].
Refusal string `json:"refusal"`
JSON struct {
Annotations respjson.Field
Text respjson.Field
Type respjson.Field
Logprobs respjson.Field
Refusal respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ResponseObjectStreamResponseContentPartDonePartUnion contains all possible properties and values from ResponseObjectStreamResponseContentPartDonePartOutputText, ResponseObjectStreamResponseContentPartDonePartRefusal, ResponseObjectStreamResponseContentPartDonePartReasoningText.
Use the ResponseObjectStreamResponseContentPartDonePartUnion.AsAny method to switch on the variant.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (ResponseObjectStreamResponseContentPartDonePartUnion) AsAny ¶
func (u ResponseObjectStreamResponseContentPartDonePartUnion) AsAny() anyResponseObjectStreamResponseContentPartDonePart
Use the following switch statement to find the correct variant
switch variant := ResponseObjectStreamResponseContentPartDonePartUnion.AsAny().(type) {
case llamastackclient.ResponseObjectStreamResponseContentPartDonePartOutputText:
case llamastackclient.ResponseObjectStreamResponseContentPartDonePartRefusal:
case llamastackclient.ResponseObjectStreamResponseContentPartDonePartReasoningText:
default:
fmt.Errorf("no variant present")
}
func (ResponseObjectStreamResponseContentPartDonePartUnion) AsOutputText ¶
func (u ResponseObjectStreamResponseContentPartDonePartUnion) AsOutputText() (v ResponseObjectStreamResponseContentPartDonePartOutputText)
func (ResponseObjectStreamResponseContentPartDonePartUnion) AsReasoningText ¶
func (u ResponseObjectStreamResponseContentPartDonePartUnion) AsReasoningText() (v ResponseObjectStreamResponseContentPartDonePartReasoningText)
func (ResponseObjectStreamResponseContentPartDonePartUnion) RawJSON ¶
func (u ResponseObjectStreamResponseContentPartDonePartUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseContentPartDonePartUnion) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseContentPartDonePartUnion) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseCreated ¶
type ResponseObjectStreamResponseCreated struct {
// The response object that was created
Response ResponseObject `json:"response,required"`
// Event type identifier, always "response.created"
Type constant.ResponseCreated `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Response respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Streaming event indicating a new response has been created.
func (ResponseObjectStreamResponseCreated) RawJSON ¶
func (r ResponseObjectStreamResponseCreated) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseCreated) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseCreated) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseFailed ¶
type ResponseObjectStreamResponseFailed struct {
// Response object describing the failure
Response ResponseObject `json:"response,required"`
// Sequential number for ordering streaming events
SequenceNumber int64 `json:"sequence_number,required"`
// Event type identifier, always "response.failed"
Type constant.ResponseFailed `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Response respjson.Field
SequenceNumber respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Streaming event emitted when a response fails.
func (ResponseObjectStreamResponseFailed) RawJSON ¶
func (r ResponseObjectStreamResponseFailed) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseFailed) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseFailed) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseFileSearchCallCompleted ¶
type ResponseObjectStreamResponseFileSearchCallCompleted struct {
// Unique identifier of the completed file search call
ItemID string `json:"item_id,required"`
// Index position of the item in the output list
OutputIndex int64 `json:"output_index,required"`
// Sequential number for ordering streaming events
SequenceNumber int64 `json:"sequence_number,required"`
// Event type identifier, always "response.file_search_call.completed"
Type constant.ResponseFileSearchCallCompleted `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ItemID respjson.Field
OutputIndex respjson.Field
SequenceNumber respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Streaming event for completed file search calls.
func (ResponseObjectStreamResponseFileSearchCallCompleted) RawJSON ¶
func (r ResponseObjectStreamResponseFileSearchCallCompleted) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseFileSearchCallCompleted) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseFileSearchCallCompleted) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseFileSearchCallInProgress ¶
type ResponseObjectStreamResponseFileSearchCallInProgress struct {
// Unique identifier of the file search call
ItemID string `json:"item_id,required"`
// Index position of the item in the output list
OutputIndex int64 `json:"output_index,required"`
// Sequential number for ordering streaming events
SequenceNumber int64 `json:"sequence_number,required"`
// Event type identifier, always "response.file_search_call.in_progress"
Type constant.ResponseFileSearchCallInProgress `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ItemID respjson.Field
OutputIndex respjson.Field
SequenceNumber respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Streaming event for file search calls in progress.
func (ResponseObjectStreamResponseFileSearchCallInProgress) RawJSON ¶
func (r ResponseObjectStreamResponseFileSearchCallInProgress) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseFileSearchCallInProgress) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseFileSearchCallInProgress) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseFileSearchCallSearching ¶
type ResponseObjectStreamResponseFileSearchCallSearching struct {
// Unique identifier of the file search call
ItemID string `json:"item_id,required"`
// Index position of the item in the output list
OutputIndex int64 `json:"output_index,required"`
// Sequential number for ordering streaming events
SequenceNumber int64 `json:"sequence_number,required"`
// Event type identifier, always "response.file_search_call.searching"
Type constant.ResponseFileSearchCallSearching `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ItemID respjson.Field
OutputIndex respjson.Field
SequenceNumber respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Streaming event for file search currently searching.
func (ResponseObjectStreamResponseFileSearchCallSearching) RawJSON ¶
func (r ResponseObjectStreamResponseFileSearchCallSearching) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseFileSearchCallSearching) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseFileSearchCallSearching) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseFunctionCallArgumentsDelta ¶
type ResponseObjectStreamResponseFunctionCallArgumentsDelta struct {
// Incremental function call arguments being added
Delta string `json:"delta,required"`
// Unique identifier of the function call being updated
ItemID string `json:"item_id,required"`
// Index position of the item in the output list
OutputIndex int64 `json:"output_index,required"`
// Sequential number for ordering streaming events
SequenceNumber int64 `json:"sequence_number,required"`
// Event type identifier, always "response.function_call_arguments.delta"
Type constant.ResponseFunctionCallArgumentsDelta `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Delta respjson.Field
ItemID respjson.Field
OutputIndex respjson.Field
SequenceNumber respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Streaming event for incremental function call argument updates.
func (ResponseObjectStreamResponseFunctionCallArgumentsDelta) RawJSON ¶
func (r ResponseObjectStreamResponseFunctionCallArgumentsDelta) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseFunctionCallArgumentsDelta) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseFunctionCallArgumentsDelta) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseFunctionCallArgumentsDone ¶
type ResponseObjectStreamResponseFunctionCallArgumentsDone struct {
// Final complete arguments JSON string for the function call
Arguments string `json:"arguments,required"`
// Unique identifier of the completed function call
ItemID string `json:"item_id,required"`
// Index position of the item in the output list
OutputIndex int64 `json:"output_index,required"`
// Sequential number for ordering streaming events
SequenceNumber int64 `json:"sequence_number,required"`
// Event type identifier, always "response.function_call_arguments.done"
Type constant.ResponseFunctionCallArgumentsDone `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Arguments respjson.Field
ItemID respjson.Field
OutputIndex respjson.Field
SequenceNumber respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Streaming event for when function call arguments are completed.
func (ResponseObjectStreamResponseFunctionCallArgumentsDone) RawJSON ¶
func (r ResponseObjectStreamResponseFunctionCallArgumentsDone) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseFunctionCallArgumentsDone) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseFunctionCallArgumentsDone) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseInProgress ¶
type ResponseObjectStreamResponseInProgress struct {
// Current response state while in progress
Response ResponseObject `json:"response,required"`
// Sequential number for ordering streaming events
SequenceNumber int64 `json:"sequence_number,required"`
// Event type identifier, always "response.in_progress"
Type constant.ResponseInProgress `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Response respjson.Field
SequenceNumber respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Streaming event indicating the response remains in progress.
func (ResponseObjectStreamResponseInProgress) RawJSON ¶
func (r ResponseObjectStreamResponseInProgress) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseInProgress) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseInProgress) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseIncomplete ¶
type ResponseObjectStreamResponseIncomplete struct {
// Response object describing the incomplete state
Response ResponseObject `json:"response,required"`
// Sequential number for ordering streaming events
SequenceNumber int64 `json:"sequence_number,required"`
// Event type identifier, always "response.incomplete"
Type constant.ResponseIncomplete `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Response respjson.Field
SequenceNumber respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Streaming event emitted when a response ends in an incomplete state.
func (ResponseObjectStreamResponseIncomplete) RawJSON ¶
func (r ResponseObjectStreamResponseIncomplete) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseIncomplete) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseIncomplete) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseMcpCallArgumentsDelta ¶
type ResponseObjectStreamResponseMcpCallArgumentsDelta struct {
Delta string `json:"delta,required"`
ItemID string `json:"item_id,required"`
OutputIndex int64 `json:"output_index,required"`
SequenceNumber int64 `json:"sequence_number,required"`
Type constant.ResponseMcpCallArgumentsDelta `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Delta respjson.Field
ItemID respjson.Field
OutputIndex respjson.Field
SequenceNumber respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ResponseObjectStreamResponseMcpCallArgumentsDelta) RawJSON ¶
func (r ResponseObjectStreamResponseMcpCallArgumentsDelta) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseMcpCallArgumentsDelta) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseMcpCallArgumentsDelta) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseMcpCallArgumentsDone ¶
type ResponseObjectStreamResponseMcpCallArgumentsDone struct {
Arguments string `json:"arguments,required"`
ItemID string `json:"item_id,required"`
OutputIndex int64 `json:"output_index,required"`
SequenceNumber int64 `json:"sequence_number,required"`
Type constant.ResponseMcpCallArgumentsDone `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Arguments respjson.Field
ItemID respjson.Field
OutputIndex respjson.Field
SequenceNumber respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ResponseObjectStreamResponseMcpCallArgumentsDone) RawJSON ¶
func (r ResponseObjectStreamResponseMcpCallArgumentsDone) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseMcpCallArgumentsDone) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseMcpCallArgumentsDone) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseMcpCallCompleted ¶
type ResponseObjectStreamResponseMcpCallCompleted struct {
// Sequential number for ordering streaming events
SequenceNumber int64 `json:"sequence_number,required"`
// Event type identifier, always "response.mcp_call.completed"
Type constant.ResponseMcpCallCompleted `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
SequenceNumber respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Streaming event for completed MCP calls.
func (ResponseObjectStreamResponseMcpCallCompleted) RawJSON ¶
func (r ResponseObjectStreamResponseMcpCallCompleted) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseMcpCallCompleted) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseMcpCallCompleted) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseMcpCallFailed ¶
type ResponseObjectStreamResponseMcpCallFailed struct {
// Sequential number for ordering streaming events
SequenceNumber int64 `json:"sequence_number,required"`
// Event type identifier, always "response.mcp_call.failed"
Type constant.ResponseMcpCallFailed `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
SequenceNumber respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Streaming event for failed MCP calls.
func (ResponseObjectStreamResponseMcpCallFailed) RawJSON ¶
func (r ResponseObjectStreamResponseMcpCallFailed) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseMcpCallFailed) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseMcpCallFailed) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseMcpCallInProgress ¶
type ResponseObjectStreamResponseMcpCallInProgress struct {
// Unique identifier of the MCP call
ItemID string `json:"item_id,required"`
// Index position of the item in the output list
OutputIndex int64 `json:"output_index,required"`
// Sequential number for ordering streaming events
SequenceNumber int64 `json:"sequence_number,required"`
// Event type identifier, always "response.mcp_call.in_progress"
Type constant.ResponseMcpCallInProgress `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ItemID respjson.Field
OutputIndex respjson.Field
SequenceNumber respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Streaming event for MCP calls in progress.
func (ResponseObjectStreamResponseMcpCallInProgress) RawJSON ¶
func (r ResponseObjectStreamResponseMcpCallInProgress) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseMcpCallInProgress) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseMcpCallInProgress) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseMcpListToolsCompleted ¶
type ResponseObjectStreamResponseMcpListToolsCompleted struct {
SequenceNumber int64 `json:"sequence_number,required"`
Type constant.ResponseMcpListToolsCompleted `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
SequenceNumber respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ResponseObjectStreamResponseMcpListToolsCompleted) RawJSON ¶
func (r ResponseObjectStreamResponseMcpListToolsCompleted) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseMcpListToolsCompleted) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseMcpListToolsCompleted) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseMcpListToolsFailed ¶
type ResponseObjectStreamResponseMcpListToolsFailed struct {
SequenceNumber int64 `json:"sequence_number,required"`
Type constant.ResponseMcpListToolsFailed `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
SequenceNumber respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ResponseObjectStreamResponseMcpListToolsFailed) RawJSON ¶
func (r ResponseObjectStreamResponseMcpListToolsFailed) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseMcpListToolsFailed) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseMcpListToolsFailed) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseMcpListToolsInProgress ¶
type ResponseObjectStreamResponseMcpListToolsInProgress struct {
SequenceNumber int64 `json:"sequence_number,required"`
Type constant.ResponseMcpListToolsInProgress `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
SequenceNumber respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ResponseObjectStreamResponseMcpListToolsInProgress) RawJSON ¶
func (r ResponseObjectStreamResponseMcpListToolsInProgress) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseMcpListToolsInProgress) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseMcpListToolsInProgress) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseOutputItemAdded ¶
type ResponseObjectStreamResponseOutputItemAdded struct {
// The output item that was added (message, tool call, etc.)
Item ResponseObjectStreamResponseOutputItemAddedItemUnion `json:"item,required"`
// Index position of this item in the output list
OutputIndex int64 `json:"output_index,required"`
// Unique identifier of the response containing this output
ResponseID string `json:"response_id,required"`
// Sequential number for ordering streaming events
SequenceNumber int64 `json:"sequence_number,required"`
// Event type identifier, always "response.output_item.added"
Type constant.ResponseOutputItemAdded `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Item respjson.Field
OutputIndex respjson.Field
ResponseID respjson.Field
SequenceNumber respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Streaming event for when a new output item is added to the response.
func (ResponseObjectStreamResponseOutputItemAdded) RawJSON ¶
func (r ResponseObjectStreamResponseOutputItemAdded) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseOutputItemAdded) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseOutputItemAdded) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseOutputItemAddedItemFileSearchCall ¶
type ResponseObjectStreamResponseOutputItemAddedItemFileSearchCall struct {
// Unique identifier for this tool call
ID string `json:"id,required"`
// List of search queries executed
Queries []string `json:"queries,required"`
// Current status of the file search operation
Status string `json:"status,required"`
// Tool call type identifier, always "file_search_call"
Type constant.FileSearchCall `json:"type,required"`
// (Optional) Search results returned by the file search operation
Results []ResponseObjectStreamResponseOutputItemAddedItemFileSearchCallResult `json:"results"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Queries respjson.Field
Status respjson.Field
Type respjson.Field
Results respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
File search tool call output message for OpenAI responses.
func (ResponseObjectStreamResponseOutputItemAddedItemFileSearchCall) RawJSON ¶
func (r ResponseObjectStreamResponseOutputItemAddedItemFileSearchCall) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseOutputItemAddedItemFileSearchCall) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseOutputItemAddedItemFileSearchCall) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseOutputItemAddedItemFileSearchCallResult ¶
type ResponseObjectStreamResponseOutputItemAddedItemFileSearchCallResult struct {
// (Optional) Key-value attributes associated with the file
Attributes map[string]ResponseObjectStreamResponseOutputItemAddedItemFileSearchCallResultAttributeUnion `json:"attributes,required"`
// Unique identifier of the file containing the result
FileID string `json:"file_id,required"`
// Name of the file containing the result
Filename string `json:"filename,required"`
// Relevance score for this search result (between 0 and 1)
Score float64 `json:"score,required"`
// Text content of the search result
Text string `json:"text,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Attributes respjson.Field
FileID respjson.Field
Filename respjson.Field
Score respjson.Field
Text respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Search results returned by the file search operation.
func (ResponseObjectStreamResponseOutputItemAddedItemFileSearchCallResult) RawJSON ¶
func (r ResponseObjectStreamResponseOutputItemAddedItemFileSearchCallResult) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseOutputItemAddedItemFileSearchCallResult) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseOutputItemAddedItemFileSearchCallResult) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseOutputItemAddedItemFileSearchCallResultAttributeUnion ¶
type ResponseObjectStreamResponseOutputItemAddedItemFileSearchCallResultAttributeUnion 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:"-"`
}
ResponseObjectStreamResponseOutputItemAddedItemFileSearchCallResultAttributeUnion 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 (ResponseObjectStreamResponseOutputItemAddedItemFileSearchCallResultAttributeUnion) AsAnyArray ¶
func (u ResponseObjectStreamResponseOutputItemAddedItemFileSearchCallResultAttributeUnion) AsAnyArray() (v []any)
func (ResponseObjectStreamResponseOutputItemAddedItemFileSearchCallResultAttributeUnion) AsBool ¶
func (u ResponseObjectStreamResponseOutputItemAddedItemFileSearchCallResultAttributeUnion) AsBool() (v bool)
func (ResponseObjectStreamResponseOutputItemAddedItemFileSearchCallResultAttributeUnion) AsFloat ¶
func (u ResponseObjectStreamResponseOutputItemAddedItemFileSearchCallResultAttributeUnion) AsFloat() (v float64)
func (ResponseObjectStreamResponseOutputItemAddedItemFileSearchCallResultAttributeUnion) AsString ¶
func (u ResponseObjectStreamResponseOutputItemAddedItemFileSearchCallResultAttributeUnion) AsString() (v string)
func (ResponseObjectStreamResponseOutputItemAddedItemFileSearchCallResultAttributeUnion) RawJSON ¶
func (u ResponseObjectStreamResponseOutputItemAddedItemFileSearchCallResultAttributeUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseOutputItemAddedItemFileSearchCallResultAttributeUnion) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseOutputItemAddedItemFileSearchCallResultAttributeUnion) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseOutputItemAddedItemFunctionCall ¶
type ResponseObjectStreamResponseOutputItemAddedItemFunctionCall struct {
// JSON string containing the function arguments
Arguments string `json:"arguments,required"`
// Unique identifier for the function call
CallID string `json:"call_id,required"`
// Name of the function being called
Name string `json:"name,required"`
// Tool call type identifier, always "function_call"
Type constant.FunctionCall `json:"type,required"`
// (Optional) Additional identifier for the tool call
ID string `json:"id"`
// (Optional) Current status of the function call execution
Status string `json:"status"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Arguments respjson.Field
CallID respjson.Field
Name respjson.Field
Type respjson.Field
ID respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Function tool call output message for OpenAI responses.
func (ResponseObjectStreamResponseOutputItemAddedItemFunctionCall) RawJSON ¶
func (r ResponseObjectStreamResponseOutputItemAddedItemFunctionCall) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseOutputItemAddedItemFunctionCall) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseOutputItemAddedItemFunctionCall) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseOutputItemAddedItemMcpApprovalRequest ¶
type ResponseObjectStreamResponseOutputItemAddedItemMcpApprovalRequest struct {
ID string `json:"id,required"`
Arguments string `json:"arguments,required"`
Name string `json:"name,required"`
ServerLabel string `json:"server_label,required"`
Type constant.McpApprovalRequest `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Arguments respjson.Field
Name respjson.Field
ServerLabel respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A request for human approval of a tool invocation.
func (ResponseObjectStreamResponseOutputItemAddedItemMcpApprovalRequest) RawJSON ¶
func (r ResponseObjectStreamResponseOutputItemAddedItemMcpApprovalRequest) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseOutputItemAddedItemMcpApprovalRequest) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseOutputItemAddedItemMcpApprovalRequest) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseOutputItemAddedItemMcpCall ¶
type ResponseObjectStreamResponseOutputItemAddedItemMcpCall struct {
// Unique identifier for this MCP call
ID string `json:"id,required"`
// JSON string containing the MCP call arguments
Arguments string `json:"arguments,required"`
// Name of the MCP method being called
Name string `json:"name,required"`
// Label identifying the MCP server handling the call
ServerLabel string `json:"server_label,required"`
// Tool call type identifier, always "mcp_call"
Type constant.McpCall `json:"type,required"`
// (Optional) Error message if the MCP call failed
Error string `json:"error"`
// (Optional) Output result from the successful MCP call
Output string `json:"output"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Arguments respjson.Field
Name respjson.Field
ServerLabel respjson.Field
Type respjson.Field
Error respjson.Field
Output respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Model Context Protocol (MCP) call output message for OpenAI responses.
func (ResponseObjectStreamResponseOutputItemAddedItemMcpCall) RawJSON ¶
func (r ResponseObjectStreamResponseOutputItemAddedItemMcpCall) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseOutputItemAddedItemMcpCall) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseOutputItemAddedItemMcpCall) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseOutputItemAddedItemMcpListTools ¶
type ResponseObjectStreamResponseOutputItemAddedItemMcpListTools struct {
// Unique identifier for this MCP list tools operation
ID string `json:"id,required"`
// Label identifying the MCP server providing the tools
ServerLabel string `json:"server_label,required"`
// List of available tools provided by the MCP server
Tools []ResponseObjectStreamResponseOutputItemAddedItemMcpListToolsTool `json:"tools,required"`
// Tool call type identifier, always "mcp_list_tools"
Type constant.McpListTools `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
ServerLabel respjson.Field
Tools respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
MCP list tools output message containing available tools from an MCP server.
func (ResponseObjectStreamResponseOutputItemAddedItemMcpListTools) RawJSON ¶
func (r ResponseObjectStreamResponseOutputItemAddedItemMcpListTools) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseOutputItemAddedItemMcpListTools) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseOutputItemAddedItemMcpListTools) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseOutputItemAddedItemMcpListToolsTool ¶
type ResponseObjectStreamResponseOutputItemAddedItemMcpListToolsTool struct {
// JSON schema defining the tool's input parameters
InputSchema map[string]ResponseObjectStreamResponseOutputItemAddedItemMcpListToolsToolInputSchemaUnion `json:"input_schema,required"`
// Name of the tool
Name string `json:"name,required"`
// (Optional) Description of what the tool does
Description string `json:"description"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
InputSchema respjson.Field
Name respjson.Field
Description respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Tool definition returned by MCP list tools operation.
func (ResponseObjectStreamResponseOutputItemAddedItemMcpListToolsTool) RawJSON ¶
func (r ResponseObjectStreamResponseOutputItemAddedItemMcpListToolsTool) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseOutputItemAddedItemMcpListToolsTool) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseOutputItemAddedItemMcpListToolsTool) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseOutputItemAddedItemMcpListToolsToolInputSchemaUnion ¶
type ResponseObjectStreamResponseOutputItemAddedItemMcpListToolsToolInputSchemaUnion 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:"-"`
}
ResponseObjectStreamResponseOutputItemAddedItemMcpListToolsToolInputSchemaUnion 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 (ResponseObjectStreamResponseOutputItemAddedItemMcpListToolsToolInputSchemaUnion) AsAnyArray ¶
func (u ResponseObjectStreamResponseOutputItemAddedItemMcpListToolsToolInputSchemaUnion) AsAnyArray() (v []any)
func (ResponseObjectStreamResponseOutputItemAddedItemMcpListToolsToolInputSchemaUnion) AsBool ¶
func (u ResponseObjectStreamResponseOutputItemAddedItemMcpListToolsToolInputSchemaUnion) AsBool() (v bool)
func (ResponseObjectStreamResponseOutputItemAddedItemMcpListToolsToolInputSchemaUnion) AsFloat ¶
func (u ResponseObjectStreamResponseOutputItemAddedItemMcpListToolsToolInputSchemaUnion) AsFloat() (v float64)
func (ResponseObjectStreamResponseOutputItemAddedItemMcpListToolsToolInputSchemaUnion) AsString ¶
func (u ResponseObjectStreamResponseOutputItemAddedItemMcpListToolsToolInputSchemaUnion) AsString() (v string)
func (ResponseObjectStreamResponseOutputItemAddedItemMcpListToolsToolInputSchemaUnion) RawJSON ¶
func (u ResponseObjectStreamResponseOutputItemAddedItemMcpListToolsToolInputSchemaUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseOutputItemAddedItemMcpListToolsToolInputSchemaUnion) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseOutputItemAddedItemMcpListToolsToolInputSchemaUnion) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseOutputItemAddedItemMessage ¶
type ResponseObjectStreamResponseOutputItemAddedItemMessage struct {
Content ResponseObjectStreamResponseOutputItemAddedItemMessageContentUnion `json:"content,required"`
// Any of "system", "developer", "user", "assistant".
Role ResponseObjectStreamResponseOutputItemAddedItemMessageRole `json:"role,required"`
Type constant.Message `json:"type,required"`
ID string `json:"id"`
Status string `json:"status"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Content respjson.Field
Role respjson.Field
Type respjson.Field
ID respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Corresponds to the various Message types in the Responses API. They are all under one type because the Responses API gives them all the same "type" value, and there is no way to tell them apart in certain scenarios.
func (ResponseObjectStreamResponseOutputItemAddedItemMessage) RawJSON ¶
func (r ResponseObjectStreamResponseOutputItemAddedItemMessage) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseOutputItemAddedItemMessage) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseOutputItemAddedItemMessage) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemDetail ¶
type ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemDetail string
Level of detail for image processing, can be "low", "high", or "auto"
const ( ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemDetailLow ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemDetail = "low" ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemDetailHigh ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemDetail = "high" ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemDetailAuto ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemDetail = "auto" )
type ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemInputFile ¶
type ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemInputFile struct {
// The type of the input item. Always `input_file`.
Type constant.InputFile `json:"type,required"`
// The data of the file to be sent to the model.
FileData string `json:"file_data"`
// (Optional) The ID of the file to be sent to the model.
FileID string `json:"file_id"`
// The URL of the file to be sent to the model.
FileURL string `json:"file_url"`
// The name of the file to be sent to the model.
Filename string `json:"filename"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Type respjson.Field
FileData respjson.Field
FileID respjson.Field
FileURL respjson.Field
Filename respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
File content for input messages in OpenAI response format.
func (ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemInputFile) RawJSON ¶
func (r ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemInputFile) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemInputFile) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemInputFile) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemInputImage ¶
type ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemInputImage struct {
// Level of detail for image processing, can be "low", "high", or "auto"
//
// Any of "low", "high", "auto".
Detail ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemInputImageDetail `json:"detail,required"`
// Content type identifier, always "input_image"
Type constant.InputImage `json:"type,required"`
// (Optional) The ID of the file to be sent to the model.
FileID string `json:"file_id"`
// (Optional) URL of the image content
ImageURL string `json:"image_url"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Detail respjson.Field
Type respjson.Field
FileID respjson.Field
ImageURL respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Image content for input messages in OpenAI response format.
func (ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemInputImage) RawJSON ¶
func (r ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemInputImage) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemInputImage) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemInputImage) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemInputImageDetail ¶
type ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemInputImageDetail string
Level of detail for image processing, can be "low", "high", or "auto"
const ( ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemInputImageDetailLow ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemInputImageDetail = "low" ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemInputImageDetailHigh ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemInputImageDetail = "high" ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemInputImageDetailAuto ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemInputImageDetail = "auto" )
type ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemInputText ¶
type ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemInputText struct {
// The text content of the input message
Text string `json:"text,required"`
// Content type identifier, always "input_text"
Type constant.InputText `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:"-"`
}
Text content for input messages in OpenAI response format.
func (ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemInputText) RawJSON ¶
func (r ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemInputText) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemInputText) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemInputText) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemUnion ¶
type ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemUnion struct {
// This field is from variant
// [ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemInputText].
Text string `json:"text"`
// Any of "input_text", "input_image", "input_file".
Type string `json:"type"`
// This field is from variant
// [ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemInputImage].
Detail ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemInputImageDetail `json:"detail"`
FileID string `json:"file_id"`
// This field is from variant
// [ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemInputImage].
ImageURL string `json:"image_url"`
// This field is from variant
// [ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemInputFile].
FileData string `json:"file_data"`
// This field is from variant
// [ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemInputFile].
FileURL string `json:"file_url"`
// This field is from variant
// [ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemInputFile].
Filename string `json:"filename"`
JSON struct {
Text respjson.Field
Type respjson.Field
Detail respjson.Field
FileID respjson.Field
ImageURL respjson.Field
FileData respjson.Field
FileURL respjson.Field
Filename respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemUnion contains all possible properties and values from ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemInputText, ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemInputImage, ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemInputFile.
Use the ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemUnion.AsAny method to switch on the variant.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemUnion) AsAny ¶
func (u ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemUnion) AsAny() anyResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItem
Use the following switch statement to find the correct variant
switch variant := ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemUnion.AsAny().(type) {
case llamastackclient.ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemInputText:
case llamastackclient.ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemInputImage:
case llamastackclient.ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemInputFile:
default:
fmt.Errorf("no variant present")
}
func (ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemUnion) AsInputFile ¶
func (ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemUnion) AsInputImage ¶
func (ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemUnion) AsInputText ¶
func (ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemUnion) RawJSON ¶
func (u ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemUnion) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemUnion) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseOutputItemAddedItemMessageContentUnion ¶
type ResponseObjectStreamResponseOutputItemAddedItemMessageContentUnion 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
// [[]ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemUnion]
// instead of an object.
OfVariant2 []ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemUnion `json:",inline"`
JSON struct {
OfString respjson.Field
OfVariant2 respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ResponseObjectStreamResponseOutputItemAddedItemMessageContentUnion contains all possible properties and values from [string], [[]ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemUnion], [[]ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemUnion].
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 OfVariant2]
func (ResponseObjectStreamResponseOutputItemAddedItemMessageContentUnion) AsResponseObjectStreamResponseOutputItemAddedItemMessageContentArray ¶
func (u ResponseObjectStreamResponseOutputItemAddedItemMessageContentUnion) AsResponseObjectStreamResponseOutputItemAddedItemMessageContentArray() (v []ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemUnion)
func (ResponseObjectStreamResponseOutputItemAddedItemMessageContentUnion) AsString ¶
func (u ResponseObjectStreamResponseOutputItemAddedItemMessageContentUnion) AsString() (v string)
func (ResponseObjectStreamResponseOutputItemAddedItemMessageContentUnion) AsVariant2 ¶
func (ResponseObjectStreamResponseOutputItemAddedItemMessageContentUnion) RawJSON ¶
func (u ResponseObjectStreamResponseOutputItemAddedItemMessageContentUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseOutputItemAddedItemMessageContentUnion) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseOutputItemAddedItemMessageContentUnion) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseOutputItemAddedItemMessageRole ¶
type ResponseObjectStreamResponseOutputItemAddedItemMessageRole string
const ( ResponseObjectStreamResponseOutputItemAddedItemMessageRoleSystem ResponseObjectStreamResponseOutputItemAddedItemMessageRole = "system" ResponseObjectStreamResponseOutputItemAddedItemMessageRoleDeveloper ResponseObjectStreamResponseOutputItemAddedItemMessageRole = "developer" ResponseObjectStreamResponseOutputItemAddedItemMessageRoleUser ResponseObjectStreamResponseOutputItemAddedItemMessageRole = "user" ResponseObjectStreamResponseOutputItemAddedItemMessageRoleAssistant ResponseObjectStreamResponseOutputItemAddedItemMessageRole = "assistant" )
type ResponseObjectStreamResponseOutputItemAddedItemRole ¶
type ResponseObjectStreamResponseOutputItemAddedItemRole string
const ( ResponseObjectStreamResponseOutputItemAddedItemRoleSystem ResponseObjectStreamResponseOutputItemAddedItemRole = "system" ResponseObjectStreamResponseOutputItemAddedItemRoleDeveloper ResponseObjectStreamResponseOutputItemAddedItemRole = "developer" ResponseObjectStreamResponseOutputItemAddedItemRoleUser ResponseObjectStreamResponseOutputItemAddedItemRole = "user" ResponseObjectStreamResponseOutputItemAddedItemRoleAssistant ResponseObjectStreamResponseOutputItemAddedItemRole = "assistant" )
type ResponseObjectStreamResponseOutputItemAddedItemUnion ¶
type ResponseObjectStreamResponseOutputItemAddedItemUnion struct {
// This field is from variant
// [ResponseObjectStreamResponseOutputItemAddedItemMessage].
Content ResponseObjectStreamResponseOutputItemAddedItemMessageContentUnion `json:"content"`
// This field is from variant
// [ResponseObjectStreamResponseOutputItemAddedItemMessage].
Role ResponseObjectStreamResponseOutputItemAddedItemMessageRole `json:"role"`
// Any of "message", "web_search_call", "file_search_call", "function_call",
// "mcp_call", "mcp_list_tools", "mcp_approval_request".
Type string `json:"type"`
ID string `json:"id"`
Status string `json:"status"`
// This field is from variant
// [ResponseObjectStreamResponseOutputItemAddedItemFileSearchCall].
Queries []string `json:"queries"`
// This field is from variant
// [ResponseObjectStreamResponseOutputItemAddedItemFileSearchCall].
Results []ResponseObjectStreamResponseOutputItemAddedItemFileSearchCallResult `json:"results"`
Arguments string `json:"arguments"`
// This field is from variant
// [ResponseObjectStreamResponseOutputItemAddedItemFunctionCall].
CallID string `json:"call_id"`
Name string `json:"name"`
ServerLabel string `json:"server_label"`
// This field is from variant
// [ResponseObjectStreamResponseOutputItemAddedItemMcpCall].
Error string `json:"error"`
// This field is from variant
// [ResponseObjectStreamResponseOutputItemAddedItemMcpCall].
Output string `json:"output"`
// This field is from variant
// [ResponseObjectStreamResponseOutputItemAddedItemMcpListTools].
Tools []ResponseObjectStreamResponseOutputItemAddedItemMcpListToolsTool `json:"tools"`
JSON struct {
Content respjson.Field
Role respjson.Field
Type respjson.Field
ID respjson.Field
Status respjson.Field
Queries respjson.Field
Results respjson.Field
Arguments respjson.Field
CallID respjson.Field
Name respjson.Field
ServerLabel respjson.Field
Error respjson.Field
Output respjson.Field
Tools respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ResponseObjectStreamResponseOutputItemAddedItemUnion contains all possible properties and values from ResponseObjectStreamResponseOutputItemAddedItemMessage, ResponseObjectStreamResponseOutputItemAddedItemWebSearchCall, ResponseObjectStreamResponseOutputItemAddedItemFileSearchCall, ResponseObjectStreamResponseOutputItemAddedItemFunctionCall, ResponseObjectStreamResponseOutputItemAddedItemMcpCall, ResponseObjectStreamResponseOutputItemAddedItemMcpListTools, ResponseObjectStreamResponseOutputItemAddedItemMcpApprovalRequest.
Use the ResponseObjectStreamResponseOutputItemAddedItemUnion.AsAny method to switch on the variant.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (ResponseObjectStreamResponseOutputItemAddedItemUnion) AsAny ¶
func (u ResponseObjectStreamResponseOutputItemAddedItemUnion) AsAny() anyResponseObjectStreamResponseOutputItemAddedItem
Use the following switch statement to find the correct variant
switch variant := ResponseObjectStreamResponseOutputItemAddedItemUnion.AsAny().(type) {
case llamastackclient.ResponseObjectStreamResponseOutputItemAddedItemMessage:
case llamastackclient.ResponseObjectStreamResponseOutputItemAddedItemWebSearchCall:
case llamastackclient.ResponseObjectStreamResponseOutputItemAddedItemFileSearchCall:
case llamastackclient.ResponseObjectStreamResponseOutputItemAddedItemFunctionCall:
case llamastackclient.ResponseObjectStreamResponseOutputItemAddedItemMcpCall:
case llamastackclient.ResponseObjectStreamResponseOutputItemAddedItemMcpListTools:
case llamastackclient.ResponseObjectStreamResponseOutputItemAddedItemMcpApprovalRequest:
default:
fmt.Errorf("no variant present")
}
func (ResponseObjectStreamResponseOutputItemAddedItemUnion) AsFileSearchCall ¶
func (u ResponseObjectStreamResponseOutputItemAddedItemUnion) AsFileSearchCall() (v ResponseObjectStreamResponseOutputItemAddedItemFileSearchCall)
func (ResponseObjectStreamResponseOutputItemAddedItemUnion) AsFunctionCall ¶
func (u ResponseObjectStreamResponseOutputItemAddedItemUnion) AsFunctionCall() (v ResponseObjectStreamResponseOutputItemAddedItemFunctionCall)
func (ResponseObjectStreamResponseOutputItemAddedItemUnion) AsMcpApprovalRequest ¶
func (u ResponseObjectStreamResponseOutputItemAddedItemUnion) AsMcpApprovalRequest() (v ResponseObjectStreamResponseOutputItemAddedItemMcpApprovalRequest)
func (ResponseObjectStreamResponseOutputItemAddedItemUnion) AsMcpListTools ¶
func (u ResponseObjectStreamResponseOutputItemAddedItemUnion) AsMcpListTools() (v ResponseObjectStreamResponseOutputItemAddedItemMcpListTools)
func (ResponseObjectStreamResponseOutputItemAddedItemUnion) AsWebSearchCall ¶
func (u ResponseObjectStreamResponseOutputItemAddedItemUnion) AsWebSearchCall() (v ResponseObjectStreamResponseOutputItemAddedItemWebSearchCall)
func (ResponseObjectStreamResponseOutputItemAddedItemUnion) RawJSON ¶
func (u ResponseObjectStreamResponseOutputItemAddedItemUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseOutputItemAddedItemUnion) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseOutputItemAddedItemUnion) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseOutputItemAddedItemWebSearchCall ¶
type ResponseObjectStreamResponseOutputItemAddedItemWebSearchCall struct {
// Unique identifier for this tool call
ID string `json:"id,required"`
// Current status of the web search operation
Status string `json:"status,required"`
// Tool call type identifier, always "web_search_call"
Type constant.WebSearchCall `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Status respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Web search tool call output message for OpenAI responses.
func (ResponseObjectStreamResponseOutputItemAddedItemWebSearchCall) RawJSON ¶
func (r ResponseObjectStreamResponseOutputItemAddedItemWebSearchCall) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseOutputItemAddedItemWebSearchCall) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseOutputItemAddedItemWebSearchCall) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseOutputItemDone ¶
type ResponseObjectStreamResponseOutputItemDone struct {
// The completed output item (message, tool call, etc.)
Item ResponseObjectStreamResponseOutputItemDoneItemUnion `json:"item,required"`
// Index position of this item in the output list
OutputIndex int64 `json:"output_index,required"`
// Unique identifier of the response containing this output
ResponseID string `json:"response_id,required"`
// Sequential number for ordering streaming events
SequenceNumber int64 `json:"sequence_number,required"`
// Event type identifier, always "response.output_item.done"
Type constant.ResponseOutputItemDone `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Item respjson.Field
OutputIndex respjson.Field
ResponseID respjson.Field
SequenceNumber respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Streaming event for when an output item is completed.
func (ResponseObjectStreamResponseOutputItemDone) RawJSON ¶
func (r ResponseObjectStreamResponseOutputItemDone) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseOutputItemDone) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseOutputItemDone) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseOutputItemDoneItemFileSearchCall ¶
type ResponseObjectStreamResponseOutputItemDoneItemFileSearchCall struct {
// Unique identifier for this tool call
ID string `json:"id,required"`
// List of search queries executed
Queries []string `json:"queries,required"`
// Current status of the file search operation
Status string `json:"status,required"`
// Tool call type identifier, always "file_search_call"
Type constant.FileSearchCall `json:"type,required"`
// (Optional) Search results returned by the file search operation
Results []ResponseObjectStreamResponseOutputItemDoneItemFileSearchCallResult `json:"results"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Queries respjson.Field
Status respjson.Field
Type respjson.Field
Results respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
File search tool call output message for OpenAI responses.
func (ResponseObjectStreamResponseOutputItemDoneItemFileSearchCall) RawJSON ¶
func (r ResponseObjectStreamResponseOutputItemDoneItemFileSearchCall) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseOutputItemDoneItemFileSearchCall) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseOutputItemDoneItemFileSearchCall) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseOutputItemDoneItemFileSearchCallResult ¶
type ResponseObjectStreamResponseOutputItemDoneItemFileSearchCallResult struct {
// (Optional) Key-value attributes associated with the file
Attributes map[string]ResponseObjectStreamResponseOutputItemDoneItemFileSearchCallResultAttributeUnion `json:"attributes,required"`
// Unique identifier of the file containing the result
FileID string `json:"file_id,required"`
// Name of the file containing the result
Filename string `json:"filename,required"`
// Relevance score for this search result (between 0 and 1)
Score float64 `json:"score,required"`
// Text content of the search result
Text string `json:"text,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Attributes respjson.Field
FileID respjson.Field
Filename respjson.Field
Score respjson.Field
Text respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Search results returned by the file search operation.
func (ResponseObjectStreamResponseOutputItemDoneItemFileSearchCallResult) RawJSON ¶
func (r ResponseObjectStreamResponseOutputItemDoneItemFileSearchCallResult) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseOutputItemDoneItemFileSearchCallResult) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseOutputItemDoneItemFileSearchCallResult) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseOutputItemDoneItemFileSearchCallResultAttributeUnion ¶
type ResponseObjectStreamResponseOutputItemDoneItemFileSearchCallResultAttributeUnion 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:"-"`
}
ResponseObjectStreamResponseOutputItemDoneItemFileSearchCallResultAttributeUnion 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 (ResponseObjectStreamResponseOutputItemDoneItemFileSearchCallResultAttributeUnion) AsAnyArray ¶
func (u ResponseObjectStreamResponseOutputItemDoneItemFileSearchCallResultAttributeUnion) AsAnyArray() (v []any)
func (ResponseObjectStreamResponseOutputItemDoneItemFileSearchCallResultAttributeUnion) AsBool ¶
func (u ResponseObjectStreamResponseOutputItemDoneItemFileSearchCallResultAttributeUnion) AsBool() (v bool)
func (ResponseObjectStreamResponseOutputItemDoneItemFileSearchCallResultAttributeUnion) AsFloat ¶
func (u ResponseObjectStreamResponseOutputItemDoneItemFileSearchCallResultAttributeUnion) AsFloat() (v float64)
func (ResponseObjectStreamResponseOutputItemDoneItemFileSearchCallResultAttributeUnion) AsString ¶
func (u ResponseObjectStreamResponseOutputItemDoneItemFileSearchCallResultAttributeUnion) AsString() (v string)
func (ResponseObjectStreamResponseOutputItemDoneItemFileSearchCallResultAttributeUnion) RawJSON ¶
func (u ResponseObjectStreamResponseOutputItemDoneItemFileSearchCallResultAttributeUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseOutputItemDoneItemFileSearchCallResultAttributeUnion) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseOutputItemDoneItemFileSearchCallResultAttributeUnion) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseOutputItemDoneItemFunctionCall ¶
type ResponseObjectStreamResponseOutputItemDoneItemFunctionCall struct {
// JSON string containing the function arguments
Arguments string `json:"arguments,required"`
// Unique identifier for the function call
CallID string `json:"call_id,required"`
// Name of the function being called
Name string `json:"name,required"`
// Tool call type identifier, always "function_call"
Type constant.FunctionCall `json:"type,required"`
// (Optional) Additional identifier for the tool call
ID string `json:"id"`
// (Optional) Current status of the function call execution
Status string `json:"status"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Arguments respjson.Field
CallID respjson.Field
Name respjson.Field
Type respjson.Field
ID respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Function tool call output message for OpenAI responses.
func (ResponseObjectStreamResponseOutputItemDoneItemFunctionCall) RawJSON ¶
func (r ResponseObjectStreamResponseOutputItemDoneItemFunctionCall) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseOutputItemDoneItemFunctionCall) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseOutputItemDoneItemFunctionCall) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseOutputItemDoneItemMcpApprovalRequest ¶
type ResponseObjectStreamResponseOutputItemDoneItemMcpApprovalRequest struct {
ID string `json:"id,required"`
Arguments string `json:"arguments,required"`
Name string `json:"name,required"`
ServerLabel string `json:"server_label,required"`
Type constant.McpApprovalRequest `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Arguments respjson.Field
Name respjson.Field
ServerLabel respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A request for human approval of a tool invocation.
func (ResponseObjectStreamResponseOutputItemDoneItemMcpApprovalRequest) RawJSON ¶
func (r ResponseObjectStreamResponseOutputItemDoneItemMcpApprovalRequest) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseOutputItemDoneItemMcpApprovalRequest) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseOutputItemDoneItemMcpApprovalRequest) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseOutputItemDoneItemMcpCall ¶
type ResponseObjectStreamResponseOutputItemDoneItemMcpCall struct {
// Unique identifier for this MCP call
ID string `json:"id,required"`
// JSON string containing the MCP call arguments
Arguments string `json:"arguments,required"`
// Name of the MCP method being called
Name string `json:"name,required"`
// Label identifying the MCP server handling the call
ServerLabel string `json:"server_label,required"`
// Tool call type identifier, always "mcp_call"
Type constant.McpCall `json:"type,required"`
// (Optional) Error message if the MCP call failed
Error string `json:"error"`
// (Optional) Output result from the successful MCP call
Output string `json:"output"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Arguments respjson.Field
Name respjson.Field
ServerLabel respjson.Field
Type respjson.Field
Error respjson.Field
Output respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Model Context Protocol (MCP) call output message for OpenAI responses.
func (ResponseObjectStreamResponseOutputItemDoneItemMcpCall) RawJSON ¶
func (r ResponseObjectStreamResponseOutputItemDoneItemMcpCall) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseOutputItemDoneItemMcpCall) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseOutputItemDoneItemMcpCall) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseOutputItemDoneItemMcpListTools ¶
type ResponseObjectStreamResponseOutputItemDoneItemMcpListTools struct {
// Unique identifier for this MCP list tools operation
ID string `json:"id,required"`
// Label identifying the MCP server providing the tools
ServerLabel string `json:"server_label,required"`
// List of available tools provided by the MCP server
Tools []ResponseObjectStreamResponseOutputItemDoneItemMcpListToolsTool `json:"tools,required"`
// Tool call type identifier, always "mcp_list_tools"
Type constant.McpListTools `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
ServerLabel respjson.Field
Tools respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
MCP list tools output message containing available tools from an MCP server.
func (ResponseObjectStreamResponseOutputItemDoneItemMcpListTools) RawJSON ¶
func (r ResponseObjectStreamResponseOutputItemDoneItemMcpListTools) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseOutputItemDoneItemMcpListTools) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseOutputItemDoneItemMcpListTools) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseOutputItemDoneItemMcpListToolsTool ¶
type ResponseObjectStreamResponseOutputItemDoneItemMcpListToolsTool struct {
// JSON schema defining the tool's input parameters
InputSchema map[string]ResponseObjectStreamResponseOutputItemDoneItemMcpListToolsToolInputSchemaUnion `json:"input_schema,required"`
// Name of the tool
Name string `json:"name,required"`
// (Optional) Description of what the tool does
Description string `json:"description"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
InputSchema respjson.Field
Name respjson.Field
Description respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Tool definition returned by MCP list tools operation.
func (ResponseObjectStreamResponseOutputItemDoneItemMcpListToolsTool) RawJSON ¶
func (r ResponseObjectStreamResponseOutputItemDoneItemMcpListToolsTool) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseOutputItemDoneItemMcpListToolsTool) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseOutputItemDoneItemMcpListToolsTool) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseOutputItemDoneItemMcpListToolsToolInputSchemaUnion ¶
type ResponseObjectStreamResponseOutputItemDoneItemMcpListToolsToolInputSchemaUnion 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:"-"`
}
ResponseObjectStreamResponseOutputItemDoneItemMcpListToolsToolInputSchemaUnion 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 (ResponseObjectStreamResponseOutputItemDoneItemMcpListToolsToolInputSchemaUnion) AsAnyArray ¶
func (u ResponseObjectStreamResponseOutputItemDoneItemMcpListToolsToolInputSchemaUnion) AsAnyArray() (v []any)
func (ResponseObjectStreamResponseOutputItemDoneItemMcpListToolsToolInputSchemaUnion) AsBool ¶
func (u ResponseObjectStreamResponseOutputItemDoneItemMcpListToolsToolInputSchemaUnion) AsBool() (v bool)
func (ResponseObjectStreamResponseOutputItemDoneItemMcpListToolsToolInputSchemaUnion) AsFloat ¶
func (u ResponseObjectStreamResponseOutputItemDoneItemMcpListToolsToolInputSchemaUnion) AsFloat() (v float64)
func (ResponseObjectStreamResponseOutputItemDoneItemMcpListToolsToolInputSchemaUnion) AsString ¶
func (u ResponseObjectStreamResponseOutputItemDoneItemMcpListToolsToolInputSchemaUnion) AsString() (v string)
func (ResponseObjectStreamResponseOutputItemDoneItemMcpListToolsToolInputSchemaUnion) RawJSON ¶
func (u ResponseObjectStreamResponseOutputItemDoneItemMcpListToolsToolInputSchemaUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseOutputItemDoneItemMcpListToolsToolInputSchemaUnion) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseOutputItemDoneItemMcpListToolsToolInputSchemaUnion) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseOutputItemDoneItemMessage ¶
type ResponseObjectStreamResponseOutputItemDoneItemMessage struct {
Content ResponseObjectStreamResponseOutputItemDoneItemMessageContentUnion `json:"content,required"`
// Any of "system", "developer", "user", "assistant".
Role ResponseObjectStreamResponseOutputItemDoneItemMessageRole `json:"role,required"`
Type constant.Message `json:"type,required"`
ID string `json:"id"`
Status string `json:"status"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Content respjson.Field
Role respjson.Field
Type respjson.Field
ID respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Corresponds to the various Message types in the Responses API. They are all under one type because the Responses API gives them all the same "type" value, and there is no way to tell them apart in certain scenarios.
func (ResponseObjectStreamResponseOutputItemDoneItemMessage) RawJSON ¶
func (r ResponseObjectStreamResponseOutputItemDoneItemMessage) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseOutputItemDoneItemMessage) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseOutputItemDoneItemMessage) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemDetail ¶
type ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemDetail string
Level of detail for image processing, can be "low", "high", or "auto"
const ( ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemDetailLow ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemDetail = "low" ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemDetailHigh ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemDetail = "high" ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemDetailAuto ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemDetail = "auto" )
type ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemInputFile ¶
type ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemInputFile struct {
// The type of the input item. Always `input_file`.
Type constant.InputFile `json:"type,required"`
// The data of the file to be sent to the model.
FileData string `json:"file_data"`
// (Optional) The ID of the file to be sent to the model.
FileID string `json:"file_id"`
// The URL of the file to be sent to the model.
FileURL string `json:"file_url"`
// The name of the file to be sent to the model.
Filename string `json:"filename"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Type respjson.Field
FileData respjson.Field
FileID respjson.Field
FileURL respjson.Field
Filename respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
File content for input messages in OpenAI response format.
func (ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemInputFile) RawJSON ¶
func (r ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemInputFile) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemInputFile) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemInputFile) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemInputImage ¶
type ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemInputImage struct {
// Level of detail for image processing, can be "low", "high", or "auto"
//
// Any of "low", "high", "auto".
Detail ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemInputImageDetail `json:"detail,required"`
// Content type identifier, always "input_image"
Type constant.InputImage `json:"type,required"`
// (Optional) The ID of the file to be sent to the model.
FileID string `json:"file_id"`
// (Optional) URL of the image content
ImageURL string `json:"image_url"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Detail respjson.Field
Type respjson.Field
FileID respjson.Field
ImageURL respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Image content for input messages in OpenAI response format.
func (ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemInputImage) RawJSON ¶
func (r ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemInputImage) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemInputImage) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemInputImage) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemInputImageDetail ¶
type ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemInputImageDetail string
Level of detail for image processing, can be "low", "high", or "auto"
const ( ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemInputImageDetailLow ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemInputImageDetail = "low" ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemInputImageDetailHigh ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemInputImageDetail = "high" ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemInputImageDetailAuto ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemInputImageDetail = "auto" )
type ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemInputText ¶
type ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemInputText struct {
// The text content of the input message
Text string `json:"text,required"`
// Content type identifier, always "input_text"
Type constant.InputText `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:"-"`
}
Text content for input messages in OpenAI response format.
func (ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemInputText) RawJSON ¶
func (r ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemInputText) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemInputText) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemInputText) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemUnion ¶
type ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemUnion struct {
// This field is from variant
// [ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemInputText].
Text string `json:"text"`
// Any of "input_text", "input_image", "input_file".
Type string `json:"type"`
// This field is from variant
// [ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemInputImage].
Detail ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemInputImageDetail `json:"detail"`
FileID string `json:"file_id"`
// This field is from variant
// [ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemInputImage].
ImageURL string `json:"image_url"`
// This field is from variant
// [ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemInputFile].
FileData string `json:"file_data"`
// This field is from variant
// [ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemInputFile].
FileURL string `json:"file_url"`
// This field is from variant
// [ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemInputFile].
Filename string `json:"filename"`
JSON struct {
Text respjson.Field
Type respjson.Field
Detail respjson.Field
FileID respjson.Field
ImageURL respjson.Field
FileData respjson.Field
FileURL respjson.Field
Filename respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemUnion contains all possible properties and values from ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemInputText, ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemInputImage, ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemInputFile.
Use the ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemUnion.AsAny method to switch on the variant.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemUnion) AsAny ¶
func (u ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemUnion) AsAny() anyResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItem
Use the following switch statement to find the correct variant
switch variant := ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemUnion.AsAny().(type) {
case llamastackclient.ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemInputText:
case llamastackclient.ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemInputImage:
case llamastackclient.ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemInputFile:
default:
fmt.Errorf("no variant present")
}
func (ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemUnion) AsInputFile ¶
func (ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemUnion) AsInputImage ¶
func (ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemUnion) AsInputText ¶
func (ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemUnion) RawJSON ¶
func (u ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemUnion) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemUnion) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseOutputItemDoneItemMessageContentUnion ¶
type ResponseObjectStreamResponseOutputItemDoneItemMessageContentUnion 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
// [[]ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemUnion]
// instead of an object.
OfVariant2 []ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemUnion `json:",inline"`
JSON struct {
OfString respjson.Field
OfVariant2 respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ResponseObjectStreamResponseOutputItemDoneItemMessageContentUnion contains all possible properties and values from [string], [[]ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemUnion], [[]ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemUnion].
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 OfVariant2]
func (ResponseObjectStreamResponseOutputItemDoneItemMessageContentUnion) AsResponseObjectStreamResponseOutputItemDoneItemMessageContentArray ¶
func (u ResponseObjectStreamResponseOutputItemDoneItemMessageContentUnion) AsResponseObjectStreamResponseOutputItemDoneItemMessageContentArray() (v []ResponseObjectStreamResponseOutputItemDoneItemMessageContentArrayItemUnion)
func (ResponseObjectStreamResponseOutputItemDoneItemMessageContentUnion) AsString ¶
func (u ResponseObjectStreamResponseOutputItemDoneItemMessageContentUnion) AsString() (v string)
func (ResponseObjectStreamResponseOutputItemDoneItemMessageContentUnion) AsVariant2 ¶
func (ResponseObjectStreamResponseOutputItemDoneItemMessageContentUnion) RawJSON ¶
func (u ResponseObjectStreamResponseOutputItemDoneItemMessageContentUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseOutputItemDoneItemMessageContentUnion) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseOutputItemDoneItemMessageContentUnion) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseOutputItemDoneItemMessageRole ¶
type ResponseObjectStreamResponseOutputItemDoneItemMessageRole string
const ( ResponseObjectStreamResponseOutputItemDoneItemMessageRoleSystem ResponseObjectStreamResponseOutputItemDoneItemMessageRole = "system" ResponseObjectStreamResponseOutputItemDoneItemMessageRoleDeveloper ResponseObjectStreamResponseOutputItemDoneItemMessageRole = "developer" ResponseObjectStreamResponseOutputItemDoneItemMessageRoleUser ResponseObjectStreamResponseOutputItemDoneItemMessageRole = "user" ResponseObjectStreamResponseOutputItemDoneItemMessageRoleAssistant ResponseObjectStreamResponseOutputItemDoneItemMessageRole = "assistant" )
type ResponseObjectStreamResponseOutputItemDoneItemRole ¶
type ResponseObjectStreamResponseOutputItemDoneItemRole string
const ( ResponseObjectStreamResponseOutputItemDoneItemRoleSystem ResponseObjectStreamResponseOutputItemDoneItemRole = "system" ResponseObjectStreamResponseOutputItemDoneItemRoleDeveloper ResponseObjectStreamResponseOutputItemDoneItemRole = "developer" ResponseObjectStreamResponseOutputItemDoneItemRoleUser ResponseObjectStreamResponseOutputItemDoneItemRole = "user" ResponseObjectStreamResponseOutputItemDoneItemRoleAssistant ResponseObjectStreamResponseOutputItemDoneItemRole = "assistant" )
type ResponseObjectStreamResponseOutputItemDoneItemUnion ¶
type ResponseObjectStreamResponseOutputItemDoneItemUnion struct {
// This field is from variant
// [ResponseObjectStreamResponseOutputItemDoneItemMessage].
Content ResponseObjectStreamResponseOutputItemDoneItemMessageContentUnion `json:"content"`
// This field is from variant
// [ResponseObjectStreamResponseOutputItemDoneItemMessage].
Role ResponseObjectStreamResponseOutputItemDoneItemMessageRole `json:"role"`
// Any of "message", "web_search_call", "file_search_call", "function_call",
// "mcp_call", "mcp_list_tools", "mcp_approval_request".
Type string `json:"type"`
ID string `json:"id"`
Status string `json:"status"`
// This field is from variant
// [ResponseObjectStreamResponseOutputItemDoneItemFileSearchCall].
Queries []string `json:"queries"`
// This field is from variant
// [ResponseObjectStreamResponseOutputItemDoneItemFileSearchCall].
Results []ResponseObjectStreamResponseOutputItemDoneItemFileSearchCallResult `json:"results"`
Arguments string `json:"arguments"`
// This field is from variant
// [ResponseObjectStreamResponseOutputItemDoneItemFunctionCall].
CallID string `json:"call_id"`
Name string `json:"name"`
ServerLabel string `json:"server_label"`
// This field is from variant
// [ResponseObjectStreamResponseOutputItemDoneItemMcpCall].
Error string `json:"error"`
// This field is from variant
// [ResponseObjectStreamResponseOutputItemDoneItemMcpCall].
Output string `json:"output"`
// This field is from variant
// [ResponseObjectStreamResponseOutputItemDoneItemMcpListTools].
Tools []ResponseObjectStreamResponseOutputItemDoneItemMcpListToolsTool `json:"tools"`
JSON struct {
Content respjson.Field
Role respjson.Field
Type respjson.Field
ID respjson.Field
Status respjson.Field
Queries respjson.Field
Results respjson.Field
Arguments respjson.Field
CallID respjson.Field
Name respjson.Field
ServerLabel respjson.Field
Error respjson.Field
Output respjson.Field
Tools respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ResponseObjectStreamResponseOutputItemDoneItemUnion contains all possible properties and values from ResponseObjectStreamResponseOutputItemDoneItemMessage, ResponseObjectStreamResponseOutputItemDoneItemWebSearchCall, ResponseObjectStreamResponseOutputItemDoneItemFileSearchCall, ResponseObjectStreamResponseOutputItemDoneItemFunctionCall, ResponseObjectStreamResponseOutputItemDoneItemMcpCall, ResponseObjectStreamResponseOutputItemDoneItemMcpListTools, ResponseObjectStreamResponseOutputItemDoneItemMcpApprovalRequest.
Use the ResponseObjectStreamResponseOutputItemDoneItemUnion.AsAny method to switch on the variant.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (ResponseObjectStreamResponseOutputItemDoneItemUnion) AsAny ¶
func (u ResponseObjectStreamResponseOutputItemDoneItemUnion) AsAny() anyResponseObjectStreamResponseOutputItemDoneItem
Use the following switch statement to find the correct variant
switch variant := ResponseObjectStreamResponseOutputItemDoneItemUnion.AsAny().(type) {
case llamastackclient.ResponseObjectStreamResponseOutputItemDoneItemMessage:
case llamastackclient.ResponseObjectStreamResponseOutputItemDoneItemWebSearchCall:
case llamastackclient.ResponseObjectStreamResponseOutputItemDoneItemFileSearchCall:
case llamastackclient.ResponseObjectStreamResponseOutputItemDoneItemFunctionCall:
case llamastackclient.ResponseObjectStreamResponseOutputItemDoneItemMcpCall:
case llamastackclient.ResponseObjectStreamResponseOutputItemDoneItemMcpListTools:
case llamastackclient.ResponseObjectStreamResponseOutputItemDoneItemMcpApprovalRequest:
default:
fmt.Errorf("no variant present")
}
func (ResponseObjectStreamResponseOutputItemDoneItemUnion) AsFileSearchCall ¶
func (u ResponseObjectStreamResponseOutputItemDoneItemUnion) AsFileSearchCall() (v ResponseObjectStreamResponseOutputItemDoneItemFileSearchCall)
func (ResponseObjectStreamResponseOutputItemDoneItemUnion) AsFunctionCall ¶
func (u ResponseObjectStreamResponseOutputItemDoneItemUnion) AsFunctionCall() (v ResponseObjectStreamResponseOutputItemDoneItemFunctionCall)
func (ResponseObjectStreamResponseOutputItemDoneItemUnion) AsMcpApprovalRequest ¶
func (u ResponseObjectStreamResponseOutputItemDoneItemUnion) AsMcpApprovalRequest() (v ResponseObjectStreamResponseOutputItemDoneItemMcpApprovalRequest)
func (ResponseObjectStreamResponseOutputItemDoneItemUnion) AsMcpCall ¶
func (u ResponseObjectStreamResponseOutputItemDoneItemUnion) AsMcpCall() (v ResponseObjectStreamResponseOutputItemDoneItemMcpCall)
func (ResponseObjectStreamResponseOutputItemDoneItemUnion) AsMcpListTools ¶
func (u ResponseObjectStreamResponseOutputItemDoneItemUnion) AsMcpListTools() (v ResponseObjectStreamResponseOutputItemDoneItemMcpListTools)
func (ResponseObjectStreamResponseOutputItemDoneItemUnion) AsMessage ¶
func (u ResponseObjectStreamResponseOutputItemDoneItemUnion) AsMessage() (v ResponseObjectStreamResponseOutputItemDoneItemMessage)
func (ResponseObjectStreamResponseOutputItemDoneItemUnion) AsWebSearchCall ¶
func (u ResponseObjectStreamResponseOutputItemDoneItemUnion) AsWebSearchCall() (v ResponseObjectStreamResponseOutputItemDoneItemWebSearchCall)
func (ResponseObjectStreamResponseOutputItemDoneItemUnion) RawJSON ¶
func (u ResponseObjectStreamResponseOutputItemDoneItemUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseOutputItemDoneItemUnion) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseOutputItemDoneItemUnion) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseOutputItemDoneItemWebSearchCall ¶
type ResponseObjectStreamResponseOutputItemDoneItemWebSearchCall struct {
// Unique identifier for this tool call
ID string `json:"id,required"`
// Current status of the web search operation
Status string `json:"status,required"`
// Tool call type identifier, always "web_search_call"
Type constant.WebSearchCall `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Status respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Web search tool call output message for OpenAI responses.
func (ResponseObjectStreamResponseOutputItemDoneItemWebSearchCall) RawJSON ¶
func (r ResponseObjectStreamResponseOutputItemDoneItemWebSearchCall) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseOutputItemDoneItemWebSearchCall) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseOutputItemDoneItemWebSearchCall) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseOutputTextAnnotationAdded ¶
type ResponseObjectStreamResponseOutputTextAnnotationAdded struct {
// The annotation object being added
Annotation ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationUnion `json:"annotation,required"`
// Index of the annotation within the content part
AnnotationIndex int64 `json:"annotation_index,required"`
// Index position of the content part within the output item
ContentIndex int64 `json:"content_index,required"`
// Unique identifier of the item to which the annotation is being added
ItemID string `json:"item_id,required"`
// Index position of the output item in the response's output array
OutputIndex int64 `json:"output_index,required"`
// Sequential number for ordering streaming events
SequenceNumber int64 `json:"sequence_number,required"`
// Event type identifier, always "response.output_text.annotation.added"
Type constant.ResponseOutputTextAnnotationAdded `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Annotation respjson.Field
AnnotationIndex respjson.Field
ContentIndex respjson.Field
ItemID respjson.Field
OutputIndex respjson.Field
SequenceNumber respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Streaming event for when an annotation is added to output text.
func (ResponseObjectStreamResponseOutputTextAnnotationAdded) RawJSON ¶
func (r ResponseObjectStreamResponseOutputTextAnnotationAdded) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseOutputTextAnnotationAdded) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseOutputTextAnnotationAdded) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationContainerFileCitation ¶
type ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationContainerFileCitation struct {
ContainerID string `json:"container_id,required"`
EndIndex int64 `json:"end_index,required"`
FileID string `json:"file_id,required"`
Filename string `json:"filename,required"`
StartIndex int64 `json:"start_index,required"`
Type constant.ContainerFileCitation `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ContainerID respjson.Field
EndIndex respjson.Field
FileID respjson.Field
Filename respjson.Field
StartIndex respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationContainerFileCitation) RawJSON ¶
func (r ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationContainerFileCitation) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationContainerFileCitation) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationContainerFileCitation) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationFileCitation ¶
type ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationFileCitation struct {
// Unique identifier of the referenced file
FileID string `json:"file_id,required"`
// Name of the referenced file
Filename string `json:"filename,required"`
// Position index of the citation within the content
Index int64 `json:"index,required"`
// Annotation type identifier, always "file_citation"
Type constant.FileCitation `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
FileID respjson.Field
Filename respjson.Field
Index respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
File citation annotation for referencing specific files in response content.
func (ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationFileCitation) RawJSON ¶
func (r ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationFileCitation) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationFileCitation) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationFileCitation) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationFilePath ¶
type ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationFilePath struct {
FileID string `json:"file_id,required"`
Index int64 `json:"index,required"`
Type constant.FilePath `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
FileID respjson.Field
Index respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationFilePath) RawJSON ¶
func (r ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationFilePath) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationFilePath) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationFilePath) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationURLCitation ¶
type ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationURLCitation struct {
// End position of the citation span in the content
EndIndex int64 `json:"end_index,required"`
// Start position of the citation span in the content
StartIndex int64 `json:"start_index,required"`
// Title of the referenced web resource
Title string `json:"title,required"`
// Annotation type identifier, always "url_citation"
Type constant.URLCitation `json:"type,required"`
// URL of the referenced web resource
URL string `json:"url,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
EndIndex respjson.Field
StartIndex respjson.Field
Title respjson.Field
Type respjson.Field
URL respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
URL citation annotation for referencing external web resources.
func (ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationURLCitation) RawJSON ¶
func (r ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationURLCitation) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationURLCitation) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationURLCitation) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationUnion ¶
type ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationUnion struct {
FileID string `json:"file_id"`
Filename string `json:"filename"`
Index int64 `json:"index"`
// Any of "file_citation", "url_citation", "container_file_citation", "file_path".
Type string `json:"type"`
EndIndex int64 `json:"end_index"`
StartIndex int64 `json:"start_index"`
// This field is from variant
// [ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationURLCitation].
Title string `json:"title"`
// This field is from variant
// [ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationURLCitation].
URL string `json:"url"`
// This field is from variant
// [ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationContainerFileCitation].
ContainerID string `json:"container_id"`
JSON struct {
FileID respjson.Field
Filename respjson.Field
Index respjson.Field
Type respjson.Field
EndIndex respjson.Field
StartIndex respjson.Field
Title respjson.Field
URL respjson.Field
ContainerID respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationUnion contains all possible properties and values from ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationFileCitation, ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationURLCitation, ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationContainerFileCitation, ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationFilePath.
Use the ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationUnion.AsAny method to switch on the variant.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationUnion) AsAny ¶
func (u ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationUnion) AsAny() anyResponseObjectStreamResponseOutputTextAnnotationAddedAnnotation
Use the following switch statement to find the correct variant
switch variant := ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationUnion.AsAny().(type) {
case llamastackclient.ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationFileCitation:
case llamastackclient.ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationURLCitation:
case llamastackclient.ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationContainerFileCitation:
case llamastackclient.ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationFilePath:
default:
fmt.Errorf("no variant present")
}
func (ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationUnion) AsContainerFileCitation ¶
func (u ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationUnion) AsContainerFileCitation() (v ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationContainerFileCitation)
func (ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationUnion) AsFileCitation ¶
func (ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationUnion) AsFilePath ¶
func (ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationUnion) AsURLCitation ¶
func (ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationUnion) RawJSON ¶
func (u ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationUnion) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationUnion) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseOutputTextDelta ¶
type ResponseObjectStreamResponseOutputTextDelta struct {
// Index position within the text content
ContentIndex int64 `json:"content_index,required"`
// Incremental text content being added
Delta string `json:"delta,required"`
// Unique identifier of the output item being updated
ItemID string `json:"item_id,required"`
// Index position of the item in the output list
OutputIndex int64 `json:"output_index,required"`
// Sequential number for ordering streaming events
SequenceNumber int64 `json:"sequence_number,required"`
// Event type identifier, always "response.output_text.delta"
Type constant.ResponseOutputTextDelta `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ContentIndex respjson.Field
Delta respjson.Field
ItemID respjson.Field
OutputIndex respjson.Field
SequenceNumber respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Streaming event for incremental text content updates.
func (ResponseObjectStreamResponseOutputTextDelta) RawJSON ¶
func (r ResponseObjectStreamResponseOutputTextDelta) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseOutputTextDelta) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseOutputTextDelta) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseOutputTextDone ¶
type ResponseObjectStreamResponseOutputTextDone struct {
// Index position within the text content
ContentIndex int64 `json:"content_index,required"`
// Unique identifier of the completed output item
ItemID string `json:"item_id,required"`
// Index position of the item in the output list
OutputIndex int64 `json:"output_index,required"`
// Sequential number for ordering streaming events
SequenceNumber int64 `json:"sequence_number,required"`
// Final complete text content of the output item
Text string `json:"text,required"`
// Event type identifier, always "response.output_text.done"
Type constant.ResponseOutputTextDone `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ContentIndex respjson.Field
ItemID respjson.Field
OutputIndex respjson.Field
SequenceNumber respjson.Field
Text respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Streaming event for when text output is completed.
func (ResponseObjectStreamResponseOutputTextDone) RawJSON ¶
func (r ResponseObjectStreamResponseOutputTextDone) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseOutputTextDone) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseOutputTextDone) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseReasoningSummaryPartAdded ¶
type ResponseObjectStreamResponseReasoningSummaryPartAdded struct {
// Unique identifier of the output item
ItemID string `json:"item_id,required"`
// Index position of the output item
OutputIndex int64 `json:"output_index,required"`
// The summary part that was added
Part ResponseObjectStreamResponseReasoningSummaryPartAddedPart `json:"part,required"`
// Sequential number for ordering streaming events
SequenceNumber int64 `json:"sequence_number,required"`
// Index of the summary part within the reasoning summary
SummaryIndex int64 `json:"summary_index,required"`
// Event type identifier, always "response.reasoning_summary_part.added"
Type constant.ResponseReasoningSummaryPartAdded `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ItemID respjson.Field
OutputIndex respjson.Field
Part respjson.Field
SequenceNumber respjson.Field
SummaryIndex respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Streaming event for when a new reasoning summary part is added.
func (ResponseObjectStreamResponseReasoningSummaryPartAdded) RawJSON ¶
func (r ResponseObjectStreamResponseReasoningSummaryPartAdded) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseReasoningSummaryPartAdded) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseReasoningSummaryPartAdded) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseReasoningSummaryPartAddedPart ¶
type ResponseObjectStreamResponseReasoningSummaryPartAddedPart struct {
// Summary text
Text string `json:"text,required"`
// Content part type identifier, always "summary_text"
Type constant.SummaryText `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:"-"`
}
The summary part that was added
func (ResponseObjectStreamResponseReasoningSummaryPartAddedPart) RawJSON ¶
func (r ResponseObjectStreamResponseReasoningSummaryPartAddedPart) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseReasoningSummaryPartAddedPart) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseReasoningSummaryPartAddedPart) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseReasoningSummaryPartDone ¶
type ResponseObjectStreamResponseReasoningSummaryPartDone struct {
// Unique identifier of the output item
ItemID string `json:"item_id,required"`
// Index position of the output item
OutputIndex int64 `json:"output_index,required"`
// The completed summary part
Part ResponseObjectStreamResponseReasoningSummaryPartDonePart `json:"part,required"`
// Sequential number for ordering streaming events
SequenceNumber int64 `json:"sequence_number,required"`
// Index of the summary part within the reasoning summary
SummaryIndex int64 `json:"summary_index,required"`
// Event type identifier, always "response.reasoning_summary_part.done"
Type constant.ResponseReasoningSummaryPartDone `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ItemID respjson.Field
OutputIndex respjson.Field
Part respjson.Field
SequenceNumber respjson.Field
SummaryIndex respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Streaming event for when a reasoning summary part is completed.
func (ResponseObjectStreamResponseReasoningSummaryPartDone) RawJSON ¶
func (r ResponseObjectStreamResponseReasoningSummaryPartDone) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseReasoningSummaryPartDone) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseReasoningSummaryPartDone) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseReasoningSummaryPartDonePart ¶
type ResponseObjectStreamResponseReasoningSummaryPartDonePart struct {
// Summary text
Text string `json:"text,required"`
// Content part type identifier, always "summary_text"
Type constant.SummaryText `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:"-"`
}
The completed summary part
func (ResponseObjectStreamResponseReasoningSummaryPartDonePart) RawJSON ¶
func (r ResponseObjectStreamResponseReasoningSummaryPartDonePart) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseReasoningSummaryPartDonePart) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseReasoningSummaryPartDonePart) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseReasoningSummaryTextDelta ¶
type ResponseObjectStreamResponseReasoningSummaryTextDelta struct {
// Incremental summary text being added
Delta string `json:"delta,required"`
// Unique identifier of the output item
ItemID string `json:"item_id,required"`
// Index position of the output item
OutputIndex int64 `json:"output_index,required"`
// Sequential number for ordering streaming events
SequenceNumber int64 `json:"sequence_number,required"`
// Index of the summary part within the reasoning summary
SummaryIndex int64 `json:"summary_index,required"`
// Event type identifier, always "response.reasoning_summary_text.delta"
Type constant.ResponseReasoningSummaryTextDelta `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Delta respjson.Field
ItemID respjson.Field
OutputIndex respjson.Field
SequenceNumber respjson.Field
SummaryIndex respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Streaming event for incremental reasoning summary text updates.
func (ResponseObjectStreamResponseReasoningSummaryTextDelta) RawJSON ¶
func (r ResponseObjectStreamResponseReasoningSummaryTextDelta) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseReasoningSummaryTextDelta) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseReasoningSummaryTextDelta) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseReasoningSummaryTextDone ¶
type ResponseObjectStreamResponseReasoningSummaryTextDone struct {
// Unique identifier of the output item
ItemID string `json:"item_id,required"`
// Index position of the output item
OutputIndex int64 `json:"output_index,required"`
// Sequential number for ordering streaming events
SequenceNumber int64 `json:"sequence_number,required"`
// Index of the summary part within the reasoning summary
SummaryIndex int64 `json:"summary_index,required"`
// Final complete summary text
Text string `json:"text,required"`
// Event type identifier, always "response.reasoning_summary_text.done"
Type constant.ResponseReasoningSummaryTextDone `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ItemID respjson.Field
OutputIndex respjson.Field
SequenceNumber respjson.Field
SummaryIndex respjson.Field
Text respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Streaming event for when reasoning summary text is completed.
func (ResponseObjectStreamResponseReasoningSummaryTextDone) RawJSON ¶
func (r ResponseObjectStreamResponseReasoningSummaryTextDone) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseReasoningSummaryTextDone) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseReasoningSummaryTextDone) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseReasoningTextDelta ¶
type ResponseObjectStreamResponseReasoningTextDelta struct {
// Index position of the reasoning content part
ContentIndex int64 `json:"content_index,required"`
// Incremental reasoning text being added
Delta string `json:"delta,required"`
// Unique identifier of the output item being updated
ItemID string `json:"item_id,required"`
// Index position of the item in the output list
OutputIndex int64 `json:"output_index,required"`
// Sequential number for ordering streaming events
SequenceNumber int64 `json:"sequence_number,required"`
// Event type identifier, always "response.reasoning_text.delta"
Type constant.ResponseReasoningTextDelta `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ContentIndex respjson.Field
Delta respjson.Field
ItemID respjson.Field
OutputIndex respjson.Field
SequenceNumber respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Streaming event for incremental reasoning text updates.
func (ResponseObjectStreamResponseReasoningTextDelta) RawJSON ¶
func (r ResponseObjectStreamResponseReasoningTextDelta) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseReasoningTextDelta) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseReasoningTextDelta) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseReasoningTextDone ¶
type ResponseObjectStreamResponseReasoningTextDone struct {
// Index position of the reasoning content part
ContentIndex int64 `json:"content_index,required"`
// Unique identifier of the completed output item
ItemID string `json:"item_id,required"`
// Index position of the item in the output list
OutputIndex int64 `json:"output_index,required"`
// Sequential number for ordering streaming events
SequenceNumber int64 `json:"sequence_number,required"`
// Final complete reasoning text
Text string `json:"text,required"`
// Event type identifier, always "response.reasoning_text.done"
Type constant.ResponseReasoningTextDone `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ContentIndex respjson.Field
ItemID respjson.Field
OutputIndex respjson.Field
SequenceNumber respjson.Field
Text respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Streaming event for when reasoning text is completed.
func (ResponseObjectStreamResponseReasoningTextDone) RawJSON ¶
func (r ResponseObjectStreamResponseReasoningTextDone) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseReasoningTextDone) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseReasoningTextDone) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseRefusalDelta ¶
type ResponseObjectStreamResponseRefusalDelta struct {
// Index position of the content part
ContentIndex int64 `json:"content_index,required"`
// Incremental refusal text being added
Delta string `json:"delta,required"`
// Unique identifier of the output item
ItemID string `json:"item_id,required"`
// Index position of the item in the output list
OutputIndex int64 `json:"output_index,required"`
// Sequential number for ordering streaming events
SequenceNumber int64 `json:"sequence_number,required"`
// Event type identifier, always "response.refusal.delta"
Type constant.ResponseRefusalDelta `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ContentIndex respjson.Field
Delta respjson.Field
ItemID respjson.Field
OutputIndex respjson.Field
SequenceNumber respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Streaming event for incremental refusal text updates.
func (ResponseObjectStreamResponseRefusalDelta) RawJSON ¶
func (r ResponseObjectStreamResponseRefusalDelta) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseRefusalDelta) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseRefusalDelta) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseRefusalDone ¶
type ResponseObjectStreamResponseRefusalDone struct {
// Index position of the content part
ContentIndex int64 `json:"content_index,required"`
// Unique identifier of the output item
ItemID string `json:"item_id,required"`
// Index position of the item in the output list
OutputIndex int64 `json:"output_index,required"`
// Final complete refusal text
Refusal string `json:"refusal,required"`
// Sequential number for ordering streaming events
SequenceNumber int64 `json:"sequence_number,required"`
// Event type identifier, always "response.refusal.done"
Type constant.ResponseRefusalDone `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ContentIndex respjson.Field
ItemID respjson.Field
OutputIndex respjson.Field
Refusal respjson.Field
SequenceNumber respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Streaming event for when refusal text is completed.
func (ResponseObjectStreamResponseRefusalDone) RawJSON ¶
func (r ResponseObjectStreamResponseRefusalDone) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseRefusalDone) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseRefusalDone) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseWebSearchCallCompleted ¶
type ResponseObjectStreamResponseWebSearchCallCompleted struct {
// Unique identifier of the completed web search call
ItemID string `json:"item_id,required"`
// Index position of the item in the output list
OutputIndex int64 `json:"output_index,required"`
// Sequential number for ordering streaming events
SequenceNumber int64 `json:"sequence_number,required"`
// Event type identifier, always "response.web_search_call.completed"
Type constant.ResponseWebSearchCallCompleted `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ItemID respjson.Field
OutputIndex respjson.Field
SequenceNumber respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Streaming event for completed web search calls.
func (ResponseObjectStreamResponseWebSearchCallCompleted) RawJSON ¶
func (r ResponseObjectStreamResponseWebSearchCallCompleted) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseWebSearchCallCompleted) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseWebSearchCallCompleted) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseWebSearchCallInProgress ¶
type ResponseObjectStreamResponseWebSearchCallInProgress struct {
// Unique identifier of the web search call
ItemID string `json:"item_id,required"`
// Index position of the item in the output list
OutputIndex int64 `json:"output_index,required"`
// Sequential number for ordering streaming events
SequenceNumber int64 `json:"sequence_number,required"`
// Event type identifier, always "response.web_search_call.in_progress"
Type constant.ResponseWebSearchCallInProgress `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ItemID respjson.Field
OutputIndex respjson.Field
SequenceNumber respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Streaming event for web search calls in progress.
func (ResponseObjectStreamResponseWebSearchCallInProgress) RawJSON ¶
func (r ResponseObjectStreamResponseWebSearchCallInProgress) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseWebSearchCallInProgress) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseWebSearchCallInProgress) UnmarshalJSON(data []byte) error
type ResponseObjectStreamResponseWebSearchCallSearching ¶
type ResponseObjectStreamResponseWebSearchCallSearching struct {
ItemID string `json:"item_id,required"`
OutputIndex int64 `json:"output_index,required"`
SequenceNumber int64 `json:"sequence_number,required"`
Type constant.ResponseWebSearchCallSearching `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ItemID respjson.Field
OutputIndex respjson.Field
SequenceNumber respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ResponseObjectStreamResponseWebSearchCallSearching) RawJSON ¶
func (r ResponseObjectStreamResponseWebSearchCallSearching) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamResponseWebSearchCallSearching) UnmarshalJSON ¶
func (r *ResponseObjectStreamResponseWebSearchCallSearching) UnmarshalJSON(data []byte) error
type ResponseObjectStreamUnion ¶
type ResponseObjectStreamUnion struct {
// This field is from variant [ResponseObjectStreamResponseCreated].
Response ResponseObject `json:"response"`
// Any of "response.created", "response.in_progress", "response.output_item.added",
// "response.output_item.done", "response.output_text.delta",
// "response.output_text.done", "response.function_call_arguments.delta",
// "response.function_call_arguments.done", "response.web_search_call.in_progress",
// "response.web_search_call.searching", "response.web_search_call.completed",
// "response.mcp_list_tools.in_progress", "response.mcp_list_tools.failed",
// "response.mcp_list_tools.completed", "response.mcp_call.arguments.delta",
// "response.mcp_call.arguments.done", "response.mcp_call.in_progress",
// "response.mcp_call.failed", "response.mcp_call.completed",
// "response.content_part.added", "response.content_part.done",
// "response.reasoning_text.delta", "response.reasoning_text.done",
// "response.reasoning_summary_part.added", "response.reasoning_summary_part.done",
// "response.reasoning_summary_text.delta", "response.reasoning_summary_text.done",
// "response.refusal.delta", "response.refusal.done",
// "response.output_text.annotation.added",
// "response.file_search_call.in_progress", "response.file_search_call.searching",
// "response.file_search_call.completed", "response.incomplete", "response.failed",
// "response.completed".
Type string `json:"type"`
SequenceNumber int64 `json:"sequence_number"`
// This field is a union of [ResponseObjectStreamResponseOutputItemAddedItemUnion],
// [ResponseObjectStreamResponseOutputItemDoneItemUnion]
Item ResponseObjectStreamUnionItem `json:"item"`
OutputIndex int64 `json:"output_index"`
ResponseID string `json:"response_id"`
ContentIndex int64 `json:"content_index"`
Delta string `json:"delta"`
ItemID string `json:"item_id"`
Text string `json:"text"`
Arguments string `json:"arguments"`
// This field is a union of
// [ResponseObjectStreamResponseContentPartAddedPartUnion],
// [ResponseObjectStreamResponseContentPartDonePartUnion],
// [ResponseObjectStreamResponseReasoningSummaryPartAddedPart],
// [ResponseObjectStreamResponseReasoningSummaryPartDonePart]
Part ResponseObjectStreamUnionPart `json:"part"`
SummaryIndex int64 `json:"summary_index"`
// This field is from variant [ResponseObjectStreamResponseRefusalDone].
Refusal string `json:"refusal"`
// This field is from variant
// [ResponseObjectStreamResponseOutputTextAnnotationAdded].
Annotation ResponseObjectStreamResponseOutputTextAnnotationAddedAnnotationUnion `json:"annotation"`
// This field is from variant
// [ResponseObjectStreamResponseOutputTextAnnotationAdded].
AnnotationIndex int64 `json:"annotation_index"`
JSON struct {
Response respjson.Field
Type respjson.Field
SequenceNumber respjson.Field
Item respjson.Field
OutputIndex respjson.Field
ResponseID respjson.Field
ContentIndex respjson.Field
Delta respjson.Field
ItemID respjson.Field
Text respjson.Field
Arguments respjson.Field
Part respjson.Field
SummaryIndex respjson.Field
Refusal respjson.Field
Annotation respjson.Field
AnnotationIndex respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ResponseObjectStreamUnion contains all possible properties and values from ResponseObjectStreamResponseCreated, ResponseObjectStreamResponseInProgress, ResponseObjectStreamResponseOutputItemAdded, ResponseObjectStreamResponseOutputItemDone, ResponseObjectStreamResponseOutputTextDelta, ResponseObjectStreamResponseOutputTextDone, ResponseObjectStreamResponseFunctionCallArgumentsDelta, ResponseObjectStreamResponseFunctionCallArgumentsDone, ResponseObjectStreamResponseWebSearchCallInProgress, ResponseObjectStreamResponseWebSearchCallSearching, ResponseObjectStreamResponseWebSearchCallCompleted, ResponseObjectStreamResponseMcpListToolsInProgress, ResponseObjectStreamResponseMcpListToolsFailed, ResponseObjectStreamResponseMcpListToolsCompleted, ResponseObjectStreamResponseMcpCallArgumentsDelta, ResponseObjectStreamResponseMcpCallArgumentsDone, ResponseObjectStreamResponseMcpCallInProgress, ResponseObjectStreamResponseMcpCallFailed, ResponseObjectStreamResponseMcpCallCompleted, ResponseObjectStreamResponseContentPartAdded, ResponseObjectStreamResponseContentPartDone, ResponseObjectStreamResponseReasoningTextDelta, ResponseObjectStreamResponseReasoningTextDone, ResponseObjectStreamResponseReasoningSummaryPartAdded, ResponseObjectStreamResponseReasoningSummaryPartDone, ResponseObjectStreamResponseReasoningSummaryTextDelta, ResponseObjectStreamResponseReasoningSummaryTextDone, ResponseObjectStreamResponseRefusalDelta, ResponseObjectStreamResponseRefusalDone, ResponseObjectStreamResponseOutputTextAnnotationAdded, ResponseObjectStreamResponseFileSearchCallInProgress, ResponseObjectStreamResponseFileSearchCallSearching, ResponseObjectStreamResponseFileSearchCallCompleted, ResponseObjectStreamResponseIncomplete, ResponseObjectStreamResponseFailed, ResponseObjectStreamResponseCompleted.
Use the ResponseObjectStreamUnion.AsAny method to switch on the variant.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (ResponseObjectStreamUnion) AsAny ¶
func (u ResponseObjectStreamUnion) AsAny() anyResponseObjectStream
Use the following switch statement to find the correct variant
switch variant := ResponseObjectStreamUnion.AsAny().(type) {
case llamastackclient.ResponseObjectStreamResponseCreated:
case llamastackclient.ResponseObjectStreamResponseInProgress:
case llamastackclient.ResponseObjectStreamResponseOutputItemAdded:
case llamastackclient.ResponseObjectStreamResponseOutputItemDone:
case llamastackclient.ResponseObjectStreamResponseOutputTextDelta:
case llamastackclient.ResponseObjectStreamResponseOutputTextDone:
case llamastackclient.ResponseObjectStreamResponseFunctionCallArgumentsDelta:
case llamastackclient.ResponseObjectStreamResponseFunctionCallArgumentsDone:
case llamastackclient.ResponseObjectStreamResponseWebSearchCallInProgress:
case llamastackclient.ResponseObjectStreamResponseWebSearchCallSearching:
case llamastackclient.ResponseObjectStreamResponseWebSearchCallCompleted:
case llamastackclient.ResponseObjectStreamResponseMcpListToolsInProgress:
case llamastackclient.ResponseObjectStreamResponseMcpListToolsFailed:
case llamastackclient.ResponseObjectStreamResponseMcpListToolsCompleted:
case llamastackclient.ResponseObjectStreamResponseMcpCallArgumentsDelta:
case llamastackclient.ResponseObjectStreamResponseMcpCallArgumentsDone:
case llamastackclient.ResponseObjectStreamResponseMcpCallInProgress:
case llamastackclient.ResponseObjectStreamResponseMcpCallFailed:
case llamastackclient.ResponseObjectStreamResponseMcpCallCompleted:
case llamastackclient.ResponseObjectStreamResponseContentPartAdded:
case llamastackclient.ResponseObjectStreamResponseContentPartDone:
case llamastackclient.ResponseObjectStreamResponseReasoningTextDelta:
case llamastackclient.ResponseObjectStreamResponseReasoningTextDone:
case llamastackclient.ResponseObjectStreamResponseReasoningSummaryPartAdded:
case llamastackclient.ResponseObjectStreamResponseReasoningSummaryPartDone:
case llamastackclient.ResponseObjectStreamResponseReasoningSummaryTextDelta:
case llamastackclient.ResponseObjectStreamResponseReasoningSummaryTextDone:
case llamastackclient.ResponseObjectStreamResponseRefusalDelta:
case llamastackclient.ResponseObjectStreamResponseRefusalDone:
case llamastackclient.ResponseObjectStreamResponseOutputTextAnnotationAdded:
case llamastackclient.ResponseObjectStreamResponseFileSearchCallInProgress:
case llamastackclient.ResponseObjectStreamResponseFileSearchCallSearching:
case llamastackclient.ResponseObjectStreamResponseFileSearchCallCompleted:
case llamastackclient.ResponseObjectStreamResponseIncomplete:
case llamastackclient.ResponseObjectStreamResponseFailed:
case llamastackclient.ResponseObjectStreamResponseCompleted:
default:
fmt.Errorf("no variant present")
}
func (ResponseObjectStreamUnion) AsResponseCompleted ¶
func (u ResponseObjectStreamUnion) AsResponseCompleted() (v ResponseObjectStreamResponseCompleted)
func (ResponseObjectStreamUnion) AsResponseContentPartAdded ¶
func (u ResponseObjectStreamUnion) AsResponseContentPartAdded() (v ResponseObjectStreamResponseContentPartAdded)
func (ResponseObjectStreamUnion) AsResponseContentPartDone ¶
func (u ResponseObjectStreamUnion) AsResponseContentPartDone() (v ResponseObjectStreamResponseContentPartDone)
func (ResponseObjectStreamUnion) AsResponseCreated ¶
func (u ResponseObjectStreamUnion) AsResponseCreated() (v ResponseObjectStreamResponseCreated)
func (ResponseObjectStreamUnion) AsResponseFailed ¶
func (u ResponseObjectStreamUnion) AsResponseFailed() (v ResponseObjectStreamResponseFailed)
func (ResponseObjectStreamUnion) AsResponseFileSearchCallCompleted ¶
func (u ResponseObjectStreamUnion) AsResponseFileSearchCallCompleted() (v ResponseObjectStreamResponseFileSearchCallCompleted)
func (ResponseObjectStreamUnion) AsResponseFileSearchCallInProgress ¶
func (u ResponseObjectStreamUnion) AsResponseFileSearchCallInProgress() (v ResponseObjectStreamResponseFileSearchCallInProgress)
func (ResponseObjectStreamUnion) AsResponseFileSearchCallSearching ¶
func (u ResponseObjectStreamUnion) AsResponseFileSearchCallSearching() (v ResponseObjectStreamResponseFileSearchCallSearching)
func (ResponseObjectStreamUnion) AsResponseFunctionCallArgumentsDelta ¶
func (u ResponseObjectStreamUnion) AsResponseFunctionCallArgumentsDelta() (v ResponseObjectStreamResponseFunctionCallArgumentsDelta)
func (ResponseObjectStreamUnion) AsResponseFunctionCallArgumentsDone ¶
func (u ResponseObjectStreamUnion) AsResponseFunctionCallArgumentsDone() (v ResponseObjectStreamResponseFunctionCallArgumentsDone)
func (ResponseObjectStreamUnion) AsResponseInProgress ¶
func (u ResponseObjectStreamUnion) AsResponseInProgress() (v ResponseObjectStreamResponseInProgress)
func (ResponseObjectStreamUnion) AsResponseIncomplete ¶
func (u ResponseObjectStreamUnion) AsResponseIncomplete() (v ResponseObjectStreamResponseIncomplete)
func (ResponseObjectStreamUnion) AsResponseMcpCallArgumentsDelta ¶
func (u ResponseObjectStreamUnion) AsResponseMcpCallArgumentsDelta() (v ResponseObjectStreamResponseMcpCallArgumentsDelta)
func (ResponseObjectStreamUnion) AsResponseMcpCallArgumentsDone ¶
func (u ResponseObjectStreamUnion) AsResponseMcpCallArgumentsDone() (v ResponseObjectStreamResponseMcpCallArgumentsDone)
func (ResponseObjectStreamUnion) AsResponseMcpCallCompleted ¶
func (u ResponseObjectStreamUnion) AsResponseMcpCallCompleted() (v ResponseObjectStreamResponseMcpCallCompleted)
func (ResponseObjectStreamUnion) AsResponseMcpCallFailed ¶
func (u ResponseObjectStreamUnion) AsResponseMcpCallFailed() (v ResponseObjectStreamResponseMcpCallFailed)
func (ResponseObjectStreamUnion) AsResponseMcpCallInProgress ¶
func (u ResponseObjectStreamUnion) AsResponseMcpCallInProgress() (v ResponseObjectStreamResponseMcpCallInProgress)
func (ResponseObjectStreamUnion) AsResponseMcpListToolsCompleted ¶
func (u ResponseObjectStreamUnion) AsResponseMcpListToolsCompleted() (v ResponseObjectStreamResponseMcpListToolsCompleted)
func (ResponseObjectStreamUnion) AsResponseMcpListToolsFailed ¶
func (u ResponseObjectStreamUnion) AsResponseMcpListToolsFailed() (v ResponseObjectStreamResponseMcpListToolsFailed)
func (ResponseObjectStreamUnion) AsResponseMcpListToolsInProgress ¶
func (u ResponseObjectStreamUnion) AsResponseMcpListToolsInProgress() (v ResponseObjectStreamResponseMcpListToolsInProgress)
func (ResponseObjectStreamUnion) AsResponseOutputItemAdded ¶
func (u ResponseObjectStreamUnion) AsResponseOutputItemAdded() (v ResponseObjectStreamResponseOutputItemAdded)
func (ResponseObjectStreamUnion) AsResponseOutputItemDone ¶
func (u ResponseObjectStreamUnion) AsResponseOutputItemDone() (v ResponseObjectStreamResponseOutputItemDone)
func (ResponseObjectStreamUnion) AsResponseOutputTextAnnotationAdded ¶
func (u ResponseObjectStreamUnion) AsResponseOutputTextAnnotationAdded() (v ResponseObjectStreamResponseOutputTextAnnotationAdded)
func (ResponseObjectStreamUnion) AsResponseOutputTextDelta ¶
func (u ResponseObjectStreamUnion) AsResponseOutputTextDelta() (v ResponseObjectStreamResponseOutputTextDelta)
func (ResponseObjectStreamUnion) AsResponseOutputTextDone ¶
func (u ResponseObjectStreamUnion) AsResponseOutputTextDone() (v ResponseObjectStreamResponseOutputTextDone)
func (ResponseObjectStreamUnion) AsResponseReasoningSummaryPartAdded ¶
func (u ResponseObjectStreamUnion) AsResponseReasoningSummaryPartAdded() (v ResponseObjectStreamResponseReasoningSummaryPartAdded)
func (ResponseObjectStreamUnion) AsResponseReasoningSummaryPartDone ¶
func (u ResponseObjectStreamUnion) AsResponseReasoningSummaryPartDone() (v ResponseObjectStreamResponseReasoningSummaryPartDone)
func (ResponseObjectStreamUnion) AsResponseReasoningSummaryTextDelta ¶
func (u ResponseObjectStreamUnion) AsResponseReasoningSummaryTextDelta() (v ResponseObjectStreamResponseReasoningSummaryTextDelta)
func (ResponseObjectStreamUnion) AsResponseReasoningSummaryTextDone ¶
func (u ResponseObjectStreamUnion) AsResponseReasoningSummaryTextDone() (v ResponseObjectStreamResponseReasoningSummaryTextDone)
func (ResponseObjectStreamUnion) AsResponseReasoningTextDelta ¶
func (u ResponseObjectStreamUnion) AsResponseReasoningTextDelta() (v ResponseObjectStreamResponseReasoningTextDelta)
func (ResponseObjectStreamUnion) AsResponseReasoningTextDone ¶
func (u ResponseObjectStreamUnion) AsResponseReasoningTextDone() (v ResponseObjectStreamResponseReasoningTextDone)
func (ResponseObjectStreamUnion) AsResponseRefusalDelta ¶
func (u ResponseObjectStreamUnion) AsResponseRefusalDelta() (v ResponseObjectStreamResponseRefusalDelta)
func (ResponseObjectStreamUnion) AsResponseRefusalDone ¶
func (u ResponseObjectStreamUnion) AsResponseRefusalDone() (v ResponseObjectStreamResponseRefusalDone)
func (ResponseObjectStreamUnion) AsResponseWebSearchCallCompleted ¶
func (u ResponseObjectStreamUnion) AsResponseWebSearchCallCompleted() (v ResponseObjectStreamResponseWebSearchCallCompleted)
func (ResponseObjectStreamUnion) AsResponseWebSearchCallInProgress ¶
func (u ResponseObjectStreamUnion) AsResponseWebSearchCallInProgress() (v ResponseObjectStreamResponseWebSearchCallInProgress)
func (ResponseObjectStreamUnion) AsResponseWebSearchCallSearching ¶
func (u ResponseObjectStreamUnion) AsResponseWebSearchCallSearching() (v ResponseObjectStreamResponseWebSearchCallSearching)
func (ResponseObjectStreamUnion) RawJSON ¶
func (u ResponseObjectStreamUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectStreamUnion) UnmarshalJSON ¶
func (r *ResponseObjectStreamUnion) UnmarshalJSON(data []byte) error
type ResponseObjectStreamUnionItem ¶
type ResponseObjectStreamUnionItem struct {
// This field is a union of
// [ResponseObjectStreamResponseOutputItemAddedItemMessageContentUnion],
// [ResponseObjectStreamResponseOutputItemDoneItemMessageContentUnion]
Content ResponseObjectStreamUnionItemContent `json:"content"`
Role string `json:"role"`
Type string `json:"type"`
ID string `json:"id"`
Status string `json:"status"`
Queries []string `json:"queries"`
// This field is a union of
// [[]ResponseObjectStreamResponseOutputItemAddedItemFileSearchCallResult],
// [[]ResponseObjectStreamResponseOutputItemDoneItemFileSearchCallResult]
Results ResponseObjectStreamUnionItemResults `json:"results"`
Arguments string `json:"arguments"`
CallID string `json:"call_id"`
Name string `json:"name"`
ServerLabel string `json:"server_label"`
Error string `json:"error"`
Output string `json:"output"`
// This field is a union of
// [[]ResponseObjectStreamResponseOutputItemAddedItemMcpListToolsTool],
// [[]ResponseObjectStreamResponseOutputItemDoneItemMcpListToolsTool]
Tools ResponseObjectStreamUnionItemTools `json:"tools"`
JSON struct {
Content respjson.Field
Role respjson.Field
Type respjson.Field
ID respjson.Field
Status respjson.Field
Queries respjson.Field
Results respjson.Field
Arguments respjson.Field
CallID respjson.Field
Name respjson.Field
ServerLabel respjson.Field
Error respjson.Field
Output respjson.Field
Tools respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ResponseObjectStreamUnionItem is an implicit subunion of ResponseObjectStreamUnion. ResponseObjectStreamUnionItem provides convenient access to the sub-properties of the union.
For type safety it is recommended to directly use a variant of the ResponseObjectStreamUnion.
func (*ResponseObjectStreamUnionItem) UnmarshalJSON ¶
func (r *ResponseObjectStreamUnionItem) UnmarshalJSON(data []byte) error
type ResponseObjectStreamUnionItemContent ¶
type ResponseObjectStreamUnionItemContent 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
// [[]ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemUnion]
// instead of an object.
OfVariant2 []ResponseObjectStreamResponseOutputItemAddedItemMessageContentArrayItemUnion `json:",inline"`
JSON struct {
OfString respjson.Field
OfVariant2 respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ResponseObjectStreamUnionItemContent is an implicit subunion of ResponseObjectStreamUnion. ResponseObjectStreamUnionItemContent provides convenient access to the sub-properties of the union.
For type safety it is recommended to directly use a variant of the ResponseObjectStreamUnion.
If the underlying value is not a json object, one of the following properties will be valid: OfString OfVariant2]
func (*ResponseObjectStreamUnionItemContent) UnmarshalJSON ¶
func (r *ResponseObjectStreamUnionItemContent) UnmarshalJSON(data []byte) error
type ResponseObjectStreamUnionItemResults ¶
type ResponseObjectStreamUnionItemResults struct {
// This field will be present if the value is a
// [[]ResponseObjectStreamResponseOutputItemAddedItemFileSearchCallResult] instead
// of an object.
OfResponseObjectStreamResponseOutputItemAddedItemFileSearchCallResults []ResponseObjectStreamResponseOutputItemAddedItemFileSearchCallResult `json:",inline"`
// This field will be present if the value is a
// [[]ResponseObjectStreamResponseOutputItemDoneItemFileSearchCallResult] instead
// of an object.
OfResponseObjectStreamResponseOutputItemDoneItemFileSearchCallResults []ResponseObjectStreamResponseOutputItemDoneItemFileSearchCallResult `json:",inline"`
JSON struct {
OfResponseObjectStreamResponseOutputItemAddedItemFileSearchCallResults respjson.Field
OfResponseObjectStreamResponseOutputItemDoneItemFileSearchCallResults respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ResponseObjectStreamUnionItemResults is an implicit subunion of ResponseObjectStreamUnion. ResponseObjectStreamUnionItemResults provides convenient access to the sub-properties of the union.
For type safety it is recommended to directly use a variant of the ResponseObjectStreamUnion.
If the underlying value is not a json object, one of the following properties will be valid: OfResponseObjectStreamResponseOutputItemAddedItemFileSearchCallResults OfResponseObjectStreamResponseOutputItemDoneItemFileSearchCallResults]
func (*ResponseObjectStreamUnionItemResults) UnmarshalJSON ¶
func (r *ResponseObjectStreamUnionItemResults) UnmarshalJSON(data []byte) error
type ResponseObjectStreamUnionItemTools ¶
type ResponseObjectStreamUnionItemTools struct {
// This field will be present if the value is a
// [[]ResponseObjectStreamResponseOutputItemAddedItemMcpListToolsTool] instead of
// an object.
OfResponseObjectStreamResponseOutputItemAddedItemMcpListToolsTools []ResponseObjectStreamResponseOutputItemAddedItemMcpListToolsTool `json:",inline"`
// This field will be present if the value is a
// [[]ResponseObjectStreamResponseOutputItemDoneItemMcpListToolsTool] instead of an
// object.
OfResponseObjectStreamResponseOutputItemDoneItemMcpListToolsTools []ResponseObjectStreamResponseOutputItemDoneItemMcpListToolsTool `json:",inline"`
JSON struct {
OfResponseObjectStreamResponseOutputItemAddedItemMcpListToolsTools respjson.Field
OfResponseObjectStreamResponseOutputItemDoneItemMcpListToolsTools respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ResponseObjectStreamUnionItemTools is an implicit subunion of ResponseObjectStreamUnion. ResponseObjectStreamUnionItemTools provides convenient access to the sub-properties of the union.
For type safety it is recommended to directly use a variant of the ResponseObjectStreamUnion.
If the underlying value is not a json object, one of the following properties will be valid: OfResponseObjectStreamResponseOutputItemAddedItemMcpListToolsTools OfResponseObjectStreamResponseOutputItemDoneItemMcpListToolsTools]
func (*ResponseObjectStreamUnionItemTools) UnmarshalJSON ¶
func (r *ResponseObjectStreamUnionItemTools) UnmarshalJSON(data []byte) error
type ResponseObjectStreamUnionPart ¶
type ResponseObjectStreamUnionPart struct {
// This field is a union of
// [[]ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationUnion],
// [[]ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationUnion]
Annotations ResponseObjectStreamUnionPartAnnotations `json:"annotations"`
Text string `json:"text"`
Type string `json:"type"`
// This field is a union of
// [[]map[string]ResponseObjectStreamResponseContentPartAddedPartOutputTextLogprobUnion],
// [[]map[string]ResponseObjectStreamResponseContentPartDonePartOutputTextLogprobUnion]
Logprobs ResponseObjectStreamUnionPartLogprobs `json:"logprobs"`
Refusal string `json:"refusal"`
JSON struct {
Annotations respjson.Field
Text respjson.Field
Type respjson.Field
Logprobs respjson.Field
Refusal respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ResponseObjectStreamUnionPart is an implicit subunion of ResponseObjectStreamUnion. ResponseObjectStreamUnionPart provides convenient access to the sub-properties of the union.
For type safety it is recommended to directly use a variant of the ResponseObjectStreamUnion.
func (*ResponseObjectStreamUnionPart) UnmarshalJSON ¶
func (r *ResponseObjectStreamUnionPart) UnmarshalJSON(data []byte) error
type ResponseObjectStreamUnionPartAnnotations ¶
type ResponseObjectStreamUnionPartAnnotations struct {
// This field will be present if the value is a
// [[]ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationUnion]
// instead of an object.
OfResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotations []ResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotationUnion `json:",inline"`
// This field will be present if the value is a
// [[]ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationUnion]
// instead of an object.
OfResponseObjectStreamResponseContentPartDonePartOutputTextAnnotations []ResponseObjectStreamResponseContentPartDonePartOutputTextAnnotationUnion `json:",inline"`
JSON struct {
OfResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotations respjson.Field
OfResponseObjectStreamResponseContentPartDonePartOutputTextAnnotations respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ResponseObjectStreamUnionPartAnnotations is an implicit subunion of ResponseObjectStreamUnion. ResponseObjectStreamUnionPartAnnotations provides convenient access to the sub-properties of the union.
For type safety it is recommended to directly use a variant of the ResponseObjectStreamUnion.
If the underlying value is not a json object, one of the following properties will be valid: OfResponseObjectStreamResponseContentPartAddedPartOutputTextAnnotations OfResponseObjectStreamResponseContentPartDonePartOutputTextAnnotations]
func (*ResponseObjectStreamUnionPartAnnotations) UnmarshalJSON ¶
func (r *ResponseObjectStreamUnionPartAnnotations) UnmarshalJSON(data []byte) error
type ResponseObjectStreamUnionPartLogprobs ¶
type ResponseObjectStreamUnionPartLogprobs struct {
// This field will be present if the value is a
// [[]map[string]ResponseObjectStreamResponseContentPartAddedPartOutputTextLogprobUnion]
// instead of an object.
OfMapOfResponseObjectStreamResponseContentPartAddedPartOutputTextLogprobMap []map[string]ResponseObjectStreamResponseContentPartAddedPartOutputTextLogprobUnion `json:",inline"`
// This field will be present if the value is a
// [[]map[string]ResponseObjectStreamResponseContentPartDonePartOutputTextLogprobUnion]
// instead of an object.
OfMapOfResponseObjectStreamResponseContentPartDonePartOutputTextLogprobMap []map[string]ResponseObjectStreamResponseContentPartDonePartOutputTextLogprobUnion `json:",inline"`
JSON struct {
OfMapOfResponseObjectStreamResponseContentPartAddedPartOutputTextLogprobMap respjson.Field
OfMapOfResponseObjectStreamResponseContentPartDonePartOutputTextLogprobMap respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ResponseObjectStreamUnionPartLogprobs is an implicit subunion of ResponseObjectStreamUnion. ResponseObjectStreamUnionPartLogprobs provides convenient access to the sub-properties of the union.
For type safety it is recommended to directly use a variant of the ResponseObjectStreamUnion.
If the underlying value is not a json object, one of the following properties will be valid: OfMapOfResponseObjectStreamResponseContentPartAddedPartOutputTextLogprobMap OfMapOfResponseObjectStreamResponseContentPartDonePartOutputTextLogprobMap]
func (*ResponseObjectStreamUnionPartLogprobs) UnmarshalJSON ¶
func (r *ResponseObjectStreamUnionPartLogprobs) UnmarshalJSON(data []byte) error
type ResponseObjectText ¶
type ResponseObjectText struct {
// (Optional) Text format configuration specifying output format requirements
Format ResponseObjectTextFormat `json:"format"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Format respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Text formatting configuration for the response
func (ResponseObjectText) RawJSON ¶
func (r ResponseObjectText) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectText) UnmarshalJSON ¶
func (r *ResponseObjectText) UnmarshalJSON(data []byte) error
type ResponseObjectTextFormat ¶
type ResponseObjectTextFormat struct {
// Must be "text", "json_schema", or "json_object" to identify the format type
//
// Any of "text", "json_schema", "json_object".
Type ResponseObjectTextFormatType `json:"type,required"`
// (Optional) A description of the response format. Only used for json_schema.
Description string `json:"description"`
// The name of the response format. Only used for json_schema.
Name string `json:"name"`
// The JSON schema the response should conform to. In a Python SDK, this is often a
// `pydantic` model. Only used for json_schema.
Schema map[string]ResponseObjectTextFormatSchemaUnion `json:"schema"`
// (Optional) Whether to strictly enforce the JSON schema. If true, the response
// must match the schema exactly. Only used for json_schema.
Strict bool `json:"strict"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Type respjson.Field
Description respjson.Field
Name respjson.Field
Schema respjson.Field
Strict respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
(Optional) Text format configuration specifying output format requirements
func (ResponseObjectTextFormat) RawJSON ¶
func (r ResponseObjectTextFormat) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectTextFormat) UnmarshalJSON ¶
func (r *ResponseObjectTextFormat) UnmarshalJSON(data []byte) error
type ResponseObjectTextFormatSchemaUnion ¶
type ResponseObjectTextFormatSchemaUnion 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:"-"`
}
ResponseObjectTextFormatSchemaUnion 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 (ResponseObjectTextFormatSchemaUnion) AsAnyArray ¶
func (u ResponseObjectTextFormatSchemaUnion) AsAnyArray() (v []any)
func (ResponseObjectTextFormatSchemaUnion) AsBool ¶
func (u ResponseObjectTextFormatSchemaUnion) AsBool() (v bool)
func (ResponseObjectTextFormatSchemaUnion) AsFloat ¶
func (u ResponseObjectTextFormatSchemaUnion) AsFloat() (v float64)
func (ResponseObjectTextFormatSchemaUnion) AsString ¶
func (u ResponseObjectTextFormatSchemaUnion) AsString() (v string)
func (ResponseObjectTextFormatSchemaUnion) RawJSON ¶
func (u ResponseObjectTextFormatSchemaUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectTextFormatSchemaUnion) UnmarshalJSON ¶
func (r *ResponseObjectTextFormatSchemaUnion) UnmarshalJSON(data []byte) error
type ResponseObjectTextFormatType ¶
type ResponseObjectTextFormatType string
Must be "text", "json_schema", or "json_object" to identify the format type
const ( ResponseObjectTextFormatTypeText ResponseObjectTextFormatType = "text" ResponseObjectTextFormatTypeJsonSchema ResponseObjectTextFormatType = "json_schema" ResponseObjectTextFormatTypeJsonObject ResponseObjectTextFormatType = "json_object" )
type ResponseObjectToolFileSearch ¶
type ResponseObjectToolFileSearch struct {
// Tool type identifier, always "file_search"
Type constant.FileSearch `json:"type,required"`
// List of vector store identifiers to search within
VectorStoreIDs []string `json:"vector_store_ids,required"`
// (Optional) Additional filters to apply to the search
Filters map[string]ResponseObjectToolFileSearchFilterUnion `json:"filters"`
// (Optional) Maximum number of search results to return (1-50)
MaxNumResults int64 `json:"max_num_results"`
// (Optional) Options for ranking and scoring search results
RankingOptions ResponseObjectToolFileSearchRankingOptions `json:"ranking_options"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Type respjson.Field
VectorStoreIDs respjson.Field
Filters respjson.Field
MaxNumResults respjson.Field
RankingOptions respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
File search tool configuration for OpenAI response inputs.
func (ResponseObjectToolFileSearch) RawJSON ¶
func (r ResponseObjectToolFileSearch) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectToolFileSearch) UnmarshalJSON ¶
func (r *ResponseObjectToolFileSearch) UnmarshalJSON(data []byte) error
type ResponseObjectToolFileSearchFilterUnion ¶
type ResponseObjectToolFileSearchFilterUnion 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:"-"`
}
ResponseObjectToolFileSearchFilterUnion 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 (ResponseObjectToolFileSearchFilterUnion) AsAnyArray ¶
func (u ResponseObjectToolFileSearchFilterUnion) AsAnyArray() (v []any)
func (ResponseObjectToolFileSearchFilterUnion) AsBool ¶
func (u ResponseObjectToolFileSearchFilterUnion) AsBool() (v bool)
func (ResponseObjectToolFileSearchFilterUnion) AsFloat ¶
func (u ResponseObjectToolFileSearchFilterUnion) AsFloat() (v float64)
func (ResponseObjectToolFileSearchFilterUnion) AsString ¶
func (u ResponseObjectToolFileSearchFilterUnion) AsString() (v string)
func (ResponseObjectToolFileSearchFilterUnion) RawJSON ¶
func (u ResponseObjectToolFileSearchFilterUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectToolFileSearchFilterUnion) UnmarshalJSON ¶
func (r *ResponseObjectToolFileSearchFilterUnion) UnmarshalJSON(data []byte) error
type ResponseObjectToolFileSearchRankingOptions ¶
type ResponseObjectToolFileSearchRankingOptions struct {
// (Optional) Name of the ranking algorithm to use
Ranker string `json:"ranker"`
// (Optional) Minimum relevance score threshold for results
ScoreThreshold float64 `json:"score_threshold"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Ranker respjson.Field
ScoreThreshold respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
(Optional) Options for ranking and scoring search results
func (ResponseObjectToolFileSearchRankingOptions) RawJSON ¶
func (r ResponseObjectToolFileSearchRankingOptions) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectToolFileSearchRankingOptions) UnmarshalJSON ¶
func (r *ResponseObjectToolFileSearchRankingOptions) UnmarshalJSON(data []byte) error
type ResponseObjectToolFunction ¶
type ResponseObjectToolFunction struct {
// Name of the function that can be called
Name string `json:"name,required"`
// Tool type identifier, always "function"
Type constant.Function `json:"type,required"`
// (Optional) Description of what the function does
Description string `json:"description"`
// (Optional) JSON schema defining the function's parameters
Parameters map[string]ResponseObjectToolFunctionParameterUnion `json:"parameters"`
// (Optional) Whether to enforce strict parameter validation
Strict bool `json:"strict"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Name respjson.Field
Type respjson.Field
Description respjson.Field
Parameters respjson.Field
Strict respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Function tool configuration for OpenAI response inputs.
func (ResponseObjectToolFunction) RawJSON ¶
func (r ResponseObjectToolFunction) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectToolFunction) UnmarshalJSON ¶
func (r *ResponseObjectToolFunction) UnmarshalJSON(data []byte) error
type ResponseObjectToolFunctionParameterUnion ¶
type ResponseObjectToolFunctionParameterUnion 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:"-"`
}
ResponseObjectToolFunctionParameterUnion 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 (ResponseObjectToolFunctionParameterUnion) AsAnyArray ¶
func (u ResponseObjectToolFunctionParameterUnion) AsAnyArray() (v []any)
func (ResponseObjectToolFunctionParameterUnion) AsBool ¶
func (u ResponseObjectToolFunctionParameterUnion) AsBool() (v bool)
func (ResponseObjectToolFunctionParameterUnion) AsFloat ¶
func (u ResponseObjectToolFunctionParameterUnion) AsFloat() (v float64)
func (ResponseObjectToolFunctionParameterUnion) AsString ¶
func (u ResponseObjectToolFunctionParameterUnion) AsString() (v string)
func (ResponseObjectToolFunctionParameterUnion) RawJSON ¶
func (u ResponseObjectToolFunctionParameterUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectToolFunctionParameterUnion) UnmarshalJSON ¶
func (r *ResponseObjectToolFunctionParameterUnion) UnmarshalJSON(data []byte) error
type ResponseObjectToolMcp ¶
type ResponseObjectToolMcp struct {
// Label to identify this MCP server
ServerLabel string `json:"server_label,required"`
// Tool type identifier, always "mcp"
Type constant.Mcp `json:"type,required"`
// (Optional) Restriction on which tools can be used from this server
AllowedTools ResponseObjectToolMcpAllowedToolsUnion `json:"allowed_tools"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ServerLabel respjson.Field
Type respjson.Field
AllowedTools respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Model Context Protocol (MCP) tool configuration for OpenAI response object.
func (ResponseObjectToolMcp) RawJSON ¶
func (r ResponseObjectToolMcp) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectToolMcp) UnmarshalJSON ¶
func (r *ResponseObjectToolMcp) UnmarshalJSON(data []byte) error
type ResponseObjectToolMcpAllowedToolsAllowedToolsFilter ¶
type ResponseObjectToolMcpAllowedToolsAllowedToolsFilter struct {
// (Optional) List of specific tool names that are allowed
ToolNames []string `json:"tool_names"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ToolNames respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Filter configuration for restricting which MCP tools can be used.
func (ResponseObjectToolMcpAllowedToolsAllowedToolsFilter) RawJSON ¶
func (r ResponseObjectToolMcpAllowedToolsAllowedToolsFilter) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectToolMcpAllowedToolsAllowedToolsFilter) UnmarshalJSON ¶
func (r *ResponseObjectToolMcpAllowedToolsAllowedToolsFilter) UnmarshalJSON(data []byte) error
type ResponseObjectToolMcpAllowedToolsUnion ¶
type ResponseObjectToolMcpAllowedToolsUnion struct {
// This field will be present if the value is a [[]string] instead of an object.
OfStringArray []string `json:",inline"`
// This field is from variant
// [ResponseObjectToolMcpAllowedToolsAllowedToolsFilter].
ToolNames []string `json:"tool_names"`
JSON struct {
OfStringArray respjson.Field
ToolNames respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ResponseObjectToolMcpAllowedToolsUnion contains all possible properties and values from [[]string], ResponseObjectToolMcpAllowedToolsAllowedToolsFilter.
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: OfStringArray]
func (ResponseObjectToolMcpAllowedToolsUnion) AsAllowedToolsFilter ¶
func (u ResponseObjectToolMcpAllowedToolsUnion) AsAllowedToolsFilter() (v ResponseObjectToolMcpAllowedToolsAllowedToolsFilter)
func (ResponseObjectToolMcpAllowedToolsUnion) AsStringArray ¶
func (u ResponseObjectToolMcpAllowedToolsUnion) AsStringArray() (v []string)
func (ResponseObjectToolMcpAllowedToolsUnion) RawJSON ¶
func (u ResponseObjectToolMcpAllowedToolsUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectToolMcpAllowedToolsUnion) UnmarshalJSON ¶
func (r *ResponseObjectToolMcpAllowedToolsUnion) UnmarshalJSON(data []byte) error
type ResponseObjectToolOpenAIResponseInputToolWebSearch ¶
type ResponseObjectToolOpenAIResponseInputToolWebSearch struct {
// Web search tool type variant to use
//
// Any of "web_search", "web_search_preview", "web_search_preview_2025_03_11",
// "web_search_2025_08_26".
Type ResponseObjectToolOpenAIResponseInputToolWebSearchType `json:"type,required"`
// (Optional) Size of search context, must be "low", "medium", or "high"
SearchContextSize string `json:"search_context_size"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Type respjson.Field
SearchContextSize respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Web search tool configuration for OpenAI response inputs.
func (ResponseObjectToolOpenAIResponseInputToolWebSearch) RawJSON ¶
func (r ResponseObjectToolOpenAIResponseInputToolWebSearch) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectToolOpenAIResponseInputToolWebSearch) UnmarshalJSON ¶
func (r *ResponseObjectToolOpenAIResponseInputToolWebSearch) UnmarshalJSON(data []byte) error
type ResponseObjectToolOpenAIResponseInputToolWebSearchType ¶
type ResponseObjectToolOpenAIResponseInputToolWebSearchType string
Web search tool type variant to use
const ( ResponseObjectToolOpenAIResponseInputToolWebSearchTypeWebSearch ResponseObjectToolOpenAIResponseInputToolWebSearchType = "web_search" ResponseObjectToolOpenAIResponseInputToolWebSearchTypeWebSearchPreview ResponseObjectToolOpenAIResponseInputToolWebSearchType = "web_search_preview" ResponseObjectToolOpenAIResponseInputToolWebSearchTypeWebSearchPreview2025_03_11 ResponseObjectToolOpenAIResponseInputToolWebSearchType = "web_search_preview_2025_03_11" ResponseObjectToolOpenAIResponseInputToolWebSearchTypeWebSearch2025_08_26 ResponseObjectToolOpenAIResponseInputToolWebSearchType = "web_search_2025_08_26" )
type ResponseObjectToolType ¶
type ResponseObjectToolType string
Web search tool type variant to use
const ( ResponseObjectToolTypeWebSearch ResponseObjectToolType = "web_search" ResponseObjectToolTypeWebSearchPreview ResponseObjectToolType = "web_search_preview" ResponseObjectToolTypeWebSearchPreview2025_03_11 ResponseObjectToolType = "web_search_preview_2025_03_11" ResponseObjectToolTypeWebSearch2025_08_26 ResponseObjectToolType = "web_search_2025_08_26" ResponseObjectToolTypeFileSearch ResponseObjectToolType = "file_search" ResponseObjectToolTypeFunction ResponseObjectToolType = "function" ResponseObjectToolTypeMcp ResponseObjectToolType = "mcp" )
type ResponseObjectToolUnion ¶
type ResponseObjectToolUnion struct {
// Any of nil, "file_search", "function", "mcp".
Type string `json:"type"`
// This field is from variant [ResponseObjectToolOpenAIResponseInputToolWebSearch].
SearchContextSize string `json:"search_context_size"`
// This field is from variant [ResponseObjectToolFileSearch].
VectorStoreIDs []string `json:"vector_store_ids"`
// This field is from variant [ResponseObjectToolFileSearch].
Filters map[string]ResponseObjectToolFileSearchFilterUnion `json:"filters"`
// This field is from variant [ResponseObjectToolFileSearch].
MaxNumResults int64 `json:"max_num_results"`
// This field is from variant [ResponseObjectToolFileSearch].
RankingOptions ResponseObjectToolFileSearchRankingOptions `json:"ranking_options"`
// This field is from variant [ResponseObjectToolFunction].
Name string `json:"name"`
// This field is from variant [ResponseObjectToolFunction].
Description string `json:"description"`
// This field is from variant [ResponseObjectToolFunction].
Parameters map[string]ResponseObjectToolFunctionParameterUnion `json:"parameters"`
// This field is from variant [ResponseObjectToolFunction].
Strict bool `json:"strict"`
// This field is from variant [ResponseObjectToolMcp].
ServerLabel string `json:"server_label"`
// This field is from variant [ResponseObjectToolMcp].
AllowedTools ResponseObjectToolMcpAllowedToolsUnion `json:"allowed_tools"`
JSON struct {
Type respjson.Field
SearchContextSize respjson.Field
VectorStoreIDs respjson.Field
Filters respjson.Field
MaxNumResults respjson.Field
RankingOptions respjson.Field
Name respjson.Field
Description respjson.Field
Parameters respjson.Field
Strict respjson.Field
ServerLabel respjson.Field
AllowedTools respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ResponseObjectToolUnion contains all possible properties and values from ResponseObjectToolOpenAIResponseInputToolWebSearch, ResponseObjectToolFileSearch, ResponseObjectToolFunction, ResponseObjectToolMcp.
Use the [ResponseObjectToolUnion.AsAny] method to switch on the variant.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (ResponseObjectToolUnion) AsFileSearch ¶
func (u ResponseObjectToolUnion) AsFileSearch() (v ResponseObjectToolFileSearch)
func (ResponseObjectToolUnion) AsFunction ¶
func (u ResponseObjectToolUnion) AsFunction() (v ResponseObjectToolFunction)
func (ResponseObjectToolUnion) AsMcp ¶
func (u ResponseObjectToolUnion) AsMcp() (v ResponseObjectToolMcp)
func (ResponseObjectToolUnion) AsOpenAIResponseInputToolWebSearch ¶
func (u ResponseObjectToolUnion) AsOpenAIResponseInputToolWebSearch() (v ResponseObjectToolOpenAIResponseInputToolWebSearch)
func (ResponseObjectToolUnion) RawJSON ¶
func (u ResponseObjectToolUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectToolUnion) UnmarshalJSON ¶
func (r *ResponseObjectToolUnion) UnmarshalJSON(data []byte) error
type ResponseObjectUsage ¶
type ResponseObjectUsage struct {
// Number of tokens in the input
InputTokens int64 `json:"input_tokens,required"`
// Number of tokens in the output
OutputTokens int64 `json:"output_tokens,required"`
// Total tokens used (input + output)
TotalTokens int64 `json:"total_tokens,required"`
// Detailed breakdown of input token usage
InputTokensDetails ResponseObjectUsageInputTokensDetails `json:"input_tokens_details"`
// Detailed breakdown of output token usage
OutputTokensDetails ResponseObjectUsageOutputTokensDetails `json:"output_tokens_details"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
InputTokens respjson.Field
OutputTokens respjson.Field
TotalTokens respjson.Field
InputTokensDetails respjson.Field
OutputTokensDetails respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
(Optional) Token usage information for the response
func (ResponseObjectUsage) RawJSON ¶
func (r ResponseObjectUsage) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectUsage) UnmarshalJSON ¶
func (r *ResponseObjectUsage) UnmarshalJSON(data []byte) error
type ResponseObjectUsageInputTokensDetails ¶
type ResponseObjectUsageInputTokensDetails struct {
// Number of tokens retrieved from cache
CachedTokens int64 `json:"cached_tokens"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CachedTokens respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Detailed breakdown of input token usage
func (ResponseObjectUsageInputTokensDetails) RawJSON ¶
func (r ResponseObjectUsageInputTokensDetails) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectUsageInputTokensDetails) UnmarshalJSON ¶
func (r *ResponseObjectUsageInputTokensDetails) UnmarshalJSON(data []byte) error
type ResponseObjectUsageOutputTokensDetails ¶
type ResponseObjectUsageOutputTokensDetails struct {
// Number of tokens used for reasoning (o1/o3 models)
ReasoningTokens int64 `json:"reasoning_tokens"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ReasoningTokens respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Detailed breakdown of output token usage
func (ResponseObjectUsageOutputTokensDetails) RawJSON ¶
func (r ResponseObjectUsageOutputTokensDetails) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResponseObjectUsageOutputTokensDetails) UnmarshalJSON ¶
func (r *ResponseObjectUsageOutputTokensDetails) UnmarshalJSON(data []byte) error
type ResponseService ¶
type ResponseService struct {
Options []option.RequestOption
InputItems ResponseInputItemService
}
ResponseService contains methods and other services that help with interacting with the llama-stack-client API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewResponseService method instead.
func NewResponseService ¶
func NewResponseService(opts ...option.RequestOption) (r ResponseService)
NewResponseService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ResponseService) Delete ¶
func (r *ResponseService) Delete(ctx context.Context, responseID string, opts ...option.RequestOption) (res *ResponseDeleteResponse, err error)
Delete a response.
func (*ResponseService) Get ¶
func (r *ResponseService) Get(ctx context.Context, responseID string, opts ...option.RequestOption) (res *ResponseObject, err error)
Get a model response.
func (*ResponseService) List ¶
func (r *ResponseService) List(ctx context.Context, query ResponseListParams, opts ...option.RequestOption) (res *pagination.OpenAICursorPage[ResponseListResponse], err error)
List all responses.
func (*ResponseService) ListAutoPaging ¶
func (r *ResponseService) ListAutoPaging(ctx context.Context, query ResponseListParams, opts ...option.RequestOption) *pagination.OpenAICursorPageAutoPager[ResponseListResponse]
List all responses.
func (*ResponseService) New ¶
func (r *ResponseService) New(ctx context.Context, body ResponseNewParams, opts ...option.RequestOption) (res *ResponseObject, err error)
Create a model response.
func (*ResponseService) NewStreaming ¶
func (r *ResponseService) NewStreaming(ctx context.Context, body ResponseNewParams, opts ...option.RequestOption) (stream *ssestream.Stream[ResponseObjectStreamUnion])
Create a model response.
type RouteInfo ¶
type RouteInfo struct {
// HTTP method for the route
Method string `json:"method,required"`
// List of provider types that implement this route
ProviderTypes []string `json:"provider_types,required"`
// The API endpoint path
Route string `json:"route,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Method respjson.Field
ProviderTypes respjson.Field
Route respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Information about an API route including its path, method, and implementing providers.
func (*RouteInfo) UnmarshalJSON ¶
type RouteListParams ¶
type RouteListParams struct {
// Optional filter to control which routes are returned. Can be an API level ('v1',
// 'v1alpha', 'v1beta') to show non-deprecated routes at that level, or
// 'deprecated' to show deprecated routes across all levels. If not specified,
// returns all non-deprecated routes.
//
// Any of "v1", "v1alpha", "v1beta", "deprecated".
APIFilter RouteListParamsAPIFilter `query:"api_filter,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (RouteListParams) URLQuery ¶
func (r RouteListParams) URLQuery() (v url.Values, err error)
URLQuery serializes RouteListParams's query parameters as `url.Values`.
type RouteListParamsAPIFilter ¶
type RouteListParamsAPIFilter string
Optional filter to control which routes are returned. Can be an API level ('v1', 'v1alpha', 'v1beta') to show non-deprecated routes at that level, or 'deprecated' to show deprecated routes across all levels. If not specified, returns all non-deprecated routes.
const ( RouteListParamsAPIFilterV1 RouteListParamsAPIFilter = "v1" RouteListParamsAPIFilterV1alpha RouteListParamsAPIFilter = "v1alpha" RouteListParamsAPIFilterV1beta RouteListParamsAPIFilter = "v1beta" RouteListParamsAPIFilterDeprecated RouteListParamsAPIFilter = "deprecated" )
type RouteService ¶
type RouteService struct {
Options []option.RequestOption
}
RouteService contains methods and other services that help with interacting with the llama-stack-client API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewRouteService method instead.
func NewRouteService ¶
func NewRouteService(opts ...option.RequestOption) (r RouteService)
NewRouteService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*RouteService) List ¶
func (r *RouteService) List(ctx context.Context, query RouteListParams, opts ...option.RequestOption) (res *[]RouteInfo, err error)
List routes. List all available API routes with their methods and implementing providers.
type RunShieldResponse ¶
type RunShieldResponse struct {
// (Optional) Safety violation detected by the shield, if any
Violation SafetyViolation `json:"violation"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Violation respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Response from running a safety shield.
func (RunShieldResponse) RawJSON ¶
func (r RunShieldResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*RunShieldResponse) UnmarshalJSON ¶
func (r *RunShieldResponse) UnmarshalJSON(data []byte) error
type SafetyRunShieldParams ¶
type SafetyRunShieldParams struct {
// The messages to run the shield on.
Messages []SafetyRunShieldParamsMessageUnion `json:"messages,omitzero,required"`
// The parameters of the shield.
Params map[string]SafetyRunShieldParamsParamUnion `json:"params,omitzero,required"`
// The identifier of the shield to run.
ShieldID string `json:"shield_id,required"`
// contains filtered or unexported fields
}
func (SafetyRunShieldParams) MarshalJSON ¶
func (r SafetyRunShieldParams) MarshalJSON() (data []byte, err error)
func (*SafetyRunShieldParams) UnmarshalJSON ¶
func (r *SafetyRunShieldParams) UnmarshalJSON(data []byte) error
type SafetyRunShieldParamsMessageAssistant ¶
type SafetyRunShieldParamsMessageAssistant struct {
// (Optional) The name of the assistant message participant.
Name param.Opt[string] `json:"name,omitzero"`
// The content of the model's response
Content SafetyRunShieldParamsMessageAssistantContentUnion `json:"content,omitzero"`
// List of tool calls. Each tool call is an OpenAIChatCompletionToolCall object.
ToolCalls []SafetyRunShieldParamsMessageAssistantToolCall `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 an OpenAI-compatible chat completion request.
The property Role is required.
func (SafetyRunShieldParamsMessageAssistant) MarshalJSON ¶
func (r SafetyRunShieldParamsMessageAssistant) MarshalJSON() (data []byte, err error)
func (*SafetyRunShieldParamsMessageAssistant) UnmarshalJSON ¶
func (r *SafetyRunShieldParamsMessageAssistant) UnmarshalJSON(data []byte) error
type SafetyRunShieldParamsMessageAssistantContentArrayItem ¶
type SafetyRunShieldParamsMessageAssistantContentArrayItem struct {
// The text content of the message
Text string `json:"text,required"`
// Must be "text" to identify this as text content
//
// This field can be elided, and will marshal its zero value as "text".
Type constant.Text `json:"type,required"`
// contains filtered or unexported fields
}
Text content part for OpenAI-compatible chat completion messages.
The properties Text, Type are required.
func (SafetyRunShieldParamsMessageAssistantContentArrayItem) MarshalJSON ¶
func (r SafetyRunShieldParamsMessageAssistantContentArrayItem) MarshalJSON() (data []byte, err error)
func (*SafetyRunShieldParamsMessageAssistantContentArrayItem) UnmarshalJSON ¶
func (r *SafetyRunShieldParamsMessageAssistantContentArrayItem) UnmarshalJSON(data []byte) error
type SafetyRunShieldParamsMessageAssistantContentUnion ¶
type SafetyRunShieldParamsMessageAssistantContentUnion struct {
OfString param.Opt[string] `json:",omitzero,inline"`
OfSafetyRunShieldsMessageAssistantContentArray []SafetyRunShieldParamsMessageAssistantContentArrayItem `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 (SafetyRunShieldParamsMessageAssistantContentUnion) MarshalJSON ¶
func (u SafetyRunShieldParamsMessageAssistantContentUnion) MarshalJSON() ([]byte, error)
func (*SafetyRunShieldParamsMessageAssistantContentUnion) UnmarshalJSON ¶
func (u *SafetyRunShieldParamsMessageAssistantContentUnion) UnmarshalJSON(data []byte) error
type SafetyRunShieldParamsMessageAssistantToolCall ¶
type SafetyRunShieldParamsMessageAssistantToolCall struct {
// (Optional) Unique identifier for the tool call
ID param.Opt[string] `json:"id,omitzero"`
// (Optional) Index of the tool call in the list
Index param.Opt[int64] `json:"index,omitzero"`
// (Optional) Function call details
Function SafetyRunShieldParamsMessageAssistantToolCallFunction `json:"function,omitzero"`
// Must be "function" to identify this as a function call
//
// This field can be elided, and will marshal its zero value as "function".
Type constant.Function `json:"type,required"`
// contains filtered or unexported fields
}
Tool call specification for OpenAI-compatible chat completion responses.
The property Type is required.
func (SafetyRunShieldParamsMessageAssistantToolCall) MarshalJSON ¶
func (r SafetyRunShieldParamsMessageAssistantToolCall) MarshalJSON() (data []byte, err error)
func (*SafetyRunShieldParamsMessageAssistantToolCall) UnmarshalJSON ¶
func (r *SafetyRunShieldParamsMessageAssistantToolCall) UnmarshalJSON(data []byte) error
type SafetyRunShieldParamsMessageAssistantToolCallFunction ¶
type SafetyRunShieldParamsMessageAssistantToolCallFunction struct {
// (Optional) Arguments to pass to the function as a JSON string
Arguments param.Opt[string] `json:"arguments,omitzero"`
// (Optional) Name of the function to call
Name param.Opt[string] `json:"name,omitzero"`
// contains filtered or unexported fields
}
(Optional) Function call details
func (SafetyRunShieldParamsMessageAssistantToolCallFunction) MarshalJSON ¶
func (r SafetyRunShieldParamsMessageAssistantToolCallFunction) MarshalJSON() (data []byte, err error)
func (*SafetyRunShieldParamsMessageAssistantToolCallFunction) UnmarshalJSON ¶
func (r *SafetyRunShieldParamsMessageAssistantToolCallFunction) UnmarshalJSON(data []byte) error
type SafetyRunShieldParamsMessageDeveloper ¶
type SafetyRunShieldParamsMessageDeveloper struct {
// The content of the developer message
Content SafetyRunShieldParamsMessageDeveloperContentUnion `json:"content,omitzero,required"`
// (Optional) The name of the developer message participant.
Name param.Opt[string] `json:"name,omitzero"`
// Must be "developer" to identify this as a developer message
//
// This field can be elided, and will marshal its zero value as "developer".
Role constant.Developer `json:"role,required"`
// contains filtered or unexported fields
}
A message from the developer in an OpenAI-compatible chat completion request.
The properties Content, Role are required.
func (SafetyRunShieldParamsMessageDeveloper) MarshalJSON ¶
func (r SafetyRunShieldParamsMessageDeveloper) MarshalJSON() (data []byte, err error)
func (*SafetyRunShieldParamsMessageDeveloper) UnmarshalJSON ¶
func (r *SafetyRunShieldParamsMessageDeveloper) UnmarshalJSON(data []byte) error
type SafetyRunShieldParamsMessageDeveloperContentArrayItem ¶
type SafetyRunShieldParamsMessageDeveloperContentArrayItem struct {
// The text content of the message
Text string `json:"text,required"`
// Must be "text" to identify this as text content
//
// This field can be elided, and will marshal its zero value as "text".
Type constant.Text `json:"type,required"`
// contains filtered or unexported fields
}
Text content part for OpenAI-compatible chat completion messages.
The properties Text, Type are required.
func (SafetyRunShieldParamsMessageDeveloperContentArrayItem) MarshalJSON ¶
func (r SafetyRunShieldParamsMessageDeveloperContentArrayItem) MarshalJSON() (data []byte, err error)
func (*SafetyRunShieldParamsMessageDeveloperContentArrayItem) UnmarshalJSON ¶
func (r *SafetyRunShieldParamsMessageDeveloperContentArrayItem) UnmarshalJSON(data []byte) error
type SafetyRunShieldParamsMessageDeveloperContentUnion ¶
type SafetyRunShieldParamsMessageDeveloperContentUnion struct {
OfString param.Opt[string] `json:",omitzero,inline"`
OfSafetyRunShieldsMessageDeveloperContentArray []SafetyRunShieldParamsMessageDeveloperContentArrayItem `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 (SafetyRunShieldParamsMessageDeveloperContentUnion) MarshalJSON ¶
func (u SafetyRunShieldParamsMessageDeveloperContentUnion) MarshalJSON() ([]byte, error)
func (*SafetyRunShieldParamsMessageDeveloperContentUnion) UnmarshalJSON ¶
func (u *SafetyRunShieldParamsMessageDeveloperContentUnion) UnmarshalJSON(data []byte) error
type SafetyRunShieldParamsMessageSystem ¶
type SafetyRunShieldParamsMessageSystem 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 SafetyRunShieldParamsMessageSystemContentUnion `json:"content,omitzero,required"`
// (Optional) The name of the system message participant.
Name param.Opt[string] `json:"name,omitzero"`
// 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 (SafetyRunShieldParamsMessageSystem) MarshalJSON ¶
func (r SafetyRunShieldParamsMessageSystem) MarshalJSON() (data []byte, err error)
func (*SafetyRunShieldParamsMessageSystem) UnmarshalJSON ¶
func (r *SafetyRunShieldParamsMessageSystem) UnmarshalJSON(data []byte) error
type SafetyRunShieldParamsMessageSystemContentArrayItem ¶
type SafetyRunShieldParamsMessageSystemContentArrayItem struct {
// The text content of the message
Text string `json:"text,required"`
// Must be "text" to identify this as text content
//
// This field can be elided, and will marshal its zero value as "text".
Type constant.Text `json:"type,required"`
// contains filtered or unexported fields
}
Text content part for OpenAI-compatible chat completion messages.
The properties Text, Type are required.
func (SafetyRunShieldParamsMessageSystemContentArrayItem) MarshalJSON ¶
func (r SafetyRunShieldParamsMessageSystemContentArrayItem) MarshalJSON() (data []byte, err error)
func (*SafetyRunShieldParamsMessageSystemContentArrayItem) UnmarshalJSON ¶
func (r *SafetyRunShieldParamsMessageSystemContentArrayItem) UnmarshalJSON(data []byte) error
type SafetyRunShieldParamsMessageSystemContentUnion ¶
type SafetyRunShieldParamsMessageSystemContentUnion struct {
OfString param.Opt[string] `json:",omitzero,inline"`
OfSafetyRunShieldsMessageSystemContentArray []SafetyRunShieldParamsMessageSystemContentArrayItem `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 (SafetyRunShieldParamsMessageSystemContentUnion) MarshalJSON ¶
func (u SafetyRunShieldParamsMessageSystemContentUnion) MarshalJSON() ([]byte, error)
func (*SafetyRunShieldParamsMessageSystemContentUnion) UnmarshalJSON ¶
func (u *SafetyRunShieldParamsMessageSystemContentUnion) UnmarshalJSON(data []byte) error
type SafetyRunShieldParamsMessageTool ¶
type SafetyRunShieldParamsMessageTool struct {
// The response content from the tool
Content SafetyRunShieldParamsMessageToolContentUnion `json:"content,omitzero,required"`
// Unique identifier for the tool call this response is for
ToolCallID string `json:"tool_call_id,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 in an OpenAI-compatible chat completion request.
The properties Content, Role, ToolCallID are required.
func (SafetyRunShieldParamsMessageTool) MarshalJSON ¶
func (r SafetyRunShieldParamsMessageTool) MarshalJSON() (data []byte, err error)
func (*SafetyRunShieldParamsMessageTool) UnmarshalJSON ¶
func (r *SafetyRunShieldParamsMessageTool) UnmarshalJSON(data []byte) error
type SafetyRunShieldParamsMessageToolContentArrayItem ¶
type SafetyRunShieldParamsMessageToolContentArrayItem struct {
// The text content of the message
Text string `json:"text,required"`
// Must be "text" to identify this as text content
//
// This field can be elided, and will marshal its zero value as "text".
Type constant.Text `json:"type,required"`
// contains filtered or unexported fields
}
Text content part for OpenAI-compatible chat completion messages.
The properties Text, Type are required.
func (SafetyRunShieldParamsMessageToolContentArrayItem) MarshalJSON ¶
func (r SafetyRunShieldParamsMessageToolContentArrayItem) MarshalJSON() (data []byte, err error)
func (*SafetyRunShieldParamsMessageToolContentArrayItem) UnmarshalJSON ¶
func (r *SafetyRunShieldParamsMessageToolContentArrayItem) UnmarshalJSON(data []byte) error
type SafetyRunShieldParamsMessageToolContentUnion ¶
type SafetyRunShieldParamsMessageToolContentUnion struct {
OfString param.Opt[string] `json:",omitzero,inline"`
OfSafetyRunShieldsMessageToolContentArray []SafetyRunShieldParamsMessageToolContentArrayItem `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 (SafetyRunShieldParamsMessageToolContentUnion) MarshalJSON ¶
func (u SafetyRunShieldParamsMessageToolContentUnion) MarshalJSON() ([]byte, error)
func (*SafetyRunShieldParamsMessageToolContentUnion) UnmarshalJSON ¶
func (u *SafetyRunShieldParamsMessageToolContentUnion) UnmarshalJSON(data []byte) error
type SafetyRunShieldParamsMessageUnion ¶
type SafetyRunShieldParamsMessageUnion struct {
OfUser *SafetyRunShieldParamsMessageUser `json:",omitzero,inline"`
OfSystem *SafetyRunShieldParamsMessageSystem `json:",omitzero,inline"`
OfAssistant *SafetyRunShieldParamsMessageAssistant `json:",omitzero,inline"`
OfTool *SafetyRunShieldParamsMessageTool `json:",omitzero,inline"`
OfDeveloper *SafetyRunShieldParamsMessageDeveloper `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 (SafetyRunShieldParamsMessageUnion) GetContent ¶
func (u SafetyRunShieldParamsMessageUnion) GetContent() (res safetyRunShieldParamsMessageUnionContent)
Returns a subunion which exports methods to access subproperties
Or use AsAny() to get the underlying value
func (SafetyRunShieldParamsMessageUnion) GetName ¶
func (u SafetyRunShieldParamsMessageUnion) GetName() *string
Returns a pointer to the underlying variant's property, if present.
func (SafetyRunShieldParamsMessageUnion) GetRole ¶
func (u SafetyRunShieldParamsMessageUnion) GetRole() *string
Returns a pointer to the underlying variant's property, if present.
func (SafetyRunShieldParamsMessageUnion) GetToolCallID ¶
func (u SafetyRunShieldParamsMessageUnion) GetToolCallID() *string
Returns a pointer to the underlying variant's property, if present.
func (SafetyRunShieldParamsMessageUnion) GetToolCalls ¶
func (u SafetyRunShieldParamsMessageUnion) GetToolCalls() []SafetyRunShieldParamsMessageAssistantToolCall
Returns a pointer to the underlying variant's property, if present.
func (SafetyRunShieldParamsMessageUnion) MarshalJSON ¶
func (u SafetyRunShieldParamsMessageUnion) MarshalJSON() ([]byte, error)
func (*SafetyRunShieldParamsMessageUnion) UnmarshalJSON ¶
func (u *SafetyRunShieldParamsMessageUnion) UnmarshalJSON(data []byte) error
type SafetyRunShieldParamsMessageUser ¶
type SafetyRunShieldParamsMessageUser struct {
// The content of the message, which can include text and other media
Content SafetyRunShieldParamsMessageUserContentUnion `json:"content,omitzero,required"`
// (Optional) The name of the user message participant.
Name param.Opt[string] `json:"name,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 an OpenAI-compatible chat completion request.
The properties Content, Role are required.
func (SafetyRunShieldParamsMessageUser) MarshalJSON ¶
func (r SafetyRunShieldParamsMessageUser) MarshalJSON() (data []byte, err error)
func (*SafetyRunShieldParamsMessageUser) UnmarshalJSON ¶
func (r *SafetyRunShieldParamsMessageUser) UnmarshalJSON(data []byte) error
type SafetyRunShieldParamsMessageUserContentArrayItemFile ¶
type SafetyRunShieldParamsMessageUserContentArrayItemFile struct {
File SafetyRunShieldParamsMessageUserContentArrayItemFileFile `json:"file,omitzero,required"`
// This field can be elided, and will marshal its zero value as "file".
Type constant.File `json:"type,required"`
// contains filtered or unexported fields
}
The properties File, Type are required.
func (SafetyRunShieldParamsMessageUserContentArrayItemFile) MarshalJSON ¶
func (r SafetyRunShieldParamsMessageUserContentArrayItemFile) MarshalJSON() (data []byte, err error)
func (*SafetyRunShieldParamsMessageUserContentArrayItemFile) UnmarshalJSON ¶
func (r *SafetyRunShieldParamsMessageUserContentArrayItemFile) UnmarshalJSON(data []byte) error
type SafetyRunShieldParamsMessageUserContentArrayItemFileFile ¶
type SafetyRunShieldParamsMessageUserContentArrayItemFileFile struct {
FileData param.Opt[string] `json:"file_data,omitzero"`
FileID param.Opt[string] `json:"file_id,omitzero"`
Filename param.Opt[string] `json:"filename,omitzero"`
// contains filtered or unexported fields
}
func (SafetyRunShieldParamsMessageUserContentArrayItemFileFile) MarshalJSON ¶
func (r SafetyRunShieldParamsMessageUserContentArrayItemFileFile) MarshalJSON() (data []byte, err error)
func (*SafetyRunShieldParamsMessageUserContentArrayItemFileFile) UnmarshalJSON ¶
func (r *SafetyRunShieldParamsMessageUserContentArrayItemFileFile) UnmarshalJSON(data []byte) error
type SafetyRunShieldParamsMessageUserContentArrayItemImageURL ¶
type SafetyRunShieldParamsMessageUserContentArrayItemImageURL struct {
// Image URL specification and processing details
ImageURL SafetyRunShieldParamsMessageUserContentArrayItemImageURLImageURL `json:"image_url,omitzero,required"`
// Must be "image_url" to identify this as image content
//
// This field can be elided, and will marshal its zero value as "image_url".
Type constant.ImageURL `json:"type,required"`
// contains filtered or unexported fields
}
Image content part for OpenAI-compatible chat completion messages.
The properties ImageURL, Type are required.
func (SafetyRunShieldParamsMessageUserContentArrayItemImageURL) MarshalJSON ¶
func (r SafetyRunShieldParamsMessageUserContentArrayItemImageURL) MarshalJSON() (data []byte, err error)
func (*SafetyRunShieldParamsMessageUserContentArrayItemImageURL) UnmarshalJSON ¶
func (r *SafetyRunShieldParamsMessageUserContentArrayItemImageURL) UnmarshalJSON(data []byte) error
type SafetyRunShieldParamsMessageUserContentArrayItemImageURLImageURL ¶
type SafetyRunShieldParamsMessageUserContentArrayItemImageURLImageURL struct {
// URL of the image to include in the message
URL string `json:"url,required"`
// (Optional) Level of detail for image processing. Can be "low", "high", or "auto"
Detail param.Opt[string] `json:"detail,omitzero"`
// contains filtered or unexported fields
}
Image URL specification and processing details
The property URL is required.
func (SafetyRunShieldParamsMessageUserContentArrayItemImageURLImageURL) MarshalJSON ¶
func (r SafetyRunShieldParamsMessageUserContentArrayItemImageURLImageURL) MarshalJSON() (data []byte, err error)
func (*SafetyRunShieldParamsMessageUserContentArrayItemImageURLImageURL) UnmarshalJSON ¶
func (r *SafetyRunShieldParamsMessageUserContentArrayItemImageURLImageURL) UnmarshalJSON(data []byte) error
type SafetyRunShieldParamsMessageUserContentArrayItemText ¶
type SafetyRunShieldParamsMessageUserContentArrayItemText struct {
// The text content of the message
Text string `json:"text,required"`
// Must be "text" to identify this as text content
//
// This field can be elided, and will marshal its zero value as "text".
Type constant.Text `json:"type,required"`
// contains filtered or unexported fields
}
Text content part for OpenAI-compatible chat completion messages.
The properties Text, Type are required.
func (SafetyRunShieldParamsMessageUserContentArrayItemText) MarshalJSON ¶
func (r SafetyRunShieldParamsMessageUserContentArrayItemText) MarshalJSON() (data []byte, err error)
func (*SafetyRunShieldParamsMessageUserContentArrayItemText) UnmarshalJSON ¶
func (r *SafetyRunShieldParamsMessageUserContentArrayItemText) UnmarshalJSON(data []byte) error
type SafetyRunShieldParamsMessageUserContentArrayItemUnion ¶
type SafetyRunShieldParamsMessageUserContentArrayItemUnion struct {
OfText *SafetyRunShieldParamsMessageUserContentArrayItemText `json:",omitzero,inline"`
OfImageURL *SafetyRunShieldParamsMessageUserContentArrayItemImageURL `json:",omitzero,inline"`
OfFile *SafetyRunShieldParamsMessageUserContentArrayItemFile `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 (SafetyRunShieldParamsMessageUserContentArrayItemUnion) GetFile ¶
func (u SafetyRunShieldParamsMessageUserContentArrayItemUnion) GetFile() *SafetyRunShieldParamsMessageUserContentArrayItemFileFile
Returns a pointer to the underlying variant's property, if present.
func (SafetyRunShieldParamsMessageUserContentArrayItemUnion) GetImageURL ¶
func (u SafetyRunShieldParamsMessageUserContentArrayItemUnion) GetImageURL() *SafetyRunShieldParamsMessageUserContentArrayItemImageURLImageURL
Returns a pointer to the underlying variant's property, if present.
func (SafetyRunShieldParamsMessageUserContentArrayItemUnion) GetText ¶
func (u SafetyRunShieldParamsMessageUserContentArrayItemUnion) GetText() *string
Returns a pointer to the underlying variant's property, if present.
func (SafetyRunShieldParamsMessageUserContentArrayItemUnion) GetType ¶
func (u SafetyRunShieldParamsMessageUserContentArrayItemUnion) GetType() *string
Returns a pointer to the underlying variant's property, if present.
func (SafetyRunShieldParamsMessageUserContentArrayItemUnion) MarshalJSON ¶
func (u SafetyRunShieldParamsMessageUserContentArrayItemUnion) MarshalJSON() ([]byte, error)
func (*SafetyRunShieldParamsMessageUserContentArrayItemUnion) UnmarshalJSON ¶
func (u *SafetyRunShieldParamsMessageUserContentArrayItemUnion) UnmarshalJSON(data []byte) error
type SafetyRunShieldParamsMessageUserContentUnion ¶
type SafetyRunShieldParamsMessageUserContentUnion struct {
OfString param.Opt[string] `json:",omitzero,inline"`
OfSafetyRunShieldsMessageUserContentArray []SafetyRunShieldParamsMessageUserContentArrayItemUnion `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 (SafetyRunShieldParamsMessageUserContentUnion) MarshalJSON ¶
func (u SafetyRunShieldParamsMessageUserContentUnion) MarshalJSON() ([]byte, error)
func (*SafetyRunShieldParamsMessageUserContentUnion) UnmarshalJSON ¶
func (u *SafetyRunShieldParamsMessageUserContentUnion) UnmarshalJSON(data []byte) error
type SafetyRunShieldParamsParamUnion ¶
type SafetyRunShieldParamsParamUnion 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 (SafetyRunShieldParamsParamUnion) MarshalJSON ¶
func (u SafetyRunShieldParamsParamUnion) MarshalJSON() ([]byte, error)
func (*SafetyRunShieldParamsParamUnion) UnmarshalJSON ¶
func (u *SafetyRunShieldParamsParamUnion) UnmarshalJSON(data []byte) error
type SafetyService ¶
type SafetyService struct {
Options []option.RequestOption
}
SafetyService contains methods and other services that help with interacting with the llama-stack-client API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewSafetyService method instead.
func NewSafetyService ¶
func NewSafetyService(opts ...option.RequestOption) (r SafetyService)
NewSafetyService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*SafetyService) RunShield ¶
func (r *SafetyService) RunShield(ctx context.Context, body SafetyRunShieldParams, opts ...option.RequestOption) (res *RunShieldResponse, err error)
Run shield. Run a shield.
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 ¶
func (u SafetyViolationMetadataUnion) RawJSON() string
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 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 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 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 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 ScoringFn ¶
type ScoringFn struct {
Identifier string `json:"identifier,required"`
Metadata map[string]ScoringFnMetadataUnion `json:"metadata,required"`
ProviderID string `json:"provider_id,required"`
ReturnType ScoringFnReturnType `json:"return_type,required"`
// The resource type, always scoring_function
Type constant.ScoringFunction `json:"type,required"`
Description string `json:"description"`
// Parameters for LLM-as-judge scoring function configuration.
Params ScoringFnParamsUnionResp `json:"params"`
ProviderResourceID string `json:"provider_resource_id"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Identifier respjson.Field
Metadata respjson.Field
ProviderID respjson.Field
ReturnType respjson.Field
Type respjson.Field
Description respjson.Field
Params respjson.Field
ProviderResourceID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A scoring function resource for evaluating model outputs.
func (*ScoringFn) UnmarshalJSON ¶
type ScoringFnMetadataUnion ¶
type ScoringFnMetadataUnion 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:"-"`
}
ScoringFnMetadataUnion 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 (ScoringFnMetadataUnion) AsAnyArray ¶
func (u ScoringFnMetadataUnion) AsAnyArray() (v []any)
func (ScoringFnMetadataUnion) AsBool ¶
func (u ScoringFnMetadataUnion) AsBool() (v bool)
func (ScoringFnMetadataUnion) AsFloat ¶
func (u ScoringFnMetadataUnion) AsFloat() (v float64)
func (ScoringFnMetadataUnion) AsString ¶
func (u ScoringFnMetadataUnion) AsString() (v string)
func (ScoringFnMetadataUnion) RawJSON ¶
func (u ScoringFnMetadataUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ScoringFnMetadataUnion) UnmarshalJSON ¶
func (r *ScoringFnMetadataUnion) UnmarshalJSON(data []byte) error
type ScoringFnParamsBasic ¶
type ScoringFnParamsBasic struct {
// Aggregation functions to apply to the scores of each row
//
// Any of "average", "weighted_average", "median", "categorical_count", "accuracy".
AggregationFunctions []string `json:"aggregation_functions,omitzero,required"`
// The type of scoring function parameters, always basic
//
// This field can be elided, and will marshal its zero value as "basic".
Type constant.Basic `json:"type,required"`
// contains filtered or unexported fields
}
Parameters for basic scoring function configuration.
The properties AggregationFunctions, Type are required.
func (ScoringFnParamsBasic) MarshalJSON ¶
func (r ScoringFnParamsBasic) MarshalJSON() (data []byte, err error)
func (*ScoringFnParamsBasic) UnmarshalJSON ¶
func (r *ScoringFnParamsBasic) UnmarshalJSON(data []byte) error
type ScoringFnParamsBasicResp ¶
type ScoringFnParamsBasicResp struct {
// Aggregation functions to apply to the scores of each row
//
// Any of "average", "weighted_average", "median", "categorical_count", "accuracy".
AggregationFunctions []string `json:"aggregation_functions,required"`
// The type of scoring function parameters, always basic
Type constant.Basic `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AggregationFunctions respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Parameters for basic scoring function configuration.
func (ScoringFnParamsBasicResp) RawJSON ¶
func (r ScoringFnParamsBasicResp) RawJSON() string
Returns the unmodified JSON received from the API
func (*ScoringFnParamsBasicResp) UnmarshalJSON ¶
func (r *ScoringFnParamsBasicResp) UnmarshalJSON(data []byte) error
type ScoringFnParamsLlmAsJudge ¶
type ScoringFnParamsLlmAsJudge struct {
// Aggregation functions to apply to the scores of each row
//
// Any of "average", "weighted_average", "median", "categorical_count", "accuracy".
AggregationFunctions []string `json:"aggregation_functions,omitzero,required"`
// Identifier of the LLM model to use as a judge for scoring
JudgeModel string `json:"judge_model,required"`
// Regexes to extract the answer from generated response
JudgeScoreRegexes []string `json:"judge_score_regexes,omitzero,required"`
// (Optional) Custom prompt template for the judge model
PromptTemplate param.Opt[string] `json:"prompt_template,omitzero"`
// The type of scoring function parameters, always llm_as_judge
//
// This field can be elided, and will marshal its zero value as "llm_as_judge".
Type constant.LlmAsJudge `json:"type,required"`
// contains filtered or unexported fields
}
Parameters for LLM-as-judge scoring function configuration.
The properties AggregationFunctions, JudgeModel, JudgeScoreRegexes, Type are required.
func (ScoringFnParamsLlmAsJudge) MarshalJSON ¶
func (r ScoringFnParamsLlmAsJudge) MarshalJSON() (data []byte, err error)
func (*ScoringFnParamsLlmAsJudge) UnmarshalJSON ¶
func (r *ScoringFnParamsLlmAsJudge) UnmarshalJSON(data []byte) error
type ScoringFnParamsLlmAsJudgeResp ¶
type ScoringFnParamsLlmAsJudgeResp struct {
// Aggregation functions to apply to the scores of each row
//
// Any of "average", "weighted_average", "median", "categorical_count", "accuracy".
AggregationFunctions []string `json:"aggregation_functions,required"`
// Identifier of the LLM model to use as a judge for scoring
JudgeModel string `json:"judge_model,required"`
// Regexes to extract the answer from generated response
JudgeScoreRegexes []string `json:"judge_score_regexes,required"`
// The type of scoring function parameters, always llm_as_judge
Type constant.LlmAsJudge `json:"type,required"`
// (Optional) Custom prompt template for the judge model
PromptTemplate string `json:"prompt_template"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AggregationFunctions respjson.Field
JudgeModel respjson.Field
JudgeScoreRegexes respjson.Field
Type respjson.Field
PromptTemplate respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Parameters for LLM-as-judge scoring function configuration.
func (ScoringFnParamsLlmAsJudgeResp) RawJSON ¶
func (r ScoringFnParamsLlmAsJudgeResp) RawJSON() string
Returns the unmodified JSON received from the API
func (*ScoringFnParamsLlmAsJudgeResp) UnmarshalJSON ¶
func (r *ScoringFnParamsLlmAsJudgeResp) UnmarshalJSON(data []byte) error
type ScoringFnParamsRegexParser ¶
type ScoringFnParamsRegexParser struct {
// Aggregation functions to apply to the scores of each row
//
// Any of "average", "weighted_average", "median", "categorical_count", "accuracy".
AggregationFunctions []string `json:"aggregation_functions,omitzero,required"`
// Regex to extract the answer from generated response
ParsingRegexes []string `json:"parsing_regexes,omitzero,required"`
// The type of scoring function parameters, always regex_parser
//
// This field can be elided, and will marshal its zero value as "regex_parser".
Type constant.RegexParser `json:"type,required"`
// contains filtered or unexported fields
}
Parameters for regex parser scoring function configuration.
The properties AggregationFunctions, ParsingRegexes, Type are required.
func (ScoringFnParamsRegexParser) MarshalJSON ¶
func (r ScoringFnParamsRegexParser) MarshalJSON() (data []byte, err error)
func (*ScoringFnParamsRegexParser) UnmarshalJSON ¶
func (r *ScoringFnParamsRegexParser) UnmarshalJSON(data []byte) error
type ScoringFnParamsRegexParserResp ¶
type ScoringFnParamsRegexParserResp struct {
// Aggregation functions to apply to the scores of each row
//
// Any of "average", "weighted_average", "median", "categorical_count", "accuracy".
AggregationFunctions []string `json:"aggregation_functions,required"`
// Regex to extract the answer from generated response
ParsingRegexes []string `json:"parsing_regexes,required"`
// The type of scoring function parameters, always regex_parser
Type constant.RegexParser `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AggregationFunctions respjson.Field
ParsingRegexes respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Parameters for regex parser scoring function configuration.
func (ScoringFnParamsRegexParserResp) RawJSON ¶
func (r ScoringFnParamsRegexParserResp) RawJSON() string
Returns the unmodified JSON received from the API
func (*ScoringFnParamsRegexParserResp) UnmarshalJSON ¶
func (r *ScoringFnParamsRegexParserResp) UnmarshalJSON(data []byte) error
type ScoringFnParamsUnion ¶
type ScoringFnParamsUnion struct {
OfLlmAsJudge *ScoringFnParamsLlmAsJudge `json:",omitzero,inline"`
OfRegexParser *ScoringFnParamsRegexParser `json:",omitzero,inline"`
OfBasic *ScoringFnParamsBasic `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 ScoringFnParamsOfBasic ¶
func ScoringFnParamsOfBasic(aggregationFunctions []string) ScoringFnParamsUnion
func ScoringFnParamsOfLlmAsJudge ¶
func ScoringFnParamsOfLlmAsJudge(aggregationFunctions []string, judgeModel string, judgeScoreRegexes []string) ScoringFnParamsUnion
func ScoringFnParamsOfRegexParser ¶
func ScoringFnParamsOfRegexParser(aggregationFunctions []string, parsingRegexes []string) ScoringFnParamsUnion
func (ScoringFnParamsUnion) GetAggregationFunctions ¶
func (u ScoringFnParamsUnion) GetAggregationFunctions() []string
Returns a pointer to the underlying variant's AggregationFunctions property, if present.
func (ScoringFnParamsUnion) GetJudgeModel ¶
func (u ScoringFnParamsUnion) GetJudgeModel() *string
Returns a pointer to the underlying variant's property, if present.
func (ScoringFnParamsUnion) GetJudgeScoreRegexes ¶
func (u ScoringFnParamsUnion) GetJudgeScoreRegexes() []string
Returns a pointer to the underlying variant's property, if present.
func (ScoringFnParamsUnion) GetParsingRegexes ¶
func (u ScoringFnParamsUnion) GetParsingRegexes() []string
Returns a pointer to the underlying variant's property, if present.
func (ScoringFnParamsUnion) GetPromptTemplate ¶
func (u ScoringFnParamsUnion) GetPromptTemplate() *string
Returns a pointer to the underlying variant's property, if present.
func (ScoringFnParamsUnion) GetType ¶
func (u ScoringFnParamsUnion) GetType() *string
Returns a pointer to the underlying variant's property, if present.
func (ScoringFnParamsUnion) MarshalJSON ¶
func (u ScoringFnParamsUnion) MarshalJSON() ([]byte, error)
func (*ScoringFnParamsUnion) UnmarshalJSON ¶
func (u *ScoringFnParamsUnion) UnmarshalJSON(data []byte) error
type ScoringFnParamsUnionResp ¶
type ScoringFnParamsUnionResp struct {
AggregationFunctions []string `json:"aggregation_functions"`
// This field is from variant [ScoringFnParamsLlmAsJudgeResp].
JudgeModel string `json:"judge_model"`
// This field is from variant [ScoringFnParamsLlmAsJudgeResp].
JudgeScoreRegexes []string `json:"judge_score_regexes"`
// Any of "llm_as_judge", "regex_parser", "basic".
Type string `json:"type"`
// This field is from variant [ScoringFnParamsLlmAsJudgeResp].
PromptTemplate string `json:"prompt_template"`
// This field is from variant [ScoringFnParamsRegexParserResp].
ParsingRegexes []string `json:"parsing_regexes"`
JSON struct {
AggregationFunctions respjson.Field
JudgeModel respjson.Field
JudgeScoreRegexes respjson.Field
Type respjson.Field
PromptTemplate respjson.Field
ParsingRegexes respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ScoringFnParamsUnionResp contains all possible properties and values from ScoringFnParamsLlmAsJudgeResp, ScoringFnParamsRegexParserResp, ScoringFnParamsBasicResp.
Use the ScoringFnParamsUnionResp.AsAny method to switch on the variant.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (ScoringFnParamsUnionResp) AsAny ¶
func (u ScoringFnParamsUnionResp) AsAny() anyScoringFnParamsResp
Use the following switch statement to find the correct variant
switch variant := ScoringFnParamsUnionResp.AsAny().(type) {
case llamastackclient.ScoringFnParamsLlmAsJudgeResp:
case llamastackclient.ScoringFnParamsRegexParserResp:
case llamastackclient.ScoringFnParamsBasicResp:
default:
fmt.Errorf("no variant present")
}
func (ScoringFnParamsUnionResp) AsBasic ¶
func (u ScoringFnParamsUnionResp) AsBasic() (v ScoringFnParamsBasicResp)
func (ScoringFnParamsUnionResp) AsLlmAsJudge ¶
func (u ScoringFnParamsUnionResp) AsLlmAsJudge() (v ScoringFnParamsLlmAsJudgeResp)
func (ScoringFnParamsUnionResp) AsRegexParser ¶
func (u ScoringFnParamsUnionResp) AsRegexParser() (v ScoringFnParamsRegexParserResp)
func (ScoringFnParamsUnionResp) RawJSON ¶
func (u ScoringFnParamsUnionResp) RawJSON() string
Returns the unmodified JSON received from the API
func (ScoringFnParamsUnionResp) ToParam ¶
func (r ScoringFnParamsUnionResp) ToParam() ScoringFnParamsUnion
ToParam converts this ScoringFnParamsUnionResp to a ScoringFnParamsUnion.
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 ScoringFnParamsUnion.Overrides()
func (*ScoringFnParamsUnionResp) UnmarshalJSON ¶
func (r *ScoringFnParamsUnionResp) UnmarshalJSON(data []byte) error
type ScoringFnReturnType ¶
type ScoringFnReturnType struct {
// Any of "string", "number", "boolean", "array", "object", "json", "union",
// "chat_completion_input", "completion_input", "agent_turn_input".
Type string `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 (ScoringFnReturnType) RawJSON ¶
func (r ScoringFnReturnType) RawJSON() string
Returns the unmodified JSON received from the API
func (*ScoringFnReturnType) UnmarshalJSON ¶
func (r *ScoringFnReturnType) UnmarshalJSON(data []byte) error
type ScoringFunctionRegisterParams ¶
type ScoringFunctionRegisterParams struct {
// The description of the scoring function.
Description string `json:"description,required"`
ReturnType ScoringFunctionRegisterParamsReturnType `json:"return_type,omitzero,required"`
// The ID of the scoring function to register.
ScoringFnID string `json:"scoring_fn_id,required"`
// The ID of the provider to use for the scoring function.
ProviderID param.Opt[string] `json:"provider_id,omitzero"`
// The ID of the provider scoring function to use for the scoring function.
ProviderScoringFnID param.Opt[string] `json:"provider_scoring_fn_id,omitzero"`
// The parameters for the scoring function for benchmark eval, these can be
// overridden for app eval.
Params ScoringFnParamsUnion `json:"params,omitzero"`
// contains filtered or unexported fields
}
func (ScoringFunctionRegisterParams) MarshalJSON ¶
func (r ScoringFunctionRegisterParams) MarshalJSON() (data []byte, err error)
func (*ScoringFunctionRegisterParams) UnmarshalJSON ¶
func (r *ScoringFunctionRegisterParams) UnmarshalJSON(data []byte) error
type ScoringFunctionRegisterParamsReturnType ¶
type ScoringFunctionRegisterParamsReturnType struct {
// Any of "string", "number", "boolean", "array", "object", "json", "union",
// "chat_completion_input", "completion_input", "agent_turn_input".
Type string `json:"type,omitzero,required"`
// contains filtered or unexported fields
}
The property Type is required.
func (ScoringFunctionRegisterParamsReturnType) MarshalJSON ¶
func (r ScoringFunctionRegisterParamsReturnType) MarshalJSON() (data []byte, err error)
func (*ScoringFunctionRegisterParamsReturnType) UnmarshalJSON ¶
func (r *ScoringFunctionRegisterParamsReturnType) UnmarshalJSON(data []byte) error
type ScoringFunctionService ¶
type ScoringFunctionService struct {
Options []option.RequestOption
}
ScoringFunctionService contains methods and other services that help with interacting with the llama-stack-client API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewScoringFunctionService method instead.
func NewScoringFunctionService ¶
func NewScoringFunctionService(opts ...option.RequestOption) (r ScoringFunctionService)
NewScoringFunctionService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ScoringFunctionService) Get ¶
func (r *ScoringFunctionService) Get(ctx context.Context, scoringFnID string, opts ...option.RequestOption) (res *ScoringFn, err error)
Get a scoring function by its ID.
func (*ScoringFunctionService) List ¶
func (r *ScoringFunctionService) List(ctx context.Context, opts ...option.RequestOption) (res *[]ScoringFn, err error)
List all scoring functions.
func (*ScoringFunctionService) Register
deprecated
func (r *ScoringFunctionService) Register(ctx context.Context, body ScoringFunctionRegisterParams, opts ...option.RequestOption) (err error)
Register a scoring function.
Deprecated: deprecated
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 (u ScoringResultAggregatedResultUnion) AsBool() (v bool)
func (ScoringResultAggregatedResultUnion) AsFloat ¶
func (u ScoringResultAggregatedResultUnion) AsFloat() (v float64)
func (ScoringResultAggregatedResultUnion) AsString ¶
func (u ScoringResultAggregatedResultUnion) AsString() (v string)
func (ScoringResultAggregatedResultUnion) RawJSON ¶
func (u ScoringResultAggregatedResultUnion) RawJSON() string
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 ScoringScoreBatchParams ¶
type ScoringScoreBatchParams struct {
// The ID of the dataset to score.
DatasetID string `json:"dataset_id,required"`
// Whether to save the results to a dataset.
SaveResultsDataset bool `json:"save_results_dataset,required"`
// The scoring functions to use for the scoring.
ScoringFunctions map[string]ScoringFnParamsUnion `json:"scoring_functions,omitzero,required"`
// contains filtered or unexported fields
}
func (ScoringScoreBatchParams) MarshalJSON ¶
func (r ScoringScoreBatchParams) MarshalJSON() (data []byte, err error)
func (*ScoringScoreBatchParams) UnmarshalJSON ¶
func (r *ScoringScoreBatchParams) UnmarshalJSON(data []byte) error
type ScoringScoreBatchResponse ¶
type ScoringScoreBatchResponse struct {
// A map of scoring function name to ScoringResult
Results map[string]ScoringResult `json:"results,required"`
// (Optional) The identifier of the dataset that was scored
DatasetID string `json:"dataset_id"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Results respjson.Field
DatasetID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Response from batch scoring operations on datasets.
func (ScoringScoreBatchResponse) RawJSON ¶
func (r ScoringScoreBatchResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ScoringScoreBatchResponse) UnmarshalJSON ¶
func (r *ScoringScoreBatchResponse) UnmarshalJSON(data []byte) error
type ScoringScoreParams ¶
type ScoringScoreParams struct {
// The rows to score.
InputRows []map[string]ScoringScoreParamsInputRowUnion `json:"input_rows,omitzero,required"`
// The scoring functions to use for the scoring.
ScoringFunctions map[string]ScoringFnParamsUnion `json:"scoring_functions,omitzero,required"`
// contains filtered or unexported fields
}
func (ScoringScoreParams) MarshalJSON ¶
func (r ScoringScoreParams) MarshalJSON() (data []byte, err error)
func (*ScoringScoreParams) UnmarshalJSON ¶
func (r *ScoringScoreParams) UnmarshalJSON(data []byte) error
type ScoringScoreParamsInputRowUnion ¶
type ScoringScoreParamsInputRowUnion 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 (ScoringScoreParamsInputRowUnion) MarshalJSON ¶
func (u ScoringScoreParamsInputRowUnion) MarshalJSON() ([]byte, error)
func (*ScoringScoreParamsInputRowUnion) UnmarshalJSON ¶
func (u *ScoringScoreParamsInputRowUnion) UnmarshalJSON(data []byte) error
type ScoringScoreResponse ¶
type ScoringScoreResponse struct {
// A map of scoring function name to ScoringResult.
Results map[string]ScoringResult `json:"results,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Results respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The response from scoring.
func (ScoringScoreResponse) RawJSON ¶
func (r ScoringScoreResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ScoringScoreResponse) UnmarshalJSON ¶
func (r *ScoringScoreResponse) UnmarshalJSON(data []byte) error
type ScoringService ¶
type ScoringService struct {
Options []option.RequestOption
}
ScoringService contains methods and other services that help with interacting with the llama-stack-client API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewScoringService method instead.
func NewScoringService ¶
func NewScoringService(opts ...option.RequestOption) (r ScoringService)
NewScoringService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ScoringService) Score ¶
func (r *ScoringService) Score(ctx context.Context, body ScoringScoreParams, opts ...option.RequestOption) (res *ScoringScoreResponse, err error)
Score a list of rows.
func (*ScoringService) ScoreBatch ¶
func (r *ScoringService) ScoreBatch(ctx context.Context, body ScoringScoreBatchParams, opts ...option.RequestOption) (res *ScoringScoreBatchResponse, err error)
Score a batch of rows.
type Shield ¶
type Shield struct {
Identifier string `json:"identifier,required"`
ProviderID string `json:"provider_id,required"`
// The resource type, always shield
Type constant.Shield `json:"type,required"`
// (Optional) Configuration parameters for the shield
Params map[string]ShieldParamUnion `json:"params"`
ProviderResourceID string `json:"provider_resource_id"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Identifier respjson.Field
ProviderID respjson.Field
Type respjson.Field
Params respjson.Field
ProviderResourceID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A safety shield resource that can be used to check content.
func (*Shield) UnmarshalJSON ¶
type ShieldParamUnion ¶
type ShieldParamUnion 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:"-"`
}
ShieldParamUnion 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 (ShieldParamUnion) AsAnyArray ¶
func (u ShieldParamUnion) AsAnyArray() (v []any)
func (ShieldParamUnion) AsBool ¶
func (u ShieldParamUnion) AsBool() (v bool)
func (ShieldParamUnion) AsFloat ¶
func (u ShieldParamUnion) AsFloat() (v float64)
func (ShieldParamUnion) AsString ¶
func (u ShieldParamUnion) AsString() (v string)
func (ShieldParamUnion) RawJSON ¶
func (u ShieldParamUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ShieldParamUnion) UnmarshalJSON ¶
func (r *ShieldParamUnion) UnmarshalJSON(data []byte) error
type ShieldRegisterParams ¶
type ShieldRegisterParams struct {
// The identifier of the shield to register.
ShieldID string `json:"shield_id,required"`
// The identifier of the provider.
ProviderID param.Opt[string] `json:"provider_id,omitzero"`
// The identifier of the shield in the provider.
ProviderShieldID param.Opt[string] `json:"provider_shield_id,omitzero"`
// The parameters of the shield.
Params map[string]ShieldRegisterParamsParamUnion `json:"params,omitzero"`
// contains filtered or unexported fields
}
func (ShieldRegisterParams) MarshalJSON ¶
func (r ShieldRegisterParams) MarshalJSON() (data []byte, err error)
func (*ShieldRegisterParams) UnmarshalJSON ¶
func (r *ShieldRegisterParams) UnmarshalJSON(data []byte) error
type ShieldRegisterParamsParamUnion ¶
type ShieldRegisterParamsParamUnion 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 (ShieldRegisterParamsParamUnion) MarshalJSON ¶
func (u ShieldRegisterParamsParamUnion) MarshalJSON() ([]byte, error)
func (*ShieldRegisterParamsParamUnion) UnmarshalJSON ¶
func (u *ShieldRegisterParamsParamUnion) UnmarshalJSON(data []byte) error
type ShieldService ¶
type ShieldService struct {
Options []option.RequestOption
}
ShieldService contains methods and other services that help with interacting with the llama-stack-client API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewShieldService method instead.
func NewShieldService ¶
func NewShieldService(opts ...option.RequestOption) (r ShieldService)
NewShieldService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ShieldService) Delete
deprecated
func (r *ShieldService) Delete(ctx context.Context, identifier string, opts ...option.RequestOption) (err error)
Unregister a shield.
Deprecated: deprecated
func (*ShieldService) Get ¶
func (r *ShieldService) Get(ctx context.Context, identifier string, opts ...option.RequestOption) (res *Shield, err error)
Get a shield by its identifier.
func (*ShieldService) List ¶
func (r *ShieldService) List(ctx context.Context, opts ...option.RequestOption) (res *[]Shield, err error)
List all shields.
func (*ShieldService) Register
deprecated
func (r *ShieldService) Register(ctx context.Context, body ShieldRegisterParams, opts ...option.RequestOption) (res *Shield, err error)
Register a shield.
Deprecated: deprecated
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 ToolDef ¶
type ToolDef struct {
// Name of the tool
Name string `json:"name,required"`
// (Optional) Human-readable description of what the tool does
Description string `json:"description"`
// (Optional) JSON Schema for tool inputs (MCP inputSchema)
InputSchema map[string]ToolDefInputSchemaUnion `json:"input_schema"`
// (Optional) Additional metadata about the tool
Metadata map[string]ToolDefMetadataUnion `json:"metadata"`
// (Optional) JSON Schema for tool outputs (MCP outputSchema)
OutputSchema map[string]ToolDefOutputSchemaUnion `json:"output_schema"`
// (Optional) ID of the tool group this tool belongs to
ToolgroupID string `json:"toolgroup_id"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Name respjson.Field
Description respjson.Field
InputSchema respjson.Field
Metadata respjson.Field
OutputSchema respjson.Field
ToolgroupID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Tool definition used in runtime contexts.
func (*ToolDef) UnmarshalJSON ¶
type ToolDefInputSchemaUnion ¶
type ToolDefInputSchemaUnion 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:"-"`
}
ToolDefInputSchemaUnion 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 (ToolDefInputSchemaUnion) AsAnyArray ¶
func (u ToolDefInputSchemaUnion) AsAnyArray() (v []any)
func (ToolDefInputSchemaUnion) AsBool ¶
func (u ToolDefInputSchemaUnion) AsBool() (v bool)
func (ToolDefInputSchemaUnion) AsFloat ¶
func (u ToolDefInputSchemaUnion) AsFloat() (v float64)
func (ToolDefInputSchemaUnion) AsString ¶
func (u ToolDefInputSchemaUnion) AsString() (v string)
func (ToolDefInputSchemaUnion) RawJSON ¶
func (u ToolDefInputSchemaUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ToolDefInputSchemaUnion) UnmarshalJSON ¶
func (r *ToolDefInputSchemaUnion) UnmarshalJSON(data []byte) error
type ToolDefMetadataUnion ¶
type ToolDefMetadataUnion 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:"-"`
}
ToolDefMetadataUnion 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 (ToolDefMetadataUnion) AsAnyArray ¶
func (u ToolDefMetadataUnion) AsAnyArray() (v []any)
func (ToolDefMetadataUnion) AsBool ¶
func (u ToolDefMetadataUnion) AsBool() (v bool)
func (ToolDefMetadataUnion) AsFloat ¶
func (u ToolDefMetadataUnion) AsFloat() (v float64)
func (ToolDefMetadataUnion) AsString ¶
func (u ToolDefMetadataUnion) AsString() (v string)
func (ToolDefMetadataUnion) RawJSON ¶
func (u ToolDefMetadataUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ToolDefMetadataUnion) UnmarshalJSON ¶
func (r *ToolDefMetadataUnion) UnmarshalJSON(data []byte) error
type ToolDefOutputSchemaUnion ¶
type ToolDefOutputSchemaUnion 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:"-"`
}
ToolDefOutputSchemaUnion 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 (ToolDefOutputSchemaUnion) AsAnyArray ¶
func (u ToolDefOutputSchemaUnion) AsAnyArray() (v []any)
func (ToolDefOutputSchemaUnion) AsBool ¶
func (u ToolDefOutputSchemaUnion) AsBool() (v bool)
func (ToolDefOutputSchemaUnion) AsFloat ¶
func (u ToolDefOutputSchemaUnion) AsFloat() (v float64)
func (ToolDefOutputSchemaUnion) AsString ¶
func (u ToolDefOutputSchemaUnion) AsString() (v string)
func (ToolDefOutputSchemaUnion) RawJSON ¶
func (u ToolDefOutputSchemaUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ToolDefOutputSchemaUnion) UnmarshalJSON ¶
func (r *ToolDefOutputSchemaUnion) UnmarshalJSON(data []byte) error
type ToolGroup ¶
type ToolGroup struct {
Identifier string `json:"identifier,required"`
ProviderID string `json:"provider_id,required"`
// Type of resource, always 'tool_group'
Type constant.ToolGroup `json:"type,required"`
// (Optional) Additional arguments for the tool group
Args map[string]ToolGroupArgUnion `json:"args"`
// (Optional) Model Context Protocol endpoint for remote tools
McpEndpoint ToolGroupMcpEndpoint `json:"mcp_endpoint"`
ProviderResourceID string `json:"provider_resource_id"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Identifier respjson.Field
ProviderID respjson.Field
Type respjson.Field
Args respjson.Field
McpEndpoint respjson.Field
ProviderResourceID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A group of related tools managed together.
func (*ToolGroup) UnmarshalJSON ¶
type ToolGroupArgUnion ¶
type ToolGroupArgUnion 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:"-"`
}
ToolGroupArgUnion 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 (ToolGroupArgUnion) AsAnyArray ¶
func (u ToolGroupArgUnion) AsAnyArray() (v []any)
func (ToolGroupArgUnion) AsBool ¶
func (u ToolGroupArgUnion) AsBool() (v bool)
func (ToolGroupArgUnion) AsFloat ¶
func (u ToolGroupArgUnion) AsFloat() (v float64)
func (ToolGroupArgUnion) AsString ¶
func (u ToolGroupArgUnion) AsString() (v string)
func (ToolGroupArgUnion) RawJSON ¶
func (u ToolGroupArgUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ToolGroupArgUnion) UnmarshalJSON ¶
func (r *ToolGroupArgUnion) UnmarshalJSON(data []byte) error
type ToolGroupMcpEndpoint ¶
type ToolGroupMcpEndpoint 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:"-"`
}
(Optional) Model Context Protocol endpoint for remote tools
func (ToolGroupMcpEndpoint) RawJSON ¶
func (r ToolGroupMcpEndpoint) RawJSON() string
Returns the unmodified JSON received from the API
func (*ToolGroupMcpEndpoint) UnmarshalJSON ¶
func (r *ToolGroupMcpEndpoint) UnmarshalJSON(data []byte) error
type ToolInvocationResult ¶
type ToolInvocationResult struct {
// (Optional) The output content from the tool execution
Content InterleavedContentUnion `json:"content"`
// (Optional) Numeric error code if the tool execution failed
ErrorCode int64 `json:"error_code"`
// (Optional) Error message if the tool execution failed
ErrorMessage string `json:"error_message"`
// (Optional) Additional metadata about the tool execution
Metadata map[string]ToolInvocationResultMetadataUnion `json:"metadata"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Content respjson.Field
ErrorCode respjson.Field
ErrorMessage respjson.Field
Metadata respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Result of a tool invocation.
func (ToolInvocationResult) RawJSON ¶
func (r ToolInvocationResult) RawJSON() string
Returns the unmodified JSON received from the API
func (*ToolInvocationResult) UnmarshalJSON ¶
func (r *ToolInvocationResult) UnmarshalJSON(data []byte) error
type ToolInvocationResultMetadataUnion ¶
type ToolInvocationResultMetadataUnion 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:"-"`
}
ToolInvocationResultMetadataUnion 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 (ToolInvocationResultMetadataUnion) AsAnyArray ¶
func (u ToolInvocationResultMetadataUnion) AsAnyArray() (v []any)
func (ToolInvocationResultMetadataUnion) AsBool ¶
func (u ToolInvocationResultMetadataUnion) AsBool() (v bool)
func (ToolInvocationResultMetadataUnion) AsFloat ¶
func (u ToolInvocationResultMetadataUnion) AsFloat() (v float64)
func (ToolInvocationResultMetadataUnion) AsString ¶
func (u ToolInvocationResultMetadataUnion) AsString() (v string)
func (ToolInvocationResultMetadataUnion) RawJSON ¶
func (u ToolInvocationResultMetadataUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ToolInvocationResultMetadataUnion) UnmarshalJSON ¶
func (r *ToolInvocationResultMetadataUnion) UnmarshalJSON(data []byte) error
type ToolListParams ¶
type ToolListParams struct {
// The ID of the tool group to list tools for.
ToolgroupID param.Opt[string] `query:"toolgroup_id,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (ToolListParams) URLQuery ¶
func (r ToolListParams) URLQuery() (v url.Values, err error)
URLQuery serializes ToolListParams's query parameters as `url.Values`.
type ToolListResponseEnvelope ¶
type ToolListResponseEnvelope struct {
// List of tool definitions
Data []ToolDef `json:"data,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Response containing a list of tool definitions.
func (ToolListResponseEnvelope) RawJSON ¶
func (r ToolListResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*ToolListResponseEnvelope) UnmarshalJSON ¶
func (r *ToolListResponseEnvelope) UnmarshalJSON(data []byte) error
type ToolRuntimeInvokeToolParams ¶
type ToolRuntimeInvokeToolParams struct {
// A dictionary of arguments to pass to the tool.
Kwargs map[string]ToolRuntimeInvokeToolParamsKwargUnion `json:"kwargs,omitzero,required"`
// The name of the tool to invoke.
ToolName string `json:"tool_name,required"`
// (Optional) OAuth access token for authenticating with the MCP server.
Authorization param.Opt[string] `json:"authorization,omitzero"`
// contains filtered or unexported fields
}
func (ToolRuntimeInvokeToolParams) MarshalJSON ¶
func (r ToolRuntimeInvokeToolParams) MarshalJSON() (data []byte, err error)
func (*ToolRuntimeInvokeToolParams) UnmarshalJSON ¶
func (r *ToolRuntimeInvokeToolParams) UnmarshalJSON(data []byte) error
type ToolRuntimeInvokeToolParamsKwargUnion ¶
type ToolRuntimeInvokeToolParamsKwargUnion 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 (ToolRuntimeInvokeToolParamsKwargUnion) MarshalJSON ¶
func (u ToolRuntimeInvokeToolParamsKwargUnion) MarshalJSON() ([]byte, error)
func (*ToolRuntimeInvokeToolParamsKwargUnion) UnmarshalJSON ¶
func (u *ToolRuntimeInvokeToolParamsKwargUnion) UnmarshalJSON(data []byte) error
type ToolRuntimeListToolsParams ¶
type ToolRuntimeListToolsParams struct {
// (Optional) OAuth access token for authenticating with the MCP server.
Authorization param.Opt[string] `query:"authorization,omitzero" json:"-"`
// The ID of the tool group to list tools for.
ToolGroupID param.Opt[string] `query:"tool_group_id,omitzero" json:"-"`
// The MCP endpoint to use for the tool group.
McpEndpoint ToolRuntimeListToolsParamsMcpEndpoint `query:"mcp_endpoint,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (ToolRuntimeListToolsParams) URLQuery ¶
func (r ToolRuntimeListToolsParams) URLQuery() (v url.Values, err error)
URLQuery serializes ToolRuntimeListToolsParams's query parameters as `url.Values`.
type ToolRuntimeListToolsParamsMcpEndpoint ¶
type ToolRuntimeListToolsParamsMcpEndpoint struct {
// The URL string pointing to the resource
Uri string `query:"uri,required" json:"-"`
// contains filtered or unexported fields
}
The MCP endpoint to use for the tool group.
The property Uri is required.
func (ToolRuntimeListToolsParamsMcpEndpoint) URLQuery ¶
func (r ToolRuntimeListToolsParamsMcpEndpoint) URLQuery() (v url.Values, err error)
URLQuery serializes ToolRuntimeListToolsParamsMcpEndpoint's query parameters as `url.Values`.
type ToolRuntimeListToolsResponseEnvelope ¶
type ToolRuntimeListToolsResponseEnvelope struct {
// List of tool definitions
Data []ToolDef `json:"data,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Response containing a list of tool definitions.
func (ToolRuntimeListToolsResponseEnvelope) RawJSON ¶
func (r ToolRuntimeListToolsResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*ToolRuntimeListToolsResponseEnvelope) UnmarshalJSON ¶
func (r *ToolRuntimeListToolsResponseEnvelope) UnmarshalJSON(data []byte) error
type ToolRuntimeRagToolService ¶
type ToolRuntimeRagToolService struct {
Options []option.RequestOption
}
ToolRuntimeRagToolService contains methods and other services that help with interacting with the llama-stack-client API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewToolRuntimeRagToolService method instead.
func NewToolRuntimeRagToolService ¶
func NewToolRuntimeRagToolService(opts ...option.RequestOption) (r ToolRuntimeRagToolService)
NewToolRuntimeRagToolService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
type ToolRuntimeService ¶
type ToolRuntimeService struct {
Options []option.RequestOption
RagTool ToolRuntimeRagToolService
}
ToolRuntimeService contains methods and other services that help with interacting with the llama-stack-client API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewToolRuntimeService method instead.
func NewToolRuntimeService ¶
func NewToolRuntimeService(opts ...option.RequestOption) (r ToolRuntimeService)
NewToolRuntimeService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ToolRuntimeService) InvokeTool ¶
func (r *ToolRuntimeService) InvokeTool(ctx context.Context, body ToolRuntimeInvokeToolParams, opts ...option.RequestOption) (res *ToolInvocationResult, err error)
Run a tool with the given arguments.
func (*ToolRuntimeService) ListTools ¶
func (r *ToolRuntimeService) ListTools(ctx context.Context, query ToolRuntimeListToolsParams, opts ...option.RequestOption) (res *[]ToolDef, err error)
List all tools in the runtime.
type ToolService ¶
type ToolService struct {
Options []option.RequestOption
}
ToolService contains methods and other services that help with interacting with the llama-stack-client API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewToolService method instead.
func NewToolService ¶
func NewToolService(opts ...option.RequestOption) (r ToolService)
NewToolService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ToolService) Get ¶
func (r *ToolService) Get(ctx context.Context, toolName string, opts ...option.RequestOption) (res *ToolDef, err error)
Get a tool by its name.
func (*ToolService) List ¶
func (r *ToolService) List(ctx context.Context, query ToolListParams, opts ...option.RequestOption) (res *[]ToolDef, err error)
List tools with optional tool group.
type ToolgroupRegisterParams ¶
type ToolgroupRegisterParams struct {
// The ID of the provider to use for the tool group.
ProviderID string `json:"provider_id,required"`
// The ID of the tool group to register.
ToolgroupID string `json:"toolgroup_id,required"`
// A dictionary of arguments to pass to the tool group.
Args map[string]ToolgroupRegisterParamsArgUnion `json:"args,omitzero"`
// The MCP endpoint to use for the tool group.
McpEndpoint ToolgroupRegisterParamsMcpEndpoint `json:"mcp_endpoint,omitzero"`
// contains filtered or unexported fields
}
func (ToolgroupRegisterParams) MarshalJSON ¶
func (r ToolgroupRegisterParams) MarshalJSON() (data []byte, err error)
func (*ToolgroupRegisterParams) UnmarshalJSON ¶
func (r *ToolgroupRegisterParams) UnmarshalJSON(data []byte) error
type ToolgroupRegisterParamsArgUnion ¶
type ToolgroupRegisterParamsArgUnion 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 (ToolgroupRegisterParamsArgUnion) MarshalJSON ¶
func (u ToolgroupRegisterParamsArgUnion) MarshalJSON() ([]byte, error)
func (*ToolgroupRegisterParamsArgUnion) UnmarshalJSON ¶
func (u *ToolgroupRegisterParamsArgUnion) UnmarshalJSON(data []byte) error
type ToolgroupRegisterParamsMcpEndpoint ¶
type ToolgroupRegisterParamsMcpEndpoint struct {
// The URL string pointing to the resource
Uri string `json:"uri,required"`
// contains filtered or unexported fields
}
The MCP endpoint to use for the tool group.
The property Uri is required.
func (ToolgroupRegisterParamsMcpEndpoint) MarshalJSON ¶
func (r ToolgroupRegisterParamsMcpEndpoint) MarshalJSON() (data []byte, err error)
func (*ToolgroupRegisterParamsMcpEndpoint) UnmarshalJSON ¶
func (r *ToolgroupRegisterParamsMcpEndpoint) UnmarshalJSON(data []byte) error
type ToolgroupService ¶
type ToolgroupService struct {
Options []option.RequestOption
}
ToolgroupService contains methods and other services that help with interacting with the llama-stack-client API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewToolgroupService method instead.
func NewToolgroupService ¶
func NewToolgroupService(opts ...option.RequestOption) (r ToolgroupService)
NewToolgroupService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ToolgroupService) Get ¶
func (r *ToolgroupService) Get(ctx context.Context, toolgroupID string, opts ...option.RequestOption) (res *ToolGroup, err error)
Get a tool group by its ID.
func (*ToolgroupService) List ¶
func (r *ToolgroupService) List(ctx context.Context, opts ...option.RequestOption) (res *[]ToolGroup, err error)
List tool groups with optional provider.
func (*ToolgroupService) Register
deprecated
func (r *ToolgroupService) Register(ctx context.Context, body ToolgroupRegisterParams, opts ...option.RequestOption) (err error)
Register a tool group.
Deprecated: deprecated
func (*ToolgroupService) Unregister
deprecated
func (r *ToolgroupService) Unregister(ctx context.Context, toolgroupID string, opts ...option.RequestOption) (err error)
Unregister a tool group.
Deprecated: deprecated
type VectorIoInsertParams ¶
type VectorIoInsertParams struct {
// The chunks to insert. Each `Chunk` should contain content which can be
// interleaved text, images, or other types. `metadata`: `dict[str, Any]` and
// `embedding`: `List[float]` are optional. If `metadata` is provided, you
// configure how Llama Stack formats the chunk during generation. If `embedding` is
// not provided, it will be computed later.
Chunks []VectorIoInsertParamsChunk `json:"chunks,omitzero,required"`
// The identifier of the vector database to insert the chunks into.
VectorStoreID string `json:"vector_store_id,required"`
// The time to live of the chunks.
TtlSeconds param.Opt[int64] `json:"ttl_seconds,omitzero"`
// contains filtered or unexported fields
}
func (VectorIoInsertParams) MarshalJSON ¶
func (r VectorIoInsertParams) MarshalJSON() (data []byte, err error)
func (*VectorIoInsertParams) UnmarshalJSON ¶
func (r *VectorIoInsertParams) UnmarshalJSON(data []byte) error
type VectorIoInsertParamsChunk ¶
type VectorIoInsertParamsChunk struct {
// Unique identifier for the chunk. Must be provided explicitly.
ChunkID string `json:"chunk_id,required"`
// The content of the chunk, which can be interleaved text, images, or other types.
Content InterleavedContentUnionParam `json:"content,omitzero,required"`
// Metadata associated with the chunk that will be used in the model context during
// inference.
Metadata map[string]VectorIoInsertParamsChunkMetadataUnion `json:"metadata,omitzero,required"`
// Metadata for the chunk that will NOT be used in the context during inference.
// The `chunk_metadata` is required backend functionality.
ChunkMetadata VectorIoInsertParamsChunkChunkMetadata `json:"chunk_metadata,omitzero"`
// Optional embedding for the chunk. If not provided, it will be computed later.
Embedding []float64 `json:"embedding,omitzero"`
// contains filtered or unexported fields
}
A chunk of content that can be inserted into a vector database.
The properties ChunkID, Content, Metadata are required.
func (VectorIoInsertParamsChunk) MarshalJSON ¶
func (r VectorIoInsertParamsChunk) MarshalJSON() (data []byte, err error)
func (*VectorIoInsertParamsChunk) UnmarshalJSON ¶
func (r *VectorIoInsertParamsChunk) UnmarshalJSON(data []byte) error
type VectorIoInsertParamsChunkChunkMetadata ¶
type VectorIoInsertParamsChunkChunkMetadata struct {
// The dimension of the embedding vector for the chunk.
ChunkEmbeddingDimension param.Opt[int64] `json:"chunk_embedding_dimension,omitzero"`
// The embedding model used to create the chunk's embedding.
ChunkEmbeddingModel param.Opt[string] `json:"chunk_embedding_model,omitzero"`
// The ID of the chunk. If not set, it will be generated based on the document ID
// and content.
ChunkID param.Opt[string] `json:"chunk_id,omitzero"`
// The tokenizer used to create the chunk. Default is Tiktoken.
ChunkTokenizer param.Opt[string] `json:"chunk_tokenizer,omitzero"`
// The window of the chunk, which can be used to group related chunks together.
ChunkWindow param.Opt[string] `json:"chunk_window,omitzero"`
// The number of tokens in the content of the chunk.
ContentTokenCount param.Opt[int64] `json:"content_token_count,omitzero"`
// An optional timestamp indicating when the chunk was created.
CreatedTimestamp param.Opt[int64] `json:"created_timestamp,omitzero"`
// The ID of the document this chunk belongs to.
DocumentID param.Opt[string] `json:"document_id,omitzero"`
// The number of tokens in the metadata of the chunk.
MetadataTokenCount param.Opt[int64] `json:"metadata_token_count,omitzero"`
// The source of the content, such as a URL, file path, or other identifier.
Source param.Opt[string] `json:"source,omitzero"`
// An optional timestamp indicating when the chunk was last updated.
UpdatedTimestamp param.Opt[int64] `json:"updated_timestamp,omitzero"`
// contains filtered or unexported fields
}
Metadata for the chunk that will NOT be used in the context during inference. The `chunk_metadata` is required backend functionality.
func (VectorIoInsertParamsChunkChunkMetadata) MarshalJSON ¶
func (r VectorIoInsertParamsChunkChunkMetadata) MarshalJSON() (data []byte, err error)
func (*VectorIoInsertParamsChunkChunkMetadata) UnmarshalJSON ¶
func (r *VectorIoInsertParamsChunkChunkMetadata) UnmarshalJSON(data []byte) error
type VectorIoInsertParamsChunkMetadataUnion ¶
type VectorIoInsertParamsChunkMetadataUnion 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 (VectorIoInsertParamsChunkMetadataUnion) MarshalJSON ¶
func (u VectorIoInsertParamsChunkMetadataUnion) MarshalJSON() ([]byte, error)
func (*VectorIoInsertParamsChunkMetadataUnion) UnmarshalJSON ¶
func (u *VectorIoInsertParamsChunkMetadataUnion) UnmarshalJSON(data []byte) error
type VectorIoQueryParams ¶
type VectorIoQueryParams struct {
// The query to search for.
Query InterleavedContentUnionParam `json:"query,omitzero,required"`
// The identifier of the vector database to query.
VectorStoreID string `json:"vector_store_id,required"`
// The parameters of the query.
Params map[string]VectorIoQueryParamsParamUnion `json:"params,omitzero"`
// contains filtered or unexported fields
}
func (VectorIoQueryParams) MarshalJSON ¶
func (r VectorIoQueryParams) MarshalJSON() (data []byte, err error)
func (*VectorIoQueryParams) UnmarshalJSON ¶
func (r *VectorIoQueryParams) UnmarshalJSON(data []byte) error
type VectorIoQueryParamsParamUnion ¶
type VectorIoQueryParamsParamUnion 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 (VectorIoQueryParamsParamUnion) MarshalJSON ¶
func (u VectorIoQueryParamsParamUnion) MarshalJSON() ([]byte, error)
func (*VectorIoQueryParamsParamUnion) UnmarshalJSON ¶
func (u *VectorIoQueryParamsParamUnion) UnmarshalJSON(data []byte) error
type VectorIoService ¶
type VectorIoService struct {
Options []option.RequestOption
}
VectorIoService contains methods and other services that help with interacting with the llama-stack-client API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewVectorIoService method instead.
func NewVectorIoService ¶
func NewVectorIoService(opts ...option.RequestOption) (r VectorIoService)
NewVectorIoService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*VectorIoService) Insert ¶
func (r *VectorIoService) Insert(ctx context.Context, body VectorIoInsertParams, opts ...option.RequestOption) (err error)
Insert chunks into a vector database.
func (*VectorIoService) Query ¶
func (r *VectorIoService) Query(ctx context.Context, body VectorIoQueryParams, opts ...option.RequestOption) (res *QueryChunksResponse, err error)
Query chunks from a vector database.
type VectorStore ¶
type VectorStore struct {
// Unique identifier for the vector store
ID string `json:"id,required"`
// Timestamp when the vector store was created
CreatedAt int64 `json:"created_at,required"`
// File processing status counts for the vector store
FileCounts VectorStoreFileCounts `json:"file_counts,required"`
// Set of key-value pairs that can be attached to the vector store
Metadata map[string]VectorStoreMetadataUnion `json:"metadata,required"`
// Object type identifier, always "vector_store"
Object string `json:"object,required"`
// Current status of the vector store
Status string `json:"status,required"`
// Storage space used by the vector store in bytes
UsageBytes int64 `json:"usage_bytes,required"`
// (Optional) Expiration policy for the vector store
ExpiresAfter map[string]VectorStoreExpiresAfterUnion `json:"expires_after"`
// (Optional) Timestamp when the vector store will expire
ExpiresAt int64 `json:"expires_at"`
// (Optional) Timestamp of last activity on the vector store
LastActiveAt int64 `json:"last_active_at"`
// (Optional) Name of the vector store
Name string `json:"name"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
FileCounts respjson.Field
Metadata respjson.Field
Object respjson.Field
Status respjson.Field
UsageBytes respjson.Field
ExpiresAfter respjson.Field
ExpiresAt respjson.Field
LastActiveAt respjson.Field
Name respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
OpenAI Vector Store object.
func (VectorStore) RawJSON ¶
func (r VectorStore) RawJSON() string
Returns the unmodified JSON received from the API
func (*VectorStore) UnmarshalJSON ¶
func (r *VectorStore) UnmarshalJSON(data []byte) error
type VectorStoreDeleteResponse ¶
type VectorStoreDeleteResponse struct {
// Unique identifier of the deleted vector store
ID string `json:"id,required"`
// Whether the deletion operation was successful
Deleted bool `json:"deleted,required"`
// Object type identifier for the deletion response
Object string `json:"object,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Deleted respjson.Field
Object respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Response from deleting a vector store.
func (VectorStoreDeleteResponse) RawJSON ¶
func (r VectorStoreDeleteResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*VectorStoreDeleteResponse) UnmarshalJSON ¶
func (r *VectorStoreDeleteResponse) UnmarshalJSON(data []byte) error
type VectorStoreExpiresAfterUnion ¶
type VectorStoreExpiresAfterUnion 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:"-"`
}
VectorStoreExpiresAfterUnion 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 (VectorStoreExpiresAfterUnion) AsAnyArray ¶
func (u VectorStoreExpiresAfterUnion) AsAnyArray() (v []any)
func (VectorStoreExpiresAfterUnion) AsBool ¶
func (u VectorStoreExpiresAfterUnion) AsBool() (v bool)
func (VectorStoreExpiresAfterUnion) AsFloat ¶
func (u VectorStoreExpiresAfterUnion) AsFloat() (v float64)
func (VectorStoreExpiresAfterUnion) AsString ¶
func (u VectorStoreExpiresAfterUnion) AsString() (v string)
func (VectorStoreExpiresAfterUnion) RawJSON ¶
func (u VectorStoreExpiresAfterUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*VectorStoreExpiresAfterUnion) UnmarshalJSON ¶
func (r *VectorStoreExpiresAfterUnion) UnmarshalJSON(data []byte) error
type VectorStoreFile ¶
type VectorStoreFile struct {
// Unique identifier for the file
ID string `json:"id,required"`
// Key-value attributes associated with the file
Attributes map[string]VectorStoreFileAttributeUnion `json:"attributes,required"`
// Strategy used for splitting the file into chunks
ChunkingStrategy VectorStoreFileChunkingStrategyUnion `json:"chunking_strategy,required"`
// Timestamp when the file was added to the vector store
CreatedAt int64 `json:"created_at,required"`
// Object type identifier, always "vector_store.file"
Object string `json:"object,required"`
// Current processing status of the file
//
// Any of "completed", "in_progress", "cancelled", "failed".
Status VectorStoreFileStatus `json:"status,required"`
// Storage space used by this file in bytes
UsageBytes int64 `json:"usage_bytes,required"`
// ID of the vector store containing this file
VectorStoreID string `json:"vector_store_id,required"`
// (Optional) Error information if file processing failed
LastError VectorStoreFileLastError `json:"last_error"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Attributes respjson.Field
ChunkingStrategy respjson.Field
CreatedAt respjson.Field
Object respjson.Field
Status respjson.Field
UsageBytes respjson.Field
VectorStoreID respjson.Field
LastError respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
OpenAI Vector Store File object.
func (VectorStoreFile) RawJSON ¶
func (r VectorStoreFile) RawJSON() string
Returns the unmodified JSON received from the API
func (*VectorStoreFile) UnmarshalJSON ¶
func (r *VectorStoreFile) UnmarshalJSON(data []byte) error
type VectorStoreFileAttributeUnion ¶
type VectorStoreFileAttributeUnion 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:"-"`
}
VectorStoreFileAttributeUnion 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 (VectorStoreFileAttributeUnion) AsAnyArray ¶
func (u VectorStoreFileAttributeUnion) AsAnyArray() (v []any)
func (VectorStoreFileAttributeUnion) AsBool ¶
func (u VectorStoreFileAttributeUnion) AsBool() (v bool)
func (VectorStoreFileAttributeUnion) AsFloat ¶
func (u VectorStoreFileAttributeUnion) AsFloat() (v float64)
func (VectorStoreFileAttributeUnion) AsString ¶
func (u VectorStoreFileAttributeUnion) AsString() (v string)
func (VectorStoreFileAttributeUnion) RawJSON ¶
func (u VectorStoreFileAttributeUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*VectorStoreFileAttributeUnion) UnmarshalJSON ¶
func (r *VectorStoreFileAttributeUnion) UnmarshalJSON(data []byte) error
type VectorStoreFileBatchCancelParams ¶
type VectorStoreFileBatchCancelParams struct {
VectorStoreID string `path:"vector_store_id,required" json:"-"`
// contains filtered or unexported fields
}
type VectorStoreFileBatchGetParams ¶
type VectorStoreFileBatchGetParams struct {
VectorStoreID string `path:"vector_store_id,required" json:"-"`
// contains filtered or unexported fields
}
type VectorStoreFileBatchListFilesParams ¶
type VectorStoreFileBatchListFilesParams struct {
VectorStoreID string `path:"vector_store_id,required" json:"-"`
// A cursor for use in pagination. `after` is an object ID that defines your place
// in the list.
After param.Opt[string] `query:"after,omitzero" json:"-"`
// A cursor for use in pagination. `before` is an object ID that defines your place
// in the list.
Before param.Opt[string] `query:"before,omitzero" json:"-"`
// Filter by file status. One of in_progress, completed, failed, cancelled.
Filter param.Opt[string] `query:"filter,omitzero" json:"-"`
// A limit on the number of objects to be returned. Limit can range between 1 and
// 100, and the default is 20.
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Sort order by the `created_at` timestamp of the objects. `asc` for ascending
// order and `desc` for descending order.
Order param.Opt[string] `query:"order,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (VectorStoreFileBatchListFilesParams) URLQuery ¶
func (r VectorStoreFileBatchListFilesParams) URLQuery() (v url.Values, err error)
URLQuery serializes VectorStoreFileBatchListFilesParams's query parameters as `url.Values`.
type VectorStoreFileBatchNewParams ¶
type VectorStoreFileBatchNewParams struct {
// A list of File IDs that the vector store should use
FileIDs []string `json:"file_ids,omitzero,required"`
// (Optional) Key-value attributes to store with the files
Attributes map[string]VectorStoreFileBatchNewParamsAttributeUnion `json:"attributes,omitzero"`
// (Optional) The chunking strategy used to chunk the file(s). Defaults to auto
ChunkingStrategy VectorStoreFileBatchNewParamsChunkingStrategyUnion `json:"chunking_strategy,omitzero"`
// contains filtered or unexported fields
}
func (VectorStoreFileBatchNewParams) MarshalJSON ¶
func (r VectorStoreFileBatchNewParams) MarshalJSON() (data []byte, err error)
func (*VectorStoreFileBatchNewParams) UnmarshalJSON ¶
func (r *VectorStoreFileBatchNewParams) UnmarshalJSON(data []byte) error
type VectorStoreFileBatchNewParamsAttributeUnion ¶
type VectorStoreFileBatchNewParamsAttributeUnion 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 (VectorStoreFileBatchNewParamsAttributeUnion) MarshalJSON ¶
func (u VectorStoreFileBatchNewParamsAttributeUnion) MarshalJSON() ([]byte, error)
func (*VectorStoreFileBatchNewParamsAttributeUnion) UnmarshalJSON ¶
func (u *VectorStoreFileBatchNewParamsAttributeUnion) UnmarshalJSON(data []byte) error
type VectorStoreFileBatchNewParamsChunkingStrategyAuto ¶
type VectorStoreFileBatchNewParamsChunkingStrategyAuto struct {
// Strategy type, always "auto" for automatic chunking
Type constant.Auto `json:"type,required"`
// contains filtered or unexported fields
}
Automatic chunking strategy for vector store files.
This struct has a constant value, construct it with NewVectorStoreFileBatchNewParamsChunkingStrategyAuto.
func NewVectorStoreFileBatchNewParamsChunkingStrategyAuto ¶
func NewVectorStoreFileBatchNewParamsChunkingStrategyAuto() VectorStoreFileBatchNewParamsChunkingStrategyAuto
func (VectorStoreFileBatchNewParamsChunkingStrategyAuto) MarshalJSON ¶
func (r VectorStoreFileBatchNewParamsChunkingStrategyAuto) MarshalJSON() (data []byte, err error)
func (*VectorStoreFileBatchNewParamsChunkingStrategyAuto) UnmarshalJSON ¶
func (r *VectorStoreFileBatchNewParamsChunkingStrategyAuto) UnmarshalJSON(data []byte) error
type VectorStoreFileBatchNewParamsChunkingStrategyStatic ¶
type VectorStoreFileBatchNewParamsChunkingStrategyStatic struct {
// Configuration parameters for the static chunking strategy
Static VectorStoreFileBatchNewParamsChunkingStrategyStaticStatic `json:"static,omitzero,required"`
// Strategy type, always "static" for static chunking
//
// This field can be elided, and will marshal its zero value as "static".
Type constant.Static `json:"type,required"`
// contains filtered or unexported fields
}
Static chunking strategy with configurable parameters.
The properties Static, Type are required.
func (VectorStoreFileBatchNewParamsChunkingStrategyStatic) MarshalJSON ¶
func (r VectorStoreFileBatchNewParamsChunkingStrategyStatic) MarshalJSON() (data []byte, err error)
func (*VectorStoreFileBatchNewParamsChunkingStrategyStatic) UnmarshalJSON ¶
func (r *VectorStoreFileBatchNewParamsChunkingStrategyStatic) UnmarshalJSON(data []byte) error
type VectorStoreFileBatchNewParamsChunkingStrategyStaticStatic ¶
type VectorStoreFileBatchNewParamsChunkingStrategyStaticStatic struct {
// Number of tokens to overlap between adjacent chunks
ChunkOverlapTokens int64 `json:"chunk_overlap_tokens,required"`
// Maximum number of tokens per chunk, must be between 100 and 4096
MaxChunkSizeTokens int64 `json:"max_chunk_size_tokens,required"`
// contains filtered or unexported fields
}
Configuration parameters for the static chunking strategy
The properties ChunkOverlapTokens, MaxChunkSizeTokens are required.
func (VectorStoreFileBatchNewParamsChunkingStrategyStaticStatic) MarshalJSON ¶
func (r VectorStoreFileBatchNewParamsChunkingStrategyStaticStatic) MarshalJSON() (data []byte, err error)
func (*VectorStoreFileBatchNewParamsChunkingStrategyStaticStatic) UnmarshalJSON ¶
func (r *VectorStoreFileBatchNewParamsChunkingStrategyStaticStatic) UnmarshalJSON(data []byte) error
type VectorStoreFileBatchNewParamsChunkingStrategyUnion ¶
type VectorStoreFileBatchNewParamsChunkingStrategyUnion struct {
OfAuto *VectorStoreFileBatchNewParamsChunkingStrategyAuto `json:",omitzero,inline"`
OfStatic *VectorStoreFileBatchNewParamsChunkingStrategyStatic `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 (VectorStoreFileBatchNewParamsChunkingStrategyUnion) GetStatic ¶
func (u VectorStoreFileBatchNewParamsChunkingStrategyUnion) GetStatic() *VectorStoreFileBatchNewParamsChunkingStrategyStaticStatic
Returns a pointer to the underlying variant's property, if present.
func (VectorStoreFileBatchNewParamsChunkingStrategyUnion) GetType ¶
func (u VectorStoreFileBatchNewParamsChunkingStrategyUnion) GetType() *string
Returns a pointer to the underlying variant's property, if present.
func (VectorStoreFileBatchNewParamsChunkingStrategyUnion) MarshalJSON ¶
func (u VectorStoreFileBatchNewParamsChunkingStrategyUnion) MarshalJSON() ([]byte, error)
func (*VectorStoreFileBatchNewParamsChunkingStrategyUnion) UnmarshalJSON ¶
func (u *VectorStoreFileBatchNewParamsChunkingStrategyUnion) UnmarshalJSON(data []byte) error
type VectorStoreFileBatchService ¶
type VectorStoreFileBatchService struct {
Options []option.RequestOption
}
VectorStoreFileBatchService contains methods and other services that help with interacting with the llama-stack-client API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewVectorStoreFileBatchService method instead.
func NewVectorStoreFileBatchService ¶
func NewVectorStoreFileBatchService(opts ...option.RequestOption) (r VectorStoreFileBatchService)
NewVectorStoreFileBatchService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*VectorStoreFileBatchService) Cancel ¶
func (r *VectorStoreFileBatchService) Cancel(ctx context.Context, batchID string, body VectorStoreFileBatchCancelParams, opts ...option.RequestOption) (res *VectorStoreFileBatches, err error)
Cancels a vector store file batch.
func (*VectorStoreFileBatchService) Get ¶
func (r *VectorStoreFileBatchService) Get(ctx context.Context, batchID string, query VectorStoreFileBatchGetParams, opts ...option.RequestOption) (res *VectorStoreFileBatches, err error)
Retrieve a vector store file batch.
func (*VectorStoreFileBatchService) ListFiles ¶
func (r *VectorStoreFileBatchService) ListFiles(ctx context.Context, batchID string, params VectorStoreFileBatchListFilesParams, opts ...option.RequestOption) (res *pagination.OpenAICursorPage[VectorStoreFile], err error)
Returns a list of vector store files in a batch.
func (*VectorStoreFileBatchService) ListFilesAutoPaging ¶
func (r *VectorStoreFileBatchService) ListFilesAutoPaging(ctx context.Context, batchID string, params VectorStoreFileBatchListFilesParams, opts ...option.RequestOption) *pagination.OpenAICursorPageAutoPager[VectorStoreFile]
Returns a list of vector store files in a batch.
func (*VectorStoreFileBatchService) New ¶
func (r *VectorStoreFileBatchService) New(ctx context.Context, vectorStoreID string, body VectorStoreFileBatchNewParams, opts ...option.RequestOption) (res *VectorStoreFileBatches, err error)
Create a vector store file batch. Generate an OpenAI-compatible vector store file batch for the given vector store.
type VectorStoreFileBatches ¶
type VectorStoreFileBatches struct {
// Unique identifier for the file batch
ID string `json:"id,required"`
// Timestamp when the file batch was created
CreatedAt int64 `json:"created_at,required"`
// File processing status counts for the batch
FileCounts VectorStoreFileBatchesFileCounts `json:"file_counts,required"`
// Object type identifier, always "vector_store.file_batch"
Object string `json:"object,required"`
// Current processing status of the file batch
//
// Any of "completed", "in_progress", "cancelled", "failed".
Status VectorStoreFileBatchesStatus `json:"status,required"`
// ID of the vector store containing the file batch
VectorStoreID string `json:"vector_store_id,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
FileCounts respjson.Field
Object respjson.Field
Status respjson.Field
VectorStoreID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
OpenAI Vector Store File Batch object.
func (VectorStoreFileBatches) RawJSON ¶
func (r VectorStoreFileBatches) RawJSON() string
Returns the unmodified JSON received from the API
func (*VectorStoreFileBatches) UnmarshalJSON ¶
func (r *VectorStoreFileBatches) UnmarshalJSON(data []byte) error
type VectorStoreFileBatchesFileCounts ¶
type VectorStoreFileBatchesFileCounts struct {
// Number of files that had their processing cancelled
Cancelled int64 `json:"cancelled,required"`
// Number of files that have been successfully processed
Completed int64 `json:"completed,required"`
// Number of files that failed to process
Failed int64 `json:"failed,required"`
// Number of files currently being processed
InProgress int64 `json:"in_progress,required"`
// Total number of files in the vector store
Total int64 `json:"total,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Cancelled respjson.Field
Completed respjson.Field
Failed respjson.Field
InProgress respjson.Field
Total respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
File processing status counts for the batch
func (VectorStoreFileBatchesFileCounts) RawJSON ¶
func (r VectorStoreFileBatchesFileCounts) RawJSON() string
Returns the unmodified JSON received from the API
func (*VectorStoreFileBatchesFileCounts) UnmarshalJSON ¶
func (r *VectorStoreFileBatchesFileCounts) UnmarshalJSON(data []byte) error
type VectorStoreFileBatchesStatus ¶
type VectorStoreFileBatchesStatus string
Current processing status of the file batch
const ( VectorStoreFileBatchesStatusCompleted VectorStoreFileBatchesStatus = "completed" VectorStoreFileBatchesStatusInProgress VectorStoreFileBatchesStatus = "in_progress" VectorStoreFileBatchesStatusCancelled VectorStoreFileBatchesStatus = "cancelled" VectorStoreFileBatchesStatusFailed VectorStoreFileBatchesStatus = "failed" )
type VectorStoreFileChunkingStrategyAuto ¶
type VectorStoreFileChunkingStrategyAuto struct {
// Strategy type, always "auto" for automatic chunking
Type constant.Auto `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:"-"`
}
Automatic chunking strategy for vector store files.
func (VectorStoreFileChunkingStrategyAuto) RawJSON ¶
func (r VectorStoreFileChunkingStrategyAuto) RawJSON() string
Returns the unmodified JSON received from the API
func (*VectorStoreFileChunkingStrategyAuto) UnmarshalJSON ¶
func (r *VectorStoreFileChunkingStrategyAuto) UnmarshalJSON(data []byte) error
type VectorStoreFileChunkingStrategyStatic ¶
type VectorStoreFileChunkingStrategyStatic struct {
// Configuration parameters for the static chunking strategy
Static VectorStoreFileChunkingStrategyStaticStatic `json:"static,required"`
// Strategy type, always "static" for static chunking
Type constant.Static `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Static respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Static chunking strategy with configurable parameters.
func (VectorStoreFileChunkingStrategyStatic) RawJSON ¶
func (r VectorStoreFileChunkingStrategyStatic) RawJSON() string
Returns the unmodified JSON received from the API
func (*VectorStoreFileChunkingStrategyStatic) UnmarshalJSON ¶
func (r *VectorStoreFileChunkingStrategyStatic) UnmarshalJSON(data []byte) error
type VectorStoreFileChunkingStrategyStaticStatic ¶
type VectorStoreFileChunkingStrategyStaticStatic struct {
// Number of tokens to overlap between adjacent chunks
ChunkOverlapTokens int64 `json:"chunk_overlap_tokens,required"`
// Maximum number of tokens per chunk, must be between 100 and 4096
MaxChunkSizeTokens int64 `json:"max_chunk_size_tokens,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ChunkOverlapTokens respjson.Field
MaxChunkSizeTokens respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Configuration parameters for the static chunking strategy
func (VectorStoreFileChunkingStrategyStaticStatic) RawJSON ¶
func (r VectorStoreFileChunkingStrategyStaticStatic) RawJSON() string
Returns the unmodified JSON received from the API
func (*VectorStoreFileChunkingStrategyStaticStatic) UnmarshalJSON ¶
func (r *VectorStoreFileChunkingStrategyStaticStatic) UnmarshalJSON(data []byte) error
type VectorStoreFileChunkingStrategyUnion ¶
type VectorStoreFileChunkingStrategyUnion struct {
// Any of "auto", "static".
Type string `json:"type"`
// This field is from variant [VectorStoreFileChunkingStrategyStatic].
Static VectorStoreFileChunkingStrategyStaticStatic `json:"static"`
JSON struct {
Type respjson.Field
Static respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
VectorStoreFileChunkingStrategyUnion contains all possible properties and values from VectorStoreFileChunkingStrategyAuto, VectorStoreFileChunkingStrategyStatic.
Use the VectorStoreFileChunkingStrategyUnion.AsAny method to switch on the variant.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (VectorStoreFileChunkingStrategyUnion) AsAny ¶
func (u VectorStoreFileChunkingStrategyUnion) AsAny() anyVectorStoreFileChunkingStrategy
Use the following switch statement to find the correct variant
switch variant := VectorStoreFileChunkingStrategyUnion.AsAny().(type) {
case llamastackclient.VectorStoreFileChunkingStrategyAuto:
case llamastackclient.VectorStoreFileChunkingStrategyStatic:
default:
fmt.Errorf("no variant present")
}
func (VectorStoreFileChunkingStrategyUnion) AsAuto ¶
func (u VectorStoreFileChunkingStrategyUnion) AsAuto() (v VectorStoreFileChunkingStrategyAuto)
func (VectorStoreFileChunkingStrategyUnion) AsStatic ¶
func (u VectorStoreFileChunkingStrategyUnion) AsStatic() (v VectorStoreFileChunkingStrategyStatic)
func (VectorStoreFileChunkingStrategyUnion) RawJSON ¶
func (u VectorStoreFileChunkingStrategyUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*VectorStoreFileChunkingStrategyUnion) UnmarshalJSON ¶
func (r *VectorStoreFileChunkingStrategyUnion) UnmarshalJSON(data []byte) error
type VectorStoreFileContentParams ¶
type VectorStoreFileContentParams struct {
VectorStoreID string `path:"vector_store_id,required" json:"-"`
// Whether to include embedding vectors in the response.
IncludeEmbeddings param.Opt[bool] `query:"include_embeddings,omitzero" json:"-"`
// Whether to include chunk metadata in the response.
IncludeMetadata param.Opt[bool] `query:"include_metadata,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (VectorStoreFileContentParams) URLQuery ¶
func (r VectorStoreFileContentParams) URLQuery() (v url.Values, err error)
URLQuery serializes VectorStoreFileContentParams's query parameters as `url.Values`.
type VectorStoreFileContentResponse ¶
type VectorStoreFileContentResponse struct {
// Parsed content of the file
Data []VectorStoreFileContentResponseData `json:"data,required"`
// Indicates if there are more content pages to fetch
HasMore bool `json:"has_more,required"`
// The object type, which is always `vector_store.file_content.page`
Object constant.VectorStoreFileContentPage `json:"object,required"`
// The token for the next page, if any
NextPage string `json:"next_page"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
HasMore respjson.Field
Object respjson.Field
NextPage respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Represents the parsed content of a vector store file.
func (VectorStoreFileContentResponse) RawJSON ¶
func (r VectorStoreFileContentResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*VectorStoreFileContentResponse) UnmarshalJSON ¶
func (r *VectorStoreFileContentResponse) UnmarshalJSON(data []byte) error
type VectorStoreFileContentResponseData ¶
type VectorStoreFileContentResponseData struct {
// The actual text content
Text string `json:"text,required"`
// Content type, currently only "text" is supported
Type constant.Text `json:"type,required"`
// Optional chunk metadata
ChunkMetadata VectorStoreFileContentResponseDataChunkMetadata `json:"chunk_metadata"`
// Optional embedding vector for this content chunk
Embedding []float64 `json:"embedding"`
// Optional user-defined metadata
Metadata map[string]VectorStoreFileContentResponseDataMetadataUnion `json:"metadata"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Text respjson.Field
Type respjson.Field
ChunkMetadata respjson.Field
Embedding respjson.Field
Metadata respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Content item from a vector store file or search result.
func (VectorStoreFileContentResponseData) RawJSON ¶
func (r VectorStoreFileContentResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*VectorStoreFileContentResponseData) UnmarshalJSON ¶
func (r *VectorStoreFileContentResponseData) UnmarshalJSON(data []byte) error
type VectorStoreFileContentResponseDataChunkMetadata ¶
type VectorStoreFileContentResponseDataChunkMetadata struct {
// The dimension of the embedding vector for the chunk.
ChunkEmbeddingDimension int64 `json:"chunk_embedding_dimension"`
// The embedding model used to create the chunk's embedding.
ChunkEmbeddingModel string `json:"chunk_embedding_model"`
// The ID of the chunk. If not set, it will be generated based on the document ID
// and content.
ChunkID string `json:"chunk_id"`
// The tokenizer used to create the chunk. Default is Tiktoken.
ChunkTokenizer string `json:"chunk_tokenizer"`
// The window of the chunk, which can be used to group related chunks together.
ChunkWindow string `json:"chunk_window"`
// The number of tokens in the content of the chunk.
ContentTokenCount int64 `json:"content_token_count"`
// An optional timestamp indicating when the chunk was created.
CreatedTimestamp int64 `json:"created_timestamp"`
// The ID of the document this chunk belongs to.
DocumentID string `json:"document_id"`
// The number of tokens in the metadata of the chunk.
MetadataTokenCount int64 `json:"metadata_token_count"`
// The source of the content, such as a URL, file path, or other identifier.
Source string `json:"source"`
// An optional timestamp indicating when the chunk was last updated.
UpdatedTimestamp int64 `json:"updated_timestamp"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ChunkEmbeddingDimension respjson.Field
ChunkEmbeddingModel respjson.Field
ChunkID respjson.Field
ChunkTokenizer respjson.Field
ChunkWindow respjson.Field
ContentTokenCount respjson.Field
CreatedTimestamp respjson.Field
DocumentID respjson.Field
MetadataTokenCount respjson.Field
Source respjson.Field
UpdatedTimestamp respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Optional chunk metadata
func (VectorStoreFileContentResponseDataChunkMetadata) RawJSON ¶
func (r VectorStoreFileContentResponseDataChunkMetadata) RawJSON() string
Returns the unmodified JSON received from the API
func (*VectorStoreFileContentResponseDataChunkMetadata) UnmarshalJSON ¶
func (r *VectorStoreFileContentResponseDataChunkMetadata) UnmarshalJSON(data []byte) error
type VectorStoreFileContentResponseDataMetadataUnion ¶
type VectorStoreFileContentResponseDataMetadataUnion 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:"-"`
}
VectorStoreFileContentResponseDataMetadataUnion 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 (VectorStoreFileContentResponseDataMetadataUnion) AsAnyArray ¶
func (u VectorStoreFileContentResponseDataMetadataUnion) AsAnyArray() (v []any)
func (VectorStoreFileContentResponseDataMetadataUnion) AsBool ¶
func (u VectorStoreFileContentResponseDataMetadataUnion) AsBool() (v bool)
func (VectorStoreFileContentResponseDataMetadataUnion) AsFloat ¶
func (u VectorStoreFileContentResponseDataMetadataUnion) AsFloat() (v float64)
func (VectorStoreFileContentResponseDataMetadataUnion) AsString ¶
func (u VectorStoreFileContentResponseDataMetadataUnion) AsString() (v string)
func (VectorStoreFileContentResponseDataMetadataUnion) RawJSON ¶
func (u VectorStoreFileContentResponseDataMetadataUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*VectorStoreFileContentResponseDataMetadataUnion) UnmarshalJSON ¶
func (r *VectorStoreFileContentResponseDataMetadataUnion) UnmarshalJSON(data []byte) error
type VectorStoreFileCounts ¶
type VectorStoreFileCounts struct {
// Number of files that had their processing cancelled
Cancelled int64 `json:"cancelled,required"`
// Number of files that have been successfully processed
Completed int64 `json:"completed,required"`
// Number of files that failed to process
Failed int64 `json:"failed,required"`
// Number of files currently being processed
InProgress int64 `json:"in_progress,required"`
// Total number of files in the vector store
Total int64 `json:"total,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Cancelled respjson.Field
Completed respjson.Field
Failed respjson.Field
InProgress respjson.Field
Total respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
File processing status counts for the vector store
func (VectorStoreFileCounts) RawJSON ¶
func (r VectorStoreFileCounts) RawJSON() string
Returns the unmodified JSON received from the API
func (*VectorStoreFileCounts) UnmarshalJSON ¶
func (r *VectorStoreFileCounts) UnmarshalJSON(data []byte) error
type VectorStoreFileDeleteParams ¶
type VectorStoreFileDeleteParams struct {
VectorStoreID string `path:"vector_store_id,required" json:"-"`
// contains filtered or unexported fields
}
type VectorStoreFileDeleteResponse ¶
type VectorStoreFileDeleteResponse struct {
// Unique identifier of the deleted file
ID string `json:"id,required"`
// Whether the deletion operation was successful
Deleted bool `json:"deleted,required"`
// Object type identifier for the deletion response
Object string `json:"object,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Deleted respjson.Field
Object respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Response from deleting a vector store file.
func (VectorStoreFileDeleteResponse) RawJSON ¶
func (r VectorStoreFileDeleteResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*VectorStoreFileDeleteResponse) UnmarshalJSON ¶
func (r *VectorStoreFileDeleteResponse) UnmarshalJSON(data []byte) error
type VectorStoreFileGetParams ¶
type VectorStoreFileGetParams struct {
VectorStoreID string `path:"vector_store_id,required" json:"-"`
// contains filtered or unexported fields
}
type VectorStoreFileLastError ¶
type VectorStoreFileLastError struct {
// Error code indicating the type of failure
//
// Any of "server_error", "rate_limit_exceeded".
Code VectorStoreFileLastErrorCode `json:"code,required"`
// Human-readable error message describing the failure
Message string `json:"message,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Code respjson.Field
Message respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
(Optional) Error information if file processing failed
func (VectorStoreFileLastError) RawJSON ¶
func (r VectorStoreFileLastError) RawJSON() string
Returns the unmodified JSON received from the API
func (*VectorStoreFileLastError) UnmarshalJSON ¶
func (r *VectorStoreFileLastError) UnmarshalJSON(data []byte) error
type VectorStoreFileLastErrorCode ¶
type VectorStoreFileLastErrorCode string
Error code indicating the type of failure
const ( VectorStoreFileLastErrorCodeServerError VectorStoreFileLastErrorCode = "server_error" VectorStoreFileLastErrorCodeRateLimitExceeded VectorStoreFileLastErrorCode = "rate_limit_exceeded" )
type VectorStoreFileListParams ¶
type VectorStoreFileListParams struct {
// (Optional) A cursor for use in pagination. `after` is an object ID that defines
// your place in the list.
After param.Opt[string] `query:"after,omitzero" json:"-"`
// (Optional) A cursor for use in pagination. `before` is an object ID that defines
// your place in the list.
Before param.Opt[string] `query:"before,omitzero" json:"-"`
// (Optional) A limit on the number of objects to be returned. Limit can range
// between 1 and 100, and the default is 20.
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// (Optional) Sort order by the `created_at` timestamp of the objects. `asc` for
// ascending order and `desc` for descending order.
Order param.Opt[string] `query:"order,omitzero" json:"-"`
// (Optional) Filter by file status to only return files with the specified status.
//
// Any of "completed", "in_progress", "cancelled", "failed".
Filter VectorStoreFileListParamsFilter `query:"filter,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (VectorStoreFileListParams) URLQuery ¶
func (r VectorStoreFileListParams) URLQuery() (v url.Values, err error)
URLQuery serializes VectorStoreFileListParams's query parameters as `url.Values`.
type VectorStoreFileListParamsFilter ¶
type VectorStoreFileListParamsFilter string
(Optional) Filter by file status to only return files with the specified status.
const ( VectorStoreFileListParamsFilterCompleted VectorStoreFileListParamsFilter = "completed" VectorStoreFileListParamsFilterInProgress VectorStoreFileListParamsFilter = "in_progress" VectorStoreFileListParamsFilterCancelled VectorStoreFileListParamsFilter = "cancelled" VectorStoreFileListParamsFilterFailed VectorStoreFileListParamsFilter = "failed" )
type VectorStoreFileNewParams ¶
type VectorStoreFileNewParams struct {
// The ID of the file to attach to the vector store.
FileID string `json:"file_id,required"`
// The key-value attributes stored with the file, which can be used for filtering.
Attributes map[string]VectorStoreFileNewParamsAttributeUnion `json:"attributes,omitzero"`
// The chunking strategy to use for the file.
ChunkingStrategy VectorStoreFileNewParamsChunkingStrategyUnion `json:"chunking_strategy,omitzero"`
// contains filtered or unexported fields
}
func (VectorStoreFileNewParams) MarshalJSON ¶
func (r VectorStoreFileNewParams) MarshalJSON() (data []byte, err error)
func (*VectorStoreFileNewParams) UnmarshalJSON ¶
func (r *VectorStoreFileNewParams) UnmarshalJSON(data []byte) error
type VectorStoreFileNewParamsAttributeUnion ¶
type VectorStoreFileNewParamsAttributeUnion 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 (VectorStoreFileNewParamsAttributeUnion) MarshalJSON ¶
func (u VectorStoreFileNewParamsAttributeUnion) MarshalJSON() ([]byte, error)
func (*VectorStoreFileNewParamsAttributeUnion) UnmarshalJSON ¶
func (u *VectorStoreFileNewParamsAttributeUnion) UnmarshalJSON(data []byte) error
type VectorStoreFileNewParamsChunkingStrategyAuto ¶
type VectorStoreFileNewParamsChunkingStrategyAuto struct {
// Strategy type, always "auto" for automatic chunking
Type constant.Auto `json:"type,required"`
// contains filtered or unexported fields
}
Automatic chunking strategy for vector store files.
This struct has a constant value, construct it with NewVectorStoreFileNewParamsChunkingStrategyAuto.
func NewVectorStoreFileNewParamsChunkingStrategyAuto ¶
func NewVectorStoreFileNewParamsChunkingStrategyAuto() VectorStoreFileNewParamsChunkingStrategyAuto
func (VectorStoreFileNewParamsChunkingStrategyAuto) MarshalJSON ¶
func (r VectorStoreFileNewParamsChunkingStrategyAuto) MarshalJSON() (data []byte, err error)
func (*VectorStoreFileNewParamsChunkingStrategyAuto) UnmarshalJSON ¶
func (r *VectorStoreFileNewParamsChunkingStrategyAuto) UnmarshalJSON(data []byte) error
type VectorStoreFileNewParamsChunkingStrategyStatic ¶
type VectorStoreFileNewParamsChunkingStrategyStatic struct {
// Configuration parameters for the static chunking strategy
Static VectorStoreFileNewParamsChunkingStrategyStaticStatic `json:"static,omitzero,required"`
// Strategy type, always "static" for static chunking
//
// This field can be elided, and will marshal its zero value as "static".
Type constant.Static `json:"type,required"`
// contains filtered or unexported fields
}
Static chunking strategy with configurable parameters.
The properties Static, Type are required.
func (VectorStoreFileNewParamsChunkingStrategyStatic) MarshalJSON ¶
func (r VectorStoreFileNewParamsChunkingStrategyStatic) MarshalJSON() (data []byte, err error)
func (*VectorStoreFileNewParamsChunkingStrategyStatic) UnmarshalJSON ¶
func (r *VectorStoreFileNewParamsChunkingStrategyStatic) UnmarshalJSON(data []byte) error
type VectorStoreFileNewParamsChunkingStrategyStaticStatic ¶
type VectorStoreFileNewParamsChunkingStrategyStaticStatic struct {
// Number of tokens to overlap between adjacent chunks
ChunkOverlapTokens int64 `json:"chunk_overlap_tokens,required"`
// Maximum number of tokens per chunk, must be between 100 and 4096
MaxChunkSizeTokens int64 `json:"max_chunk_size_tokens,required"`
// contains filtered or unexported fields
}
Configuration parameters for the static chunking strategy
The properties ChunkOverlapTokens, MaxChunkSizeTokens are required.
func (VectorStoreFileNewParamsChunkingStrategyStaticStatic) MarshalJSON ¶
func (r VectorStoreFileNewParamsChunkingStrategyStaticStatic) MarshalJSON() (data []byte, err error)
func (*VectorStoreFileNewParamsChunkingStrategyStaticStatic) UnmarshalJSON ¶
func (r *VectorStoreFileNewParamsChunkingStrategyStaticStatic) UnmarshalJSON(data []byte) error
type VectorStoreFileNewParamsChunkingStrategyUnion ¶
type VectorStoreFileNewParamsChunkingStrategyUnion struct {
OfAuto *VectorStoreFileNewParamsChunkingStrategyAuto `json:",omitzero,inline"`
OfStatic *VectorStoreFileNewParamsChunkingStrategyStatic `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 (VectorStoreFileNewParamsChunkingStrategyUnion) GetStatic ¶
func (u VectorStoreFileNewParamsChunkingStrategyUnion) GetStatic() *VectorStoreFileNewParamsChunkingStrategyStaticStatic
Returns a pointer to the underlying variant's property, if present.
func (VectorStoreFileNewParamsChunkingStrategyUnion) GetType ¶
func (u VectorStoreFileNewParamsChunkingStrategyUnion) GetType() *string
Returns a pointer to the underlying variant's property, if present.
func (VectorStoreFileNewParamsChunkingStrategyUnion) MarshalJSON ¶
func (u VectorStoreFileNewParamsChunkingStrategyUnion) MarshalJSON() ([]byte, error)
func (*VectorStoreFileNewParamsChunkingStrategyUnion) UnmarshalJSON ¶
func (u *VectorStoreFileNewParamsChunkingStrategyUnion) UnmarshalJSON(data []byte) error
type VectorStoreFileService ¶
type VectorStoreFileService struct {
Options []option.RequestOption
}
VectorStoreFileService contains methods and other services that help with interacting with the llama-stack-client API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewVectorStoreFileService method instead.
func NewVectorStoreFileService ¶
func NewVectorStoreFileService(opts ...option.RequestOption) (r VectorStoreFileService)
NewVectorStoreFileService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*VectorStoreFileService) Content ¶
func (r *VectorStoreFileService) Content(ctx context.Context, fileID string, params VectorStoreFileContentParams, opts ...option.RequestOption) (res *VectorStoreFileContentResponse, err error)
Retrieves the contents of a vector store file.
func (*VectorStoreFileService) Delete ¶
func (r *VectorStoreFileService) Delete(ctx context.Context, fileID string, body VectorStoreFileDeleteParams, opts ...option.RequestOption) (res *VectorStoreFileDeleteResponse, err error)
Delete a vector store file.
func (*VectorStoreFileService) Get ¶
func (r *VectorStoreFileService) Get(ctx context.Context, fileID string, query VectorStoreFileGetParams, opts ...option.RequestOption) (res *VectorStoreFile, err error)
Retrieves a vector store file.
func (*VectorStoreFileService) List ¶
func (r *VectorStoreFileService) List(ctx context.Context, vectorStoreID string, query VectorStoreFileListParams, opts ...option.RequestOption) (res *pagination.OpenAICursorPage[VectorStoreFile], err error)
List files in a vector store.
func (*VectorStoreFileService) ListAutoPaging ¶
func (r *VectorStoreFileService) ListAutoPaging(ctx context.Context, vectorStoreID string, query VectorStoreFileListParams, opts ...option.RequestOption) *pagination.OpenAICursorPageAutoPager[VectorStoreFile]
List files in a vector store.
func (*VectorStoreFileService) New ¶
func (r *VectorStoreFileService) New(ctx context.Context, vectorStoreID string, body VectorStoreFileNewParams, opts ...option.RequestOption) (res *VectorStoreFile, err error)
Attach a file to a vector store.
func (*VectorStoreFileService) Update ¶
func (r *VectorStoreFileService) Update(ctx context.Context, fileID string, params VectorStoreFileUpdateParams, opts ...option.RequestOption) (res *VectorStoreFile, err error)
Updates a vector store file.
type VectorStoreFileStatus ¶
type VectorStoreFileStatus string
Current processing status of the file
const ( VectorStoreFileStatusCompleted VectorStoreFileStatus = "completed" VectorStoreFileStatusInProgress VectorStoreFileStatus = "in_progress" VectorStoreFileStatusCancelled VectorStoreFileStatus = "cancelled" VectorStoreFileStatusFailed VectorStoreFileStatus = "failed" )
type VectorStoreFileUpdateParams ¶
type VectorStoreFileUpdateParams struct {
VectorStoreID string `path:"vector_store_id,required" json:"-"`
// The updated key-value attributes to store with the file.
Attributes map[string]VectorStoreFileUpdateParamsAttributeUnion `json:"attributes,omitzero,required"`
// contains filtered or unexported fields
}
func (VectorStoreFileUpdateParams) MarshalJSON ¶
func (r VectorStoreFileUpdateParams) MarshalJSON() (data []byte, err error)
func (*VectorStoreFileUpdateParams) UnmarshalJSON ¶
func (r *VectorStoreFileUpdateParams) UnmarshalJSON(data []byte) error
type VectorStoreFileUpdateParamsAttributeUnion ¶
type VectorStoreFileUpdateParamsAttributeUnion 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 (VectorStoreFileUpdateParamsAttributeUnion) MarshalJSON ¶
func (u VectorStoreFileUpdateParamsAttributeUnion) MarshalJSON() ([]byte, error)
func (*VectorStoreFileUpdateParamsAttributeUnion) UnmarshalJSON ¶
func (u *VectorStoreFileUpdateParamsAttributeUnion) UnmarshalJSON(data []byte) error
type VectorStoreListParams ¶
type VectorStoreListParams struct {
// A cursor for use in pagination. `after` is an object ID that defines your place
// in the list.
After param.Opt[string] `query:"after,omitzero" json:"-"`
// A cursor for use in pagination. `before` is an object ID that defines your place
// in the list.
Before param.Opt[string] `query:"before,omitzero" json:"-"`
// A limit on the number of objects to be returned. Limit can range between 1 and
// 100, and the default is 20.
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Sort order by the `created_at` timestamp of the objects. `asc` for ascending
// order and `desc` for descending order.
Order param.Opt[string] `query:"order,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (VectorStoreListParams) URLQuery ¶
func (r VectorStoreListParams) URLQuery() (v url.Values, err error)
URLQuery serializes VectorStoreListParams's query parameters as `url.Values`.
type VectorStoreMetadataUnion ¶
type VectorStoreMetadataUnion 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:"-"`
}
VectorStoreMetadataUnion 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 (VectorStoreMetadataUnion) AsAnyArray ¶
func (u VectorStoreMetadataUnion) AsAnyArray() (v []any)
func (VectorStoreMetadataUnion) AsBool ¶
func (u VectorStoreMetadataUnion) AsBool() (v bool)
func (VectorStoreMetadataUnion) AsFloat ¶
func (u VectorStoreMetadataUnion) AsFloat() (v float64)
func (VectorStoreMetadataUnion) AsString ¶
func (u VectorStoreMetadataUnion) AsString() (v string)
func (VectorStoreMetadataUnion) RawJSON ¶
func (u VectorStoreMetadataUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*VectorStoreMetadataUnion) UnmarshalJSON ¶
func (r *VectorStoreMetadataUnion) UnmarshalJSON(data []byte) error
type VectorStoreNewParams ¶
type VectorStoreNewParams struct {
// (Optional) A name for the vector store
Name param.Opt[string] `json:"name,omitzero"`
// (Optional) Strategy for splitting files into chunks
ChunkingStrategy VectorStoreNewParamsChunkingStrategyUnion `json:"chunking_strategy,omitzero"`
// (Optional) Expiration policy for the vector store
ExpiresAfter map[string]VectorStoreNewParamsExpiresAfterUnion `json:"expires_after,omitzero"`
// List of file IDs to include in the vector store
FileIDs []string `json:"file_ids,omitzero"`
// Set of key-value pairs that can be attached to the vector store
Metadata map[string]VectorStoreNewParamsMetadataUnion `json:"metadata,omitzero"`
// contains filtered or unexported fields
}
func (VectorStoreNewParams) MarshalJSON ¶
func (r VectorStoreNewParams) MarshalJSON() (data []byte, err error)
func (*VectorStoreNewParams) UnmarshalJSON ¶
func (r *VectorStoreNewParams) UnmarshalJSON(data []byte) error
type VectorStoreNewParamsChunkingStrategyAuto ¶
type VectorStoreNewParamsChunkingStrategyAuto struct {
// Strategy type, always "auto" for automatic chunking
Type constant.Auto `json:"type,required"`
// contains filtered or unexported fields
}
Automatic chunking strategy for vector store files.
This struct has a constant value, construct it with NewVectorStoreNewParamsChunkingStrategyAuto.
func NewVectorStoreNewParamsChunkingStrategyAuto ¶
func NewVectorStoreNewParamsChunkingStrategyAuto() VectorStoreNewParamsChunkingStrategyAuto
func (VectorStoreNewParamsChunkingStrategyAuto) MarshalJSON ¶
func (r VectorStoreNewParamsChunkingStrategyAuto) MarshalJSON() (data []byte, err error)
func (*VectorStoreNewParamsChunkingStrategyAuto) UnmarshalJSON ¶
func (r *VectorStoreNewParamsChunkingStrategyAuto) UnmarshalJSON(data []byte) error
type VectorStoreNewParamsChunkingStrategyStatic ¶
type VectorStoreNewParamsChunkingStrategyStatic struct {
// Configuration parameters for the static chunking strategy
Static VectorStoreNewParamsChunkingStrategyStaticStatic `json:"static,omitzero,required"`
// Strategy type, always "static" for static chunking
//
// This field can be elided, and will marshal its zero value as "static".
Type constant.Static `json:"type,required"`
// contains filtered or unexported fields
}
Static chunking strategy with configurable parameters.
The properties Static, Type are required.
func (VectorStoreNewParamsChunkingStrategyStatic) MarshalJSON ¶
func (r VectorStoreNewParamsChunkingStrategyStatic) MarshalJSON() (data []byte, err error)
func (*VectorStoreNewParamsChunkingStrategyStatic) UnmarshalJSON ¶
func (r *VectorStoreNewParamsChunkingStrategyStatic) UnmarshalJSON(data []byte) error
type VectorStoreNewParamsChunkingStrategyStaticStatic ¶
type VectorStoreNewParamsChunkingStrategyStaticStatic struct {
// Number of tokens to overlap between adjacent chunks
ChunkOverlapTokens int64 `json:"chunk_overlap_tokens,required"`
// Maximum number of tokens per chunk, must be between 100 and 4096
MaxChunkSizeTokens int64 `json:"max_chunk_size_tokens,required"`
// contains filtered or unexported fields
}
Configuration parameters for the static chunking strategy
The properties ChunkOverlapTokens, MaxChunkSizeTokens are required.
func (VectorStoreNewParamsChunkingStrategyStaticStatic) MarshalJSON ¶
func (r VectorStoreNewParamsChunkingStrategyStaticStatic) MarshalJSON() (data []byte, err error)
func (*VectorStoreNewParamsChunkingStrategyStaticStatic) UnmarshalJSON ¶
func (r *VectorStoreNewParamsChunkingStrategyStaticStatic) UnmarshalJSON(data []byte) error
type VectorStoreNewParamsChunkingStrategyUnion ¶
type VectorStoreNewParamsChunkingStrategyUnion struct {
OfAuto *VectorStoreNewParamsChunkingStrategyAuto `json:",omitzero,inline"`
OfStatic *VectorStoreNewParamsChunkingStrategyStatic `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 (VectorStoreNewParamsChunkingStrategyUnion) GetStatic ¶
func (u VectorStoreNewParamsChunkingStrategyUnion) GetStatic() *VectorStoreNewParamsChunkingStrategyStaticStatic
Returns a pointer to the underlying variant's property, if present.
func (VectorStoreNewParamsChunkingStrategyUnion) GetType ¶
func (u VectorStoreNewParamsChunkingStrategyUnion) GetType() *string
Returns a pointer to the underlying variant's property, if present.
func (VectorStoreNewParamsChunkingStrategyUnion) MarshalJSON ¶
func (u VectorStoreNewParamsChunkingStrategyUnion) MarshalJSON() ([]byte, error)
func (*VectorStoreNewParamsChunkingStrategyUnion) UnmarshalJSON ¶
func (u *VectorStoreNewParamsChunkingStrategyUnion) UnmarshalJSON(data []byte) error
type VectorStoreNewParamsExpiresAfterUnion ¶
type VectorStoreNewParamsExpiresAfterUnion 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 (VectorStoreNewParamsExpiresAfterUnion) MarshalJSON ¶
func (u VectorStoreNewParamsExpiresAfterUnion) MarshalJSON() ([]byte, error)
func (*VectorStoreNewParamsExpiresAfterUnion) UnmarshalJSON ¶
func (u *VectorStoreNewParamsExpiresAfterUnion) UnmarshalJSON(data []byte) error
type VectorStoreNewParamsMetadataUnion ¶
type VectorStoreNewParamsMetadataUnion 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 (VectorStoreNewParamsMetadataUnion) MarshalJSON ¶
func (u VectorStoreNewParamsMetadataUnion) MarshalJSON() ([]byte, error)
func (*VectorStoreNewParamsMetadataUnion) UnmarshalJSON ¶
func (u *VectorStoreNewParamsMetadataUnion) UnmarshalJSON(data []byte) error
type VectorStoreSearchParams ¶
type VectorStoreSearchParams struct {
// The query string or array for performing the search.
Query VectorStoreSearchParamsQueryUnion `json:"query,omitzero,required"`
// Maximum number of results to return (1 to 50 inclusive, default 10).
MaxNumResults param.Opt[int64] `json:"max_num_results,omitzero"`
// Whether to rewrite the natural language query for vector search (default false)
RewriteQuery param.Opt[bool] `json:"rewrite_query,omitzero"`
// The search mode to use - "keyword", "vector", or "hybrid" (default "vector")
SearchMode param.Opt[string] `json:"search_mode,omitzero"`
// Filters based on file attributes to narrow the search results.
Filters map[string]VectorStoreSearchParamsFilterUnion `json:"filters,omitzero"`
// Ranking options for fine-tuning the search results.
RankingOptions VectorStoreSearchParamsRankingOptions `json:"ranking_options,omitzero"`
// contains filtered or unexported fields
}
func (VectorStoreSearchParams) MarshalJSON ¶
func (r VectorStoreSearchParams) MarshalJSON() (data []byte, err error)
func (*VectorStoreSearchParams) UnmarshalJSON ¶
func (r *VectorStoreSearchParams) UnmarshalJSON(data []byte) error
type VectorStoreSearchParamsFilterUnion ¶
type VectorStoreSearchParamsFilterUnion 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 (VectorStoreSearchParamsFilterUnion) MarshalJSON ¶
func (u VectorStoreSearchParamsFilterUnion) MarshalJSON() ([]byte, error)
func (*VectorStoreSearchParamsFilterUnion) UnmarshalJSON ¶
func (u *VectorStoreSearchParamsFilterUnion) UnmarshalJSON(data []byte) error
type VectorStoreSearchParamsQueryUnion ¶
type VectorStoreSearchParamsQueryUnion struct {
OfString param.Opt[string] `json:",omitzero,inline"`
OfStringArray []string `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 (VectorStoreSearchParamsQueryUnion) MarshalJSON ¶
func (u VectorStoreSearchParamsQueryUnion) MarshalJSON() ([]byte, error)
func (*VectorStoreSearchParamsQueryUnion) UnmarshalJSON ¶
func (u *VectorStoreSearchParamsQueryUnion) UnmarshalJSON(data []byte) error
type VectorStoreSearchParamsRankingOptions ¶
type VectorStoreSearchParamsRankingOptions struct {
// (Optional) Name of the ranking algorithm to use
Ranker param.Opt[string] `json:"ranker,omitzero"`
// (Optional) Minimum relevance score threshold for results
ScoreThreshold param.Opt[float64] `json:"score_threshold,omitzero"`
// contains filtered or unexported fields
}
Ranking options for fine-tuning the search results.
func (VectorStoreSearchParamsRankingOptions) MarshalJSON ¶
func (r VectorStoreSearchParamsRankingOptions) MarshalJSON() (data []byte, err error)
func (*VectorStoreSearchParamsRankingOptions) UnmarshalJSON ¶
func (r *VectorStoreSearchParamsRankingOptions) UnmarshalJSON(data []byte) error
type VectorStoreSearchResponse ¶
type VectorStoreSearchResponse struct {
// List of search result objects
Data []VectorStoreSearchResponseData `json:"data,required"`
// Whether there are more results available beyond this page
HasMore bool `json:"has_more,required"`
// Object type identifier for the search results page
Object string `json:"object,required"`
// The original search query that was executed
SearchQuery []string `json:"search_query,required"`
// (Optional) Token for retrieving the next page of results
NextPage string `json:"next_page"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
HasMore respjson.Field
Object respjson.Field
SearchQuery respjson.Field
NextPage respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Paginated response from searching a vector store.
func (VectorStoreSearchResponse) RawJSON ¶
func (r VectorStoreSearchResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*VectorStoreSearchResponse) UnmarshalJSON ¶
func (r *VectorStoreSearchResponse) UnmarshalJSON(data []byte) error
type VectorStoreSearchResponseData ¶
type VectorStoreSearchResponseData struct {
// List of content items matching the search query
Content []VectorStoreSearchResponseDataContent `json:"content,required"`
// Unique identifier of the file containing the result
FileID string `json:"file_id,required"`
// Name of the file containing the result
Filename string `json:"filename,required"`
// Relevance score for this search result
Score float64 `json:"score,required"`
// (Optional) Key-value attributes associated with the file
Attributes map[string]VectorStoreSearchResponseDataAttributeUnion `json:"attributes"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Content respjson.Field
FileID respjson.Field
Filename respjson.Field
Score respjson.Field
Attributes respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Response from searching a vector store.
func (VectorStoreSearchResponseData) RawJSON ¶
func (r VectorStoreSearchResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*VectorStoreSearchResponseData) UnmarshalJSON ¶
func (r *VectorStoreSearchResponseData) UnmarshalJSON(data []byte) error
type VectorStoreSearchResponseDataAttributeUnion ¶
type VectorStoreSearchResponseDataAttributeUnion 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:"-"`
}
VectorStoreSearchResponseDataAttributeUnion 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 (VectorStoreSearchResponseDataAttributeUnion) AsBool ¶
func (u VectorStoreSearchResponseDataAttributeUnion) AsBool() (v bool)
func (VectorStoreSearchResponseDataAttributeUnion) AsFloat ¶
func (u VectorStoreSearchResponseDataAttributeUnion) AsFloat() (v float64)
func (VectorStoreSearchResponseDataAttributeUnion) AsString ¶
func (u VectorStoreSearchResponseDataAttributeUnion) AsString() (v string)
func (VectorStoreSearchResponseDataAttributeUnion) RawJSON ¶
func (u VectorStoreSearchResponseDataAttributeUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*VectorStoreSearchResponseDataAttributeUnion) UnmarshalJSON ¶
func (r *VectorStoreSearchResponseDataAttributeUnion) UnmarshalJSON(data []byte) error
type VectorStoreSearchResponseDataContent ¶
type VectorStoreSearchResponseDataContent struct {
// The actual text content
Text string `json:"text,required"`
// Content type, currently only "text" is supported
Type constant.Text `json:"type,required"`
// Optional chunk metadata
ChunkMetadata VectorStoreSearchResponseDataContentChunkMetadata `json:"chunk_metadata"`
// Optional embedding vector for this content chunk
Embedding []float64 `json:"embedding"`
// Optional user-defined metadata
Metadata map[string]VectorStoreSearchResponseDataContentMetadataUnion `json:"metadata"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Text respjson.Field
Type respjson.Field
ChunkMetadata respjson.Field
Embedding respjson.Field
Metadata respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Content item from a vector store file or search result.
func (VectorStoreSearchResponseDataContent) RawJSON ¶
func (r VectorStoreSearchResponseDataContent) RawJSON() string
Returns the unmodified JSON received from the API
func (*VectorStoreSearchResponseDataContent) UnmarshalJSON ¶
func (r *VectorStoreSearchResponseDataContent) UnmarshalJSON(data []byte) error
type VectorStoreSearchResponseDataContentChunkMetadata ¶
type VectorStoreSearchResponseDataContentChunkMetadata struct {
// The dimension of the embedding vector for the chunk.
ChunkEmbeddingDimension int64 `json:"chunk_embedding_dimension"`
// The embedding model used to create the chunk's embedding.
ChunkEmbeddingModel string `json:"chunk_embedding_model"`
// The ID of the chunk. If not set, it will be generated based on the document ID
// and content.
ChunkID string `json:"chunk_id"`
// The tokenizer used to create the chunk. Default is Tiktoken.
ChunkTokenizer string `json:"chunk_tokenizer"`
// The window of the chunk, which can be used to group related chunks together.
ChunkWindow string `json:"chunk_window"`
// The number of tokens in the content of the chunk.
ContentTokenCount int64 `json:"content_token_count"`
// An optional timestamp indicating when the chunk was created.
CreatedTimestamp int64 `json:"created_timestamp"`
// The ID of the document this chunk belongs to.
DocumentID string `json:"document_id"`
// The number of tokens in the metadata of the chunk.
MetadataTokenCount int64 `json:"metadata_token_count"`
// The source of the content, such as a URL, file path, or other identifier.
Source string `json:"source"`
// An optional timestamp indicating when the chunk was last updated.
UpdatedTimestamp int64 `json:"updated_timestamp"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ChunkEmbeddingDimension respjson.Field
ChunkEmbeddingModel respjson.Field
ChunkID respjson.Field
ChunkTokenizer respjson.Field
ChunkWindow respjson.Field
ContentTokenCount respjson.Field
CreatedTimestamp respjson.Field
DocumentID respjson.Field
MetadataTokenCount respjson.Field
Source respjson.Field
UpdatedTimestamp respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Optional chunk metadata
func (VectorStoreSearchResponseDataContentChunkMetadata) RawJSON ¶
func (r VectorStoreSearchResponseDataContentChunkMetadata) RawJSON() string
Returns the unmodified JSON received from the API
func (*VectorStoreSearchResponseDataContentChunkMetadata) UnmarshalJSON ¶
func (r *VectorStoreSearchResponseDataContentChunkMetadata) UnmarshalJSON(data []byte) error
type VectorStoreSearchResponseDataContentMetadataUnion ¶
type VectorStoreSearchResponseDataContentMetadataUnion 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:"-"`
}
VectorStoreSearchResponseDataContentMetadataUnion 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 (VectorStoreSearchResponseDataContentMetadataUnion) AsAnyArray ¶
func (u VectorStoreSearchResponseDataContentMetadataUnion) AsAnyArray() (v []any)
func (VectorStoreSearchResponseDataContentMetadataUnion) AsBool ¶
func (u VectorStoreSearchResponseDataContentMetadataUnion) AsBool() (v bool)
func (VectorStoreSearchResponseDataContentMetadataUnion) AsFloat ¶
func (u VectorStoreSearchResponseDataContentMetadataUnion) AsFloat() (v float64)
func (VectorStoreSearchResponseDataContentMetadataUnion) AsString ¶
func (u VectorStoreSearchResponseDataContentMetadataUnion) AsString() (v string)
func (VectorStoreSearchResponseDataContentMetadataUnion) RawJSON ¶
func (u VectorStoreSearchResponseDataContentMetadataUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*VectorStoreSearchResponseDataContentMetadataUnion) UnmarshalJSON ¶
func (r *VectorStoreSearchResponseDataContentMetadataUnion) UnmarshalJSON(data []byte) error
type VectorStoreService ¶
type VectorStoreService struct {
Options []option.RequestOption
Files VectorStoreFileService
FileBatches VectorStoreFileBatchService
}
VectorStoreService contains methods and other services that help with interacting with the llama-stack-client API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewVectorStoreService method instead.
func NewVectorStoreService ¶
func NewVectorStoreService(opts ...option.RequestOption) (r VectorStoreService)
NewVectorStoreService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*VectorStoreService) Delete ¶
func (r *VectorStoreService) Delete(ctx context.Context, vectorStoreID string, opts ...option.RequestOption) (res *VectorStoreDeleteResponse, err error)
Delete a vector store.
func (*VectorStoreService) Get ¶
func (r *VectorStoreService) Get(ctx context.Context, vectorStoreID string, opts ...option.RequestOption) (res *VectorStore, err error)
Retrieves a vector store.
func (*VectorStoreService) List ¶
func (r *VectorStoreService) List(ctx context.Context, query VectorStoreListParams, opts ...option.RequestOption) (res *pagination.OpenAICursorPage[VectorStore], err error)
Returns a list of vector stores.
func (*VectorStoreService) ListAutoPaging ¶
func (r *VectorStoreService) ListAutoPaging(ctx context.Context, query VectorStoreListParams, opts ...option.RequestOption) *pagination.OpenAICursorPageAutoPager[VectorStore]
Returns a list of vector stores.
func (*VectorStoreService) New ¶
func (r *VectorStoreService) New(ctx context.Context, body VectorStoreNewParams, opts ...option.RequestOption) (res *VectorStore, err error)
Creates a vector store. Generate an OpenAI-compatible vector store with the given parameters.
func (*VectorStoreService) Search ¶
func (r *VectorStoreService) Search(ctx context.Context, vectorStoreID string, body VectorStoreSearchParams, opts ...option.RequestOption) (res *VectorStoreSearchResponse, err error)
Search for chunks in a vector store. Searches a vector store for relevant chunks based on a query and optional file attribute filters.
func (*VectorStoreService) Update ¶
func (r *VectorStoreService) Update(ctx context.Context, vectorStoreID string, body VectorStoreUpdateParams, opts ...option.RequestOption) (res *VectorStore, err error)
Updates a vector store.
type VectorStoreUpdateParams ¶
type VectorStoreUpdateParams struct {
// The name of the vector store.
Name param.Opt[string] `json:"name,omitzero"`
// The expiration policy for a vector store.
ExpiresAfter map[string]VectorStoreUpdateParamsExpiresAfterUnion `json:"expires_after,omitzero"`
// Set of 16 key-value pairs that can be attached to an object.
Metadata map[string]VectorStoreUpdateParamsMetadataUnion `json:"metadata,omitzero"`
// contains filtered or unexported fields
}
func (VectorStoreUpdateParams) MarshalJSON ¶
func (r VectorStoreUpdateParams) MarshalJSON() (data []byte, err error)
func (*VectorStoreUpdateParams) UnmarshalJSON ¶
func (r *VectorStoreUpdateParams) UnmarshalJSON(data []byte) error
type VectorStoreUpdateParamsExpiresAfterUnion ¶
type VectorStoreUpdateParamsExpiresAfterUnion 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 (VectorStoreUpdateParamsExpiresAfterUnion) MarshalJSON ¶
func (u VectorStoreUpdateParamsExpiresAfterUnion) MarshalJSON() ([]byte, error)
func (*VectorStoreUpdateParamsExpiresAfterUnion) UnmarshalJSON ¶
func (u *VectorStoreUpdateParamsExpiresAfterUnion) UnmarshalJSON(data []byte) error
type VectorStoreUpdateParamsMetadataUnion ¶
type VectorStoreUpdateParamsMetadataUnion 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 (VectorStoreUpdateParamsMetadataUnion) MarshalJSON ¶
func (u VectorStoreUpdateParamsMetadataUnion) MarshalJSON() ([]byte, error)
func (*VectorStoreUpdateParamsMetadataUnion) UnmarshalJSON ¶
func (u *VectorStoreUpdateParamsMetadataUnion) UnmarshalJSON(data []byte) error
type VersionInfo ¶
type VersionInfo struct {
// Version number of the service
Version string `json:"version,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Version respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Version information for the service.
func (VersionInfo) RawJSON ¶
func (r VersionInfo) RawJSON() string
Returns the unmodified JSON received from the API
func (*VersionInfo) UnmarshalJSON ¶
func (r *VersionInfo) UnmarshalJSON(data []byte) error
Source Files
¶
- aliases.go
- alpha.go
- alphabenchmark.go
- alphaeval.go
- alphaevaljob.go
- alphainference.go
- alphaposttraining.go
- alphaposttrainingjob.go
- beta.go
- betadataset.go
- chat.go
- chatcompletion.go
- client.go
- completion.go
- conversation.go
- conversationitem.go
- embedding.go
- field.go
- file.go
- inspect.go
- model.go
- modelopenai.go
- moderation.go
- prompt.go
- promptversion.go
- provider.go
- response.go
- responseinputitem.go
- route.go
- safety.go
- scoring.go
- scoringfunction.go
- shared.go
- shield.go
- tool.go
- toolgroup.go
- toolruntime.go
- toolruntimeragtool.go
- vectorio.go
- vectorstore.go
- vectorstorefile.go
- vectorstorefilebatch.go
Directories
¶
| Path | Synopsis |
|---|---|
|
encoding/json
Package json implements encoding and decoding of JSON as defined in RFC 7159.
|
Package json implements encoding and decoding of JSON as defined in RFC 7159. |
|
encoding/json/shims
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package.
|
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package. |
|
packages
|
|
|
shared
|
|