#[non_exhaustive]pub struct Turn {
pub query: Option<Query>,
pub answer: String,
pub detailed_answer: Option<Answer>,
pub detailed_assist_answer: Option<AssistAnswer>,
pub query_config: HashMap<String, String>,
/* private fields */
}conversational-search-service or session-service only.Expand description
Represents a turn, including a query from the user and a answer from service.
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.query: Option<Query>Optional. The user query. May not be set if this turn is merely regenerating an answer to a different turn
answer: StringOptional. The resource name of the answer to the user query.
Only set if the answer generation (/answer API call) happened in this turn.
detailed_answer: Option<Answer>Output only. In ConversationalSearchService.GetSession API, if GetSessionRequest.include_answer_details is set to true, this field will be populated when getting answer query session.
detailed_assist_answer: Option<AssistAnswer>Output only. In ConversationalSearchService.GetSession API, if GetSessionRequest.include_answer_details is set to true, this field will be populated when getting assistant session.
query_config: HashMap<String, String>Optional. Represents metadata related to the query config, for example LLM model and version used, model parameters (temperature, grounding parameters, etc.). The prefix “google.” is reserved for Google-developed functionality.
Implementations§
Source§impl Turn
impl Turn
Sourcepub fn set_or_clear_query<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_query<T>(self, v: Option<T>) -> Self
Sourcepub fn set_answer<T: Into<String>>(self, v: T) -> Self
pub fn set_answer<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_detailed_answer<T>(self, v: T) -> Self
pub fn set_detailed_answer<T>(self, v: T) -> Self
Sets the value of detailed_answer.
§Example
use google_cloud_discoveryengine_v1::model::Answer;
let x = Turn::new().set_detailed_answer(Answer::default()/* use setters */);Sourcepub fn set_or_clear_detailed_answer<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_detailed_answer<T>(self, v: Option<T>) -> Self
Sets or clears the value of detailed_answer.
§Example
use google_cloud_discoveryengine_v1::model::Answer;
let x = Turn::new().set_or_clear_detailed_answer(Some(Answer::default()/* use setters */));
let x = Turn::new().set_or_clear_detailed_answer(None::<Answer>);Sourcepub fn set_detailed_assist_answer<T>(self, v: T) -> Selfwhere
T: Into<AssistAnswer>,
pub fn set_detailed_assist_answer<T>(self, v: T) -> Selfwhere
T: Into<AssistAnswer>,
Sets the value of detailed_assist_answer.
§Example
use google_cloud_discoveryengine_v1::model::AssistAnswer;
let x = Turn::new().set_detailed_assist_answer(AssistAnswer::default()/* use setters */);Sourcepub fn set_or_clear_detailed_assist_answer<T>(self, v: Option<T>) -> Selfwhere
T: Into<AssistAnswer>,
pub fn set_or_clear_detailed_assist_answer<T>(self, v: Option<T>) -> Selfwhere
T: Into<AssistAnswer>,
Sets or clears the value of detailed_assist_answer.
§Example
use google_cloud_discoveryengine_v1::model::AssistAnswer;
let x = Turn::new().set_or_clear_detailed_assist_answer(Some(AssistAnswer::default()/* use setters */));
let x = Turn::new().set_or_clear_detailed_assist_answer(None::<AssistAnswer>);Sourcepub fn set_query_config<T, K, V>(self, v: T) -> Self
pub fn set_query_config<T, K, V>(self, v: T) -> Self
Sets the value of query_config.
§Example
let x = Turn::new().set_query_config([
("key0", "abc"),
("key1", "xyz"),
]);Trait Implementations§
impl StructuralPartialEq for Turn
Auto Trait Implementations§
impl Freeze for Turn
impl RefUnwindSafe for Turn
impl Send for Turn
impl Sync for Turn
impl Unpin for Turn
impl UnsafeUnpin for Turn
impl UnwindSafe for Turn
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request