Method: projects.conversations.suggestions.searchKnowledge

Get answers for the given query based on knowledge documents.

HTTP request

POST https://{endpoint}/v2beta1/{conversation=projects/*/conversations/*}/suggestions:searchKnowledge

Where {endpoint} is one of the supported service endpoints.

The URLs use gRPC Transcoding syntax.

Path parameters

Parameters
conversation

string

Optional. The conversation (between human agent and end user) where the search request is triggered. Format: projects/<Project ID>/locations/<Location ID>/conversations/<Conversation ID>.

Request body

The request body contains data with the following structure:

JSON representation
{
  "parent": string,
  "query": {
    object (TextInput)
  },
  "conversationProfile": string,
  "sessionId": string,
  "latestMessage": string,
  "querySource": enum (QuerySource),
  "endUserMetadata": {
    object
  },
  "searchConfig": {
    object (SearchConfig)
  },
  "exactSearch": boolean
}
Fields
parent

string

Required. The parent resource contains the conversation profile Format: 'projects/' or projects/<Project ID>/locations/<Location ID>.

query

object (TextInput)

Required. The natural language text query for knowledge search.

conversationProfile

string

Required. The conversation profile used to configure the search. Format: projects/<Project ID>/locations/<Location ID>/conversationProfiles/<Conversation Profile ID>.

sessionId

string

Required. The ID of the search session. The sessionId 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.

latestMessage

string

Optional. 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>.

querySource

enum (QuerySource)

Optional. The source of the query in the request.

endUserMetadata

object (Struct format)

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"}
  ]
}
searchConfig

object (SearchConfig)

Optional. Configuration specific to search queries with data stores.

Response body

If successful, the response body contains an instance of SearchKnowledgeResponse.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloud-platform
  • https://www.googleapis.com/auth/dialogflow

For more information, see the Authentication Overview.