pub struct ChatEvent {Show 15 fields
pub recorded_at: DateTime<Utc>,
pub workspace: PathBuf,
pub session_id: String,
pub role: String,
pub agent_name: Option<String>,
pub message_type: String,
pub content: Option<String>,
pub tool_name: Option<String>,
pub tool_success: Option<bool>,
pub tool_duration_ms: Option<u64>,
pub parent_event_id: Option<String>,
pub sequence: u64,
pub okr_id: Option<String>,
pub okr_run_id: Option<String>,
pub relay_id: Option<String>,
}Expand description
A single event in the JSONL event stream
Fields§
§recorded_at: DateTime<Utc>When the event was recorded (ISO 8601)
workspace: PathBufWorkspace/working directory
session_id: StringSession identifier
role: StringRole: user, assistant, tool
agent_name: Option<String>Agent name if applicable
message_type: StringMessage type: message_start, message_end, tool_call, tool_result, etc.
content: Option<String>Event content (truncated for large outputs)
tool_name: Option<String>Tool name if this is a tool event
tool_success: Option<bool>Whether tool succeeded
tool_duration_ms: Option<u64>Tool execution duration in milliseconds
parent_event_id: Option<String>Parent event ID for traceability
sequence: u64Sequence number in the session
okr_id: Option<String>OKR ID if this event is part of an OKR-gated operation
okr_run_id: Option<String>OKR run ID if this event is part of an OKR run
relay_id: Option<String>Relay ID if this event is part of a relay execution
Implementations§
Source§impl ChatEvent
impl ChatEvent
Sourcepub fn new(
workspace: PathBuf,
session_id: String,
role: &str,
message_type: &str,
sequence: u64,
) -> Self
pub fn new( workspace: PathBuf, session_id: String, role: &str, message_type: &str, sequence: u64, ) -> Self
Create a new chat event
Sourcepub fn with_okr(
self,
okr_id: Option<String>,
okr_run_id: Option<String>,
relay_id: Option<String>,
) -> Self
pub fn with_okr( self, okr_id: Option<String>, okr_run_id: Option<String>, relay_id: Option<String>, ) -> Self
Create a chat event with OKR correlation
Sourcepub fn tool_result(
workspace: PathBuf,
session_id: String,
tool_name: &str,
success: bool,
duration_ms: u64,
content: &str,
sequence: u64,
) -> Self
pub fn tool_result( workspace: PathBuf, session_id: String, tool_name: &str, success: bool, duration_ms: u64, content: &str, sequence: u64, ) -> Self
Create a tool result event
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ChatEvent
impl<'de> Deserialize<'de> for ChatEvent
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ChatEvent
impl RefUnwindSafe for ChatEvent
impl Send for ChatEvent
impl Sync for ChatEvent
impl Unpin for ChatEvent
impl UnwindSafe for ChatEvent
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§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>
Wrap the input message
T in a tonic::RequestSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> Serialize for T
impl<T> Serialize for T
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>
fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>
Source§impl<T> ServiceExt for T
impl<T> ServiceExt for T
Source§fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
Apply a transformation to the response body. Read more
Source§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using HTTP status codes. Read more
Source§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using gRPC headers. Read more