getPrompt method

Future<GetPromptResponse> getPrompt({
  1. required String promptIdentifier,
  2. IncludedData? includedData,
  3. String? promptVersion,
})

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 includedData : Controls the scope of data returned. Set to METADATA_ONLY to return only resource metadata. Set to ALL_DATA or omit this field to return the full response.

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,
  IncludedData? includedData,
  String? promptVersion,
}) async {
  final $query = <String, List<String>>{
    if (includedData != null) 'includedData': [includedData.value],
    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);
}