pub trait ModelTransport: Send + Sync {
// Required methods
fn chat_turn<'a>(
&'a self,
model: &'a ModelId,
conversation: &'a Conversation,
tools: &'a [ToolSpec],
choice: ToolChoicePolicy,
) -> TransportFuture<'a, TurnOutput>;
fn capabilities(&self, model: &ModelId) -> ProviderCapabilities;
fn family_of(&self, model: &ModelId) -> ModelFamily;
fn adapter_kind(&self) -> &'static str;
// Provided methods
fn chat_turn_with_options<'a>(
&'a self,
model: &'a ModelId,
conversation: &'a Conversation,
tools: &'a [ToolSpec],
choice: ToolChoicePolicy,
_options: GenerationOptions,
) -> TransportFuture<'a, TurnOutput> { ... }
fn prompt_route(&self, model: &ModelId) -> PromptRoute { ... }
}Expand description
The transport port: one assistant turn against one fully qualified model.
Required Methods§
Sourcefn chat_turn<'a>(
&'a self,
model: &'a ModelId,
conversation: &'a Conversation,
tools: &'a [ToolSpec],
choice: ToolChoicePolicy,
) -> TransportFuture<'a, TurnOutput>
fn chat_turn<'a>( &'a self, model: &'a ModelId, conversation: &'a Conversation, tools: &'a [ToolSpec], choice: ToolChoicePolicy, ) -> TransportFuture<'a, TurnOutput>
Run one chat turn: render the conversation for the route’s provider, send the tool specs, and return either tool calls or text.
The transport records nothing; observation recording is the caller’s obligation (R2) so that replay never re-invokes a provider.
Sourcefn capabilities(&self, model: &ModelId) -> ProviderCapabilities
fn capabilities(&self, model: &ModelId) -> ProviderCapabilities
The route’s capability record (declared or probed).
Sourcefn family_of(&self, model: &ModelId) -> ModelFamily
fn family_of(&self, model: &ModelId) -> ModelFamily
The model’s training lineage — a routing prior, never a measurement.
Sourcefn adapter_kind(&self) -> &'static str
fn adapter_kind(&self) -> &'static str
The stable transport adapter identity (PSP-10 system 24). This is
NOT the configured endpoint id: endpoint names identify locations
and credentials, never model behavior. Scripted transports return
"scripted".
Provided Methods§
Sourcefn chat_turn_with_options<'a>(
&'a self,
model: &'a ModelId,
conversation: &'a Conversation,
tools: &'a [ToolSpec],
choice: ToolChoicePolicy,
_options: GenerationOptions,
) -> TransportFuture<'a, TurnOutput>
fn chat_turn_with_options<'a>( &'a self, model: &'a ModelId, conversation: &'a Conversation, tools: &'a [ToolSpec], choice: ToolChoicePolicy, _options: GenerationOptions, ) -> TransportFuture<'a, TurnOutput>
Run one turn with explicit generation controls. Implementations that cannot express them retain their ordinary turn behavior.
Sourcefn prompt_route(&self, model: &ModelId) -> PromptRoute
fn prompt_route(&self, model: &ModelId) -> PromptRoute
The prompt identity of one call: adapter kind, model family, and the exact model. A model served through a compatible gateway keeps its own family identity.