#[non_exhaustive]pub struct SearchKnowledgeRequest {
pub parent: String,
pub query: Option<TextInput>,
pub conversation_profile: String,
pub session_id: String,
pub conversation: String,
pub latest_message: String,
pub query_source: QuerySource,
pub end_user_metadata: Option<Struct>,
pub search_config: Option<SearchConfig>,
pub exact_search: bool,
/* private fields */
}conversations only.Expand description
The request message for Conversations.SearchKnowledge.
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.parent: StringRequired. The parent resource contains the conversation profile
Format: ‘projects/<Project ID>’ or projects/<Project ID>/locations/<Location ID>.
query: Option<TextInput>Required. The natural language text query for knowledge search.
conversation_profile: StringRequired. The conversation profile used to configure the search.
Format: projects/<Project ID>/locations/<Location ID>/conversationProfiles/<Conversation Profile ID>.
session_id: StringRequired. The ID of the search session.
The session_id can be combined with Dialogflow V3 Agent ID retrieved from
conversation profile or on its own to identify a search session. The search
history of the same session will impact the search result. It’s up to the
API caller to choose an appropriate Session ID. It can be a random number
or some type of session identifiers (preferably hashed). The length must
not exceed 36 characters.
conversation: StringOptional. The conversation (between human agent and end user) where the
search request is triggered. Format: projects/<Project ID>/locations/<Location ID>/conversations/<Conversation ID>.
latest_message: StringOptional. The name of the latest conversation message when the request is
triggered.
Format: projects/<Project ID>/locations/<Location ID>/conversations/<Conversation ID>/messages/<Message ID>.
query_source: QuerySourceOptional. The source of the query in the request.
end_user_metadata: Option<Struct>Optional. Information about the end-user to improve the relevance and accuracy of generative answers.
This will be interpreted and used by a language model, so, for good results, the data should be self-descriptive, and in a simple structure.
Example:
{
"subscription plan": "Business Premium Plus",
"devices owned": [
{"model": "Google Pixel 7"},
{"model": "Google Pixel Tablet"}
]
}search_config: Option<SearchConfig>Optional. Configuration specific to search queries with data stores.
exact_search: boolOptional. Whether to search the query exactly without query rewrite.
Implementations§
Source§impl SearchKnowledgeRequest
impl SearchKnowledgeRequest
pub fn new() -> Self
Sourcepub fn set_parent<T: Into<String>>(self, v: T) -> Self
pub fn set_parent<T: Into<String>>(self, v: T) -> 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
Sourcepub fn set_conversation_profile<T: Into<String>>(self, v: T) -> Self
pub fn set_conversation_profile<T: Into<String>>(self, v: T) -> Self
Sets the value of conversation_profile.
§Example
let x = SearchKnowledgeRequest::new().set_conversation_profile("example");Sourcepub fn set_session_id<T: Into<String>>(self, v: T) -> Self
pub fn set_session_id<T: Into<String>>(self, v: T) -> Self
Sets the value of session_id.
§Example
let x = SearchKnowledgeRequest::new().set_session_id("example");Sourcepub fn set_conversation<T: Into<String>>(self, v: T) -> Self
pub fn set_conversation<T: Into<String>>(self, v: T) -> Self
Sets the value of conversation.
§Example
let x = SearchKnowledgeRequest::new().set_conversation("example");Sourcepub fn set_latest_message<T: Into<String>>(self, v: T) -> Self
pub fn set_latest_message<T: Into<String>>(self, v: T) -> Self
Sets the value of latest_message.
§Example
let x = SearchKnowledgeRequest::new().set_latest_message("example");Sourcepub fn set_query_source<T: Into<QuerySource>>(self, v: T) -> Self
pub fn set_query_source<T: Into<QuerySource>>(self, v: T) -> Self
Sets the value of query_source.
§Example
use google_cloud_dialogflow_v2::model::search_knowledge_request::QuerySource;
let x0 = SearchKnowledgeRequest::new().set_query_source(QuerySource::AgentQuery);
let x1 = SearchKnowledgeRequest::new().set_query_source(QuerySource::SuggestedQuery);Sourcepub fn set_end_user_metadata<T>(self, v: T) -> Self
pub fn set_end_user_metadata<T>(self, v: T) -> Self
Sets the value of end_user_metadata.
§Example
use wkt::Struct;
let x = SearchKnowledgeRequest::new().set_end_user_metadata(Struct::default()/* use setters */);Sourcepub fn set_or_clear_end_user_metadata<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_end_user_metadata<T>(self, v: Option<T>) -> Self
Sets or clears the value of end_user_metadata.
§Example
use wkt::Struct;
let x = SearchKnowledgeRequest::new().set_or_clear_end_user_metadata(Some(Struct::default()/* use setters */));
let x = SearchKnowledgeRequest::new().set_or_clear_end_user_metadata(None::<Struct>);Sourcepub fn set_search_config<T>(self, v: T) -> Selfwhere
T: Into<SearchConfig>,
pub fn set_search_config<T>(self, v: T) -> Selfwhere
T: Into<SearchConfig>,
Sets the value of search_config.
§Example
use google_cloud_dialogflow_v2::model::search_knowledge_request::SearchConfig;
let x = SearchKnowledgeRequest::new().set_search_config(SearchConfig::default()/* use setters */);Sourcepub fn set_or_clear_search_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<SearchConfig>,
pub fn set_or_clear_search_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<SearchConfig>,
Sets or clears the value of search_config.
§Example
use google_cloud_dialogflow_v2::model::search_knowledge_request::SearchConfig;
let x = SearchKnowledgeRequest::new().set_or_clear_search_config(Some(SearchConfig::default()/* use setters */));
let x = SearchKnowledgeRequest::new().set_or_clear_search_config(None::<SearchConfig>);Sourcepub fn set_exact_search<T: Into<bool>>(self, v: T) -> Self
pub fn set_exact_search<T: Into<bool>>(self, v: T) -> Self
Sets the value of exact_search.
§Example
let x = SearchKnowledgeRequest::new().set_exact_search(true);Trait Implementations§
Source§impl Clone for SearchKnowledgeRequest
impl Clone for SearchKnowledgeRequest
Source§fn clone(&self) -> SearchKnowledgeRequest
fn clone(&self) -> SearchKnowledgeRequest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more