pub struct AgentResponseUpdate {
pub contents: Vec<Content>,
pub role: Option<Role>,
pub author_name: Option<String>,
pub response_id: Option<String>,
pub message_id: Option<String>,
pub conversation_id: Option<String>,
pub created_at: Option<String>,
pub additional_properties: HashMap<String, Value>,
pub raw_representation: Option<Value>,
}Expand description
A single streaming chunk from an agent run.
Fields§
§contents: Vec<Content>§role: Option<Role>§response_id: Option<String>§message_id: Option<String>§conversation_id: Option<String>Service-side conversation id carried by the underlying chat update
(Responses / Assistants / Azure AI service-managed conversations).
Preserved so aggregating a streamed run via
AgentResponse::from_updates yields the same
AgentResponse::conversation_id a non-streaming run() returns.
created_at: Option<String>§additional_properties: HashMap<String, Value>Provider-specific metadata for this update. Merged onto
AgentResponse::additional_properties during aggregation.
raw_representation: Option<Value>The raw provider payload this update was decoded from, if retained.
Implementations§
Source§impl AgentResponseUpdate
impl AgentResponseUpdate
Sourcepub fn user_input_requests(&self) -> Vec<&FunctionApprovalRequestContent>
pub fn user_input_requests(&self) -> Vec<&FunctionApprovalRequestContent>
The user-input (function-approval) requests carried by this update.
Mirrors Python AgentResponseUpdate.user_input_requests.
Sourcepub fn from_chat_update(u: &ChatResponseUpdate) -> AgentResponseUpdate
pub fn from_chat_update(u: &ChatResponseUpdate) -> AgentResponseUpdate
Wrap a chat update as an agent update.
Trait Implementations§
Source§impl Clone for AgentResponseUpdate
impl Clone for AgentResponseUpdate
Source§fn clone(&self) -> AgentResponseUpdate
fn clone(&self) -> AgentResponseUpdate
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 Debug for AgentResponseUpdate
impl Debug for AgentResponseUpdate
Source§impl Default for AgentResponseUpdate
impl Default for AgentResponseUpdate
Source§fn default() -> AgentResponseUpdate
fn default() -> AgentResponseUpdate
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for AgentResponseUpdate
impl<'de> Deserialize<'de> for AgentResponseUpdate
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<AgentResponseUpdate, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<AgentResponseUpdate, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for AgentResponseUpdate
impl Serialize for AgentResponseUpdate
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for AgentResponseUpdate
impl RefUnwindSafe for AgentResponseUpdate
impl Send for AgentResponseUpdate
impl Sync for AgentResponseUpdate
impl Unpin for AgentResponseUpdate
impl UnsafeUnpin for AgentResponseUpdate
impl UnwindSafe for AgentResponseUpdate
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