Skip to content

evaluate_session async

evaluate_session(
    domain_id: DomainId,
    session_name_or_id: SessionNameOrId,
    *,
    config_overrides: Optional[AsyncVoiceIDClientConfig] = None,
) -> EvaluateSessionResponse

Evaluates a specified session based on audio data accumulated during a streaming Amazon Connect Voice ID call.

Parameters:

  • domain_id (DomainId) –

    The identifier of the domain where the session started.

  • session_name_or_id (SessionNameOrId) –

    The session identifier, or name of the session, that you want to evaluate. In Voice ID integration, this is the Contact-Id.

Raises:

Source code in docs_src/capo_voice_id/_services/async_voice_id.py
async def evaluate_session(
    self,
    domain_id: "capo_voice_id.types.domain_id.DomainId",
    session_name_or_id: "capo_voice_id.types.session_name_or_id.SessionNameOrId",
    *,
    config_overrides: Optional[AsyncVoiceIDClientConfig] = None,
) -> "capo_voice_id.types.evaluate_session_response.EvaluateSessionResponse":
    """<p>Evaluates a specified session based on audio data accumulated during a streaming Amazon Connect Voice ID call.</p>

    Args:
        domain_id: <p>The identifier of the domain where the session started.</p>
        session_name_or_id: <p>The session identifier, or name of the session, that you want to evaluate. In Voice ID integration, this is the Contact-Id.</p>

    Raises:
        capo_voice_id.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient permissions to perform this action. Check the error message and try again.</p>
        capo_voice_id.errors.conflict_exception.ConflictException: <p>The request failed due to a conflict. Check the <code>ConflictType</code> and error message for more details.</p>
        capo_voice_id.errors.internal_server_exception.InternalServerException: <p>The request failed due to an unknown error on the server side.</p>
        capo_voice_id.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource cannot be found. Check the <code>ResourceType</code> and error message for more details.</p>
        capo_voice_id.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling. Please slow down your request rate. Refer to <a href="https://docs.aws.amazon.com/connect/latest/adminguide/amazon-connect-service-limits.html##voiceid-api-quotas"> Amazon Connect Voice ID Service API throttling quotas </a> and try your request again.</p>
        capo_voice_id.errors.validation_exception.ValidationException: <p>The request failed one or more validations; check the error message for more details.</p>
        capo_voice_id.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_voice_id.types.evaluate_session_request.EvaluateSessionRequest]",
    ) -> AsyncOperationResponse[
        "capo_voice_id.types.evaluate_session_response.EvaluateSessionResponse"
    ]:
        import capo_voice_id._operations.voice_id.evaluate_session

        (
            output,
            http_response,
        ) = await capo_voice_id._operations.voice_id.evaluate_session.async_evaluate_session(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_voice_id.types.evaluate_session_response.EvaluateSessionResponse",
    ) -> dict[str, Any]:
        import capo_voice_id.types.evaluate_session_response

        return capo_voice_id.types.evaluate_session_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("EvaluateSession", redact_output=_redact_output),
    )
    input_: capo_voice_id.types.evaluate_session_request.EvaluateSessionRequest = {
        "domain_id": domain_id,
        "session_name_or_id": session_name_or_id,
    }

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output