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
- Model
Error - Safe frontend diagnostic. Backends must not place credentials or raw
provider bodies in
message. - Model
Request - Model
Response - Models
- A cloneable model capability. Clones retain the originating host session; constructing another host does not replace it. Browser backends need not be Send.
- Provider
Administration - Host-scoped authority to administer providers, independent of inference access.
- Provider
Snapshot - Authoritative backend settings and their compare-and-swap revision.
- Stream
State - 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. - Tool
Call - Tool
Definition - The same schema is used to advertise a tool and validate its arguments. Business validation and permission checks remain with the tool dispatcher.
- Tool
Result - Usage
- Normalized token accounting. Missing provider counters remain zero.
Enums§
- Content
- Credential
Status - Non-secret diagnosis of a provider’s credential custody.
- Error
Kind - Recovery
- What a person can do next. None of these authorize replaying actions.
- Role
- Stop
Reason - Stream
Event - Presentation-only updates. A call delta, including a complete-looking JSON
argument string, must never trigger dispatch.
Finishedis authoritative. - Stream
Status - Explicit terminal status: transport EOF is never completion.
- Tool
Choice
Traits§
- Model
Backend - Provider
Admin - 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§
- Completion
Future - No sockets, threads or
Sendrequirement: a browser frontend can implement this using a lightweight backend, while native callers use the gateway. - Stream
Sink - Local presentation sink. Tool deltas are never authorization to execute.