Documentation
¶
Index ¶
- type AnthropicErrorDetail
- type AnthropicErrorResponse
- type ChatChoice
- type ChatErrorDetail
- type ChatErrorResponse
- type ChatMessage
- type ChatRequest
- type ChatResponse
- type ChatStreamResponse
- type ChatUsage
- type ContentBlock
- type ResponseItem
- type ResponsesRequest
- type ResponsesResponse
- type StreamChoice
- type StreamOptions
- type Usage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnthropicErrorDetail ¶ added in v0.1.4
type AnthropicErrorResponse ¶ added in v0.1.4
type AnthropicErrorResponse struct {
Type string `json:"type"`
Error *AnthropicErrorDetail `json:"error"`
}
AnthropicErrorResponse models the Anthropic Messages API error format.
type ChatChoice ¶
type ChatChoice struct {
Index int `json:"index"`
Message ChatMessage `json:"message"`
FinishReason string `json:"finish_reason"`
}
type ChatErrorDetail ¶ added in v0.1.4
type ChatErrorResponse ¶ added in v0.1.4
type ChatErrorResponse struct {
Error *ChatErrorDetail `json:"error"`
}
ChatErrorResponse models the OpenAI/Chat API error format. Used by Chat and Responses APIs.
type ChatMessage ¶
type ChatRequest ¶
type ChatRequest struct {
Model string `json:"model"`
Messages []ChatMessage `json:"messages"`
MaxTokens int `json:"max_tokens,omitempty"`
Temperature float64 `json:"temperature,omitempty"`
TopP float64 `json:"top_p,omitempty"`
Stream bool `json:"stream,omitempty"`
StreamOptions *StreamOptions `json:"stream_options,omitempty"`
N int `json:"n,omitempty"`
}
type ChatResponse ¶
type ChatStreamResponse ¶
type ContentBlock ¶
type ResponseItem ¶
type ResponsesRequest ¶
type ResponsesRequest struct {
Model string `json:"model"`
Input any `json:"input,omitempty"`
Instructions string `json:"instructions,omitempty"`
MaxTokens int `json:"max_tokens,omitempty"`
Store bool `json:"store,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
TopP float64 `json:"top_p,omitempty"`
Temperature float64 `json:"temperature,omitempty"`
PreviousResponseID string `json:"previous_response_id,omitempty"`
Stream bool `json:"stream,omitempty"`
}
type ResponsesResponse ¶
type StreamChoice ¶
type StreamChoice struct {
Index int `json:"index"`
Delta ChatMessage `json:"delta"`
FinishReason string `json:"finish_reason"`
}
type StreamOptions ¶ added in v0.1.4
type StreamOptions struct {
IncludeUsage bool `json:"include_usage"`
}
Click to show internal directories.
Click to hide internal directories.