Documentation
¶
Overview ¶
Package ai is the single-import surface for the SDK's AI subsystem. It owns the registry of concrete provider adapters and re-exports the shared types so plugins depend on one package:
- ai/provider holds the provider-neutral contract (Client, Config, Schema, AnalyzeResponse, Error) and the base adapters build on.
- ai/openai (and future sibling packages) hold concrete adapters, registered in clientFactories below.
- ai/assist holds the plugin-facing accelerator surfaced here as Assist.
See docs/ai-client.md and docs/ai-assist.md.
Index ¶
Constants ¶
const ( ProviderOpenAI = openai.Provider ProviderAnthropic = anthropic.Provider EvidenceType = assist.EvidenceType ErrorKindRateLimited = provider.ErrorKindRateLimited ErrorKindTimeout = provider.ErrorKindTimeout ErrorKindProviderError = provider.ErrorKindProviderError ErrorKindInvalidRequest = provider.ErrorKindInvalidRequest ErrorKindInvalidResponse = provider.ErrorKindInvalidResponse ErrorKindUnsupportedConfig = provider.ErrorKindUnsupportedConfig )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnalyzeResponse ¶
type AnalyzeResponse = provider.AnalyzeResponse
Aliases for the provider-neutral contract and the assist accelerator types, so callers import only this package.
type Client ¶
Aliases for the provider-neutral contract and the assist accelerator types, so callers import only this package.
func NewClient ¶
NewClient is the default constructor for plugins: it extracts the ai_* settings from the primary end user config and builds a Client from them. When AI is not configured it returns (nil, nil) — check the returned client, not just the error, and treat a nil client as "AI disabled".
func NewClientWithAIConfig ¶ added in v1.31.1
NewClientWithAIConfig builds a client from an explicit provider-neutral Config. It validates the config and dispatches to the adapter registered for config.Provider.
type Config ¶
Aliases for the provider-neutral contract and the assist accelerator types, so callers import only this package.
type Error ¶
Aliases for the provider-neutral contract and the assist accelerator types, so callers import only this package.
type ErrorKind ¶
Aliases for the provider-neutral contract and the assist accelerator types, so callers import only this package.
type EvidencePayload ¶ added in v1.31.1
type EvidencePayload = assist.EvidencePayload
Aliases for the provider-neutral contract and the assist accelerator types, so callers import only this package.
type Provider ¶
Aliases for the provider-neutral contract and the assist accelerator types, so callers import only this package.
type Question ¶ added in v1.31.1
Aliases for the provider-neutral contract and the assist accelerator types, so callers import only this package.
type Response ¶ added in v1.31.1
Aliases for the provider-neutral contract and the assist accelerator types, so callers import only this package.
type ResponseMetadata ¶
type ResponseMetadata = provider.ResponseMetadata
Aliases for the provider-neutral contract and the assist accelerator types, so callers import only this package.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package anthropic is the Anthropic Messages API adapter for the provider-neutral AI client contract.
|
Package anthropic is the Anthropic Messages API adapter for the provider-neutral AI client contract. |
|
Package assist is the plugin-facing accelerator for AI-assisted assessment steps: it asks a provider-neutral client for a structured verdict against an SDK-owned schema and packages the answer as auditable gemara.Evidence.
|
Package assist is the plugin-facing accelerator for AI-assisted assessment steps: it asks a provider-neutral client for a structured verdict against an SDK-owned schema and packages the answer as auditable gemara.Evidence. |
|
Package openai is the OpenAI Chat Completions adapter for the provider-neutral AI client contract.
|
Package openai is the OpenAI Chat Completions adapter for the provider-neutral AI client contract. |
|
Package provider defines the provider-neutral contract callers use to talk to any AI backend, plus the shared base every concrete adapter builds on.
|
Package provider defines the provider-neutral contract callers use to talk to any AI backend, plus the shared base every concrete adapter builds on. |