Documentation
¶
Overview ¶
Package provider defines Alaska's LLM provider abstraction. Concrete providers (Anthropic, OpenAI, Alaska API) live in subpackages.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChatRequest ¶
type Message ¶
Message is one entry in the chat transcript sent to the model.
- role=user → Content is what the user typed.
- role=assistant → Content is the model's text (may be empty if only tool_calls). ToolCalls is populated when the model asked to run tools.
- role=tool → Content is the tool output; ToolCallID ties it to a specific call.
type ModelInfo ¶
ModelCatalog is a curated list of models known to work with each provider type. Used by `/model` (interactive picker) and `alaska provider models`. Custom providers of type "openai" with a base_url get no default catalog — users list models via `alaska provider models <name>` which hits the remote /models endpoint.
func KnownModels ¶
KnownModels returns a static catalog for a provider type. Empty slice means "no known catalog — discover at runtime or let the user type the id".
type Provider ¶
type Provider interface {
Name() string
Stream(ctx context.Context, req ChatRequest) (<-chan StreamChunk, error)
// SupportsTools reports whether the provider forwards Tools to the model.
// Providers that return false will silently ignore req.Tools.
SupportsTools() bool
}
type StreamChunk ¶
StreamChunk carries one piece of the provider's streaming response. Exactly one of Delta / ToolCall / Err is populated per chunk.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package anthropic implements the provider.Provider interface on top of the official anthropics/anthropic-sdk-go client.
|
Package anthropic implements the provider.Provider interface on top of the official anthropics/anthropic-sdk-go client. |
|
Package factory constructs a provider.Provider from a config entry + OS keyring.
|
Package factory constructs a provider.Provider from a config entry + OS keyring. |
|
Package openai implements the provider.Provider interface on top of the official openai/openai-go client.
|
Package openai implements the provider.Provider interface on top of the official openai/openai-go client. |