pub enum ExecutionPhase {
Commentary,
FinalAnswer,
}Expand description
Execution phase for assistant messages in multi-step tool-calling flows.
Providers that natively support phases (OpenAI GPT-5.x) send the phase value directly in the API request. For providers without native support (Anthropic, Gemini), the phase is still tracked internally and derived from state in the ReasonAtom, but is not sent to the provider API.
Serialized as lowercase strings for backward compatibility with existing
persisted messages: "commentary" and "final_answer".
Legacy values "in_progress" and "completed" are accepted during
deserialization for backward compatibility.
Variants§
Commentary
Intermediate update — preamble or commentary before/between tool calls. The model is still working and may issue more tool calls.
FinalAnswer
Final completed response — no more tool calls expected.
Implementations§
Source§impl ExecutionPhase
impl ExecutionPhase
Sourcepub fn from_has_tool_calls(has_tool_calls: bool) -> Self
pub fn from_has_tool_calls(has_tool_calls: bool) -> Self
Derive phase from whether the response contains tool calls.
Sourcepub fn from_provider_str(s: &str) -> Option<Self>
pub fn from_provider_str(s: &str) -> Option<Self>
Parse a provider wire value into an ExecutionPhase.
Returns None for unrecognized values.
Sourcepub fn as_provider_str(&self) -> &'static str
pub fn as_provider_str(&self) -> &'static str
Wire value used by providers that support native phases (OpenAI).
Trait Implementations§
Source§impl Clone for ExecutionPhase
impl Clone for ExecutionPhase
Source§fn clone(&self) -> ExecutionPhase
fn clone(&self) -> ExecutionPhase
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 ExecutionPhase
Source§impl Debug for ExecutionPhase
impl Debug for ExecutionPhase
Source§impl<'de> Deserialize<'de> for ExecutionPhase
impl<'de> Deserialize<'de> for ExecutionPhase
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Source§impl Display for ExecutionPhase
impl Display for ExecutionPhase
impl Eq for ExecutionPhase
Source§impl PartialEq for ExecutionPhase
impl PartialEq for ExecutionPhase
Source§fn eq(&self, other: &ExecutionPhase) -> bool
fn eq(&self, other: &ExecutionPhase) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for ExecutionPhase
impl Serialize for ExecutionPhase
impl StructuralPartialEq for ExecutionPhase
Auto Trait Implementations§
impl Freeze for ExecutionPhase
impl RefUnwindSafe for ExecutionPhase
impl Send for ExecutionPhase
impl Sync for ExecutionPhase
impl Unpin for ExecutionPhase
impl UnsafeUnpin for ExecutionPhase
impl UnwindSafe for ExecutionPhase
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request