updateAIPrompt method
Updates an AI Prompt.
May throw AccessDeniedException.
May throw ConflictException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
May throw UnauthorizedException.
May throw ValidationException.
Parameter aiPromptId :
The identifier of the Amazon Q in Connect AI Prompt.
Parameter assistantId :
The identifier of the Amazon Q in Connect assistant. Can be either the ID
or the ARN. URLs cannot contain the ARN.
Parameter visibilityStatus :
The visibility status of the Amazon Q in Connect AI prompt.
Parameter clientToken :
A unique, case-sensitive identifier that you provide to ensure the
idempotency of the request. If not provided, the Amazon Web Services SDK
populates this field. For more information about idempotency, see Making
retries safe with idempotent APIs..
Parameter description :
The description of the Amazon Q in Connect AI Prompt.
Parameter inferenceConfiguration :
The updated inference configuration for the AI Prompt.
Parameter modelId :
The identifier of the model used for this AI Prompt.
Parameter templateConfiguration :
The configuration of the prompt template for this AI Prompt.
Implementation
Future<UpdateAIPromptResponse> updateAIPrompt({
required String aiPromptId,
required String assistantId,
required VisibilityStatus visibilityStatus,
String? clientToken,
String? description,
AIPromptInferenceConfiguration? inferenceConfiguration,
String? modelId,
AIPromptTemplateConfiguration? templateConfiguration,
}) async {
final $payload = <String, dynamic>{
'visibilityStatus': visibilityStatus.value,
'clientToken': clientToken ?? _s.generateIdempotencyToken(),
if (description != null) 'description': description,
if (inferenceConfiguration != null)
'inferenceConfiguration': inferenceConfiguration,
if (modelId != null) 'modelId': modelId,
if (templateConfiguration != null)
'templateConfiguration': templateConfiguration,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri:
'/assistants/${Uri.encodeComponent(assistantId)}/aiprompts/${Uri.encodeComponent(aiPromptId)}',
exceptionFnMap: _exceptionFns,
);
return UpdateAIPromptResponse.fromJson(response);
}