Documentation
¶
Overview ¶
Package llm provides a minimal chat client for LLM-powered memory features: auto topic extraction and project summarization. Supports Ollama, any OpenAI-compatible endpoint and the Anthropic Messages API. Optional: nil client disables LLM features.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AnthropicClient ¶ added in v0.5.0
AnthropicClient talks to the Anthropic Messages API (/v1/messages). Any Anthropic-compatible endpoint (api.anthropic.com, Bedrock/Vertex proxies, self-hosted gateways) works through the same client.
func NewAnthropic ¶ added in v0.5.0
func NewAnthropic(baseURL, apiKey, model string) *AnthropicClient
NewAnthropic returns an Anthropic client with defaults. A small fast model is chosen: topic extraction and summarization are short JSON tasks.
type Client ¶
type Client interface {
// Chat sends a system+user message and returns the assistant reply.
Chat(ctx context.Context, system, user string) (string, error)
}
Client is the minimal chat interface used by memory features.
type OllamaClient ¶
OllamaClient talks to a local Ollama /api/chat endpoint.
func NewOllama ¶
func NewOllama(baseURL, model string) *OllamaClient
NewOllama returns an Ollama client with defaults.
type OpenAICompatClient ¶
OpenAICompatClient talks to any OpenAI-compatible /v1/chat/completions endpoint.
func NewOpenAICompat ¶
func NewOpenAICompat(baseURL, apiKey, model string) *OpenAICompatClient
NewOpenAICompat returns an OpenAI-compatible chat client with defaults.