Skip to content

list_ai_prompts async

list_ai_prompts(
    assistant_id: UuidOrArn,
    *,
    config_overrides: Optional[AsyncQConnectClientConfig] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[MaxResults] = None,
    origin: Optional[Origin] = None,
) -> ListAIPromptsResponse

Lists the AI Prompts available on the Amazon Q in Connect assistant.

Parameters:

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

  • next_token (Optional[NextToken], default: None ) –

    The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.

  • max_results (Optional[MaxResults], default: None ) –

    The maximum number of results to return per page.

  • origin (Optional[Origin], default: None ) –

    The origin of the AI Prompts to be listed. SYSTEM for a default AI Agent created by Q in Connect or CUSTOMER for an AI Agent created by calling AI Agent creation APIs.

Raises:

Source code in docs_src/capo_qconnect/_services/async_q_connect.py
async def list_ai_prompts(
    self,
    assistant_id: "capo_qconnect.types.uuid_or_arn.UuidOrArn",
    *,
    config_overrides: Optional[AsyncQConnectClientConfig] = None,
    next_token: Optional["capo_qconnect.types.next_token.NextToken"] = None,
    max_results: Optional["capo_qconnect.types.max_results.MaxResults"] = None,
    origin: Optional["capo_qconnect.types.origin.Origin"] = None,
) -> "capo_qconnect.types.list_ai_prompts_response.ListAIPromptsResponse":
    """<p>Lists the AI Prompts available on the Amazon Q in Connect assistant.</p>

    Args:
        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>
        next_token: <p>The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.</p>
        max_results: <p>The maximum number of results to return per page.</p>
        origin: <p>The origin of the AI Prompts to be listed. <code>SYSTEM</code> for a default AI Agent created by Q in Connect or <code>CUSTOMER</code> for an AI Agent created by calling AI Agent creation APIs. </p>

    Raises:
        capo_qconnect.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_qconnect.types.list_ai_prompts_request.ListAIPromptsRequest]",
    ) -> AsyncOperationResponse[
        "capo_qconnect.types.list_ai_prompts_response.ListAIPromptsResponse"
    ]:
        import capo_qconnect._operations.wisdom_service.list_ai_prompts

        (
            output,
            http_response,
        ) = await capo_qconnect._operations.wisdom_service.list_ai_prompts.async_list_ai_prompts(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListAIPrompts")
    )
    input_: capo_qconnect.types.list_ai_prompts_request.ListAIPromptsRequest = {
        "assistant_id": assistant_id
    }
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results
    if origin is not None:
        input_["origin"] = origin

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