Dialogflow API . projects . conversations . suggestions

Instance Methods

close()

Close httplib2 connections.

searchKnowledge(conversation, body=None, x__xgafv=None)

Get answers for the given query based on knowledge documents.

suggestConversationSummary(conversation, body=None, x__xgafv=None)

Suggests summary for a conversation based on specific historical messages. The range of the messages to be used for summary can be specified in the request.

Method Details

close()
Close httplib2 connections.
searchKnowledge(conversation, body=None, x__xgafv=None)
Get answers for the given query based on knowledge documents.

Args:
  conversation: string, The conversation (between human agent and end user) where the search request is triggered. Format: `projects//locations//conversations/`. (required)
  body: object, The request body.
    The object takes the form of:

{ # The request message for Conversations.SearchKnowledge.
  "conversation": "A String", # The conversation (between human agent and end user) where the search request is triggered. Format: `projects//locations//conversations/`.
  "conversationProfile": "A String", # Required. The conversation profile used to configure the search. Format: `projects//locations//conversationProfiles/`.
  "latestMessage": "A String", # The name of the latest conversation message when the request is triggered. Format: `projects//locations//conversations//messages/`.
  "parent": "A String", # The parent resource contains the conversation profile Format: 'projects/' or `projects//locations/`.
  "query": { # Auxiliary proto messages. Represents the natural language text to be processed. # Required. The natural language text query for knowledge search.
    "languageCode": "A String", # Required. The language of this conversational query. See [Language Support](https://cloud.google.com/dialogflow/docs/reference/language) for a list of the currently supported language codes. Note that queries in the same session do not necessarily need to specify the same language.
    "text": "A String", # Required. The UTF-8 encoded natural language text to be processed. Text length must not exceed 256 characters for virtual agent interactions.
  },
  "sessionId": "A String", # 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.
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # The response message for Conversations.SearchKnowledge.
  "answers": [ # Most relevant snippets extracted from articles in the given knowledge base, ordered by confidence.
    { # Represents a SearchKnowledge answer.
      "answer": "A String", # The piece of text from the knowledge base documents that answers the search query
      "answerRecord": "A String", # The name of the answer record. Format: `projects//locations//answer Records/`
      "answerSources": [ # All sources used to generate the answer.
        { # The sources of the answers.
          "snippet": "A String", # The relevant snippet of the article.
          "title": "A String", # The title of the article.
          "uri": "A String", # The URI of the article.
        },
      ],
      "answerType": "A String", # The type of the answer.
    },
  ],
  "rewrittenQuery": "A String", # The rewritten query used to search knowledge.
}
suggestConversationSummary(conversation, body=None, x__xgafv=None)
Suggests summary for a conversation based on specific historical messages. The range of the messages to be used for summary can be specified in the request.

Args:
  conversation: string, Required. The conversation to fetch suggestion for. Format: `projects//locations//conversations/`. (required)
  body: object, The request body.
    The object takes the form of:

{ # The request message for Conversations.SuggestConversationSummary.
  "assistQueryParams": { # Represents the parameters of human assist query. # Parameters for a human assist query. Only used for POC/demo purpose.
    "documentsMetadataFilters": { # Key-value filters on the metadata of documents returned by article suggestion. If specified, article suggestion only returns suggested documents that match all filters in their Document.metadata. Multiple values for a metadata key should be concatenated by comma. For example, filters to match all documents that have 'US' or 'CA' in their market metadata values and 'agent' in their user metadata values will be ``` documents_metadata_filters { key: "market" value: "US,CA" } documents_metadata_filters { key: "user" value: "agent" } ```
      "a_key": "A String",
    },
  },
  "contextSize": 42, # Max number of messages prior to and including [latest_message] to use as context when compiling the suggestion. By default 500 and at most 1000.
  "latestMessage": "A String", # The name of the latest conversation message used as context for compiling suggestion. If empty, the latest message of the conversation will be used. Format: `projects//locations//conversations//messages/`.
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # The response message for Conversations.SuggestConversationSummary.
  "contextSize": 42, # Number of messages prior to and including last_conversation_message used to compile the suggestion. It may be smaller than the SuggestSummaryRequest.context_size field in the request if there weren't that many messages in the conversation.
  "latestMessage": "A String", # The name of the latest conversation message used as context for compiling suggestion. Format: `projects//locations//conversations//messages/`.
  "summary": { # Generated summary for a conversation. # Generated summary.
    "answerRecord": "A String", # The name of the answer record. Format: "projects//answerRecords/"
    "baselineModelVersion": "A String", # The baseline model version used to generate this summary. It is empty if a baseline model was not used to generate this summary.
    "text": "A String", # The summary content that is concatenated into one string.
    "textSections": { # The summary content that is divided into sections. The key is the section's name and the value is the section's content. There is no specific format for the key or value.
      "a_key": "A String",
    },
  },
}