QBusiness / Client / update_chat_controls_configuration

update_chat_controls_configuration#

QBusiness.Client.update_chat_controls_configuration(**kwargs)#

Updates an set of chat controls configured for an existing Amazon Q application.

See also: AWS API Documentation

Request Syntax

response = client.update_chat_controls_configuration(
    applicationId='string',
    blockedPhrasesConfigurationUpdate={
        'blockedPhrasesToCreateOrUpdate': [
            'string',
        ],
        'blockedPhrasesToDelete': [
            'string',
        ],
        'systemMessageOverride': 'string'
    },
    clientToken='string',
    responseScope='ENTERPRISE_CONTENT_ONLY'|'EXTENDED_KNOWLEDGE_ENABLED',
    topicConfigurationsToCreateOrUpdate=[
        {
            'description': 'string',
            'exampleChatMessages': [
                'string',
            ],
            'name': 'string',
            'rules': [
                {
                    'excludedUsersAndGroups': {
                        'userGroups': [
                            'string',
                        ],
                        'userIds': [
                            'string',
                        ]
                    },
                    'includedUsersAndGroups': {
                        'userGroups': [
                            'string',
                        ],
                        'userIds': [
                            'string',
                        ]
                    },
                    'ruleConfiguration': {
                        'contentBlockerRule': {
                            'systemMessageOverride': 'string'
                        },
                        'contentRetrievalRule': {
                            'eligibleDataSources': [
                                {
                                    'dataSourceId': 'string',
                                    'indexId': 'string'
                                },
                            ]
                        }
                    },
                    'ruleType': 'CONTENT_BLOCKER_RULE'|'CONTENT_RETRIEVAL_RULE'
                },
            ]
        },
    ],
    topicConfigurationsToDelete=[
        {
            'description': 'string',
            'exampleChatMessages': [
                'string',
            ],
            'name': 'string',
            'rules': [
                {
                    'excludedUsersAndGroups': {
                        'userGroups': [
                            'string',
                        ],
                        'userIds': [
                            'string',
                        ]
                    },
                    'includedUsersAndGroups': {
                        'userGroups': [
                            'string',
                        ],
                        'userIds': [
                            'string',
                        ]
                    },
                    'ruleConfiguration': {
                        'contentBlockerRule': {
                            'systemMessageOverride': 'string'
                        },
                        'contentRetrievalRule': {
                            'eligibleDataSources': [
                                {
                                    'dataSourceId': 'string',
                                    'indexId': 'string'
                                },
                            ]
                        }
                    },
                    'ruleType': 'CONTENT_BLOCKER_RULE'|'CONTENT_RETRIEVAL_RULE'
                },
            ]
        },
    ]
)
Parameters:
  • applicationId (string) –

    [REQUIRED]

    The identifier of the application for which the chat controls are configured.

  • blockedPhrasesConfigurationUpdate (dict) –

    The phrases blocked from chat by your chat control configuration.

    • blockedPhrasesToCreateOrUpdate (list) –

      Creates or updates a blocked phrases configuration in your Amazon Q application.

      • (string) –

    • blockedPhrasesToDelete (list) –

      Deletes a blocked phrases configuration in your Amazon Q application.

      • (string) –

    • systemMessageOverride (string) –

      The configured custom message displayed to your end user when they use blocked phrase during chat.

  • clientToken (string) –

    A token that you provide to identify the request to update a Amazon Q application chat configuration.

    This field is autopopulated if not provided.

  • responseScope (string) – The response scope configured for your application. This determines whether your application uses its retrieval augmented generation (RAG) system to generate answers only from your enterprise data, or also uses the large language models (LLM) knowledge to respons to end user questions in chat.

  • topicConfigurationsToCreateOrUpdate (list) –

    The configured topic specific chat controls you want to update.

    • (dict) –

      The topic specific controls configured for an Amazon Q application.

      • description (string) –

        A description for your topic control configuration. Use this outline how the large language model (LLM) should use this topic control configuration.

      • exampleChatMessages (list) –

        A list of example phrases that you expect the end user to use in relation to the topic.

        • (string) –

      • name (string) – [REQUIRED]

        A name for your topic control configuration.

      • rules (list) – [REQUIRED]

        Rules defined for a topic configuration.

        • (dict) –

          Guardrail rules for an Amazon Q application. Amazon Q supports only one rule at a time.

          • excludedUsersAndGroups (dict) –

            Users and groups to be excluded from a rule.

            • userGroups (list) –

              The user groups associated with a topic control rule.

              • (string) –

            • userIds (list) –

              The user ids associated with a topic control rule.

              • (string) –

          • includedUsersAndGroups (dict) –

            Users and groups to be included in a rule.

            • userGroups (list) –

              The user groups associated with a topic control rule.

              • (string) –

            • userIds (list) –

              The user ids associated with a topic control rule.

              • (string) –

          • ruleConfiguration (dict) –

            The configuration information for a rule.

            Note

            This is a Tagged Union structure. Only one of the following top level keys can be set: contentBlockerRule, contentRetrievalRule.

            • contentBlockerRule (dict) –

              A rule for configuring how Amazon Q responds when it encounters a a blocked topic.

              • systemMessageOverride (string) –

                The configured custom message displayed to an end user informing them that they’ve used a blocked phrase during chat.

            • contentRetrievalRule (dict) –

              Rules for retrieving content from data sources connected to a Amazon Q application for a specific topic control configuration.

              • eligibleDataSources (list) –

                Specifies data sources in a Amazon Q application to use for content generation.

                • (dict) –

                  The identifier of the data source Amazon Q will generate responses from.

                  • dataSourceId (string) –

                    The identifier of the data source.

                  • indexId (string) –

                    The identifier of the index the data source is attached to.

          • ruleType (string) – [REQUIRED]

            The type fo rule.

  • topicConfigurationsToDelete (list) –

    The configured topic specific chat controls you want to delete.

    • (dict) –

      The topic specific controls configured for an Amazon Q application.

      • description (string) –

        A description for your topic control configuration. Use this outline how the large language model (LLM) should use this topic control configuration.

      • exampleChatMessages (list) –

        A list of example phrases that you expect the end user to use in relation to the topic.

        • (string) –

      • name (string) – [REQUIRED]

        A name for your topic control configuration.

      • rules (list) – [REQUIRED]

        Rules defined for a topic configuration.

        • (dict) –

          Guardrail rules for an Amazon Q application. Amazon Q supports only one rule at a time.

          • excludedUsersAndGroups (dict) –

            Users and groups to be excluded from a rule.

            • userGroups (list) –

              The user groups associated with a topic control rule.

              • (string) –

            • userIds (list) –

              The user ids associated with a topic control rule.

              • (string) –

          • includedUsersAndGroups (dict) –

            Users and groups to be included in a rule.

            • userGroups (list) –

              The user groups associated with a topic control rule.

              • (string) –

            • userIds (list) –

              The user ids associated with a topic control rule.

              • (string) –

          • ruleConfiguration (dict) –

            The configuration information for a rule.

            Note

            This is a Tagged Union structure. Only one of the following top level keys can be set: contentBlockerRule, contentRetrievalRule.

            • contentBlockerRule (dict) –

              A rule for configuring how Amazon Q responds when it encounters a a blocked topic.

              • systemMessageOverride (string) –

                The configured custom message displayed to an end user informing them that they’ve used a blocked phrase during chat.

            • contentRetrievalRule (dict) –

              Rules for retrieving content from data sources connected to a Amazon Q application for a specific topic control configuration.

              • eligibleDataSources (list) –

                Specifies data sources in a Amazon Q application to use for content generation.

                • (dict) –

                  The identifier of the data source Amazon Q will generate responses from.

                  • dataSourceId (string) –

                    The identifier of the data source.

                  • indexId (string) –

                    The identifier of the index the data source is attached to.

          • ruleType (string) – [REQUIRED]

            The type fo rule.

Return type:

dict

Returns:

Response Syntax

{}

Response Structure

  • (dict) –

Exceptions

  • QBusiness.Client.exceptions.ResourceNotFoundException

  • QBusiness.Client.exceptions.InternalServerException

  • QBusiness.Client.exceptions.ConflictException

  • QBusiness.Client.exceptions.ThrottlingException

  • QBusiness.Client.exceptions.ValidationException

  • QBusiness.Client.exceptions.AccessDeniedException

  • QBusiness.Client.exceptions.ServiceQuotaExceededException