Skip to content

update_ai_agent

update_ai_agent(
    assistant_id: UuidOrArn,
    ai_agent_id: UuidOrArnOrEitherWithQualifier,
    visibility_status: VisibilityStatus,
    *,
    config_overrides: Optional[QConnectClientConfig] = None,
    client_token: Optional[ClientToken] = None,
    configuration: Optional[AIAgentConfiguration] = None,
    description: Optional[Description] = None,
) -> UpdateAIAgentResponse

Updates an AI Agent.

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..

  • assistant_id (UuidOrArn) –

    The identifier of the Amazon Q in Connect assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.

  • ai_agent_id (UuidOrArnOrEitherWithQualifier) –

    The identifier of the Amazon Q in Connect AI Agent.

  • visibility_status (VisibilityStatus) –

    The visbility status of the Amazon Q in Connect AI Agent.

  • configuration (Optional[AIAgentConfiguration], default: None ) –

    The configuration of the Amazon Q in Connect AI Agent.

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

    The description of the Amazon Q in Connect AI Agent.

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.

  • ResourceNotFoundException –

    The specified resource does not exist.

  • ThrottlingException –

    The throttling limit has been exceeded.

  • 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 update_ai_agent(
    self,
    assistant_id: "capo_qconnect.types.uuid_or_arn.UuidOrArn",
    ai_agent_id: "capo_qconnect.types.uuid_or_arn_or_either_with_qualifier.UuidOrArnOrEitherWithQualifier",
    visibility_status: "capo_qconnect.types.visibility_status.VisibilityStatus",
    *,
    config_overrides: Optional[QConnectClientConfig] = None,
    client_token: Optional["capo_qconnect.types.client_token.ClientToken"] = None,
    configuration: Optional[
        "capo_qconnect.types.ai_agent_configuration.AIAgentConfiguration"
    ] = None,
    description: Optional["capo_qconnect.types.description.Description"] = None,
) -> "capo_qconnect.types.update_ai_agent_response.UpdateAIAgentResponse":
    """<p>Updates an AI Agent.</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>
        assistant_id: <p>The identifier of the Amazon Q in Connect assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.</p>
        ai_agent_id: <p>The identifier of the Amazon Q in Connect AI Agent.</p>
        visibility_status: <p>The visbility status of the Amazon Q in Connect AI Agent.</p>
        configuration: <p>The configuration of the Amazon Q in Connect AI Agent.</p>
        description: <p>The description of the Amazon Q in Connect AI Agent.</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.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
        capo_qconnect.errors.throttling_exception.ThrottlingException: <p>The throttling limit has been exceeded.</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.update_ai_agent_request.UpdateAIAgentRequest]",
    ) -> OperationResponse[
        "capo_qconnect.types.update_ai_agent_response.UpdateAIAgentResponse"
    ]:
        import capo_qconnect._operations.wisdom_service.update_ai_agent

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

    def _redact_input(
        input_: "capo_qconnect.types.update_ai_agent_request.UpdateAIAgentRequest",
    ) -> dict[str, Any]:
        import capo_qconnect.types.update_ai_agent_request

        return capo_qconnect.types.update_ai_agent_request.redact_sensitive(input_)

    def _redact_output(
        output: "capo_qconnect.types.update_ai_agent_response.UpdateAIAgentResponse",
    ) -> dict[str, Any]:
        import capo_qconnect.types.update_ai_agent_response

        return capo_qconnect.types.update_ai_agent_response.redact_sensitive(output)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "UpdateAIAgent",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_qconnect.types.update_ai_agent_request.UpdateAIAgentRequest = {
        "assistant_id": assistant_id,
        "ai_agent_id": ai_agent_id,
        "visibility_status": visibility_status,
    }
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if configuration is not None:
        input_["configuration"] = configuration
    if description is not None:
        input_["description"] = description

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