Skip to main content

Crate llm_api

Crate llm_api 

Source
Expand description

Canonical model invocation and continuation contract. No Agent or transport implementation.

Re-exports§

pub use service::Image;

Modules§

service

Structs§

Completion
Provider-neutral completion returned to Runtime.
CompletionRequest
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.
GenerationParameters
Deployment-owned generation settings, never supplied through Agent constraints. None leaves the setting unspecified. Adapters must apply every explicit value or reject it; this basic validation does not establish model/provider support.
Message
Provider-neutral conversation message.
ModelCapabilities
Confirmed model capabilities. Missing information never establishes support.
ModelConstraints
Caller-declared requirements. True requires confirmed support; false imposes no requirement. Adapters must not infer or override these flags from message content.
ModelMode
Logical model mode selected by the product, independent of provider and model identifiers.
ModelProfile
Provider-neutral limits for one frozen logical model route.
TokenUsage
Normalized token accounting reported by an implementation.
ToolCall
Tool call returned by an LLM.
ToolDefinition
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§

ContentPart
One typed part of a model message.
FinishReason
Why a model invocation stopped.
MessageRole
Role of a message in a model conversation.

Constants§

MESSAGE_SCHEMA
Offline normative schema for persisted model messages.