pub enum ReasoningFormat {
AnthropicClaudeV1,
GoogleGeminiV1,
OpenaiResponsesV1,
AzureOpenaiResponsesV1,
XaiResponsesV1,
Unknown,
}Expand description
Tagged provider source for a reasoning item.
Mirrors the format field on OpenRouter’s reasoning_details
items, plus an Unknown fallback so we never silently drop a
payload from an unrecognized future provider.
Variants§
AnthropicClaudeV1
format: "anthropic-claude-v1" — Claude thinking /
redacted_thinking blocks; signature field on the
Text variant is mandatory round-trip when next turn has
tool_result.
GoogleGeminiV1
format: "google-gemini-v1" — Vertex AI / AI Studio
Gemini 2.5+. Encrypted variant carries the
thoughtSignature blob OpenRouter explodes out of the
per-Part attachment. Gemini 3 with tools requires exact
round-trip or returns 400 INVALID_ARGUMENT “Thought
signature is not valid”.
OpenaiResponsesV1
format: "openai-responses-v1" — OpenAI o-series via the
Responses API. Encrypted.data holds encrypted_content;
callers must opt in via include: ["reasoning.encrypted_content"].
AzureOpenaiResponsesV1
format: "azure-openai-responses-v1" — Azure variant of
the same shape.
XaiResponsesV1
format: "xai-responses-v1" — xAI Grok via the Responses
API.
Unknown
Anything else. Round-tripped opaquely; the codec preserves
the original Value as raw so a future provider never
silently loses fidelity.
Implementations§
Source§impl ReasoningFormat
impl ReasoningFormat
pub fn as_wire(&self) -> &'static str
pub fn from_wire(s: &str) -> Self
Sourcepub fn replay_contract(&self) -> ReplayContract
pub fn replay_contract(&self) -> ReplayContract
Replay contract this provider format imposes on the next turn.
Each variant’s enforcement story lives in the variant’s own docs; this method is the typed projection the audit pipeline reads. Centralizing here keeps the audit free of per-provider switches and gives new providers exactly one place to declare their contract.
Trait Implementations§
Source§impl Clone for ReasoningFormat
impl Clone for ReasoningFormat
Source§fn clone(&self) -> ReasoningFormat
fn clone(&self) -> ReasoningFormat
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ReasoningFormat
impl Debug for ReasoningFormat
Source§impl<'de> Deserialize<'de> for ReasoningFormat
impl<'de> Deserialize<'de> for ReasoningFormat
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Hash for ReasoningFormat
impl Hash for ReasoningFormat
Source§impl PartialEq for ReasoningFormat
impl PartialEq for ReasoningFormat
Source§fn eq(&self, other: &ReasoningFormat) -> bool
fn eq(&self, other: &ReasoningFormat) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for ReasoningFormat
impl Serialize for ReasoningFormat
impl Copy for ReasoningFormat
impl Eq for ReasoningFormat
impl StructuralPartialEq for ReasoningFormat
Auto Trait Implementations§
impl Freeze for ReasoningFormat
impl RefUnwindSafe for ReasoningFormat
impl Send for ReasoningFormat
impl Sync for ReasoningFormat
impl Unpin for ReasoningFormat
impl UnsafeUnpin for ReasoningFormat
impl UnwindSafe for ReasoningFormat
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.