generateQuery method
Future<GenerateQueryResponse>
generateQuery({
- required QueryGenerationInput queryGenerationInput,
- required TransformationConfiguration transformationConfiguration,
Generates an SQL query from a natural language query. For more information, see Generate a query for structured data in the Amazon Bedrock User Guide.
May throw AccessDeniedException.
May throw BadGatewayException.
May throw ConflictException.
May throw DependencyFailedException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter queryGenerationInput :
Specifies information about a natural language query to transform into
SQL.
Parameter transformationConfiguration :
Specifies configurations for transforming the natural language query into
SQL.
Implementation
Future<GenerateQueryResponse> generateQuery({
required QueryGenerationInput queryGenerationInput,
required TransformationConfiguration transformationConfiguration,
}) async {
final $payload = <String, dynamic>{
'queryGenerationInput': queryGenerationInput,
'transformationConfiguration': transformationConfiguration,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/generateQuery',
exceptionFnMap: _exceptionFns,
);
return GenerateQueryResponse.fromJson(response);
}