Documentation
¶
Index ¶
- Constants
- func CreateCodexCliTokenSource() func() (string, string, error)
- func ReadCodexCliCredentials() (accessToken, accountID string, expiresAt time.Time, err error)
- type ClaudeCliProvider
- type CodexCliAuth
- type CodexCliProvider
- type FunctionCall
- type GitHubCopilotProvider
- type LLMProvider
- type LLMResponse
- type Message
- type ToolCall
- type ToolDefinition
- type ToolFunctionDefinition
- type UsageInfo
Constants ¶
const CodexHomeEnvVar = "CODEX_HOME"
CodexHomeEnvVar is the environment variable that overrides the Codex CLI home directory when resolving the codex auth.json credentials file. Default: ~/.codex
Variables ¶
This section is empty.
Functions ¶
func CreateCodexCliTokenSource ¶
CreateCodexCliTokenSource creates a token source that reads from ~/.codex/auth.json. This allows the existing CodexProvider to reuse Codex CLI credentials.
Types ¶
type ClaudeCliProvider ¶
type ClaudeCliProvider struct {
// contains filtered or unexported fields
}
ClaudeCliProvider implements LLMProvider using the claude CLI as a subprocess.
func NewClaudeCliProvider ¶
func NewClaudeCliProvider(workspace string) *ClaudeCliProvider
NewClaudeCliProvider creates a new Claude CLI provider.
func (*ClaudeCliProvider) Chat ¶
func (p *ClaudeCliProvider) Chat( ctx context.Context, messages []Message, tools []ToolDefinition, model string, options map[string]any, ) (*LLMResponse, error)
Chat implements LLMProvider.Chat by executing the claude CLI.
func (*ClaudeCliProvider) GetDefaultModel ¶
func (p *ClaudeCliProvider) GetDefaultModel() string
GetDefaultModel returns the default model identifier.
type CodexCliAuth ¶
type CodexCliAuth struct {
Tokens struct {
AccessToken string `json:"access_token"`
RefreshToken string `json:"refresh_token"`
AccountID string `json:"account_id"`
} `json:"tokens"`
}
CodexCliAuth represents the ~/.codex/auth.json file structure.
type CodexCliProvider ¶
type CodexCliProvider struct {
// contains filtered or unexported fields
}
CodexCliProvider implements LLMProvider by wrapping the codex CLI as a subprocess.
func NewCodexCliProvider ¶
func NewCodexCliProvider(workspace string) *CodexCliProvider
NewCodexCliProvider creates a new Codex CLI provider.
func (*CodexCliProvider) Chat ¶
func (p *CodexCliProvider) Chat( ctx context.Context, messages []Message, tools []ToolDefinition, model string, options map[string]any, ) (*LLMResponse, error)
Chat implements LLMProvider.Chat by executing the codex CLI in non-interactive mode.
func (*CodexCliProvider) GetDefaultModel ¶
func (p *CodexCliProvider) GetDefaultModel() string
GetDefaultModel returns the default model identifier.
type FunctionCall ¶
type FunctionCall = protocoltypes.FunctionCall
type GitHubCopilotProvider ¶
type GitHubCopilotProvider struct {
// contains filtered or unexported fields
}
func NewGitHubCopilotProvider ¶
func NewGitHubCopilotProvider(uri string, connectMode string, model string) (*GitHubCopilotProvider, error)
func (*GitHubCopilotProvider) Chat ¶
func (p *GitHubCopilotProvider) Chat( ctx context.Context, messages []Message, tools []ToolDefinition, model string, options map[string]any, ) (*LLMResponse, error)
func (*GitHubCopilotProvider) Close ¶
func (p *GitHubCopilotProvider) Close()
func (*GitHubCopilotProvider) GetDefaultModel ¶
func (p *GitHubCopilotProvider) GetDefaultModel() string
type LLMProvider ¶
type LLMProvider interface {
Chat(
ctx context.Context,
messages []Message,
tools []ToolDefinition,
model string,
options map[string]any,
) (*LLMResponse, error)
GetDefaultModel() string
}
type LLMResponse ¶
type LLMResponse = protocoltypes.LLMResponse
type Message ¶
type Message = protocoltypes.Message
type ToolCall ¶
type ToolCall = protocoltypes.ToolCall
func NormalizeToolCall ¶
NormalizeToolCall normalizes a ToolCall to ensure all fields are properly populated. It handles cases where Name/Arguments might be in different locations (top-level vs Function) and ensures both are populated consistently.
type ToolDefinition ¶
type ToolDefinition = protocoltypes.ToolDefinition
type ToolFunctionDefinition ¶
type ToolFunctionDefinition = protocoltypes.ToolFunctionDefinition
type UsageInfo ¶
type UsageInfo = protocoltypes.UsageInfo