Skip to content

predict_q_app

predict_q_app(
    instance_id: InstanceId,
    *,
    config_overrides: Optional[QAppsClientConfig] = None,
    options: Optional[PredictQAppInputOptions] = None,
) -> PredictQAppOutput

Generates an Amazon Q App definition based on either a conversation or a problem statement provided as input.The resulting app definition can be used to call CreateQApp. This API doesn't create Amazon Q Apps directly.

Parameters:

  • instance_id (InstanceId) –

    The unique identifier of the Amazon Q Business application environment instance.

  • options (Optional[PredictQAppInputOptions], default: None ) –

    The input to generate the Q App definition from, either a conversation or problem statement.

Raises:

  • AccessDeniedException –

    The client is not authorized to perform the requested operation.

  • InternalServerException –

    An internal service error occurred while processing the request.

  • ThrottlingException –

    The requested operation could not be completed because too many requests were sent at once. Wait a bit and try again later.

  • UnauthorizedException –

    The client is not authenticated or authorized to perform the requested operation.

  • ValidationException –

    The input failed to satisfy the constraints specified by the service.

  • UnknownServiceError –

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

Source code in docs_src/capo_qapps/_services/q_apps.py
def predict_q_app(
    self,
    instance_id: "capo_qapps.types.instance_id.InstanceId",
    *,
    config_overrides: Optional[QAppsClientConfig] = None,
    options: Optional[
        "capo_qapps.types.predict_q_app_input_options.PredictQAppInputOptions"
    ] = None,
) -> "capo_qapps.types.predict_q_app_output.PredictQAppOutput":
    """<p>Generates an Amazon Q App definition based on either a conversation or a problem statement provided as input.The resulting app definition can be used to call <code>CreateQApp</code>. This API doesn't create Amazon Q Apps directly.</p>

    Args:
        instance_id: <p>The unique identifier of the Amazon Q Business application environment instance.</p>
        options: <p>The input to generate the Q App definition from, either a conversation or problem statement.</p>

    Raises:
        capo_qapps.errors.access_denied_exception.AccessDeniedException: <p>The client is not authorized to perform the requested operation.</p>
        capo_qapps.errors.internal_server_exception.InternalServerException: <p>An internal service error occurred while processing the request.</p>
        capo_qapps.errors.throttling_exception.ThrottlingException: <p>The requested operation could not be completed because too many requests were sent at once. Wait a bit and try again later.</p>
        capo_qapps.errors.unauthorized_exception.UnauthorizedException: <p>The client is not authenticated or authorized to perform the requested operation.</p>
        capo_qapps.errors.validation_exception.ValidationException: <p>The input failed to satisfy the constraints specified by the service.</p>
        capo_qapps.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_qapps.types.predict_q_app_input.PredictQAppInput]",
    ) -> OperationResponse[
        "capo_qapps.types.predict_q_app_output.PredictQAppOutput"
    ]:
        import capo_qapps._operations.q_apps_service.predict_q_app

        output, http_response = (
            capo_qapps._operations.q_apps_service.predict_q_app.predict_q_app(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("PredictQApp")
    )
    input_: capo_qapps.types.predict_q_app_input.PredictQAppInput = {
        "instance_id": instance_id
    }
    if options is not None:
        input_["options"] = options

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