Skip to main content

ProviderResp

Struct ProviderResp 

Source
pub struct ProviderResp {
    pub output: Value,
    pub usage: Option<Usage>,
    pub cost_usd: Option<f64>,
    pub error: Option<ProtocolError>,
    pub metadata: Option<Value>,
    pub stop_reason: Option<String>,
    pub empty_reason: Option<String>,
    pub reasoning: Option<String>,
    pub model: Option<String>,
    pub tool_calls: Vec<ToolCall>,
}
Expand description

A provider response read from the child’s stdout. Only output is required.

Default is derived so a child can write ProviderResp { output, ..Default::default() } and stay correct as optional fields are added — the shape a provider author reaches for first should not have to enumerate fields it does not use.

Fields§

§output: Value§usage: Option<Usage>§cost_usd: Option<f64>§error: Option<ProtocolError>§metadata: Option<Value>§stop_reason: Option<String>

The vendor’s finish reason, verbatim (end_turn, length, refusal, …). Free-form: this crate never checks it against a list, because the list grows at model-release cadence with no domarinn release in the loop.

§empty_reason: Option<String>

Why output has nothing gradeable in it, when it does not.

Set this when you know — a refusal, a truncation, a tool call with no prose — rather than returning an empty string and letting every assertion score zero for a reason that has nothing to do with the prompt. See docs/protocol.md for the known values; an unrecognized one is carried through verbatim and is never an error.

§reasoning: Option<String>

The model’s reasoning or thinking text, when the child can expose it.

§model: Option<String>

The model actually used, as opposed to the one requested — an alias that silently repoints to a new snapshot has no other signal.

Response metadata, not request identity: it never enters a cache key, because a key cannot depend on something learned after the call.

§tool_calls: Vec<ToolCall>

The tool calls the model made, in the order it made them.

Report these whenever the model called a tool, including when it also produced text. A case whose right answer is a tool call has no gradeable prose, and returning "" scores it zero for a reason unrelated to the prompt — set empty_reason: "tool_use_only" alongside these when that is what happened.

Trait Implementations§

Source§

impl Clone for ProviderResp

Source§

fn clone(&self) -> ProviderResp

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ProviderResp

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ProviderResp

Source§

fn default() -> ProviderResp

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for ProviderResp

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for ProviderResp

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,