Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Agent interface {
Generate(context.Context, string) (any, error)
GenerateWithFiles(context.Context, string, []File) (any, error)
}
func NewGeminiLLM ¶
func NewLLMProvider ¶
func NewLLMProvider(ctx context.Context, provider string, model string, promptPrefix string) (Agent, error)
NewLLMProvider returns a concrete Agent.
func TryCreateCachedLLM ¶ added in v1.10.5
TryCreateCachedLLM checks env vars and wraps the agent if caching is enabled.
type AnthropicLLM ¶
type AnthropicLLM struct {
Client *anthropic.Client
Model string
MaxTokens int
PromptPrefix string
}
AnthropicLLM implements your Agent interface using Anthropic's Messages API.
func NewAnthropicLLM ¶
func NewAnthropicLLM(model, promptPrefix string) *AnthropicLLM
NewAnthropicLLM constructs a client. It reads ANTHROPIC_API_KEY from the env.
func (*AnthropicLLM) Generate ¶
Generate performs a single-turn completion and returns concatenated text.
func (*AnthropicLLM) GenerateWithFiles ¶
type CachedLLM ¶ added in v1.10.5
CachedLLM wraps an Agent and caches Generate calls.
func NewCachedLLM ¶ added in v1.10.5
NewCachedLLM creates a new CachedLLM wrapper.
type DummyLLM ¶
type DummyLLM struct {
Prefix string
}
DummyLLM is a lightweight model implementation useful for local testing without API calls.
func NewDummyLLM ¶
type File ¶
File is a lightweight in-memory attachment. Name is used for display; MIME should be best-effort (e.g., "text/markdown").
type OllamaLLM ¶
type OllamaLLM struct {
Client *ollama.Client
Model string
PromptPrefix string
// contains filtered or unexported fields
}