Datasets

Expand dataset with synthetic samples

Generate synthetic dataset samples using LLM based on existing data patterns

post/v1/private/datasets/{id}/expansions

Path parameters

idstring uuid required

Request body

modelstring required

The model to use for synthetic data generation

sample_countinteger

Number of synthetic samples to generate

preserve_fieldsstring[]

Fields to preserve patterns from original data

variation_instructionsstring

Additional instructions for data variation

custom_promptstring

Custom prompt to use for generation instead of auto-generated one

max_completion_tokensinteger

Maximum number of tokens for the LLM response. Required by Anthropic, used as maxOutputTokens for Gemini. If not provided, defaults to 4000 for Anthropic models only.

Example request

{
  "model": "gpt-4",
  "sample_count": 10,
  "preserve_fields": [
    "input",
    "expected_output"
  ],
  "variation_instructions": "Create variations that test edge cases"
}

Response

Generated synthetic samples

modelstring

Model used for generation

total_generatedinteger

Total number of samples generated

generation_timestring date-time

Generation timestamp

Example response

{
  "model": "gpt-4",
  "total_generated": 10
}

Changes

Changed in 4 of the 58 revisions of this API.55

    • added the optional property generated_samples/items/experiment_items/items/feedback_scores/items/value_by_author/additionalProperties/author to the response with the 200 status

      response-optional-property-added

    • added the optional property generated_samples/items/experiment_items/items/feedback_scores/items/value_by_author/additionalProperties/source_queue_id to the response with the 200 status

      response-optional-property-added

    • added the optional property generated_samples/items/experiment_items/items/comments/items/source_queue_id to the response with the 200 status

      response-optional-property-added

    • added the optional property generated_samples/items/experiment_items/items/feedback_scores/items/source_queue_id to the response with the 200 status

      response-optional-property-added

    • added the optional property generated_samples/items/experiment_items/items/trace_metadata to the response with the 200 status

      response-optional-property-added

    • removed the optional property generated_samples/items/experiment_items/items/comments/items/source_queue_id from the response with the 200 status

      response-optional-property-removed

    • removed the optional property generated_samples/items/experiment_items/items/feedback_scores/items/source_queue_id from the response with the 200 status

      response-optional-property-removed

    • removed the optional property generated_samples/items/experiment_items/items/feedback_scores/items/value_by_author/additionalProperties/author from the response with the 200 status

      response-optional-property-removed

    • removed the optional property generated_samples/items/experiment_items/items/feedback_scores/items/value_by_author/additionalProperties/source_queue_id from the response with the 200 status

      response-optional-property-removed

    • removed the optional property generated_samples/items/experiment_items/items/trace_metadata from the response with the 200 status

      response-optional-property-removed

    This revision also has 40 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog