queryNLPFeatureExtraction method
Future<List<ApiResponseNLPFeatureExtraction?> ?>
queryNLPFeatureExtraction({
- required ApiQueryNLPFeatureExtraction taskParameters,
- required String model,
queryNLPFeatureExtraction
NLP query for the feature extraction task. This task reads some text and outputs raw float values, that are usually consumed as part of a semantic database/semantic search.
taskParameters
Parameter set for the task
[model The model to use for the task
Implementation
Future<List<ApiResponseNLPFeatureExtraction?>?> queryNLPFeatureExtraction(
{required ApiQueryNLPFeatureExtraction taskParameters,
required String model}) async {
final response = await _withHttpInfo(taskParameters.toJson(), model);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty &&
response.statusCode != HttpStatus.noContent) {
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(
responseBody, 'List<QueryNLPFeatureExtractionTask>'));
}
return null;
}