#[non_exhaustive]pub struct Turn {
pub query: Option<Query>,
pub answer: String,
pub detailed_answer: Option<Answer>,
pub query_config: HashMap<String, String>,
/* private fields */
}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.
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
pub fn new() -> Self
Sourcepub fn set_or_clear_query<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_query<T>(self, v: Option<T>) -> Self
Sets or clears the value of query.
Sourcepub fn set_answer<T: Into<String>>(self, v: T) -> Self
pub fn set_answer<T: Into<String>>(self, v: T) -> Self
Sets the value of answer.
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.
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.
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.