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
impl Clone for ProviderResp
Source§fn clone(&self) -> ProviderResp
fn clone(&self) -> ProviderResp
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more