#[non_exhaustive]pub struct SessionEvent {
pub name: String,
pub author: String,
pub content: Option<Content>,
pub invocation_id: String,
pub actions: Option<EventActions>,
pub timestamp: Option<Timestamp>,
pub error_code: String,
pub error_message: String,
pub event_metadata: Option<EventMetadata>,
pub raw_event: Option<Struct>,
/* private fields */
}session-service only.Expand description
An event represents a message from either the user or agent.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringIdentifier. The resource name of the event.
Format:projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}/events/{event}.
Required. The name of the agent that sent the event, or user.
content: Option<Content>Optional. Content of the event provided by the author.
invocation_id: StringRequired. The invocation id of the event, multiple events can have the same invocation id.
actions: Option<EventActions>Optional. Actions executed by the agent.
timestamp: Option<Timestamp>Required. Timestamp when the event was created on client side.
error_code: StringOptional. Error code if the response is an error. Code varies by model.
error_message: StringOptional. Error message if the response is an error.
event_metadata: Option<EventMetadata>Optional. Metadata relating to this event.
raw_event: Option<Struct>Optional. Weakly typed raw event data in proto struct format.
Implementations§
Source§impl SessionEvent
impl SessionEvent
pub fn new() -> Self
Sourcepub fn set_content<T>(self, v: T) -> Self
pub fn set_content<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_content<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_content<T>(self, v: Option<T>) -> Self
Sourcepub fn set_invocation_id<T: Into<String>>(self, v: T) -> Self
pub fn set_invocation_id<T: Into<String>>(self, v: T) -> Self
Sets the value of invocation_id.
§Example
let x = SessionEvent::new().set_invocation_id("example");Sourcepub fn set_actions<T>(self, v: T) -> Selfwhere
T: Into<EventActions>,
pub fn set_actions<T>(self, v: T) -> Selfwhere
T: Into<EventActions>,
Sourcepub fn set_or_clear_actions<T>(self, v: Option<T>) -> Selfwhere
T: Into<EventActions>,
pub fn set_or_clear_actions<T>(self, v: Option<T>) -> Selfwhere
T: Into<EventActions>,
Sourcepub fn set_timestamp<T>(self, v: T) -> Self
pub fn set_timestamp<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_timestamp<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_timestamp<T>(self, v: Option<T>) -> Self
Sourcepub fn set_error_code<T: Into<String>>(self, v: T) -> Self
pub fn set_error_code<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_error_message<T: Into<String>>(self, v: T) -> Self
pub fn set_error_message<T: Into<String>>(self, v: T) -> Self
Sets the value of error_message.
§Example
let x = SessionEvent::new().set_error_message("example");Sourcepub fn set_event_metadata<T>(self, v: T) -> Selfwhere
T: Into<EventMetadata>,
pub fn set_event_metadata<T>(self, v: T) -> Selfwhere
T: Into<EventMetadata>,
Sets the value of event_metadata.
§Example
use google_cloud_aiplatform_v1::model::EventMetadata;
let x = SessionEvent::new().set_event_metadata(EventMetadata::default()/* use setters */);Sourcepub fn set_or_clear_event_metadata<T>(self, v: Option<T>) -> Selfwhere
T: Into<EventMetadata>,
pub fn set_or_clear_event_metadata<T>(self, v: Option<T>) -> Selfwhere
T: Into<EventMetadata>,
Sets or clears the value of event_metadata.
§Example
use google_cloud_aiplatform_v1::model::EventMetadata;
let x = SessionEvent::new().set_or_clear_event_metadata(Some(EventMetadata::default()/* use setters */));
let x = SessionEvent::new().set_or_clear_event_metadata(None::<EventMetadata>);Sourcepub fn set_raw_event<T>(self, v: T) -> Self
pub fn set_raw_event<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_raw_event<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_raw_event<T>(self, v: Option<T>) -> Self
Trait Implementations§
Source§impl Clone for SessionEvent
impl Clone for SessionEvent
Source§fn clone(&self) -> SessionEvent
fn clone(&self) -> SessionEvent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more