AgentsforBedrock / Client / create_retrieval_instruction
create_retrieval_instruction¶
- AgentsforBedrock.Client.create_retrieval_instruction(**kwargs)¶
Creates a new retrieval instruction. The retrieval instruction is usable once its status becomes ACTIVE. Use GetRetrievalInstruction to check whether it is ready.
See also: AWS API Documentation
Request Syntax
response = client.create_retrieval_instruction( clientToken='string', name='string', instruction={ 'retrievalGuidance': 'string', 'persona': 'string', 'answerFormat': 'string', 'answerPolicy': 'string' }, description='string', customerEncryptionKeyArn='string', tags={ 'string': 'string' } )
- Parameters:
clientToken (string) –
A caller-supplied token that makes a retried create return the existing resource rather than a second one. The window is 8 hours.
This field is autopopulated if not provided.
name (string) –
[REQUIRED]
Specifies the name of the retrieval instruction.
instruction (dict) –
[REQUIRED]
The instruction content, as a set of named fields. Get does not return this field until the create 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) – Specifies a description of the retrieval instruction.
customerEncryptionKeyArn (string) – The Amazon Resource Name (ARN) of a customer managed AWS Key Management Service (AWS KMS) key used to encrypt the instruction content at rest. If you omit it, the service uses an AWS owned key. You fix the key at create and cannot change it later.
tags (dict) –
Tags for the retrieval instruction.
(string) –
(string) –
- 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 newly created retrieval instruction.
retrievalInstructionArn (string) –
The ARN of the newly created retrieval instruction.
name (string) –
The name of the retrieval instruction.
status (string) –
Always INACTIVE on this response. The content review has not run when this call returns, so the resource is not yet usable.
lastTransitionStatus (string) –
Always CREATING 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