pub struct TextMessageStartEvent {
pub base: BaseEvent,
pub message_id: MessageId,
pub role: TextMessageRole,
pub name: Option<String>,
pub subagent_run_id: Option<SubagentRunId>,
}Expand description
Opens a text message. Every following TEXT_MESSAGE_CONTENT with the same
message_id appends to it, until TEXT_MESSAGE_END.
Fields§
§base: BaseEventTimestamp and raw provider event.
message_id: MessageIdId of the message being opened.
role: TextMessageRoleWho is speaking. Defaults to assistant when omitted, and a JSON null
reads as omitted.
name: Option<String>Display name for the author.
subagent_run_id: Option<SubagentRunId>The subagent that produced this event; absent means the parent agent.
A JSON null is rejected — see crate::event::subagent.
Implementations§
Source§impl TextMessageStartEvent
impl TextMessageStartEvent
Sourcepub fn new(message_id: impl Into<MessageId>, role: TextMessageRole) -> Self
pub fn new(message_id: impl Into<MessageId>, role: TextMessageRole) -> Self
Opens a message with the given id and role.
Trait Implementations§
Source§impl Clone for TextMessageStartEvent
impl Clone for TextMessageStartEvent
Source§fn clone(&self) -> TextMessageStartEvent
fn clone(&self) -> TextMessageStartEvent
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl ComposeSchema for TextMessageStartEvent
impl ComposeSchema for TextMessageStartEvent
Source§impl Debug for TextMessageStartEvent
impl Debug for TextMessageStartEvent
Source§impl Default for TextMessageStartEvent
impl Default for TextMessageStartEvent
Source§fn default() -> TextMessageStartEvent
fn default() -> TextMessageStartEvent
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for TextMessageStartEvent
impl<'de> Deserialize<'de> for TextMessageStartEvent
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
Source§impl From<TextMessageStartEvent> for Event
impl From<TextMessageStartEvent> for Event
Source§fn from(payload: TextMessageStartEvent) -> Self
fn from(payload: TextMessageStartEvent) -> Self
Converts to this type from the input type.
Source§impl JsonSchema for TextMessageStartEvent
impl JsonSchema for TextMessageStartEvent
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for TextMessageStartEvent
impl PartialEq for TextMessageStartEvent
Source§fn eq(&self, other: &TextMessageStartEvent) -> bool
fn eq(&self, other: &TextMessageStartEvent) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for TextMessageStartEvent
impl Serialize for TextMessageStartEvent
impl StructuralPartialEq for TextMessageStartEvent
Auto Trait Implementations§
impl Freeze for TextMessageStartEvent
impl RefUnwindSafe for TextMessageStartEvent
impl Send for TextMessageStartEvent
impl Sync for TextMessageStartEvent
impl Unpin for TextMessageStartEvent
impl UnsafeUnpin for TextMessageStartEvent
impl UnwindSafe for TextMessageStartEvent
Blanket Implementations§
impl<T> AgentState for T
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