Documentation
¶
Index ¶
Constants ¶
View Source
const Version = "v2"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Block ¶
type Block struct {
Type BlockType `json:"type"`
Text *Text `json:"text,omitempty"`
Thinking *Thinking `json:"thinking,omitempty"`
ToolUse *ToolUse `json:"tool_use,omitempty"`
ToolResult *ToolResult `json:"tool_result,omitempty"`
}
type ContextEntity ¶
type ContextEntity struct {
EntityType ContextEntityType `json:"entity_type"`
EntityID string `json:"entity_id"`
}
type ContextEntityType ¶
type ContextEntityType string
const ( ContextEntityTypeService ContextEntityType = "service" ContextEntityTypeLogEvent ContextEntityType = "log_event" )
type Message ¶
type Message struct {
Role Role `json:"role"`
Content []Block `json:"content"`
Model string `json:"model,omitempty"`
StopReason *StopReason `json:"stop_reason,omitempty"`
}
type Request ¶
type Request struct {
ChatProtocolVersion string `json:"chat_protocol_version"`
ConversationID string `json:"conversation_id"`
Messages []Message `json:"messages"`
ContextEntities []ContextEntity `json:"context_entities,omitempty"`
Tools []Tool `json:"tools,omitempty"`
}
type StopReason ¶
type StopReason string
const ( StopReasonEndTurn StopReason = "end_turn" StopReasonToolUse StopReason = "tool_use" )
type ToolResult ¶
type ToolResult struct {
ToolUseID string `json:"tool_use_id"`
IsError *bool `json:"is_error"`
Error string `json:"error,omitempty"`
Content json.RawMessage `json:"content,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.