Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChatResponse ¶
type ChatResponse struct {
Message string `json:"message"`
Reasoning string `json:"reasoning,omitempty"`
FunctionCalls []FunctionCall `json:"function_calls,omitempty"`
TokenUsage *TokenUsage `json:"token_usage,omitempty"`
}
ChatResponse represents the response from a chat request
type FunctionCall ¶
type FunctionCall struct {
ID string `json:"id,omitempty"`
Name string `json:"name"`
Arguments map[string]interface{} `json:"arguments"`
}
FunctionCall represents a tool/function call
type FunctionResponseData ¶
type FunctionResponseData struct {
ID string `json:"id"`
Name string `json:"name"`
Response map[string]interface{} `json:"response"`
}
FunctionResponseData represents the response to a function call
type Message ¶
type Message struct {
Role string `json:"role"`
Content string `json:"content"`
ReasoningContent string `json:"reasoning_content,omitempty"`
FunctionCalls []FunctionCall `json:"function_calls,omitempty"`
FunctionResponse *FunctionResponseData `json:"function_response,omitempty"`
}
Message represents a chat message
type Provider ¶
type Provider interface {
// Chat sends a non-streaming chat request
Chat(messages []Message, tools []Tool, thinkingEnabled bool) (*ChatResponse, error)
// ChatStream sends a streaming chat request
ChatStream(messages []Message, tools []Tool, thinkingEnabled bool, callback StreamCallback) (*ChatResponse, error)
// Close closes any resources
Close() error
}
Provider represents an LLM provider interface
type ProviderConfig ¶
type ProviderConfig struct {
Provider string // "claude", "openai", "openrouter"
APIKey string
BaseURL string // optional override
Model string // model name
Timeout time.Duration
}
ProviderConfig holds configuration for creating a provider
type StreamCallback ¶
StreamCallback is called for each chunk during streaming
type TokenUsage ¶
type TokenUsage struct {
InputTokens int64 `json:"input_tokens"`
OutputTokens int64 `json:"output_tokens"`
}
TokenUsage represents token usage information
Click to show internal directories.
Click to hide internal directories.