pub struct ReasoningHandle<'a, S> { /* private fields */ }Expand description
One open reasoning block.
Created by RunContext::reasoning. The
REASONING_* family nests a message inside a block, so the handle brackets
four events rather than two:
REASONING_START ← on creation
REASONING_MESSAGE_START ← on creation
REASONING_MESSAGE_CONTENT × n
REASONING_MESSAGE_END ← on end() or Drop
REASONING_END ← on end() or DropUse it for model reasoning you want the client to render. Reasoning a
provider returns only as an opaque blob goes through
encrypted_value instead.
Implementations§
Source§impl<'a, S> ReasoningHandle<'a, S>
impl<'a, S> ReasoningHandle<'a, S>
Sourcepub fn delta(&mut self, text: impl Into<String>) -> Result<()>
pub fn delta(&mut self, text: impl Into<String>) -> Result<()>
Appends reasoning text — REASONING_MESSAGE_CONTENT.
Sourcepub fn encrypted_value(&mut self, value: impl Into<String>) -> Result<()>
pub fn encrypted_value(&mut self, value: impl Into<String>) -> Result<()>
Attaches the provider’s opaque reasoning signature —
REASONING_ENCRYPTED_VALUE.
Under zero-data-retention the provider returns no readable reasoning, only a blob that must be replayed on the next request for the model to stay coherent.
Source§impl<S: AgentState> ReasoningHandle<'_, S>
The run’s state, reachable while the block is open. See
ToolCallHandle, where this matters most.
impl<S: AgentState> ReasoningHandle<'_, S>
The run’s state, reachable while the block is open. See
ToolCallHandle, where this matters most.
Sourcepub fn state_mut(&mut self) -> &mut S
pub fn state_mut(&mut self) -> &mut S
The typed state, mutably. Nothing is emitted until you call
publish_state.
Sourcepub fn publish_state(&mut self) -> Result<()>
pub fn publish_state(&mut self) -> Result<()>
Publishes whatever state_mut left behind, as a
STATE_SNAPSHOT or a STATE_DELTA inside this block’s brackets.
A no-op when nothing changed since the last publish.