Documentation
¶
Index ¶
- func FindClaudeCodeCLIPath() (string, error)
- type AnthropicClient
- type ChatMessage
- type ChatOptions
- type ChatResponse
- type ClaudeCodeCLIClient
- type Client
- type ClientConfig
- type GeminiNativeClient
- type ModelFetcher
- type OpenAICodexClient
- type OpenAICompatibleClient
- type ProviderError
- type ProviderOptions
- type ToolCall
- type ToolFunctionSchema
- type ToolSchema
- type Usage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindClaudeCodeCLIPath ¶ added in v0.5.5
Types ¶
type AnthropicClient ¶
type AnthropicClient struct {
// contains filtered or unexported fields
}
func NewAnthropicClient ¶
func NewAnthropicClient(baseURL, apiKey, model string, maxTokens int) (*AnthropicClient, error)
func (*AnthropicClient) Chat ¶
func (c *AnthropicClient) Chat(ctx context.Context, messages []ChatMessage, opts ChatOptions) (ChatResponse, error)
type ChatMessage ¶
type ChatOptions ¶
type ChatOptions struct {
OnDelta func(text string) // SSE streaming callback (nil = no streaming)
Tools []ToolSchema
// ToolChoice follows OpenAI-compatible values like "auto", "none", "required".
ToolChoice string
// ReasoningEffort is a provider-agnostic hint. Supported values are
// none, minimal, low, medium, high.
ReasoningEffort string
// ThinkingBudget enables provider-native thinking when budgeted tokens are supported.
ThinkingBudget int
// ServiceTier controls provider-side latency tier when supported.
ServiceTier string
}
type ChatResponse ¶
type ChatResponse struct {
Message ChatMessage
Usage Usage
StopReason string
}
type ClaudeCodeCLIClient ¶ added in v0.5.5
type ClaudeCodeCLIClient struct {
// contains filtered or unexported fields
}
func NewClaudeCodeCLIClient ¶ added in v0.5.5
func NewClaudeCodeCLIClient(workDir, model string) (*ClaudeCodeCLIClient, error)
func (*ClaudeCodeCLIClient) Chat ¶ added in v0.5.5
func (c *ClaudeCodeCLIClient) Chat(ctx context.Context, messages []ChatMessage, opts ChatOptions) (ChatResponse, error)
type Client ¶
type Client interface {
Ask(ctx context.Context, prompt string) (string, error)
Chat(ctx context.Context, messages []ChatMessage, opts ChatOptions) (ChatResponse, error)
}
func NewProvider ¶
func NewProvider(opts ProviderOptions) (Client, error)
type ClientConfig ¶
type ClientConfig struct {
HTTPTimeout time.Duration
MaxTokens int
ReasoningEffort string
ThinkingBudget int
ServiceTier string
}
func DefaultClientConfig ¶
func DefaultClientConfig() ClientConfig
type GeminiNativeClient ¶
type GeminiNativeClient struct {
// contains filtered or unexported fields
}
func NewGeminiNativeClient ¶
func NewGeminiNativeClient(baseURL, apiKey, model string) (*GeminiNativeClient, error)
func (*GeminiNativeClient) Chat ¶
func (c *GeminiNativeClient) Chat(ctx context.Context, messages []ChatMessage, opts ChatOptions) (ChatResponse, error)
type ModelFetcher ¶
type ModelFetcher interface {
FetchModels(ctx context.Context, opts ProviderOptions) ([]string, error)
}
ModelFetcher resolves provider model ids via provider-specific live APIs.
func NewModelFetcher ¶
func NewModelFetcher() ModelFetcher
type OpenAICodexClient ¶
type OpenAICodexClient struct {
// contains filtered or unexported fields
}
func NewOpenAICodexClient ¶
func NewOpenAICodexClient(baseURL, model, authMode, oauthProvider, apiKey string) (*OpenAICodexClient, error)
func (*OpenAICodexClient) Chat ¶
func (c *OpenAICodexClient) Chat(ctx context.Context, messages []ChatMessage, opts ChatOptions) (ChatResponse, error)
type OpenAICompatibleClient ¶
type OpenAICompatibleClient struct {
// contains filtered or unexported fields
}
OpenAICompatibleClient works with any OpenAI-compatible /chat/completions API (Bifrost, OpenAI, Azure OpenAI, etc.).
func NewBifrostClient ¶
func NewBifrostClient(baseURL, apiKey, model string) (*OpenAICompatibleClient, error)
func NewGeminiClient ¶
func NewGeminiClient(baseURL, apiKey, model string) (*OpenAICompatibleClient, error)
func NewOpenAIClient ¶
func NewOpenAIClient(baseURL, apiKey, model string) (*OpenAICompatibleClient, error)
func (*OpenAICompatibleClient) Chat ¶
func (c *OpenAICompatibleClient) Chat(ctx context.Context, messages []ChatMessage, opts ChatOptions) (ChatResponse, error)
type ProviderError ¶
type ProviderError struct {
Provider string
Operation string
StatusCode int
Message string
Cause error
}
ProviderError is a structured error for LLM provider failures.
func (*ProviderError) Error ¶
func (e *ProviderError) Error() string
func (*ProviderError) Unwrap ¶
func (e *ProviderError) Unwrap() error
type ProviderOptions ¶
type ToolFunctionSchema ¶
type ToolFunctionSchema struct {
Name string `json:"name"`
Description string `json:"description"`
Parameters json.RawMessage `json:"parameters,omitempty"`
}
type ToolSchema ¶
type ToolSchema struct {
Type string `json:"type"`
Function ToolFunctionSchema `json:"function"`
}
Click to show internal directories.
Click to hide internal directories.