pub struct OpenRouterExt;Trait Implementations§
Source§impl<H> Capabilities<H> for OpenRouterExt
impl<H> Capabilities<H> for OpenRouterExt
Source§type Completion = Capable<GenericCompletionModel<OpenRouterExt, H>>
type Completion = Capable<GenericCompletionModel<OpenRouterExt, H>>
Source§type Embeddings = Capable<GenericEmbeddingModel<OpenRouterExt, H>>
type Embeddings = Capable<GenericEmbeddingModel<OpenRouterExt, H>>
Source§type Transcription = Capable<GenericTranscriptionModel<OpenRouterExt, H>>
type Transcription = Capable<GenericTranscriptionModel<OpenRouterExt, H>>
Source§type ModelListing = Capable<OpenRouterModelLister<H>>
type ModelListing = Capable<OpenRouterModelLister<H>>
Source§type ImageGeneration = Nothing
type ImageGeneration = Nothing
image only.Source§type AudioGeneration = Capable<GenericAudioGenerationModel<OpenRouterExt, H>>
type AudioGeneration = Capable<GenericAudioGenerationModel<OpenRouterExt, H>>
audio only.Source§impl Clone for OpenRouterExt
impl Clone for OpenRouterExt
Source§fn clone(&self) -> OpenRouterExt
fn clone(&self) -> OpenRouterExt
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for OpenRouterExt
Source§impl Debug for OpenRouterExt
impl Debug for OpenRouterExt
Source§impl DebugExt for OpenRouterExt
impl DebugExt for OpenRouterExt
Source§impl Default for OpenRouterExt
impl Default for OpenRouterExt
Source§fn default() -> OpenRouterExt
fn default() -> OpenRouterExt
Source§impl OpenAICompatibleProvider for OpenRouterExt
impl OpenAICompatibleProvider for OpenRouterExt
Source§fn streaming_detail_reasoning(
&self,
detail: &Value,
) -> Option<(StreamPartId, Option<WireId>, ReasoningContent)>
fn streaming_detail_reasoning( &self, detail: &Value, ) -> Option<(StreamPartId, Option<WireId>, ReasoningContent)>
Encrypted reasoning ({"type":"reasoning.encrypted"}) is the turn’s own
output, not tool-call metadata: it arrives with reasoning: null and an
rs_* id of its own, which never matches a call_* tool-call id, and it
arrives before any tool call opens. Emitting it as a reasoning block
matches the non-streaming path (which maps the same detail to
message::ReasoningContent::Encrypted) and is what lets the blob reach
the aggregated choice and be replayed on the next turn.
Source§fn streaming_reasoning_signature(&self, detail: &Value) -> Option<String>
fn streaming_reasoning_signature(&self, detail: &Value) -> Option<String>
Anthropic routes stream the plaintext in delta.reasoning, then send
its replay-required signature as a final signature-only
reasoning.text detail immediately before the tool call. Feed that
authoritative close into the shared lifecycle so the normalized
reasoning block is signed just like the blocking response.
Source§const PROVIDER_NAME: &'static str = self::PROVIDER_NAME
const PROVIDER_NAME: &'static str = self::PROVIDER_NAME
gen_ai.provider.name telemetry spans.Source§const STREAM_INCLUDE_USAGE: bool = false
const STREAM_INCLUDE_USAGE: bool = false
"stream_options": {"include_usage": true}. Providers that reject
unknown parameters and already report usage on the final chunk set
this to false.Source§type StreamingUsage = Usage
type StreamingUsage = Usage
Usage for most providers;
providers with richer usage accounting (e.g. Mistral’s cached-token
fallbacks, DeepSeek’s cache hit/miss counters) substitute their own.Source§type Response = CompletionResponse
type Response = CompletionResponse
Source§fn map_streaming_finish_reason(
&self,
finish_reason: Option<&str>,
native_finish_reason: Option<&str>,
) -> Option<FinishReason>
fn map_streaming_finish_reason( &self, finish_reason: Option<&str>, native_finish_reason: Option<&str>, ) -> Option<FinishReason>
Source§fn build_completion_request(
&self,
model: String,
request: CompletionRequest,
options: CompletionModelOptions,
) -> Result<CompletionRequest, CompletionError>
fn build_completion_request( &self, model: String, request: CompletionRequest, options: CompletionModelOptions, ) -> Result<CompletionRequest, CompletionError>
GenericCompletionModel for sending,
streaming, error handling, and telemetry.Source§fn finalize_request_body_with_options(
&self,
body: &mut Value,
options: CompletionModelOptions,
) -> Result<(), CompletionError>
fn finalize_request_body_with_options( &self, body: &mut Value, options: CompletionModelOptions, ) -> Result<(), CompletionError>
finalize_request_body instead.Source§const REQUEST_ID_HEADER: Option<&'static str> = None
const REQUEST_ID_HEADER: Option<&'static str> = None
x-request-id). None — the
default — means the provider does not report one; the normalized
response’s provider_request_id is then None, never an error.Source§const EMITS_COMPLETE_SINGLE_CHUNK_TOOL_CALLS: bool = false
const EMITS_COMPLETE_SINGLE_CHUNK_TOOL_CALLS: bool = false
Source§const SUPPORTS_TOOLS: bool = true
const SUPPORTS_TOOLS: bool = true
tools and
tool_choice are dropped with a warning during request conversion —
before tool-choice validation, so unsupported tool configurations
never error client-side on a provider that ignores tools anyway.Source§const SUPPORTS_RESPONSE_FORMAT: bool = true
const SUPPORTS_RESPONSE_FORMAT: bool = true
output_schema maps to OpenAI’s response_format. Providers
whose APIs reject json_schema response formats set this to false;
the schema is then dropped with a warning instead of being sent.Source§fn requires_modern_output_cap(&self, model: &str) -> bool
fn requires_modern_output_cap(&self, model: &str) -> bool
model’s endpoint rejects the legacy max_tokens field and
requires max_completion_tokens instead. Read moreSource§fn completion_path(&self, model: &str) -> String
fn completion_path(&self, model: &str) -> String
Provider::build_uri.
Providers that route the model through the URL (e.g. Azure deployment
paths) or keep other capabilities on differently-versioned paths
override this. model is the identifier the completion model handle
was created with; per-request model overrides only affect the body.Source§fn prepare_request(
&self,
request: &mut CompletionRequest,
) -> Result<(), CompletionError>
fn prepare_request( &self, request: &mut CompletionRequest, ) -> Result<(), CompletionError>
additional_params).Source§fn finalize_request_body(&self, body: &mut Value) -> Result<(), CompletionError>
fn finalize_request_body(&self, body: &mut Value) -> Result<(), CompletionError>
"any" tool
choice, DeepSeek’s string-flattened message content).Source§fn decorate_streaming_tool_call(
&self,
detail: &Value,
) -> Option<ToolCallDecoration>
fn decorate_streaming_tool_call( &self, detail: &Value, ) -> Option<ToolCallDecoration>
Source§impl Provider for OpenRouterExt
impl Provider for OpenRouterExt
Source§const VERIFY_PATH: &'static str = "/key"
const VERIFY_PATH: &'static str = "/key"
VerifyClient to validate credentials.Source§type Builder = OpenRouterExtBuilder
type Builder = OpenRouterExtBuilder
Auto Trait Implementations§
impl Freeze for OpenRouterExt
impl RefUnwindSafe for OpenRouterExt
impl Send for OpenRouterExt
impl Sync for OpenRouterExt
impl Unpin for OpenRouterExt
impl UnsafeUnpin for OpenRouterExt
impl UnwindSafe for OpenRouterExt
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more