Chat
ChatCompletions
List available chat completion models
client.Chat.Completions.Models(ctx, query) (*ChatCompletionModelsResponse, error)
GET/v5/chat/completions/models
Generate OpenAI chat completion from messages
client.Chat.Completions.New(ctx, params) (*ChatCompletionNewResponseUnion, error)
POST/v5/chat/completions
ModelsExpand Collapse
type ChatCompletion struct{…}
type ChatCompletion struct{…}
Choices []ChatCompletionChoice
Choices []ChatCompletionChoice
FinishReason string
FinishReason string
Message ChatCompletionChoiceMessageA chat completion message generated by the model.
Message ChatCompletionChoiceMessage
A chat completion message generated by the model.
Audio ChatCompletionChoiceMessageAudioOptionalIf the audio output modality is requested, this object contains data
about the audio response from the model. Learn more.
Audio ChatCompletionChoiceMessageAudioOptional
If the audio output modality is requested, this object contains data about the audio response from the model. Learn more.
FunctionCall ChatCompletionChoiceMessageFunctionCallOptionalDeprecated and replaced by tool_calls.
The name and arguments of a function that should be called, as generated by the model.
FunctionCall ChatCompletionChoiceMessageFunctionCallOptional
Deprecated and replaced by tool_calls.
The name and arguments of a function that should be called, as generated by the model.
type ChatCompletionChunk struct{…}
type ChatCompletionChunk struct{…}
Choices []ChatCompletionChunkChoice
Choices []ChatCompletionChunkChoice
Delta ChatCompletionChunkChoiceDeltaA chat completion delta generated by streamed model responses.
Delta ChatCompletionChunkChoiceDelta
A chat completion delta generated by streamed model responses.
FinishReason stringOptional
FinishReason stringOptional
type ModelDefinition struct{…}
type ModelDefinition struct{…}
ModelType InferenceModelTypemodel type, for example chat_completion
ModelType InferenceModelType
model type, for example chat_completion
ModelVendor InferenceModelVendormodel vendor, for example openai
ModelVendor InferenceModelVendor
model vendor, for example openai