AgentsforBedrock / Client / update_retrieval_instruction

update_retrieval_instruction

AgentsforBedrock.Client.update_retrieval_instruction(**kwargs)

Updates the content of a retrieval instruction. The update is processed asynchronously; the stored content is a candidate until content review passes, and the served content does not change while the update is in flight. The service rejects the request with ConflictException while lastTransitionStatus is CREATING or UPDATING.

See also: AWS API Documentation

Request Syntax

response = client.update_retrieval_instruction(
    retrievalInstructionId='string',
    instruction={
        'retrievalGuidance': 'string',
        'persona': 'string',
        'answerFormat': 'string',
        'answerPolicy': 'string'
    },
    description='string'
)
Parameters:
  • retrievalInstructionId (string) –

    [REQUIRED]

    The identifier of the retrieval instruction to update.

  • instruction (dict) –

    [REQUIRED]

    The replacement instruction content. This is a full replacement of all four fields, not a patch. During UPDATING, Get continues to return the previously-served content until the update review passes.

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

  • description (string) – A replacement description; applied together with the content when the review passes. Omit to clear.

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',
    'createdAt': datetime(2015, 1, 1),
    'updatedAt': datetime(2015, 1, 1)
}

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) –

      Whether the instruction can be used. An update never lowers status. Unchanged from the previous value on this response.

    • lastTransitionStatus (string) –

      Always UPDATING on this response. Poll GetRetrievalInstruction until this member is neither CREATING nor UPDATING, then read the outcome from it.

    • createdAt (datetime) –

      When you created the retrieval instruction.

    • updatedAt (datetime) –

      When the retrieval instruction was last updated.

Exceptions