#[non_exhaustive]pub struct SessionSpec {
pub query_id: String,
pub search_result_persistence_count: Option<i32>,
/* private fields */
}assistant-service or conversational-search-service or search-service or serving-config-service only.Expand description
Session specification.
Multi-turn Search feature is currently at private GA stage. Please use v1alpha or v1beta version instead before we launch this feature to public GA. Or ask for allowlisting through Google Support team.
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_id: StringIf set, the search result gets stored to the “turn” specified by this query ID.
Example: Let’s say the session looks like this: session { name: “…/sessions/xxx” turns { query { text: “What is foo?” query_id: “…/questions/yyy” } answer: “Foo is …” } turns { query { text: “How about bar then?” query_id: “…/questions/zzz” } } }
The user can call /search API with a request like this:
session: “…/sessions/xxx” session_spec { query_id: “…/questions/zzz” }
Then, the API stores the search result, associated with the last turn. The stored search result can be used by a subsequent /answer API call (with the session ID and the query ID specified). Also, it is possible to call /search and /answer in parallel with the same session ID & query ID.
search_result_persistence_count: Option<i32>The number of top search results to persist. The persisted search results can be used for the subsequent /answer api call.
This field is similar to the summary_result_count field in
SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count.
At most 10 results for documents mode, or 50 for chunks mode.
Implementations§
Source§impl SessionSpec
impl SessionSpec
pub fn new() -> Self
Sourcepub fn set_query_id<T: Into<String>>(self, v: T) -> Self
pub fn set_query_id<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_search_result_persistence_count<T>(self, v: T) -> Self
pub fn set_search_result_persistence_count<T>(self, v: T) -> Self
Sets the value of search_result_persistence_count.
§Example
let x = SessionSpec::new().set_search_result_persistence_count(42);Sourcepub fn set_or_clear_search_result_persistence_count<T>(
self,
v: Option<T>,
) -> Self
pub fn set_or_clear_search_result_persistence_count<T>( self, v: Option<T>, ) -> Self
Sets or clears the value of search_result_persistence_count.
§Example
let x = SessionSpec::new().set_or_clear_search_result_persistence_count(Some(42));
let x = SessionSpec::new().set_or_clear_search_result_persistence_count(None::<i32>);Trait Implementations§
Source§impl Clone for SessionSpec
impl Clone for SessionSpec
Source§fn clone(&self) -> SessionSpec
fn clone(&self) -> SessionSpec
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more