Documentation
¶
Overview ¶
Package chat exposes multi-provider AI chat — the same surface `vxcli chat` ships. Provider routing dispatches to Anthropic / OpenAI / Google / OpenClaw using credentials stored under /api/v2/setup/ai-*.
The platform handler at POST /api/v2/chat/send accepts a provider key and forwards the request, so SDK consumers don't need to vendor each provider's client. Streaming via Server-Sent Events is documented in BIG_PLAN.md M3 (followup); v0.1 is one-shot only.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client is the entry point. Construct via:
c.Chat()
type Message ¶
type Message struct {
Role string `json:"role"` // system | user | assistant
Content string `json:"content"`
}
Message is one entry in a chat conversation.
type Provider ¶
type Provider string
Provider names that the platform's chat router recognizes. Match the AI credential keys under /api/v2/setup/ai-<provider>-credentials.
const ( ProviderAnthropic Provider = "anthropic" ProviderOpenAI Provider = "openai" ProviderGoogle Provider = "google" ProviderOpenClaw Provider = "openclaw" ProviderDeepseek Provider = "deepseek" ProviderQwen Provider = "qwen" ProviderGroq Provider = "groq" ProviderMistral Provider = "mistral" ProviderPerplexity Provider = "perplexity" ProviderHF Provider = "huggingface" ProviderOllama Provider = "ollama" ProviderHermes Provider = "hermes" )
type SendInput ¶
type SendInput struct {
Provider Provider
Model string
Messages []Message
SystemPrompt string // optional convenience; prepended as a system message
Temperature float64 // 0–1; default 0.7 server-side if zero
MaxTokens int // 0 = provider default
}
SendInput is the request shape for one-shot chat completion.
type SendOutput ¶
type SendOutput struct {
Completion string `json:"completion"`
Provider string `json:"provider,omitempty"`
Model string `json:"model,omitempty"`
InputTokens int `json:"input_tokens,omitempty"`
OutputTokens int `json:"output_tokens,omitempty"`
Raw map[string]interface{} `json:"-"`
}
SendOutput is the response envelope.