pub enum ReasoningPlan {
Unset,
Sent(Reasoning),
Attempted(Reasoning),
Unsupported(Reasoning),
}Expand description
What a configured Reasoning will do on the provider that was selected.
Reasoning tokens are billed, so “asked for, and this provider has nowhere to
put it” has to be tellable from “never asked for”. Both used to resolve to
the same None on SelectedLlm, which left korps doctor unable to report
a setting the run would quietly discard.
Variants§
Unset
Nothing was configured; the model’s own default stands.
Sent(Reasoning)
Configured, and this provider puts it on the wire.
Attempted(Reasoning)
Configured, and this provider sends it — but whether the model accepts it is not known until the first call.
OpenAI’s reasoning_effort and Gemini’s thinkingConfig are refused by
the models that do not reason, and which models those are changes with
every release. So the parameter is sent, a refusal is recognized from the
400, and the request is retried without it — meaning this setting may
still end up dropped, and only the run knows.
Unsupported(Reasoning)
Configured, and this provider has no field that carries it. Dropped before any request is made.
Implementations§
Source§impl ReasoningPlan
impl ReasoningPlan
Sourcepub fn carried(reasoning: Option<Reasoning>) -> Self
pub fn carried(reasoning: Option<Reasoning>) -> Self
The plan for a provider that can carry whatever was configured.
Sourcepub fn attempted(reasoning: Option<Reasoning>) -> Self
pub fn attempted(reasoning: Option<Reasoning>) -> Self
The plan for a provider that sends it and finds out from the model.
Sourcepub fn dropped(reasoning: Option<Reasoning>) -> Self
pub fn dropped(reasoning: Option<Reasoning>) -> Self
The plan for a provider with no reasoning field.
Sourcepub fn sent(self) -> Option<Reasoning>
pub fn sent(self) -> Option<Reasoning>
What reaches the wire, if anything. A setting dropped before the request reads as nothing here, because nothing is what gets sent; an attempted one reads as sent, because it is on the first request.
Sourcepub fn requested(self) -> Option<Reasoning>
pub fn requested(self) -> Option<Reasoning>
What was configured, whether or not it will be sent.
Sourcepub fn unsupported(self) -> Option<Reasoning>
pub fn unsupported(self) -> Option<Reasoning>
What this provider was asked for and will not send. Only the settings
answered before a request is made — see Self::attempted for the ones
the model gets the last word on.
Sourcepub fn attempting(self) -> Option<Reasoning>
pub fn attempting(self) -> Option<Reasoning>
What this provider will send and may still have refused. None when the
answer is already known either way.
Trait Implementations§
Source§impl Clone for ReasoningPlan
impl Clone for ReasoningPlan
Source§fn clone(&self) -> ReasoningPlan
fn clone(&self) -> ReasoningPlan
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more