Skip to content
中文

Models & interaction ​

Core · Interfaces & runtime guarantees · Back to layer index

SymbolKindPurpose
AggregatedToolCallinterfaceOne completed native tool call in provider index order.
AsIntenttypeDemand-discovery metadata; it has no identity independent of its tool.
ChatProviderclassStreaming model provider. Implementations must stop producing when context.signal aborts and should surface transport failures by rejecting the iteration rather than ending it silently.
createModelTransportfunctionCompose a registered selection transport. The capability source may be a static catalog or a function of the stage id; the resulting definitions are captured when prepare runs and are used both to build the instruction and to reject unknown capability ids at finish time. requireStrictArguments is a registration-time assertion: a transport cannot demand strict arguments from an adapter that does not support them.
createToolCallCollectorfunctionCreate a collector for one response.
FunctionCallDeltainterfaceOne streamed fragment of a function call; fragments with the same index must be joined.
IntentOptionsinterfaceDemand-facing hints attached to one Tool; no independent identity is created.
jsonObjectInteractionconstant
ModelAssistantToolMessagetypeAssistant turn that may declare tool calls and may carry an empty text body.
ModelCallRequesttypeOne model call request. The input shape selects prompt mode or message mode.
ModelCallTraceinterfaceAccumulated facts of one model call, reported on success and on failure.
ModelChildOptionsinterfaceRequest-bound isolated runner settings; provider and ancestor budgets cannot be replaced.
ModelChildPolicyinterfaceRequest-wide limits, shared by every descendant. They cannot be enlarged by a child.
ModelFunctioninterfaceProvider-neutral function definition. Execution and authorization stay with the host.
ModelImageinterfaceModel message primitives shared by every provider adapter. These shapes are deliberately provider-neutral: they describe text, optional images, streamed parts and the options a call may carry. Provider-specific wire formats stay in support/model. Exports: ModelImage, ModelMessage, ModelToolCall, ModelAssistantToolMessage, ModelToolResultMessage, ModelUsage, ModelFunction, FunctionCallDelta, ModelPart, ModelOptions.
ModelInputMeasurementinterfaceExact prepared-request accounting; token values exist only with an explicit model counter.
ModelInteractionAdapterinterfacePluggable implementations all consume the same business registry. No automatic fallback.
ModelMessageinterfaceOne provider-neutral turn; images are user visual input and are not part of the text budget.
ModelOptionsinterfacePer-call provider options; Core passes them through and does not normalize provider ranges.
ModelOutputEventtypeDelivery sink, awaited in order. Parts are unvalidated proposals, never execution receipts.
ModelParttypeOne streamed response part: assistant text or a function-call fragment.
ModelPrepareRequestinterfaceTransport selection for prepare; omitted fields take the runner defaults.
modelProtocolErrorfunctionThrow a model protocol validation error.
ModelProviderContextinterfacePer-call facts a provider receives besides the messages themselves.
ModelResponseCollectorinterfaceAccumulates streamed parts for one call and resolves them into the transport's result.
ModelRunnerclassExecute registered model stages under one request's budgets and lifetime. Invariants: at most one call is in flight per runner; callCount and journal are local to the runner while totalCallCount includes descendants; every call is charged to the shared budget before I/O and every failure is annotated with its stage before it propagates. No business prompts, domain stages or provider SDKs are built into this runner.
modelRunnerDefaultsconstant
ModelRunnerOptionstypeFull runner construction options: provider, transports, sinks and named limits.
ModelRunnerPortsinterfaceHost ports a model runner needs in addition to its provider and transports.
ModelRunnerSettingsinterfaceNamed settings keep all model limits together; output token reservation stays per call.
ModelRuntimeConfiginterfacePer-request model runtime limits.
ModelSelectiontypeA model's chosen capability together with its parsed arguments.
ModelSessionCallinterfaceOne completed tool call in a session response.
ModelSessionResultinterfaceComplete result of one session response.
ModelTokenBudgetinterfaceProvider-injected token accounting. Core never guesses a character-to-token conversion, so token budgets exist only when a host supplies a real counter.
ModelToolinterfaceCommon selectable model interface; resolution proposes a value without business execution.
ModelToolCallinterfaceOne tool call the assistant declared, in provider order.
ModelToolCatalogtypeA compiled entity catalog also supports the minimal stage source contract.
ModelToolRegistrationtypeRegistration form: input typing is erased, output typing is preserved.
ModelToolRegistryclassA request/stage projection is a sealed registry. Hosts filter availability before projection.
ModelToolResultMessagetypeTool result turn; toolCallId is required and images/tool declarations are rejected.
ModelToolSourceinterfaceMinimal source a stage needs: enumerate tools and resolve one selection.
ModelTransportDefinitioninterfaceOne registered transport: a wire format prepared for a stage.
ModelTransportRegistrationinterfaceBinds an adapter to the tools one transport serves.
ModelUsageinterfaceProvider-reported token counts for one call; used for accounting, never for admission.
NativeFunctionCallinterfaceRequest-local native call buffer; never an execution receipt.
nativeFunctionInteractionconstant
PreparedModelCallinterfaceRequest-bound, single-use transport snapshot. Repeated measurements do not prepare or spend calls.
PreparedModelInteractioninterfaceAdapter output for one stage, before the caller binds capability resolution.
PreparedModelTransportinterfacePrepared transport handed to the runner, including sampling defaults.
RegisteredModelTooltypeFrozen snapshot stored by a registry after schema validation.
RegisteredTransportOutputtypeResult type of a transport selected by id. core:plain-text yields string, a registered id yields its declared result, and an id the runner does not know yields unknown rather than a guessed type.
retryMultipleModelCallsfunctionRetry once when the failure is a rejected multi-call proposal. Only the MODEL_MULTIPLE_CALLS code is retried; every other failure is rethrown unchanged. The caller owns the fallback prompt and the budget it consumes.
ToolCallCollectorinterfaceAggregation entry point for streamed function-call deltas.
ToolCallFailuretypeReport a protocol violation and stop; callers decide how the failure is classified.
ToolConditiontypeActivation is independent of participation in demand discovery.
ToolContexttypeRead-only host data without changing explicit any/unknown erasure into an object constraint.
ToolProposalinterfaceA model proposal, not an authorization or execution receipt.

API reference, usage examples and developer guides.