putInvocationStep method

Future<PutInvocationStepResponse> putInvocationStep({
  1. required String invocationIdentifier,
  2. required DateTime invocationStepTime,
  3. required InvocationStepPayload payload,
  4. required String sessionIdentifier,
  5. String? invocationStepId,
})

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:

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ServiceQuotaExceededException. May throw ThrottlingException. May throw ValidationException.

Parameter invocationIdentifier : The unique identifier (in UUID format) of the invocation to add the invocation step to.

Parameter invocationStepTime : The timestamp for when the invocation step occurred.

Parameter payload : The payload for the invocation step, including text and images for the interaction.

Parameter sessionIdentifier : 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).

Parameter invocationStepId : The unique identifier of the invocation step in UUID format.

Implementation

Future<PutInvocationStepResponse> putInvocationStep({
  required String invocationIdentifier,
  required DateTime invocationStepTime,
  required InvocationStepPayload payload,
  required String sessionIdentifier,
  String? invocationStepId,
}) async {
  final $payload = <String, dynamic>{
    'invocationIdentifier': invocationIdentifier,
    'invocationStepTime': iso8601ToJson(invocationStepTime),
    'payload': payload,
    if (invocationStepId != null) 'invocationStepId': invocationStepId,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri:
        '/sessions/${Uri.encodeComponent(sessionIdentifier)}/invocationSteps/',
    exceptionFnMap: _exceptionFns,
  );
  return PutInvocationStepResponse.fromJson(response);
}