Full name: projects.locations.generateSyntheticData
Generates synthetic data based on the provided configuration.
Endpoint
posthttps://aiplatform.googleapis.com/v1/{location}:generateSyntheticData
Path parameters
location
string
Required. The resource name of the Location to run the job. Format: projects/{project}/locations/{location}
Request body
The request body contains data with the following structure:
count
integer
Required. The number of synthetic examples to generate. For this stateless API, the count is limited to a small number.
Required. The schema of the desired output, defined by a list of fields.
Optional. A list of few-shot examples to guide the model's output style and format.
strategy
Union type
strategy
can be only one of the following:Generate data from a high-level task description.
Response body
The response containing the generated data.
If successful, the response body contains data with the following structure:
A list of generated synthetic examples.
JSON representation |
---|
{
"syntheticExamples": [
{
object ( |
TaskDescriptionStrategy
Defines a generation strategy based on a high-level task description.
taskDescription
string
Required. A high-level description of the synthetic data to be generated.
JSON representation |
---|
{ "taskDescription": string } |
OutputFieldSpec
Defines a specification for a single output field.
fieldName
string
Required. The name of the output field.
guidance
string
Optional. Optional, but recommended. Additional guidance specific to this field to provide targeted instructions for the LLM to generate the content of a single output field. While the LLM can sometimes infer content from the field name, providing explicit guidance is preferred.
Optional. The data type of the field. Defaults to CONTENT if not set.
JSON representation |
---|
{
"fieldName": string,
"guidance": string,
"fieldType": enum ( |
FieldType
The data type of the field.
Enums | |
---|---|
FIELD_TYPE_UNSPECIFIED |
Field type is unspecified. |
CONTENT |
Arbitrary content field type. |
TEXT |
Text field type. |
IMAGE |
Image field type. |
AUDIO |
Audio field type. |
SyntheticExample
Represents a single synthetic example, composed of multiple fields. Used for providing few-shot examples in the request and for returning generated examples in the response.
Required. A list of fields that constitute an example.
JSON representation |
---|
{
"fields": [
{
object ( |