getPrompt method
Retrieves information about the working draft (DRAFT version)
of a prompt or a version of it, depending on whether you include the
promptVersion field or not. For more information, see View
information about prompts using Prompt management and View
information about a version of your prompt in the Amazon Bedrock User
Guide.
May throw AccessDeniedException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
May throw ValidationException.
Parameter promptIdentifier :
The unique identifier of the prompt.
Parameter promptVersion :
The version of the prompt about which you want to retrieve information.
Omit this field to return information about the working draft of the
prompt.
Implementation
Future<GetPromptResponse> getPrompt({
required String promptIdentifier,
String? promptVersion,
}) async {
final $query = <String, List<String>>{
if (promptVersion != null) 'promptVersion': [promptVersion],
};
final response = await _protocol.send(
payload: null,
method: 'GET',
requestUri: '/prompts/${Uri.encodeComponent(promptIdentifier)}/',
queryParams: $query,
exceptionFnMap: _exceptionFns,
);
return GetPromptResponse.fromJson(response);
}