Dialogflow API . projects . locations . conversations . participants . suggestions

Instance Methods

close()

Close httplib2 connections.

suggestArticles(parent, body=None, x__xgafv=None)

Gets suggested articles for a participant based on specific historical messages.

suggestFaqAnswers(parent, body=None, x__xgafv=None)

Gets suggested faq answers for a participant based on specific historical messages.

Method Details

close()
Close httplib2 connections.
suggestArticles(parent, body=None, x__xgafv=None)
Gets suggested articles for a participant based on specific historical messages.

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

{ # The request message for Participants.SuggestArticles.
  "assistQueryParams": { # Represents the parameters of human assist query. # Parameters for a human assist query.
    "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 20 and at most 50.
  "latestMessage": "A String", # The name of the latest conversation message to compile suggestion for. If empty, it will be the latest message of the conversation. 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 Participants.SuggestArticles.
  "articleAnswers": [ # Articles ordered by score in descending order.
    { # Represents article answer.
      "answerRecord": "A String", # The name of answer record, in the format of "projects//locations//answerRecords/"
      "confidence": 3.14, # Article match confidence. The system's confidence score that this article is a good match for this conversation, as a value from 0.0 (completely uncertain) to 1.0 (completely certain).
      "metadata": { # A map that contains metadata about the answer and the document from which it originates.
        "a_key": "A String",
      },
      "snippets": [ # Article snippets.
        "A String",
      ],
      "title": "A String", # The article title.
      "uri": "A String", # The article URI.
    },
  ],
  "contextSize": 42, # Number of messages prior to and including latest_message to compile the suggestion. It may be smaller than the SuggestArticlesRequest.context_size field in the request if there aren't that many messages in the conversation.
  "latestMessage": "A String", # The name of the latest conversation message used to compile suggestion for. Format: `projects//locations//conversations//messages/`.
}
suggestFaqAnswers(parent, body=None, x__xgafv=None)
Gets suggested faq answers for a participant based on specific historical messages.

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

{ # The request message for Participants.SuggestFaqAnswers.
  "assistQueryParams": { # Represents the parameters of human assist query. # Parameters for a human assist query.
    "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 20 and at most 50.
  "latestMessage": "A String", # The name of the latest conversation message to compile suggestion for. If empty, it will be the latest message of the conversation. 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 request message for Participants.SuggestFaqAnswers.
  "contextSize": 42, # Number of messages prior to and including latest_message to compile the suggestion. It may be smaller than the SuggestFaqAnswersRequest.context_size field in the request if there aren't that many messages in the conversation.
  "faqAnswers": [ # Answers extracted from FAQ documents.
    { # Represents answer from "frequently asked questions".
      "answer": "A String", # The piece of text from the `source` knowledge base document.
      "answerRecord": "A String", # The name of answer record, in the format of "projects//locations//answerRecords/"
      "confidence": 3.14, # The system's confidence score that this Knowledge answer is a good match for this conversational query, range from 0.0 (completely uncertain) to 1.0 (completely certain).
      "metadata": { # A map that contains metadata about the answer and the document from which it originates.
        "a_key": "A String",
      },
      "question": "A String", # The corresponding FAQ question.
      "source": "A String", # Indicates which Knowledge Document this answer was extracted from. Format: `projects//locations//agent/knowledgeBases//documents/`.
    },
  ],
  "latestMessage": "A String", # The name of the latest conversation message used to compile suggestion for. Format: `projects//locations//conversations//messages/`.
}