generateInstanceRubrics method
- GoogleCloudAiplatformV1GenerateInstanceRubricsRequest request,
- String location, {
- String? $fields,
Generates rubrics for a given prompt.
A rubric represents a single testable criterion for evaluation. One input prompt could have multiple rubrics This RPC allows users to get suggested rubrics based on provided prompt, which can then be reviewed and used for subsequent evaluations.
request
- The metadata request object.
Request parameters:
location
- Required. The resource name of the Location to generate
rubrics from. Format: projects/{project}/locations/{location}
Value must have pattern ^projects/\[^/\]+/locations/\[^/\]+$
.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a GoogleCloudAiplatformV1GenerateInstanceRubricsResponse.
Completes with a commons.ApiRequestError if the API endpoint returned an error.
If the used http.Client
completes with an error when making a REST call,
this method will complete with the same error.
Implementation
async.Future<GoogleCloudAiplatformV1GenerateInstanceRubricsResponse>
generateInstanceRubrics(
GoogleCloudAiplatformV1GenerateInstanceRubricsRequest request,
core.String location, {
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
if ($fields != null) 'fields': [$fields],
};
final url_ =
'v1/' + core.Uri.encodeFull('$location') + ':generateInstanceRubrics';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return GoogleCloudAiplatformV1GenerateInstanceRubricsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}