Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanModelName ¶
Types ¶
type ContentBlock ¶
type ContentBlock struct {
Type string `json:"type"`
Text string `json:"text,omitempty"`
Source *ContentBlockSource `json:"source,omitempty"`
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Input any `json:"input,omitempty"`
ToolUseID string `json:"tool_use_id,omitempty"`
Content any `json:"content,omitempty"`
Thinking string `json:"thinking,omitempty"`
Signature string `json:"signature,omitempty"`
}
type ContentBlockSource ¶
type ErrorResponse ¶
type Message ¶
type Message struct {
Role string `json:"role" validate:"required"`
Content any `json:"content" validate:"required"`
}
func (*Message) GetContentAsString ¶
type MessagesRequest ¶
type MessagesRequest struct {
Type string `json:"type,omitempty"`
Model string `json:"model" validate:"required"`
MaxTokens int `json:"max_tokens" validate:"required"`
Messages []Message `json:"messages" validate:"required"`
System any `json:"system,omitempty"`
StopSequences []string `json:"stop_sequences,omitempty"`
Stream *bool `json:"stream,omitempty"`
Temperature *float64 `json:"temperature,omitempty"`
TopP *float64 `json:"top_p,omitempty"`
TopK *int `json:"top_k,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
Tools []Tool `json:"tools,omitempty"`
ToolChoice *ToolChoice `json:"tool_choice,omitempty"`
Thinking *ThinkingConfig `json:"thinking,omitempty"`
OutputConfig *OutputConfig `json:"output_config,omitempty"`
OriginalModel string `json:"-"`
}
type MessagesResponse ¶
type MessagesResponse struct {
ID string `json:"id"`
Type string `json:"type"`
Role string `json:"role"`
Content []ContentBlock `json:"content"`
Model string `json:"model"`
StopReason string `json:"stop_reason,omitempty"`
StopSequence *string `json:"stop_sequence,omitempty"`
Usage Usage `json:"usage"`
}
type OutputConfig ¶ added in v0.2.0
type OutputConfig struct {
Effort string `json:"effort,omitempty"`
}
type ThinkingConfig ¶
type Tool ¶
type Tool struct {
Type string `json:"type,omitempty"`
Name string `json:"name" validate:"required"`
Description string `json:"description,omitempty"`
InputSchema json.RawMessage `json:"input_schema" validate:"required"`
}
type ToolChoice ¶
Click to show internal directories.
Click to hide internal directories.