pub struct QueryResult {
pub result: String,
pub session_id: Option<String>,
pub thread_id: Option<String>,
pub cost_usd: Option<f64>,
pub events: Vec<JsonLineEvent>,
}Expand description
A typed summary of a completed codex exec run, assembled from the JSONL
event stream.
This mirrors the shape of claude-wrapper’s QueryResult so a downstream
abstraction can treat both wrappers uniformly. The full parsed event stream
is retained in events as an escape hatch for fields
not surfaced here.
Fields§
§result: StringFinal assistant text from the terminal completed event.
Empty if no completed event carried a result.text value.
session_id: Option<String>The session_id captured from the event stream, if any.
thread_id: Option<String>The thread_id captured from the event stream, if any.
This is Codex’s native identifier for resuming a conversation.
cost_usd: Option<f64>Total cost in USD from the completed event, if reported.
events: Vec<JsonLineEvent>The full parsed event stream this result was assembled from.
Implementations§
Source§impl QueryResult
impl QueryResult
Sourcepub fn from_events(events: Vec<JsonLineEvent>) -> Self
pub fn from_events(events: Vec<JsonLineEvent>) -> Self
Assemble a QueryResult from a parsed JSONL event stream.
result and cost_usd are taken from the last completed event;
session_id and thread_id are the first occurrences in the stream.
Trait Implementations§
Source§impl Clone for QueryResult
impl Clone for QueryResult
Source§fn clone(&self) -> QueryResult
fn clone(&self) -> QueryResult
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more