Skip to content

create_assistant

create_assistant(
    name: Name,
    type: AssistantType,
    *,
    config_overrides: Optional[QConnectClientConfig] = None,
    client_token: Optional[ClientToken] = None,
    description: Optional[Description] = None,
    tags: Optional[Tags] = None,
    server_side_encryption_configuration: Optional[
        ServerSideEncryptionConfiguration
    ] = None,
) -> CreateAssistantResponse

Creates an Amazon Q in Connect assistant.

Parameters:

  • client_token (Optional[ClientToken], default: None ) –

    A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see Making retries safe with idempotent APIs.

  • name (Name) –

    The name of the assistant.

  • type (AssistantType) –

    The type of assistant.

  • description (Optional[Description], default: None ) –

    The description of the assistant.

  • tags (Optional[Tags], default: None ) –

    The tags used to organize, track, or control access for this resource.

  • server_side_encryption_configuration (Optional[ServerSideEncryptionConfiguration], default: None ) –

    The configuration information for the customer managed key used for encryption.

    The customer managed key must have a policy that allows kms:CreateGrant, kms:DescribeKey, kms:Decrypt, and kms:GenerateDataKey* permissions to the IAM identity using the key to invoke Amazon Q in Connect. To use Amazon Q in Connect with chat, the key policy must also allow kms:Decrypt, kms:GenerateDataKey*, and kms:DescribeKey permissions to the connect.amazonaws.com service principal.

    For more information about setting up a customer managed key for Amazon Q in Connect, see Enable Amazon Q in Connect for your instance.

Raises:

  • AccessDeniedException –

    You do not have sufficient access to perform this action.

  • ConflictException –

    The request could not be processed because of conflict in the current state of the resource. For example, if you're using a Create API (such as CreateAssistant) that accepts name, a conflicting resource (usually with the same name) is being created or mutated.

  • ServiceQuotaExceededException –

    You've exceeded your service quota. To perform the requested action, remove some of the relevant resources, or use service quotas to request a service quota increase.

  • UnauthorizedException –

    You do not have permission to perform this action.

  • ValidationException –

    The input fails to satisfy the constraints specified by a service.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_qconnect/_services/q_connect.py
def create_assistant(
    self,
    name: "capo_qconnect.types.name.Name",
    type: "capo_qconnect.types.assistant_type.AssistantType",
    *,
    config_overrides: Optional[QConnectClientConfig] = None,
    client_token: Optional["capo_qconnect.types.client_token.ClientToken"] = None,
    description: Optional["capo_qconnect.types.description.Description"] = None,
    tags: Optional["capo_qconnect.types.tags.Tags"] = None,
    server_side_encryption_configuration: Optional[
        "capo_qconnect.types.server_side_encryption_configuration.ServerSideEncryptionConfiguration"
    ] = None,
) -> "capo_qconnect.types.create_assistant_response.CreateAssistantResponse":
    """<p>Creates an Amazon Q in Connect assistant.</p>

    Args:
        client_token: <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see <a href="http://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>.</p>
        name: <p>The name of the assistant.</p>
        type: <p>The type of assistant.</p>
        description: <p>The description of the assistant.</p>
        tags: <p>The tags used to organize, track, or control access for this resource.</p>
        server_side_encryption_configuration: <p>The configuration information for the customer managed key used for encryption. </p> <p>The customer managed key must have a policy that allows <code>kms:CreateGrant</code>, <code> kms:DescribeKey</code>, <code>kms:Decrypt</code>, and <code>kms:GenerateDataKey*</code> permissions to the IAM identity using the key to invoke Amazon Q in Connect. To use Amazon Q in Connect with chat, the key policy must also allow <code>kms:Decrypt</code>, <code>kms:GenerateDataKey*</code>, and <code>kms:DescribeKey</code> permissions to the <code>connect.amazonaws.com</code> service principal. </p> <p>For more information about setting up a customer managed key for Amazon Q in Connect, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/enable-q.html">Enable Amazon Q in Connect for your instance</a>.</p>

    Raises:
        capo_qconnect.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_qconnect.errors.conflict_exception.ConflictException: <p>The request could not be processed because of conflict in the current state of the resource. For example, if you're using a <code>Create</code> API (such as <code>CreateAssistant</code>) that accepts name, a conflicting resource (usually with the same name) is being created or mutated.</p>
        capo_qconnect.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>You've exceeded your service quota. To perform the requested action, remove some of the relevant resources, or use service quotas to request a service quota increase.</p>
        capo_qconnect.errors.unauthorized_exception.UnauthorizedException: <p>You do not have permission to perform this action.</p>
        capo_qconnect.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by a service.</p>
        capo_qconnect.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_qconnect.types.create_assistant_request.CreateAssistantRequest]",
    ) -> OperationResponse[
        "capo_qconnect.types.create_assistant_response.CreateAssistantResponse"
    ]:
        import capo_qconnect._operations.wisdom_service.create_assistant

        output, http_response = (
            capo_qconnect._operations.wisdom_service.create_assistant.create_assistant(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateAssistant")
    )
    input_: capo_qconnect.types.create_assistant_request.CreateAssistantRequest = {
        "name": name,
        "type": type,
    }
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if description is not None:
        input_["description"] = description
    if tags is not None:
        input_["tags"] = tags
    if server_side_encryption_configuration is not None:
        input_["server_side_encryption_configuration"] = (
            server_side_encryption_configuration
        )

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output