AgentsforBedrockRuntime / Client / put_invocation_step
put_invocation_step#
- AgentsforBedrockRuntime.Client.put_invocation_step(**kwargs)#
Add an invocation step to an invocation in a session. An invocation step stores fine-grained state checkpoints, including text and images, for each interaction. For more information about sessions, see Store and retrieve conversation history and context with Amazon Bedrock sessions.
Related APIs:
See also: AWS API Documentation
Request Syntax
response = client.put_invocation_step( invocationIdentifier='string', invocationStepId='string', invocationStepTime=datetime(2015, 1, 1), payload={ 'contentBlocks': [ { 'image': { 'format': 'png'|'jpeg'|'gif'|'webp', 'source': { 'bytes': b'bytes', 's3Location': { 'uri': 'string' } } }, 'text': 'string' }, ] }, sessionIdentifier='string' )
- Parameters:
invocationIdentifier (string) –
[REQUIRED]
The unique identifier (in UUID format) of the invocation to add the invocation step to.
invocationStepId (string) – The unique identifier of the invocation step in UUID format.
invocationStepTime (datetime) –
[REQUIRED]
The timestamp for when the invocation step occurred.
payload (dict) –
[REQUIRED]
The payload for the invocation step, including text and images for the interaction.
Note
This is a Tagged Union structure. Only one of the following top level keys can be set:
contentBlocks
.contentBlocks (list) –
The content for the invocation step.
(dict) –
A block of content that you pass to, or receive from, a Amazon Bedrock session in an invocation step. You pass the content to a session in the
payLoad
of the PutInvocationStep API operation. You retrieve the content with the GetInvocationStep API operation.For more information about sessions, see Store and retrieve conversation history and context with Amazon Bedrock sessions.
Note
This is a Tagged Union structure. Only one of the following top level keys can be set:
image
,text
.image (dict) –
The image in the invocation step.
format (string) – [REQUIRED]
The format of the image.
source (dict) – [REQUIRED]
The source for the image.
Note
This is a Tagged Union structure. Only one of the following top level keys can be set:
bytes
,s3Location
.bytes (bytes) –
The raw image bytes for the image. If you use an Amazon Web Services SDK, you don’t need to encode the image bytes in base64.
s3Location (dict) –
The path to the Amazon S3 bucket where the image is stored.
uri (string) – [REQUIRED]
The path to the Amazon S3 bucket where the image is stored.
text (string) –
The text in the invocation step.
sessionIdentifier (string) –
[REQUIRED]
The unique identifier for the session to add the invocation step to. You can specify either the session’s
sessionId
or its Amazon Resource Name (ARN).
- Return type:
dict
- Returns:
Response Syntax
{ 'invocationStepId': 'string' }
Response Structure
(dict) –
invocationStepId (string) –
The unique identifier of the invocation step in UUID format.
Exceptions
AgentsforBedrockRuntime.Client.exceptions.ResourceNotFoundException
AgentsforBedrockRuntime.Client.exceptions.ValidationException
AgentsforBedrockRuntime.Client.exceptions.InternalServerException
AgentsforBedrockRuntime.Client.exceptions.ThrottlingException
AgentsforBedrockRuntime.Client.exceptions.AccessDeniedException
AgentsforBedrockRuntime.Client.exceptions.ServiceQuotaExceededException