Skip to main content

Module models

Module models 

Expand description

Asynchronous model access explicitly supplied by an authenticated host.

Unlike presentation services this capability has no process default. A host binds its authenticated session to a backend before passing it to an app.

Structs§

Conversation
Portable conversation history. A turn is appended atomically only when every result matches its call, in order. Reusing an executed call id is refused rather than silently replaying an action after an inference retry.
Message
ModelError
Safe frontend diagnostic. Backends must not place credentials or raw provider bodies in message.
ModelRequest
ModelResponse
Models
A cloneable model capability. Clones retain the originating host session; constructing another host does not replace it. Browser backends need not be Send.
ProviderAdministration
Host-scoped authority to administer providers, independent of inference access.
ProviderSnapshot
Authoritative backend settings and their compare-and-swap revision.
StreamState
Retained presentation state for one inference attempt. Deltas are inert; only response() exposes a validated, completed turn for dispatch. There is deliberately no automatic retry: callers keep committed conversation/results and start new inference rather than re-executing a previous action batch.
ToolCall
ToolDefinition
The same schema is used to advertise a tool and validate its arguments. Business validation and permission checks remain with the tool dispatcher.
ToolResult
Usage
Normalized token accounting. Missing provider counters remain zero.

Enums§

Content
CredentialStatus
Non-secret diagnosis of a provider’s credential custody.
ErrorKind
Recovery
What a person can do next. None of these authorize replaying actions.
Role
StopReason
StreamEvent
Presentation-only updates. A call delta, including a complete-looking JSON argument string, must never trigger dispatch. Finished is authoritative.
StreamStatus
Explicit terminal status: transport EOF is never completion.
ToolChoice

Traits§

ModelBackend
ProviderAdmin
An explicitly granted capability, not part of an ordinary model session. Hosts bind the authenticated user before providing this interface. Every operation remains subject to backend authorization and durable-write checks. Dropping a mutation abandons its response, not its durable commit. Refresh configuration/status before deciding whether an interrupted write needs retry.

Type Aliases§

CompletionFuture
No sockets, threads or Send requirement: a browser frontend can implement this using a lightweight backend, while native callers use the gateway.
StreamSink
Local presentation sink. Tool deltas are never authorization to execute.