Dialogflow API . projects . locations . suggestions

Instance Methods

close()

Close httplib2 connections.

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

Generates and returns a summary for a conversation that does not have a resource created for it.

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

Get answers for the given query based on knowledge documents.

Method Details

close()
Close httplib2 connections.
generateStatelessSummary(parent, body=None, x__xgafv=None)
Generates and returns a summary for a conversation that does not have a resource created for it.

Args:
  parent: string, Required. The parent resource to charge for the Summary's generation. Format: `projects//locations/`. (required)
  body: object, The request body.
    The object takes the form of:

{ # The request message for Conversations.GenerateStatelessSummary.
  "conversationProfile": { # Defines the services to connect to incoming Dialogflow conversations. # Required. A ConversationProfile containing information required for Summary generation. Required fields: {language_code, security_settings} Optional fields: {agent_assistant_config}
    "automatedAgentConfig": { # Defines the Automated Agent to connect to a conversation. # Configuration for an automated agent to use with this profile.
      "agent": "A String", # Required. ID of the Dialogflow agent environment to use. This project needs to either be the same project as the conversation or you need to grant `service-@gcp-sa-dialogflow.iam.gserviceaccount.com` the `Dialogflow API Service Agent` role in this project. - For ES agents, use format: `projects//locations//agent/environments/`. If environment is not specified, the default `draft` environment is used. Refer to [DetectIntentRequest](/dialogflow/docs/reference/rpc/google.cloud.dialogflow.v2#google.cloud.dialogflow.v2.DetectIntentRequest) for more details. - For CX agents, use format `projects//locations//agents//environments/`. If environment is not specified, the default `draft` environment is used.
      "sessionTtl": "A String", # Optional. Configure lifetime of the Dialogflow session. By default, a Dialogflow CX session remains active and its data is stored for 30 minutes after the last request is sent for the session. This value should be no longer than 1 day.
    },
    "createTime": "A String", # Output only. Create time of the conversation profile.
    "displayName": "A String", # Required. Human readable name for this profile. Max length 1024 bytes.
    "humanAgentAssistantConfig": { # Defines the Human Agent Assist to connect to a conversation. # Configuration for agent assistance to use with this profile.
      "endUserSuggestionConfig": { # Detail human agent assistant config. # Configuration for agent assistance of end user participant. Currently, this feature is not general available, please contact Google to get access.
        "disableHighLatencyFeaturesSyncDelivery": True or False, # Optional. When disable_high_latency_features_sync_delivery is true and using the AnalyzeContent API, we will not deliver the responses from high latency features in the API response. The human_agent_assistant_config.notification_config must be configured and enable_event_based_suggestion must be set to true to receive the responses from high latency features in Pub/Sub. High latency feature(s): KNOWLEDGE_ASSIST
        "featureConfigs": [ # Configuration of different suggestion features. One feature can have only one config.
          { # Config for suggestion features.
            "conversationModelConfig": { # Custom conversation models used in agent assist feature. Supported feature: ARTICLE_SUGGESTION, SMART_COMPOSE, SMART_REPLY, CONVERSATION_SUMMARIZATION. # Configs of custom conversation model.
              "baselineModelVersion": "A String", # Version of current baseline model. It will be ignored if model is set. Valid versions are: Article Suggestion baseline model: - 0.9 - 1.0 (default) Summarization baseline model: - 1.0
              "model": "A String", # Conversation model resource name. Format: `projects//conversationModels/`.
            },
            "conversationProcessConfig": { # Config to process conversation. # Configs for processing conversation.
              "recentSentencesCount": 42, # Number of recent non-small-talk sentences to use as context for article and FAQ suggestion
            },
            "disableAgentQueryLogging": True or False, # Optional. Disable the logging of search queries sent by human agents. It can prevent those queries from being stored at answer records. Supported features: KNOWLEDGE_SEARCH.
            "enableConversationAugmentedQuery": True or False, # Optional. Enable including conversation context during query answer generation. Supported features: KNOWLEDGE_SEARCH.
            "enableEventBasedSuggestion": True or False, # Automatically iterates all participants and tries to compile suggestions. Supported features: ARTICLE_SUGGESTION, FAQ, DIALOGFLOW_ASSIST, KNOWLEDGE_ASSIST.
            "enableQuerySuggestionOnly": True or False, # Optional. Enable query suggestion only. Supported features: KNOWLEDGE_ASSIST
            "enableQuerySuggestionWhenNoAnswer": True or False, # Optional. Enable query suggestion even if we can't find its answer. By default, queries are suggested only if we find its answer. Supported features: KNOWLEDGE_ASSIST
            "queryConfig": { # Config for suggestion query. # Configs of query.
              "confidenceThreshold": 3.14, # Confidence threshold of query result. Agent Assist gives each suggestion a score in the range [0.0, 1.0], based on the relevance between the suggestion and the current conversation context. A score of 0.0 has no relevance, while a score of 1.0 has high relevance. Only suggestions with a score greater than or equal to the value of this field are included in the results. For a baseline model (the default), the recommended value is in the range [0.05, 0.1]. For a custom model, there is no recommended value. Tune this value by starting from a very low value and slowly increasing until you have desired results. If this field is not set, it defaults to 0.0, which means that all suggestions are returned. Supported features: ARTICLE_SUGGESTION, FAQ, SMART_REPLY, SMART_COMPOSE, KNOWLEDGE_SEARCH, KNOWLEDGE_ASSIST, ENTITY_EXTRACTION.
              "contextFilterSettings": { # Settings that determine how to filter recent conversation context when generating suggestions. # Determines how recent conversation context is filtered when generating suggestions. If unspecified, no messages will be dropped.
                "dropHandoffMessages": True or False, # If set to true, the last message from virtual agent (hand off message) and the message before it (trigger message of hand off) are dropped.
                "dropIvrMessages": True or False, # If set to true, all messages from ivr stage are dropped.
                "dropVirtualAgentMessages": True or False, # If set to true, all messages from virtual agent are dropped.
              },
              "contextSize": 42, # Optional. The number of recent messages to include in the context. Supported features: KNOWLEDGE_ASSIST.
              "dialogflowQuerySource": { # Dialogflow source setting. Supported feature: DIALOGFLOW_ASSIST. # Query from Dialogflow agent. It is used by DIALOGFLOW_ASSIST.
                "agent": "A String", # Required. The name of a Dialogflow virtual agent used for end user side intent detection and suggestion. Format: `projects//locations//agent`. When multiple agents are allowed in the same Dialogflow project.
                "humanAgentSideConfig": { # The configuration used for human agent side Dialogflow assist suggestion. # Optional. The Dialogflow assist configuration for human agent.
                  "agent": "A String", # Optional. The name of a dialogflow virtual agent used for intent detection and suggestion triggered by human agent. Format: `projects//locations//agent`.
                },
              },
              "documentQuerySource": { # Document source settings. Supported features: SMART_REPLY, SMART_COMPOSE. # Query from knowledge base document. It is used by: SMART_REPLY, SMART_COMPOSE.
                "documents": [ # Required. Knowledge documents to query from. Format: `projects//locations//knowledgeBases//documents/`. Currently, at most 5 documents are supported.
                  "A String",
                ],
              },
              "knowledgeBaseQuerySource": { # Knowledge base source settings. Supported features: ARTICLE_SUGGESTION, FAQ. # Query from knowledgebase. It is used by: ARTICLE_SUGGESTION, FAQ.
                "knowledgeBases": [ # Required. Knowledge bases to query. Format: `projects//locations//knowledgeBases/`. Currently, at most 5 knowledge bases are supported.
                  "A String",
                ],
              },
              "maxResults": 42, # Maximum number of results to return. Currently, if unset, defaults to 10. And the max number is 20.
              "sections": { # Custom sections to return when requesting a summary of a conversation. This is only supported when `baseline_model_version` == '2.0'. Supported features: CONVERSATION_SUMMARIZATION, CONVERSATION_SUMMARIZATION_VOICE. # Optional. The customized sections chosen to return when requesting a summary of a conversation.
                "sectionTypes": [ # The selected sections chosen to return when requesting a summary of a conversation. A duplicate selected section will be treated as a single selected section. If section types are not provided, the default will be {SITUATION, ACTION, RESULT}.
                  "A String",
                ],
              },
            },
            "suggestionFeature": { # The type of Human Agent Assistant API suggestion to perform, and the maximum number of results to return for that type. Multiple `Feature` objects can be specified in the `features` list. # The suggestion feature.
              "type": "A String", # Type of Human Agent Assistant API feature to request.
            },
            "suggestionTriggerSettings": { # Settings of suggestion trigger. # Settings of suggestion trigger. Currently, only ARTICLE_SUGGESTION and FAQ will use this field.
              "noSmalltalk": True or False, # Do not trigger if last utterance is small talk.
              "onlyEndUser": True or False, # Only trigger suggestion if participant role of last utterance is END_USER.
            },
          },
        ],
        "generators": [ # Optional. List of various generator resource names used in the conversation profile.
          "A String",
        ],
        "groupSuggestionResponses": True or False, # If `group_suggestion_responses` is false, and there are multiple `feature_configs` in `event based suggestion` or StreamingAnalyzeContent, we will try to deliver suggestions to customers as soon as we get new suggestion. Different type of suggestions based on the same context will be in separate Pub/Sub event or `StreamingAnalyzeContentResponse`. If `group_suggestion_responses` set to true. All the suggestions to the same participant based on the same context will be grouped into a single Pub/Sub event or StreamingAnalyzeContentResponse.
      },
      "humanAgentSuggestionConfig": { # Detail human agent assistant config. # Configuration for agent assistance of human agent participant.
        "disableHighLatencyFeaturesSyncDelivery": True or False, # Optional. When disable_high_latency_features_sync_delivery is true and using the AnalyzeContent API, we will not deliver the responses from high latency features in the API response. The human_agent_assistant_config.notification_config must be configured and enable_event_based_suggestion must be set to true to receive the responses from high latency features in Pub/Sub. High latency feature(s): KNOWLEDGE_ASSIST
        "featureConfigs": [ # Configuration of different suggestion features. One feature can have only one config.
          { # Config for suggestion features.
            "conversationModelConfig": { # Custom conversation models used in agent assist feature. Supported feature: ARTICLE_SUGGESTION, SMART_COMPOSE, SMART_REPLY, CONVERSATION_SUMMARIZATION. # Configs of custom conversation model.
              "baselineModelVersion": "A String", # Version of current baseline model. It will be ignored if model is set. Valid versions are: Article Suggestion baseline model: - 0.9 - 1.0 (default) Summarization baseline model: - 1.0
              "model": "A String", # Conversation model resource name. Format: `projects//conversationModels/`.
            },
            "conversationProcessConfig": { # Config to process conversation. # Configs for processing conversation.
              "recentSentencesCount": 42, # Number of recent non-small-talk sentences to use as context for article and FAQ suggestion
            },
            "disableAgentQueryLogging": True or False, # Optional. Disable the logging of search queries sent by human agents. It can prevent those queries from being stored at answer records. Supported features: KNOWLEDGE_SEARCH.
            "enableConversationAugmentedQuery": True or False, # Optional. Enable including conversation context during query answer generation. Supported features: KNOWLEDGE_SEARCH.
            "enableEventBasedSuggestion": True or False, # Automatically iterates all participants and tries to compile suggestions. Supported features: ARTICLE_SUGGESTION, FAQ, DIALOGFLOW_ASSIST, KNOWLEDGE_ASSIST.
            "enableQuerySuggestionOnly": True or False, # Optional. Enable query suggestion only. Supported features: KNOWLEDGE_ASSIST
            "enableQuerySuggestionWhenNoAnswer": True or False, # Optional. Enable query suggestion even if we can't find its answer. By default, queries are suggested only if we find its answer. Supported features: KNOWLEDGE_ASSIST
            "queryConfig": { # Config for suggestion query. # Configs of query.
              "confidenceThreshold": 3.14, # Confidence threshold of query result. Agent Assist gives each suggestion a score in the range [0.0, 1.0], based on the relevance between the suggestion and the current conversation context. A score of 0.0 has no relevance, while a score of 1.0 has high relevance. Only suggestions with a score greater than or equal to the value of this field are included in the results. For a baseline model (the default), the recommended value is in the range [0.05, 0.1]. For a custom model, there is no recommended value. Tune this value by starting from a very low value and slowly increasing until you have desired results. If this field is not set, it defaults to 0.0, which means that all suggestions are returned. Supported features: ARTICLE_SUGGESTION, FAQ, SMART_REPLY, SMART_COMPOSE, KNOWLEDGE_SEARCH, KNOWLEDGE_ASSIST, ENTITY_EXTRACTION.
              "contextFilterSettings": { # Settings that determine how to filter recent conversation context when generating suggestions. # Determines how recent conversation context is filtered when generating suggestions. If unspecified, no messages will be dropped.
                "dropHandoffMessages": True or False, # If set to true, the last message from virtual agent (hand off message) and the message before it (trigger message of hand off) are dropped.
                "dropIvrMessages": True or False, # If set to true, all messages from ivr stage are dropped.
                "dropVirtualAgentMessages": True or False, # If set to true, all messages from virtual agent are dropped.
              },
              "contextSize": 42, # Optional. The number of recent messages to include in the context. Supported features: KNOWLEDGE_ASSIST.
              "dialogflowQuerySource": { # Dialogflow source setting. Supported feature: DIALOGFLOW_ASSIST. # Query from Dialogflow agent. It is used by DIALOGFLOW_ASSIST.
                "agent": "A String", # Required. The name of a Dialogflow virtual agent used for end user side intent detection and suggestion. Format: `projects//locations//agent`. When multiple agents are allowed in the same Dialogflow project.
                "humanAgentSideConfig": { # The configuration used for human agent side Dialogflow assist suggestion. # Optional. The Dialogflow assist configuration for human agent.
                  "agent": "A String", # Optional. The name of a dialogflow virtual agent used for intent detection and suggestion triggered by human agent. Format: `projects//locations//agent`.
                },
              },
              "documentQuerySource": { # Document source settings. Supported features: SMART_REPLY, SMART_COMPOSE. # Query from knowledge base document. It is used by: SMART_REPLY, SMART_COMPOSE.
                "documents": [ # Required. Knowledge documents to query from. Format: `projects//locations//knowledgeBases//documents/`. Currently, at most 5 documents are supported.
                  "A String",
                ],
              },
              "knowledgeBaseQuerySource": { # Knowledge base source settings. Supported features: ARTICLE_SUGGESTION, FAQ. # Query from knowledgebase. It is used by: ARTICLE_SUGGESTION, FAQ.
                "knowledgeBases": [ # Required. Knowledge bases to query. Format: `projects//locations//knowledgeBases/`. Currently, at most 5 knowledge bases are supported.
                  "A String",
                ],
              },
              "maxResults": 42, # Maximum number of results to return. Currently, if unset, defaults to 10. And the max number is 20.
              "sections": { # Custom sections to return when requesting a summary of a conversation. This is only supported when `baseline_model_version` == '2.0'. Supported features: CONVERSATION_SUMMARIZATION, CONVERSATION_SUMMARIZATION_VOICE. # Optional. The customized sections chosen to return when requesting a summary of a conversation.
                "sectionTypes": [ # The selected sections chosen to return when requesting a summary of a conversation. A duplicate selected section will be treated as a single selected section. If section types are not provided, the default will be {SITUATION, ACTION, RESULT}.
                  "A String",
                ],
              },
            },
            "suggestionFeature": { # The type of Human Agent Assistant API suggestion to perform, and the maximum number of results to return for that type. Multiple `Feature` objects can be specified in the `features` list. # The suggestion feature.
              "type": "A String", # Type of Human Agent Assistant API feature to request.
            },
            "suggestionTriggerSettings": { # Settings of suggestion trigger. # Settings of suggestion trigger. Currently, only ARTICLE_SUGGESTION and FAQ will use this field.
              "noSmalltalk": True or False, # Do not trigger if last utterance is small talk.
              "onlyEndUser": True or False, # Only trigger suggestion if participant role of last utterance is END_USER.
            },
          },
        ],
        "generators": [ # Optional. List of various generator resource names used in the conversation profile.
          "A String",
        ],
        "groupSuggestionResponses": True or False, # If `group_suggestion_responses` is false, and there are multiple `feature_configs` in `event based suggestion` or StreamingAnalyzeContent, we will try to deliver suggestions to customers as soon as we get new suggestion. Different type of suggestions based on the same context will be in separate Pub/Sub event or `StreamingAnalyzeContentResponse`. If `group_suggestion_responses` set to true. All the suggestions to the same participant based on the same context will be grouped into a single Pub/Sub event or StreamingAnalyzeContentResponse.
      },
      "messageAnalysisConfig": { # Configuration for analyses to run on each conversation message. # Configuration for message analysis.
        "enableEntityExtraction": True or False, # Enable entity extraction in conversation messages on [agent assist stage](https://cloud.google.com/dialogflow/priv/docs/contact-center/basics#stages). If unspecified, defaults to false. Currently, this feature is not general available, please contact Google to get access.
        "enableSentimentAnalysis": True or False, # Enable sentiment analysis in conversation messages on [agent assist stage](https://cloud.google.com/dialogflow/priv/docs/contact-center/basics#stages). If unspecified, defaults to false. Sentiment analysis inspects user input and identifies the prevailing subjective opinion, especially to determine a user's attitude as positive, negative, or neutral: https://cloud.google.com/natural-language/docs/basics#sentiment_analysis For Participants.StreamingAnalyzeContent method, result will be in StreamingAnalyzeContentResponse.message.SentimentAnalysisResult. For Participants.AnalyzeContent method, result will be in AnalyzeContentResponse.message.SentimentAnalysisResult For Conversations.ListMessages method, result will be in ListMessagesResponse.messages.SentimentAnalysisResult If Pub/Sub notification is configured, result will be in ConversationEvent.new_message_payload.SentimentAnalysisResult.
      },
      "notificationConfig": { # Defines notification behavior. # Pub/Sub topic on which to publish new agent assistant events.
        "messageFormat": "A String", # Format of message.
        "topic": "A String", # Name of the Pub/Sub topic to publish conversation events like CONVERSATION_STARTED as serialized ConversationEvent protos. For telephony integration to receive notification, make sure either this topic is in the same project as the conversation or you grant `service-@gcp-sa-dialogflow.iam.gserviceaccount.com` the `Dialogflow Service Agent` role in the topic project. For chat integration to receive notification, make sure API caller has been granted the `Dialogflow Service Agent` role for the topic. Format: `projects//locations//topics/`.
      },
    },
    "humanAgentHandoffConfig": { # Defines the hand off to a live agent, typically on which external agent service provider to connect to a conversation. Currently, this feature is not general available, please contact Google to get access. # Configuration for connecting to a live agent. Currently, this feature is not general available, please contact Google to get access.
      "livePersonConfig": { # Configuration specific to [LivePerson](https://www.liveperson.com). # Uses [LivePerson](https://www.liveperson.com).
        "accountNumber": "A String", # Required. Account number of the LivePerson account to connect. This is the account number you input at the login page.
      },
      "salesforceLiveAgentConfig": { # Configuration specific to Salesforce Live Agent. # Uses Salesforce Live Agent.
        "buttonId": "A String", # Required. Live Agent chat button ID.
        "deploymentId": "A String", # Required. Live Agent deployment ID.
        "endpointDomain": "A String", # Required. Domain of the Live Agent endpoint for this agent. You can find the endpoint URL in the `Live Agent settings` page. For example if URL has the form https://d.la4-c2-phx.salesforceliveagent.com/..., you should fill in d.la4-c2-phx.salesforceliveagent.com.
        "organizationId": "A String", # Required. The organization ID of the Salesforce account.
      },
    },
    "languageCode": "A String", # Language code for the conversation profile. If not specified, the language is en-US. Language at ConversationProfile should be set for all non en-US languages. This should be a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. Example: "en-US".
    "loggingConfig": { # Defines logging behavior for conversation lifecycle events. # Configuration for logging conversation lifecycle events.
      "enableStackdriverLogging": True or False, # Whether to log conversation events like CONVERSATION_STARTED to Stackdriver in the conversation project as JSON format ConversationEvent protos.
    },
    "name": "A String", # The unique identifier of this conversation profile. Format: `projects//locations//conversationProfiles/`.
    "newMessageEventNotificationConfig": { # Defines notification behavior. # Configuration for publishing new message events. Event will be sent in format of ConversationEvent
      "messageFormat": "A String", # Format of message.
      "topic": "A String", # Name of the Pub/Sub topic to publish conversation events like CONVERSATION_STARTED as serialized ConversationEvent protos. For telephony integration to receive notification, make sure either this topic is in the same project as the conversation or you grant `service-@gcp-sa-dialogflow.iam.gserviceaccount.com` the `Dialogflow Service Agent` role in the topic project. For chat integration to receive notification, make sure API caller has been granted the `Dialogflow Service Agent` role for the topic. Format: `projects//locations//topics/`.
    },
    "notificationConfig": { # Defines notification behavior. # Configuration for publishing conversation lifecycle events.
      "messageFormat": "A String", # Format of message.
      "topic": "A String", # Name of the Pub/Sub topic to publish conversation events like CONVERSATION_STARTED as serialized ConversationEvent protos. For telephony integration to receive notification, make sure either this topic is in the same project as the conversation or you grant `service-@gcp-sa-dialogflow.iam.gserviceaccount.com` the `Dialogflow Service Agent` role in the topic project. For chat integration to receive notification, make sure API caller has been granted the `Dialogflow Service Agent` role for the topic. Format: `projects//locations//topics/`.
    },
    "securitySettings": "A String", # Name of the CX SecuritySettings reference for the agent. Format: `projects//locations//securitySettings/`.
    "sttConfig": { # Configures speech transcription for ConversationProfile. # Settings for speech transcription.
      "audioEncoding": "A String", # Audio encoding of the audio content to process.
      "enableWordInfo": True or False, # If `true`, Dialogflow returns SpeechWordInfo in StreamingRecognitionResult with information about the recognized speech words, e.g. start and end time offsets. If false or unspecified, Speech doesn't return any word-level information.
      "languageCode": "A String", # The language of the supplied audio. Dialogflow does not do translations. 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.
      "model": "A String", # Which Speech model to select. Select the model best suited to your domain to get best results. If a model is not explicitly specified, then Dialogflow auto-selects a model based on other parameters in the SpeechToTextConfig and Agent settings. If enhanced speech model is enabled for the agent and an enhanced version of the specified model for the language does not exist, then the speech is recognized using the standard version of the specified model. Refer to [Cloud Speech API documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model) for more details. If you specify a model, the following models typically have the best performance: - phone_call (best for Agent Assist and telephony) - latest_short (best for Dialogflow non-telephony) - command_and_search Leave this field unspecified to use [Agent Speech settings](https://cloud.google.com/dialogflow/cx/docs/concept/agent#settings-speech) for model selection.
      "phraseSets": [ # List of names of Cloud Speech phrase sets that are used for transcription.
        "A String",
      ],
      "sampleRateHertz": 42, # Sample rate (in Hertz) of the audio content sent in the query. Refer to [Cloud Speech API documentation](https://cloud.google.com/speech-to-text/docs/basics) for more details.
      "speechModelVariant": "A String", # The speech model used in speech to text. `SPEECH_MODEL_VARIANT_UNSPECIFIED`, `USE_BEST_AVAILABLE` will be treated as `USE_ENHANCED`. It can be overridden in AnalyzeContentRequest and StreamingAnalyzeContentRequest request. If enhanced model variant is specified and an enhanced version of the specified model for the language does not exist, then it would emit an error.
      "useTimeoutBasedEndpointing": True or False, # Use timeout based endpointing, interpreting endpointer sensitivy as seconds of timeout value.
    },
    "timeZone": "A String", # The time zone of this conversational profile from the [time zone database](https://www.iana.org/time-zones), e.g., America/New_York, Europe/Paris. Defaults to America/New_York.
    "ttsConfig": { # Configuration of how speech should be synthesized. # Configuration for Text-to-Speech synthesization. Used by Phone Gateway to specify synthesization options. If agent defines synthesization options as well, agent settings overrides the option here.
      "effectsProfileId": [ # Optional. An identifier which selects 'audio effects' profiles that are applied on (post synthesized) text to speech. Effects are applied on top of each other in the order they are given.
        "A String",
      ],
      "pitch": 3.14, # Optional. Speaking pitch, in the range [-20.0, 20.0]. 20 means increase 20 semitones from the original pitch. -20 means decrease 20 semitones from the original pitch.
      "speakingRate": 3.14, # Optional. Speaking rate/speed, in the range [0.25, 4.0]. 1.0 is the normal native speed supported by the specific voice. 2.0 is twice as fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 speed. Any other values < 0.25 or > 4.0 will return an error.
      "voice": { # Description of which voice to use for speech synthesis. # Optional. The desired voice of the synthesized audio.
        "name": "A String", # Optional. The name of the voice. If not set, the service will choose a voice based on the other parameters such as language_code and ssml_gender.
        "ssmlGender": "A String", # Optional. The preferred gender of the voice. If not set, the service will choose a voice based on the other parameters such as language_code and name. Note that this is only a preference, not requirement. If a voice of the appropriate gender is not available, the synthesizer should substitute a voice with a different gender rather than failing the request.
      },
      "volumeGainDb": 3.14, # Optional. Volume gain (in dB) of the normal native volume supported by the specific voice, in the range [-96.0, 16.0]. If unset, or set to a value of 0.0 (dB), will play at normal native signal amplitude. A value of -6.0 (dB) will play at approximately half the amplitude of the normal native signal amplitude. A value of +6.0 (dB) will play at approximately twice the amplitude of the normal native signal amplitude. We strongly recommend not to exceed +10 (dB) as there's usually no effective increase in loudness for any value greater than that.
    },
    "updateTime": "A String", # Output only. Update time of the conversation profile.
  },
  "latestMessage": "A String", # Optional. The name of the latest conversation message used as context for generating a Summary. If empty, the latest message of the conversation will be used. The format is specific to the user and the names of the messages provided.
  "maxContextSize": 42, # Optional. 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.
  "statelessConversation": { # The minimum amount of information required to generate a Summary without having a Conversation resource created. # Required. The conversation to suggest a summary for.
    "messages": [ # Required. The messages that the Summary will be generated from. It is expected that this message content is already redacted and does not contain any PII. Required fields: {content, language_code, participant, participant_role} Optional fields: {send_time} If send_time is not provided, then the messages must be provided in chronological order.
      { # Represents a message posted into a conversation.
        "content": "A String", # Required. The message content.
        "createTime": "A String", # Output only. The time when the message was created in Contact Center AI.
        "languageCode": "A String", # Optional. The message language. This should be a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. Example: "en-US".
        "messageAnnotation": { # Represents the result of annotation for the message. # Output only. The annotation for the message.
          "containEntities": True or False, # Indicates whether the text message contains entities.
          "parts": [ # The collection of annotated message parts ordered by their position in the message. You can recover the annotated message by concatenating [AnnotatedMessagePart.text].
            { # Represents a part of a message possibly annotated with an entity. The part can be an entity or purely a part of the message between two entities or message start/end.
              "entityType": "A String", # The [Dialogflow system entity type](https://cloud.google.com/dialogflow/docs/reference/system-entities) of this message part. If this is empty, Dialogflow could not annotate the phrase part with a system entity.
              "formattedValue": "", # The [Dialogflow system entity formatted value ](https://cloud.google.com/dialogflow/docs/reference/system-entities) of this message part. For example for a system entity of type `@sys.unit-currency`, this may contain: { "amount": 5, "currency": "USD" }
              "text": "A String", # A part of a message possibly annotated with an entity.
            },
          ],
        },
        "name": "A String", # Optional. The unique identifier of the message. Format: `projects//locations//conversations//messages/`.
        "participant": "A String", # Output only. The participant that sends this message.
        "participantRole": "A String", # Output only. The role of the participant.
        "sendTime": "A String", # Optional. The time when the message was sent.
        "sentimentAnalysis": { # The result of sentiment analysis. Sentiment analysis inspects user input and identifies the prevailing subjective opinion, especially to determine a user's attitude as positive, negative, or neutral. For Participants.DetectIntent, it needs to be configured in DetectIntentRequest.query_params. For Participants.StreamingDetectIntent, it needs to be configured in StreamingDetectIntentRequest.query_params. And for Participants.AnalyzeContent and Participants.StreamingAnalyzeContent, it needs to be configured in ConversationProfile.human_agent_assistant_config # Output only. The sentiment analysis result for the message.
          "queryTextSentiment": { # The sentiment, such as positive/negative feeling or association, for a unit of analysis, such as the query text. See: https://cloud.google.com/natural-language/docs/basics#interpreting_sentiment_analysis_values for how to interpret the result. # The sentiment analysis result for `query_text`.
            "magnitude": 3.14, # A non-negative number in the [0, +inf) range, which represents the absolute magnitude of sentiment, regardless of score (positive or negative).
            "score": 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0 (positive sentiment).
          },
        },
      },
    ],
  },
}

  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.GenerateStatelessSummary.
  "contextSize": 42, # Number of messages prior to and including last_conversation_message used to compile the suggestion. It may be smaller than the GenerateStatelessSummaryRequest.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. The format is specific to the user and the names of the messages provided.
  "summary": { # Generated summary for a conversation. # Generated summary.
    "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",
    },
  },
}
searchKnowledge(parent, body=None, x__xgafv=None)
Get answers for the given query based on knowledge documents.

Args:
  parent: string, Required. The parent resource contains the conversation profile Format: 'projects/' or `projects//locations/`. (required)
  body: object, The request body.
    The object takes the form of:

{ # The request message for Conversations.SearchKnowledge.
  "conversation": "A String", # Optional. 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/`.
  "endUserMetadata": { # 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: ```json { "subscription plan": "Business Premium Plus", "devices owned": [ {"model": "Google Pixel 7"}, {"model": "Google Pixel Tablet"} ] } ```
    "a_key": "", # Properties of the object.
  },
  "exactSearch": True or False, # Optional. Whether to search the query exactly without query rewrite.
  "latestMessage": "A String", # Optional. The name of the latest conversation message when the request is triggered. Format: `projects//locations//conversations//messages/`.
  "parent": "A String", # Required. 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.
  },
  "querySource": "A String", # Optional. The source of the query in the request.
  "searchConfig": { # Configuration specific to search queries with data stores. # Optional. Configuration specific to search queries with data stores.
    "boostSpecs": [ # Optional. Boost specifications for data stores.
      { # Boost specifications for data stores.
        "dataStores": [ # Optional. Data Stores where the boosting configuration is applied. The full names of the referenced data stores. Formats: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}` `projects/{project}/locations/{location}/dataStores/{data_store}
          "A String",
        ],
        "spec": [ # Optional. A list of boosting specifications.
          { # Boost specification to boost certain documents. A copy of google.cloud.discoveryengine.v1main.BoostSpec, field documentation is available at https://cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1alpha/BoostSpec
            "conditionBoostSpecs": [ # Optional. Condition boost specifications. If a document matches multiple conditions in the specifictions, boost scores from these specifications are all applied and combined in a non-linear way. Maximum number of specifications is 20.
              { # Boost applies to documents which match a condition.
                "boost": 3.14, # Optional. Strength of the condition boost, which should be in [-1, 1]. Negative boost means demotion. Default is 0.0. Setting to 1.0 gives the document a big promotion. However, it does not necessarily mean that the boosted document will be the top result at all times, nor that other documents will be excluded. Results could still be shown even when none of them matches the condition. And results that are significantly more relevant to the search query can still trump your heavily favored but irrelevant documents. Setting to -1.0 gives the document a big demotion. However, results that are deeply relevant might still be shown. The document will have an upstream battle to get a fairly high ranking, but it is not blocked out completely. Setting to 0.0 means no boost applied. The boosting condition is ignored.
                "boostControlSpec": { # Specification for custom ranking based on customer specified attribute value. It provides more controls for customized ranking than the simple (condition, boost) combination above. # Optional. Complex specification for custom ranking based on customer defined attribute value.
                  "attributeType": "A String", # Optional. The attribute type to be used to determine the boost amount. The attribute value can be derived from the field value of the specified field_name. In the case of numerical it is straightforward i.e. attribute_value = numerical_field_value. In the case of freshness however, attribute_value = (time.now() - datetime_field_value).
                  "controlPoints": [ # Optional. The control points used to define the curve. The monotonic function (defined through the interpolation_type above) passes through the control points listed here.
                    { # The control points used to define the curve. The curve defined through these control points can only be monotonically increasing or decreasing(constant values are acceptable).
                      "attributeValue": "A String", # Optional. Can be one of: 1. The numerical field value. 2. The duration spec for freshness: The value must be formatted as an XSD `dayTimeDuration` value (a restricted subset of an ISO 8601 duration value). The pattern for this is: `nDnM]`.
                      "boostAmount": 3.14, # Optional. The value between -1 to 1 by which to boost the score if the attribute_value evaluates to the value specified above.
                    },
                  ],
                  "fieldName": "A String", # Optional. The name of the field whose value will be used to determine the boost amount.
                  "interpolationType": "A String", # Optional. The interpolation type to be applied to connect the control points listed below.
                },
                "condition": "A String", # Optional. An expression which specifies a boost condition. The syntax and supported fields are the same as a filter expression. Examples: * To boost documents with document ID "doc_1" or "doc_2", and color "Red" or "Blue": * (id: ANY("doc_1", "doc_2")) AND (color: ANY("Red","Blue"))
              },
            ],
          },
        ],
      },
    ],
    "filterSpecs": [ # Optional. Filter specification for data store queries.
      { # Filter specification for data store queries.
        "dataStores": [ # Optional. The data store where the filter configuration is applied. Full resource name of data store, such as projects/{project}/locations/{location}/collections/{collectionId}/ dataStores/{dataStoreId}.
          "A String",
        ],
        "filter": "A String", # Optional. The filter expression to be applied. Expression syntax is documented at https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata#filter-expression-syntax
      },
    ],
  },
  "sessionId": "A String", # Required. 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.
          "metadata": { # Metadata associated with the article.
            "a_key": "", # Properties of the object.
          },
          "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.
}