Documentation
¶
Index ¶
- Constants
- type ClaudeProvider
- func (p *ClaudeProvider) Chat(messages []common.Message, tools []common.Tool, thinkingEnabled bool) (*common.ChatResponse, error)
- func (p *ClaudeProvider) ChatStream(messages []common.Message, tools []common.Tool, thinkingEnabled bool, ...) (*common.ChatResponse, error)
- func (p *ClaudeProvider) Close() error
- type Client
- func (c *Client) Chat(messages []Message, thinkingEnabled bool, tools []Tool) (string, string, []FunctionCallResult, *TokenUsage, error)
- func (c *Client) ChatStream(messages []Message, thinkingEnabled bool, tools []Tool, ...) (string, []FunctionCallResult, *TokenUsage, error)
- func (c *Client) Close()
- type FunctionCallData
- type FunctionCallResult
- type FunctionResponseData
- type Message
- type StreamCallback
- type TokenUsage
- type Tool
Constants ¶
View Source
const ( // Claude API limits MaxTokensNonStreaming = 4096 // Max tokens for regular Chat() MaxTokensStreaming = 8192 // Max tokens for ChatStream() ThinkingBudget = 5000 // Extended thinking budget (tokens) )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClaudeProvider ¶
type ClaudeProvider struct {
// contains filtered or unexported fields
}
ClaudeProvider implements common.Provider for Claude
func NewClaudeProvider ¶
func NewClaudeProvider(config common.ProviderConfig) (*ClaudeProvider, error)
NewClaudeProvider creates a new Claude provider
func (*ClaudeProvider) Chat ¶
func (p *ClaudeProvider) Chat(messages []common.Message, tools []common.Tool, thinkingEnabled bool) (*common.ChatResponse, error)
Chat sends a non-streaming chat request
func (*ClaudeProvider) ChatStream ¶
func (p *ClaudeProvider) ChatStream(messages []common.Message, tools []common.Tool, thinkingEnabled bool, callback common.StreamCallback) (*common.ChatResponse, error)
ChatStream sends a streaming chat request
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClientWithConfig ¶
NewClientWithConfig creates a new Claude client with explicit API key and model
func (*Client) Chat ¶
func (c *Client) Chat(messages []Message, thinkingEnabled bool, tools []Tool) (string, string, []FunctionCallResult, *TokenUsage, error)
Chat sends a non-streaming chat request
func (*Client) ChatStream ¶
func (c *Client) ChatStream(messages []Message, thinkingEnabled bool, tools []Tool, callback StreamCallback) (string, []FunctionCallResult, *TokenUsage, error)
ChatStream sends a streaming chat request
type FunctionCallData ¶
type FunctionCallResult ¶
type FunctionResponseData ¶
type Message ¶
type Message struct {
Role string
Content string
ReasoningContent string
FunctionResponse *FunctionResponseData
FunctionCalls []FunctionCallData
}
type StreamCallback ¶
type TokenUsage ¶
TokenUsage represents token usage information
Click to show internal directories.
Click to hide internal directories.