Expand description
Canonical model invocation and continuation contract. No Agent or transport implementation.
Re-exports§
pub use service::Image;
Modules§
Structs§
- Backend
Capability - What one backend protocol can express, independent of any model. These are wire facts owned by the adapter, not catalog facts: a protocol that cannot carry a field makes the field unusable even when the model supports it.
- Completion
- Provider-neutral completion returned to Runtime.
- Completion
Request - One logical LLM invocation.
- Continuation
- Provider-issued replay data attached to exactly one completed model message. Adapters own the format and compatibility key. Callers must not synthesize or edit payloads.
- Effective
Generation - Generation parameters that may reach the wire. Fields left
Noneare omitted from the payload, which leaves the provider default in effect. - Generation
Controls - What a settings UI may expose after intersecting catalog facts with the backend protocol.
This is the same judgment
resolveuses; a hidden control cannot appear on the wire, and a shown control is one the current backend can actually carry. - Generation
Parameters - Deployment-owned generation settings, never supplied through Agent constraints. None leaves the setting unspecified. These are desired preferences. Adapters omit unsupported fields and clamp reasoning intensity onto the model’s list. Syntax validation does not establish model/provider support.
- Generation
Support - Confirmed per-model parameter support from catalog
metadata.generationSupport. Missing information never establishes support; it is never inferred from preferences. Unknown catalog keys are ignored so a newer catalog cannot break an older client. - Message
- Provider-neutral conversation message.
- Model
Capabilities - Confirmed model capabilities. Missing information never establishes support.
- Model
Constraints - Caller-declared requirements. Listed input modalities and true flags require confirmed
support; an empty
inputlist and false flags impose no requirement. Adapters must not infer or override these declarations from message content. - Model
Mode - Logical model mode selected by the product, independent of provider and model identifiers.
- Model
Profile - Provider-neutral limits for one frozen logical model route.
- Token
Usage - Normalized token accounting reported by an implementation.
- Tool
Call - Tool call returned by an LLM.
- Tool
Definition - A callable function exposed to the model. Execution policy belongs to the caller.
- UseCase
- Logical model use case resolved by the deployment’s LLM implementation.
Enums§
- Content
Part - One typed part of a model message.
- Finish
Reason - Why a model invocation stopped.
- Message
Role - Role of a message in a model conversation.
Constants§
- DEFAULT_
MAX_ OUTPUT_ TOKENS - Internal per-response output cap. Not a user setting. Adapters omit it when
the model snapshot says
maxTokensis false. - INPUT_
AUDIO - Audio input.
- INPUT_
FILE - Generic file input.
- INPUT_
IMAGE - Closed vocabulary for non-text model input.
textis implied and must not be listed. - INPUT_
VIDEO - Video input.
- MESSAGE_
SCHEMA - Offline normative schema for persisted model messages.
- REASONING_
EFFORT_ LADDER - Reasoning intensity ordered from least to most. Turning thinking off is the
thinkingswitch, never a listed intensity, sononeis not on this ladder.
Functions§
- controls
- Settings that can take effect on this backend for this model. Callers must not infer controls from catalog fields alone.
- input_
modality_ for_ kind - Closed-vocabulary token for an artifact kind.
- input_
modality_ for_ mime - Closed-vocabulary token for a MIME type. Non-media types map to
file. - normalize_
capability_ input - Normalizes catalog capability tokens.
textis ignored; unknown tokens fail. - normalize_
constraint_ input - Normalizes caller-declared constraint tokens.
textis illegal here. - normalize_
input_ token - Maps one catalog/constraint token.
textis dropped.visionand unknown values fail. - payload_
input_ modalities - Distinct payload modalities required by
ArtifactandImageparts. - resolve
- The single resolution of desired generation parameters against model and protocol facts. Every caller resolves exactly once, against facts frozen for the request, so replaying a frozen route always yields the same wire payload.