QConnect / Client / create_ai_prompt

create_ai_prompt#

QConnect.Client.create_ai_prompt(**kwargs)#

Creates an Amazon Q in Connect AI Prompt.

See also: AWS API Documentation

Request Syntax

response = client.create_ai_prompt(
    apiFormat='ANTHROPIC_CLAUDE_MESSAGES'|'ANTHROPIC_CLAUDE_TEXT_COMPLETIONS',
    assistantId='string',
    clientToken='string',
    description='string',
    modelId='string',
    name='string',
    tags={
        'string': 'string'
    },
    templateConfiguration={
        'textFullAIPromptEditTemplateConfiguration': {
            'text': 'string'
        }
    },
    templateType='TEXT',
    type='ANSWER_GENERATION'|'INTENT_LABELING_GENERATION'|'QUERY_REFORMULATION',
    visibilityStatus='SAVED'|'PUBLISHED'
)
Parameters:
  • apiFormat (string) –

    [REQUIRED]

    The API Format of the AI Prompt.

  • assistantId (string) –

    [REQUIRED]

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

  • clientToken (string) –

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

    This field is autopopulated if not provided.

  • description (string) – The description of the AI Prompt.

  • modelId (string) –

    [REQUIRED]

    The identifier of the model used for this AI Prompt. Model Ids supported are: CLAUDE_3_HAIKU_20240307_V1

  • name (string) –

    [REQUIRED]

    The name of the AI Prompt.

  • tags (dict) –

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

    • (string) –

      • (string) –

  • templateConfiguration (dict) –

    [REQUIRED]

    The configuration of the prompt template for this AI Prompt.

    Note

    This is a Tagged Union structure. Only one of the following top level keys can be set: textFullAIPromptEditTemplateConfiguration.

    • textFullAIPromptEditTemplateConfiguration (dict) –

      The configuration for a prompt template that supports full textual prompt configuration using a YAML prompt.

      • text (string) – [REQUIRED]

        The YAML text for the AI Prompt template.

  • templateType (string) –

    [REQUIRED]

    The type of the prompt template for this AI Prompt.

  • type (string) –

    [REQUIRED]

    The type of this AI Prompt.

  • visibilityStatus (string) –

    [REQUIRED]

    The visibility status of the AI Prompt.

Return type:

dict

Returns:

Response Syntax

{
    'aiPrompt': {
        'aiPromptArn': 'string',
        'aiPromptId': 'string',
        'apiFormat': 'ANTHROPIC_CLAUDE_MESSAGES'|'ANTHROPIC_CLAUDE_TEXT_COMPLETIONS',
        'assistantArn': 'string',
        'assistantId': 'string',
        'description': 'string',
        'modelId': 'string',
        'modifiedTime': datetime(2015, 1, 1),
        'name': 'string',
        'origin': 'SYSTEM'|'CUSTOMER',
        'status': 'CREATE_IN_PROGRESS'|'CREATE_FAILED'|'ACTIVE'|'DELETE_IN_PROGRESS'|'DELETE_FAILED'|'DELETED',
        'tags': {
            'string': 'string'
        },
        'templateConfiguration': {
            'textFullAIPromptEditTemplateConfiguration': {
                'text': 'string'
            }
        },
        'templateType': 'TEXT',
        'type': 'ANSWER_GENERATION'|'INTENT_LABELING_GENERATION'|'QUERY_REFORMULATION',
        'visibilityStatus': 'SAVED'|'PUBLISHED'
    }
}

Response Structure

  • (dict) –

    • aiPrompt (dict) –

      The data of the AI Prompt.

      • aiPromptArn (string) –

        The Amazon Resource Name (ARN) of the AI Prompt.

      • aiPromptId (string) –

        The identifier of the Amazon Q in Connect AI prompt.

      • apiFormat (string) –

        The API format used for this AI Prompt.

      • assistantArn (string) –

        The Amazon Resource Name (ARN) of the Amazon Q in Connect assistant.

      • assistantId (string) –

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

      • description (string) –

        The description of the AI Prompt.

      • modelId (string) –

        The identifier of the model used for this AI Prompt. Model Ids supported are: CLAUDE_3_HAIKU_20240307_V1.

      • modifiedTime (datetime) –

        The time the AI Prompt was last modified.

      • name (string) –

        The name of the AI Prompt

      • origin (string) –

        The origin of the AI Prompt. SYSTEM for a default AI Prompt created by Q in Connect or CUSTOMER for an AI Prompt created by calling AI Prompt creation APIs.

      • status (string) –

        The status of the AI Prompt.

      • tags (dict) –

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

        • (string) –

          • (string) –

      • templateConfiguration (dict) –

        The configuration of the prompt template for this AI Prompt.

        Note

        This is a Tagged Union structure. Only one of the following top level keys will be set: textFullAIPromptEditTemplateConfiguration. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:

        'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
        
        • textFullAIPromptEditTemplateConfiguration (dict) –

          The configuration for a prompt template that supports full textual prompt configuration using a YAML prompt.

          • text (string) –

            The YAML text for the AI Prompt template.

      • templateType (string) –

        The type of the prompt template for this AI Prompt.

      • type (string) –

        The type of this AI Prompt.

      • visibilityStatus (string) –

        The visibility status of the AI Prompt.

Exceptions

  • QConnect.Client.exceptions.ConflictException

  • QConnect.Client.exceptions.ValidationException

  • QConnect.Client.exceptions.ServiceQuotaExceededException

  • QConnect.Client.exceptions.AccessDeniedException

  • QConnect.Client.exceptions.ResourceNotFoundException

  • QConnect.Client.exceptions.ThrottlingException