AgentsforBedrock / Client / get_retrieval_instruction

get_retrieval_instruction

AgentsforBedrock.Client.get_retrieval_instruction(**kwargs)

Gets a retrieval instruction. Also used to poll the terminal reporting of an asynchronous create or update.

See also: AWS API Documentation

Request Syntax

response = client.get_retrieval_instruction(
    retrievalInstructionId='string',
    retrievalInstructionVersion='string'
)
Parameters:
  • retrievalInstructionId (string) –

    [REQUIRED]

    The identifier of the retrieval instruction to get.

  • retrievalInstructionVersion (string) – The version to return: a version number, or DRAFT for the retrieval instruction’s current reviewed content. When omitted, DRAFT is used. This default is permanent: omitting retrievalInstructionVersion will never resolve to a numbered version.

Return type:

dict

Returns:

Response Syntax

{
    'retrievalInstructionId': 'string',
    'retrievalInstructionArn': 'string',
    'name': 'string',
    'status': 'ACTIVE'|'INACTIVE',
    'lastTransitionStatus': 'CREATING'|'UPDATING'|'CREATE_SUCCESSFUL'|'CREATE_FAILED'|'UPDATE_SUCCESSFUL'|'UPDATE_FAILED',
    'instruction': {
        'retrievalGuidance': 'string',
        'persona': 'string',
        'answerFormat': 'string',
        'answerPolicy': 'string'
    },
    'createdAt': datetime(2015, 1, 1),
    'updatedAt': datetime(2015, 1, 1),
    'description': 'string',
    'customerEncryptionKeyArn': 'string',
    'lastTransitionStatusReasons': [
        {
            'fieldName': 'RETRIEVAL_GUIDANCE'|'PERSONA'|'ANSWER_FORMAT'|'ANSWER_POLICY',
            'code': 'CONTENT_REJECTED'|'CLIENT_ERROR'|'INTERNAL_ERROR',
            'message': 'string'
        },
    ],
    'version': 'string',
    'latestVersion': 'string'
}

Response Structure

  • (dict) –

    • retrievalInstructionId (string) –

      The identifier of the retrieval instruction.

    • retrievalInstructionArn (string) –

      The ARN of the retrieval instruction.

    • name (string) –

      The name of the retrieval instruction.

    • status (string) –

      Specifies whether you can use the instruction. You can resolve only an ACTIVE instruction at retrieval time. Monotone: INACTIVE to ACTIVE once, never back. Numbered versions are always ACTIVE.

    • lastTransitionStatus (string) –

      The outcome or in-progress state of the most recent create or update. CREATING or UPDATING means the operation is still running. Independent of status. Always has a value from the create 202 onward. On a numbered version this is always CREATE_SUCCESSFUL: a version is created once, from reviewed content, and is immutable.

    • instruction (dict) –

      The reviewed content this instruction serves — what AgenticRetrieveStream resolves while status is ACTIVE. Absent until the first create review passes. Always present on a numbered version.

      • retrievalGuidance (string) –

        How to interpret and decompose the question, and what to prioritise when searching.

      • persona (string) –

        Who the assistant is: identity, tone and language.

      • answerFormat (string) –

        How the answer is structured, including how sources are cited.

      • answerPolicy (string) –

        Whether and how to answer: how strongly an answer must be supported, and what to do with questions outside scope.

    • createdAt (datetime) –

      When the retrieval instruction was created. On a numbered version, when that version was created.

    • updatedAt (datetime) –

      When the retrieval instruction was last updated. Equal to createdAt on a numbered version, which is immutable.

    • description (string) –

      A description of the retrieval instruction. On a numbered version, the description of that version.

    • customerEncryptionKeyArn (string) –

      The ARN of the customer managed KMS key protecting this content, when one was supplied at create.

    • lastTransitionStatusReasons (list) –

      Why the most recent create or update was rejected. One entry for each rejected field, or a single entry when the review itself failed. Each entry has a machine-readable code and a message, and names the field when it applies to one. The service includes this field only when lastTransitionStatus is CREATE_FAILED or UPDATE_FAILED. Never present on a numbered version.

      • (dict) –

        One reason the most recent create or update did not succeed. code drives programmatic branching (fix the text, fix the configuration, or retry); message carries the specific cause.

        • fieldName (string) –

          The instruction field this entry is about. Present on review rejections of a specific field; absent when the failure applies to the whole review, because a client-side execution failure or a service fault has no single field.

        • code (string) –

          Stable, machine-readable classification by fault attribution. Valid values:

          • CONTENT_REJECTED – The review rejected the named field’s content; revise the text and resubmit.

          • CLIENT_ERROR – The review could not run for a customer-side reason, for example the customer managed AWS KMS key could not be used; fix the configuration and resubmit.

          • INTERNAL_ERROR – The review could not complete due to a service fault; retry the create or update.

          New values may be added over time; your client should tolerate values it does not recognize and treat them as a failure.

        • message (string) –

          Human-readable explanation of the specific cause. Never contains the customer’s own text.

    • version (string) –

      The version this response describes: a version number, or DRAFT.

    • latestVersion (string) –

      The largest version number that currently exists for this retrieval instruction, that is, the newest version you can retrieve. Present only on a DRAFT read, and only when at least one version exists. Because version numbers are never reused, deleting versions can leave gaps: this is the newest existing version, not a count and not the highest number ever created.

Exceptions