Documentation
¶
Overview ¶
Package llm is the public LLM boundary of the SDD framework (20260830-234501-d-cpt-q6n): pure vocabulary plus one one-method interface. No dependencies, no I/O, no machinery — routing, observation, and timeouts compose around Runner instances at each host's composition site.
The guiding analogy is net/http: Runner is our RoundTripper. Attribution is response-carried (Result.Identity) rather than a method on the interface, because implementations may route.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Error ¶
Error optionally attributes a failed call. An implementation that knows what it routed to wraps its error so failures measure like successes.
type Identity ¶
type Identity struct {
Provider string
Model string
// Variant is the behaviour-affecting configuration the model ran under —
// a reasoning effort, a thinking budget — carried so calls at different
// settings measure apart. Canonical form is comma-separated key=value in
// sorted key order ("reasoning_effort=high"); empty at model defaults.
//
// The boundary is what the request carries, not what the setting means:
// a value sent as its own field is a variant, a value inside the model
// identifier is the model.
Variant string
}
Identity names what served a call, reported per call on Result. It is never a static property of an implementation, because implementations may route.
type Purpose ¶
type Purpose string
Purpose names what a call is for: a routing key for implementations and an observability dimension, the same value for both so they cannot drift. The set is closed: purposes are minted only by application operations. Hosts route on these constants and never invent values.
type Request ¶
type Request struct {
Purpose Purpose
// SystemPrompt is the stable prefix, cacheable by providers that can.
SystemPrompt string
// UserPrompt is the per-call variable part.
UserPrompt string
}
Request carries everything an implementation may route on: ctx (who) and Purpose (what for), plus the two-part prompt.
type Result ¶
type Result struct {
Text string
// Identity is required on success: what actually served this call.
Identity Identity
Usage Usage
}
Result reports what a call produced and what served it.
type Runner ¶
Runner is the single port. Contract, stated RoundTripper-style: fill Result.Identity on success; report Usage, never invent it; no internal retries (retry is caller policy); bound your own calls, because deadlines are configuration and configuration is host-private; ctx carries request-scoped facts a routing implementation may use (tenant, logger).
type RunnerFunc ¶
RunnerFunc adapts a function to Runner (test doubles, error stubs).