Documentation
¶
Overview ¶
Package llm hosts the gridctl LLM provider abstraction. Each subpackage (anthropic, openai, google, gateway) implements the agent.ChatModel interface against a single vendor's wire format.
Providers use only net/http and encoding/json; gridctl deliberately avoids each vendor's official SDK because the LLM-API surface is narrow, the cost of impedance mismatches with our typed graph runtime is high, and the SDK ecosystems churn quickly. The provider tool adapters in <provider>/tools.go translate gridctl's agent.ToolInfo / agent.ToolCall to the vendor's tool format — the compose graph never sees vendor-specific shapes.
All providers honor the Article VI contract (ctx context.Context as first argument), the Article XIV contract (log/slog only — no fmt.Println / log.Printf), and the Article V contract (error propagation, no panics in library code).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package anthropic implements agent.ChatModel against the Anthropic Messages API.
|
Package anthropic implements agent.ChatModel against the Anthropic Messages API. |
|
Package gateway is the LLM-side passthrough provider.
|
Package gateway is the LLM-side passthrough provider. |
|
Package google implements agent.ChatModel against the Google Gemini Generative Language API.
|
Package google implements agent.ChatModel against the Google Gemini Generative Language API. |
|
Package observed wraps an agent.ChatModel with the gridctl observability surface — OTel spans, pricing.CalculateBreakdown for USD cost, and metrics.Accumulator.RecordCost with a synthetic provider name (no MCP envelope spoofing).
|
Package observed wraps an agent.ChatModel with the gridctl observability surface — OTel spans, pricing.CalculateBreakdown for USD cost, and metrics.Accumulator.RecordCost with a synthetic provider name (no MCP envelope spoofing). |
|
Package openai implements agent.ChatModel against the OpenAI Chat Completions API.
|
Package openai implements agent.ChatModel against the OpenAI Chat Completions API. |