Documentation
¶
Index ¶
- type ChatCompletionRequest
- type ChatCompletionResponse
- type Client
- type EmbeddingObject
- type EmbeddingRequest
- type EmbeddingResponse
- type File
- type FilePart
- type ImagePart
- type ImageURL
- type JSONSchema
- type Message
- type PDFConfig
- type Plugin
- type ResponseFormat
- type ResponseFormatJSONSchema
- type TextPart
- type Tool
- type ToolCall
- type ToolFunction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChatCompletionRequest ¶
type ChatCompletionResponse ¶
type ChatCompletionResponse struct {
ID string `json:"id"`
Model string `json:"model"`
Choices []struct {
Message struct {
Role string `json:"role"`
Content string `json:"content"`
ToolCalls []ToolCall `json:"tool_calls,omitempty"`
ReasoningDetails interface{} `json:"reasoning_details,omitempty"`
} `json:"message"`
} `json:"choices"`
Usage struct {
PromptTokens int `json:"prompt_tokens"`
CompletionTokens int `json:"completion_tokens"`
TotalTokens int `json:"total_tokens"`
} `json:"usage"`
}
type Client ¶
type Client interface {
CreateChatCompletion(ctx context.Context, req ChatCompletionRequest) (ChatCompletionResponse, error)
CreateEmbeddings(ctx context.Context, req EmbeddingRequest) (EmbeddingResponse, error)
}
type EmbeddingObject ¶
type EmbeddingRequest ¶
type EmbeddingResponse ¶
type EmbeddingResponse struct {
Object string `json:"object"`
Data []EmbeddingObject `json:"data"`
Model string `json:"model"`
Usage struct {
PromptTokens int `json:"prompt_tokens"`
TotalTokens int `json:"total_tokens"`
} `json:"usage"`
}
type JSONSchema ¶
type ResponseFormat ¶
type ResponseFormat struct {
Type string `json:"type"`
JSONSchema *JSONSchema `json:"json_schema,omitempty"`
}
type ResponseFormatJSONSchema ¶
type ResponseFormatJSONSchema struct {
Type string `json:"type"` // "json_schema"
JSONSchema JSONSchema `json:"json_schema"`
}
type Tool ¶
type Tool struct {
Type string `json:"type"`
Function ToolFunction `json:"function"`
}
type ToolFunction ¶
Click to show internal directories.
Click to hide internal directories.