Documentation
¶
Index ¶
- Constants
- func IsConnectorTextBlock(m map[string]interface{}) bool
- type APIConnectionError
- type APIConnectionTimeoutError
- type APIError
- type APIUserAbortError
- type AgentId
- type AssistantMessage
- type AuthenticationError
- type Base64ImageSource
- type BetaMessage
- type BetaMessageParam
- type BetaUsage
- type CacheCreation
- type ClientOptions
- type ConnectorTextBlock
- type ConnectorTextDelta
- type ContentBlock
- type ContentBlockParam
- type ErrorDetails
- type ImageBlockParam
- type Message
- type MessageCreateParams
- type MessageOrigin
- type MessageParam
- type MessageSource
- type MessageStreamEvent
- type NonNullableUsage
- type NotFoundError
- type RedactedThinkingBlock
- type RedactedThinkingBlockParam
- type ServerToolUse
- type SessionId
- type SystemMessage
- type TextBlock
- type TextBlockParam
- type ThinkingBlock
- type ThinkingBlockParam
- type Tool
- type ToolChoice
- type ToolInputSchema
- type ToolResultBlockParam
- type ToolUseBlock
- type ToolUseBlockParam
- type Usage
- type UserMessage
Constants ¶
View Source
const ( EndTurn = "end_turn" MaxTokens = "max_tokens" StopSequence = "stop_sequence" ToolUse = "tool_use" )
Variables ¶
This section is empty.
Functions ¶
func IsConnectorTextBlock ¶
Types ¶
type APIConnectionError ¶
type APIConnectionError struct{ APIError }
func NewAPIConnectionError ¶
func NewAPIConnectionError(message string) *APIConnectionError
type APIConnectionTimeoutError ¶
type APIConnectionTimeoutError struct{ APIError }
func NewAPIConnectionTimeoutError ¶
func NewAPIConnectionTimeoutError(message string) *APIConnectionTimeoutError
type APIError ¶
type APIError struct {
Status int `json:"status"`
Headers map[string]string `json:"headers"`
Err map[string]interface{} `json:"error"`
Message string `json:"message"`
}
func NewAPIError ¶
type APIUserAbortError ¶
type APIUserAbortError struct{ APIError }
func NewAPIUserAbortError ¶
func NewAPIUserAbortError(message string) *APIUserAbortError
type AssistantMessage ¶
type AssistantMessage struct {
Message
IsApiErrorMessage bool `json:"is_api_error_message"`
ErrorDetails *ErrorDetails `json:"error_details,omitempty"`
}
func CreateAssistantMessage ¶
func CreateAssistantMessage(text string) AssistantMessage
type AuthenticationError ¶
type AuthenticationError struct{ APIError }
func NewAuthenticationError ¶
func NewAuthenticationError(message string) *AuthenticationError
type Base64ImageSource ¶
type BetaMessage ¶
type BetaMessageParam ¶
type BetaMessageParam struct {
Role string `json:"role"`
Content interface{} `json:"content"`
}
type CacheCreation ¶
type ClientOptions ¶
type ConnectorTextBlock ¶
type ConnectorTextDelta ¶
type ContentBlock ¶
type ContentBlock = interface{}
type ContentBlockParam ¶
type ContentBlockParam = interface{}
type ErrorDetails ¶
type ImageBlockParam ¶
type ImageBlockParam struct {
Type string `json:"type"`
Source Base64ImageSource `json:"source"`
}
func IsImageBlock ¶
func IsImageBlock(v interface{}) (ImageBlockParam, bool)
type MessageCreateParams ¶
type MessageCreateParams struct {
Model string `json:"model"`
MaxTokens int `json:"max_tokens"`
Messages []MessageParam `json:"messages"`
Tools []Tool `json:"tools,omitempty"`
ToolChoice *ToolChoice `json:"tool_choice,omitempty"`
System *string `json:"system,omitempty"`
Temperature *float64 `json:"temperature,omitempty"`
TopP *float64 `json:"top_p,omitempty"`
TopK *int `json:"top_k,omitempty"`
StopSequences []string `json:"stop_sequences,omitempty"`
Stream bool `json:"stream"`
}
type MessageOrigin ¶
type MessageOrigin = string
const ( User MessageOrigin = "user" API MessageOrigin = "api" ToolOrigin MessageOrigin = "tool" System MessageOrigin = "system" Compact MessageOrigin = "compact" Recovery MessageOrigin = "recovery" )
type MessageParam ¶
type MessageParam struct {
Role string `json:"role"`
Content interface{} `json:"content"`
}
type MessageSource ¶
type MessageSource = string
const ( UserSource MessageSource = "user" Teammate MessageSource = "teammate" SystemSource MessageSource = "system" Tick MessageSource = "tick" Task MessageSource = "task" )
type MessageStreamEvent ¶
type MessageStreamEvent struct {
Type string `json:"type"`
}
type NonNullableUsage ¶
type NonNullableUsage struct {
InputTokens int `json:"input_tokens"`
CacheCreationInputTokens int `json:"cache_creation_input_tokens"`
CacheReadInputTokens int `json:"cache_read_input_tokens"`
OutputTokens int `json:"output_tokens"`
ServerToolUse ServerToolUse `json:"server_tool_use"`
ServiceTier string `json:"service_tier"`
CacheCreation CacheCreation `json:"cache_creation"`
InferenceGeo string `json:"inference_geo"`
Iterations []interface{} `json:"iterations"`
Speed string `json:"speed"`
}
func EmptyUsage ¶
func EmptyUsage() NonNullableUsage
type NotFoundError ¶
type NotFoundError struct{ APIError }
func NewNotFoundError ¶
func NewNotFoundError(message string) *NotFoundError
type RedactedThinkingBlock ¶
type ServerToolUse ¶
type SystemMessage ¶
type SystemMessage struct {
Message
}
func CreateSystemMessage ¶
func CreateSystemMessage(text string) SystemMessage
type TextBlock ¶
func IsTextBlock ¶
type TextBlockParam ¶
type ThinkingBlock ¶
type ThinkingBlockParam ¶
type Tool ¶
type Tool struct {
Name string `json:"name"`
Description string `json:"description"`
InputSchema ToolInputSchema `json:"input_schema"`
}
type ToolChoice ¶
type ToolInputSchema ¶
type ToolResultBlockParam ¶
type ToolResultBlockParam struct {
Type string `json:"type"`
ToolUseID string `json:"tool_use_id"`
Content interface{} `json:"content"`
IsError bool `json:"is_error"`
}
func IsToolResultBlock ¶
func IsToolResultBlock(v interface{}) (ToolResultBlockParam, bool)
type ToolUseBlock ¶
type ToolUseBlock struct {
Type string `json:"type"`
ID string `json:"id"`
Name string `json:"name"`
Input map[string]interface{} `json:"input"`
}
func IsToolUseBlock ¶
func IsToolUseBlock(v interface{}) (ToolUseBlock, bool)
type ToolUseBlockParam ¶
type UserMessage ¶
type UserMessage struct {
Message
}
func CreateUserMessage ¶
func CreateUserMessage(text string) UserMessage
Click to show internal directories.
Click to hide internal directories.