Documentation
¶
Overview ¶
Package models is the adapter layer between core-agent's configuration and concrete LLM backends. The Provider interface keeps the rest of the codebase free of provider-specific imports so additional backends plug in behind the same contract.
Built-in providers:
- "gemini" / "vertex" — google.golang.org/adk/model/gemini
- "anthropic" — Claude via github.com/anthropics/anthropic-sdk-go
Each backend's package init() calls Register so importing the subpackage is enough to make the provider available.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
func Register(name string, c Constructor)
Register installs a Constructor under its provider name. Idiomatically called from package init() in each backend implementation.
Types ¶
type Constructor ¶
Constructor builds a Provider from validated config. Tests register alternates via Register so resolution stays decoupled from the imports of any single backend.
type Provider ¶
type Provider interface {
// Name reports the provider identity ("gemini", "vertex", "anthropic").
// Used for telemetry and diagnostic messages.
Name() string
// Model returns a usable model.LLM for the given model ID. The same
// Provider may be asked for several models over its lifetime.
Model(ctx context.Context, modelID string) (model.LLM, error)
}
Provider constructs concrete model.LLM instances on demand. A Provider is bound to one credential source (API key, Vertex project, etc.) at construction time; callers ask for specific models by ID through Model.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package anthropic implements models.Provider for Anthropic / Claude.
|
Package anthropic implements models.Provider for Anthropic / Claude. |
|
Package gemini implements models.Provider for the Gemini family, covering both the public Gemini API (API-key auth) and Vertex AI (Application Default Credentials + GCP project).
|
Package gemini implements models.Provider for the Gemini family, covering both the public Gemini API (API-key auth) and Vertex AI (Application Default Credentials + GCP project). |
|
Package mock ships two credential-free LLM providers and a recording wrapper that pair for offline testing of agent flows:
|
Package mock ships two credential-free LLM providers and a recording wrapper that pair for offline testing of agent flows: |