#[non_exhaustive]pub struct StreamAssistResponse {
pub answer: Option<AssistAnswer>,
pub session_info: Option<SessionInfo>,
pub assist_token: String,
/* private fields */
}assistant-service only.Expand description
Response for the [AssistantService.StreamAssist][google.cloud.discoveryengine.v1.AssistantService.StreamAssist] method.
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.answer: Option<AssistAnswer>Assist answer resource object containing parts of the assistant’s final answer for the user’s query.
Not present if the current response doesn’t add anything to previously sent AssistAnswer.replies.
Observe
AssistAnswer.state to
see if more parts are to be expected. While the state is IN_PROGRESS, the
AssistAnswer.replies
field in each response will contain replies (reply fragments) to be
appended to the ones received in previous responses. AssistAnswer.name
won’t be filled.
If the state is SUCCEEDED, FAILED or SKIPPED, the response
is the last response and AssistAnswer.name will have a value.
session_info: Option<SessionInfo>Session information.
assist_token: StringA global unique ID that identifies the current pair of request and stream of responses. Used for feedback and support.
Implementations§
Source§impl StreamAssistResponse
impl StreamAssistResponse
pub fn new() -> Self
Sourcepub fn set_answer<T>(self, v: T) -> Selfwhere
T: Into<AssistAnswer>,
pub fn set_answer<T>(self, v: T) -> Selfwhere
T: Into<AssistAnswer>,
Sourcepub fn set_or_clear_answer<T>(self, v: Option<T>) -> Selfwhere
T: Into<AssistAnswer>,
pub fn set_or_clear_answer<T>(self, v: Option<T>) -> Selfwhere
T: Into<AssistAnswer>,
Sourcepub fn set_session_info<T>(self, v: T) -> Selfwhere
T: Into<SessionInfo>,
pub fn set_session_info<T>(self, v: T) -> Selfwhere
T: Into<SessionInfo>,
Sets the value of session_info.
§Example
use google_cloud_discoveryengine_v1::model::stream_assist_response::SessionInfo;
let x = StreamAssistResponse::new().set_session_info(SessionInfo::default()/* use setters */);Sourcepub fn set_or_clear_session_info<T>(self, v: Option<T>) -> Selfwhere
T: Into<SessionInfo>,
pub fn set_or_clear_session_info<T>(self, v: Option<T>) -> Selfwhere
T: Into<SessionInfo>,
Sets or clears the value of session_info.
§Example
use google_cloud_discoveryengine_v1::model::stream_assist_response::SessionInfo;
let x = StreamAssistResponse::new().set_or_clear_session_info(Some(SessionInfo::default()/* use setters */));
let x = StreamAssistResponse::new().set_or_clear_session_info(None::<SessionInfo>);Sourcepub fn set_assist_token<T: Into<String>>(self, v: T) -> Self
pub fn set_assist_token<T: Into<String>>(self, v: T) -> Self
Sets the value of assist_token.
§Example
let x = StreamAssistResponse::new().set_assist_token("example");Trait Implementations§
Source§impl Clone for StreamAssistResponse
impl Clone for StreamAssistResponse
Source§fn clone(&self) -> StreamAssistResponse
fn clone(&self) -> StreamAssistResponse
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more