pub struct TurnOutcome {
pub reply: String,
pub events: Vec<AgentEvent>,
pub citations: Vec<Citation>,
}Expand description
The outcome of running one knowledge-grounded turn through the agent.
Carries the final assistant text plus every AgentEvent the engine
emitted during the run — so callers (and tests) can inspect exactly what
happened: which tools ran, what they returned, how many iterations.
Fields§
§reply: StringThe agent’s final natural-language reply (the last assistant turn with no pending tool calls). Empty string if the agent produced no text.
events: Vec<AgentEvent>Every event the engine emitted, in order. Inspect for
AgentEvent::ToolCallStart / AgentEvent::ToolCallComplete to
prove a knowledge search happened.
citations: Vec<Citation>The sources that grounded this turn, deduplicated by id and capped at
MAX_CITATIONS. Collected from the documents the turn actually
retrieved — the engine’s auto-injected [Relevant knowledge] context
(mirrored by the runtime) plus every knowledge_search tool result.
Empty when nothing was retrieved.
Implementations§
Source§impl TurnOutcome
impl TurnOutcome
Sourcepub fn invoked_tool(&self, tool_name: &str) -> bool
pub fn invoked_tool(&self, tool_name: &str) -> bool
true if the agent invoked a tool named tool_name during the turn.
Sourcepub fn tool_result(&self, tool_name: &str) -> Option<&str>
pub fn tool_result(&self, tool_name: &str) -> Option<&str>
The completed result text of the first call to tool_name, if any.
Sourced from AgentEvent::ToolCallComplete (truncated to ~500 chars
by the engine), so a test can assert the tool returned the seeded doc.
Trait Implementations§
Source§impl Clone for TurnOutcome
impl Clone for TurnOutcome
Source§fn clone(&self) -> TurnOutcome
fn clone(&self) -> TurnOutcome
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for TurnOutcome
impl RefUnwindSafe for TurnOutcome
impl Send for TurnOutcome
impl Sync for TurnOutcome
impl Unpin for TurnOutcome
impl UnsafeUnpin for TurnOutcome
impl UnwindSafe for TurnOutcome
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,
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