> ## Documentation Index
> Fetch the complete documentation index at: https://docs.galtea.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate dataset configuration from specifications

> Derives dataset type, variant, and name from specifications (rule-based).

With `automaticCreation: true` this does more than return a suggestion: it **creates the datasets** and their test-case generation continues on the background worker, so each one comes back with status `PENDING`.

Accuracy (QUALITY) specifications need `groundTruthUri`, a knowledge base file uploaded beforehand, because an accuracy dataset grades answers against known-correct ones and a specification never states what the correct answer is.

Behavior (SCENARIOS) specifications can take `dataCatalogUri`, a data catalog file uploaded beforehand, so the generated scenarios use the product's real values instead of invented ones. It is optional, one catalog covers every behavior dataset the call creates, and it is ignored for the other test types.

See [Datasets](https://docs.galtea.ai/concepts/product/dataset).

> [!WARNING]
>
> You are reading the docs of Galtea 5.14. [Read this page in the latest version](https://docs.galtea.ai/api-reference/datasets/generate-dataset-configuration-from-specifications.md).


## OpenAPI

````yaml /v5.14/openapi.json post /tests/generate-config
openapi: 3.0.0
info:
  version: 1.0.0
  title: Product Management Service API
  description: API documentation for Product Management Service
  contact:
    name: Galtea AI
servers:
  - url: https://api.galtea.ai
security:
  - bearerAuth: []
tags: []
externalDocs:
  description: Galtea Platform Documentation
  url: https://docs.galtea.ai
paths:
  /tests/generate-config:
    post:
      tags:
        - datasets
      summary: Generate dataset configuration from specifications
      description: >-
        Derives dataset type, variant, and name from specifications
        (rule-based).


        With `automaticCreation: true` this does more than return a suggestion:
        it **creates the datasets** and their test-case generation continues on
        the background worker, so each one comes back with status `PENDING`.


        Accuracy (QUALITY) specifications need `groundTruthUri`, a knowledge
        base file uploaded beforehand, because an accuracy dataset grades
        answers against known-correct ones and a specification never states what
        the correct answer is.


        Behavior (SCENARIOS) specifications can take `dataCatalogUri`, a data
        catalog file uploaded beforehand, so the generated scenarios use the
        product's real values instead of invented ones. It is optional, one
        catalog covers every behavior dataset the call creates, and it is
        ignored for the other test types.


        See [Datasets](https://docs.galtea.ai/concepts/product/dataset).
      operationId: generateDatasetConfig
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GenerateTestConfigBody'
      responses:
        '200':
          description: >-
            Dataset configuration generated, and the datasets created when asked
            for
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenerateTestConfigResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    GenerateTestConfigBody:
      type: object
      properties:
        specificationIds:
          type: array
          items:
            type: string
          minItems: 1
          example:
            - spec_123
            - spec_456
          description: IDs of the specifications to generate dataset configs for
        automaticCreation:
          type: boolean
          example: false
          description: >-
            When true, creates the datasets from the generated config and starts
            their test-case generation on the background worker.
        maxTestCases:
          type: integer
          minimum: 0
          exclusiveMinimum: true
          example: 30
          description: >-
            How many test cases to generate per dataset. Defaults to 3. The
            upper limit is per test type and deployment-configured, and is
            enforced when the dataset is created (`automaticCreation: true`).
        groundTruthUri:
          type: string
          format: uri
          description: >-
            Presigned upload URL of the knowledge base file, uploaded
            beforehand. Required for accuracy (QUALITY) specifications, ignored
            for the other test types.
        dataCatalogUri:
          type: string
          format: uri
          description: >-
            Presigned upload URL of the data catalog file, uploaded beforehand.
            Grounds the generated scenarios in real domain values instead of
            invented ones. Optional for behavior (SCENARIOS) specifications,
            ignored for the other test types. A call whose specifications are
            all accuracy or security drops the file and still succeeds.
        languageCode:
          type: string
          example: es-ES
          description: >-
            Language the generated test cases are written in, as a BCP-47 tag
            (`es`, `es-ES`) or a language name. The value is stored on the
            dataset as `languageCode`. Generated test text keeps the base
            language; the region subtag selects the regional variety in
            simulated user messages and voice synthesis. Optional. Omit it and
            the generator picks the language itself. The allowed set is the same
            for every test type, so one value covers every specification in the
            call.
      required:
        - specificationIds
    GenerateTestConfigResponse:
      type: object
      properties:
        config:
          type: array
          items:
            $ref: '#/components/schemas/GeneratedTestConfig'
          description: One generated dataset config per specification
        tests:
          type: array
          items:
            $ref: '#/components/schemas/Test'
          description: >-
            The created datasets, present only when `automaticCreation` was
            true. Each comes back `PENDING`, with its test-case generation
            running on the background worker. Absent when the datasets were
            created but could not be read back; `GET /tests` lists them.
      required:
        - config
    Error:
      type: object
      properties:
        error:
          type: string
          example: Error type
        message:
          type: string
          example: Error message description
    GeneratedTestConfig:
      type: object
      properties:
        name:
          type: string
          example: Scenarios for polite refusals
        type:
          type: string
          enum:
            - QUALITY
            - RED_TEAMING
            - SCENARIOS
          example: SCENARIOS
        specificationId:
          type: string
          example: spec_123
        productId:
          type: string
          example: prod_123
        variants:
          type: array
          items:
            type: string
          example:
            - custom
        customVariantDescription:
          type: string
        strategies:
          type: array
          items:
            type: string
          example:
            - written
        maxTestCases:
          type: integer
          example: 30
        languageCode:
          type: string
          example: es-ES
          description: >-
            Language the generated test cases are written in, as a BCP-47 tag
            (`es`, `es-ES`). Always the normalized tag, even when the request
            sent a language name. Absent when the request sent no language.
      required:
        - name
        - type
        - specificationId
        - productId
        - maxTestCases
    Test:
      type: object
      properties:
        id:
          type: string
          example: test_123
        productId:
          type: string
          nullable: true
          example: prod_123
        userId:
          type: string
          nullable: true
          example: user_123
        name:
          type: string
          example: Quality Test
        type:
          type: string
          enum:
            - QUALITY
            - RED_TEAMING
            - SCENARIOS
          example: QUALITY
        models:
          type: array
          items:
            type: string
          example:
            - gpt-4
            - claude-3
        groundTruthUri:
          type: string
          nullable: true
          example: https://files.galtea.ai/tests/test_123/ground-truth.csv
          description: >-
            Storage URI of the ground-truth file, derived from the presigned URL
            supplied at creation. Returned as `<STORAGE_PUBLIC_BASE_URL>/<key>`
            when the deployment configures a public file base, otherwise in its
            stored form. S3: `s3://<bucket>/<key>`. Azure Blob: blob URL with
            the SAS query stripped (e.g.
            `https://<account>.blob.core.windows.net/<container>/<path>`).
            Either form resolves through `GET
            /storage/generate-get-presigned-url`.
        uri:
          type: string
          nullable: true
          example: https://files.galtea.ai/tests/test_123/test.csv
          description: >-
            Storage URI of the uploaded custom test file. Same format rules as
            `groundTruthUri`.
        error:
          type: string
          nullable: true
        status:
          type: string
          enum:
            - PENDING
            - SUCCESS
            - FAILED
            - AUGMENTING
            - EXTENDING
            - CANCELLED
          example: SUCCESS
        fewShot:
          type: string
          nullable: true
          example: Example few-shot learning data
          description: >-
            Optional few-shot examples (input/output pairs) used to guide
            test-case generation for QUALITY tests.
        languageCode:
          type: string
          nullable: true
          example: es-MX
          description: >-
            BCP-47 language tag (e.g. en, es-MX). The region subtag selects the
            regional variety in simulated user messages and voice synthesis;
            generated test text keeps the base language. The value is stored as
            the full tag. A bare code for ca, de, es, eu, fr, gl, it, nl or pt
            defaults to the European variety of that language, in simulated user
            messages only (pt -> pt-PT); an explicit region always overrides it,
            and neither voice synthesis nor the stored value is affected.
        backgroundNoiseProfile:
          type: string
          nullable: true
          enum:
            - office
            - street
            - car
            - white
            - pink
            - null
          example: street
          description: >-
            Background noise mixed into the simulated caller audio during a
            voice test. Clip-backed (office, street, car) or synthetic (white,
            pink). Null means off; set together with backgroundNoiseLevel.
        backgroundNoiseLevel:
          type: string
          nullable: true
          enum:
            - light
            - medium
            - heavy
            - null
          example: medium
          description: >-
            How loud the background noise is relative to the caller speech. Null
            means off; set together with backgroundNoiseProfile.
        variants:
          type: array
          items:
            type: string
          example:
            - rag
            - summarization
          description: >-
            Test variants. QUALITY: rag, entity_extraction, summarization,
            classification, translation, correction, other. RED_TEAMING:
            data_leakage, financial_attacks, illegal_activities, misuse,
            toxicity, custom.
        customVariantDescription:
          type: string
          nullable: true
          example: Custom variant description
        strategies:
          type: array
          items:
            type: string
          example:
            - original
          description: >-
            Generation strategies. "original" is the default for RED_TEAMING. At
            least one strategy is required for SCENARIOS tests.
        customUserPersona:
          type: string
          nullable: true
          example: Business analyst
        maxTestCases:
          type: integer
          nullable: true
          example: 100
        sourceTestId:
          type: string
          nullable: true
        dataCatalogUri:
          type: string
          nullable: true
          example: https://files.galtea.ai/tests/test_123/data-catalog.json
          description: >-
            Storage URI of the data-catalog file (SCENARIOS tests only). Same
            format rules as `groundTruthUri`.
        metadata:
          nullable: true
          description: >-
            Arbitrary metadata, returned as stored. Usually an object, but any
            JSON value is accepted.
          example:
            key: value
        specificationIds:
          type: array
          items:
            type: string
          example:
            - spec_123
          description: The specifications this dataset is linked to, oldest link first.
        specificationId:
          type: string
          nullable: true
          example: spec_123
          deprecated: true
          description: >-
            Deprecated, read `specificationIds`. The oldest linked
            specification, or null when there is none.
        isExtendable:
          type: boolean
          example: true
          description: >-
            True when the test can be extended by re-running its original
            generator (generated tests; QUALITY only when it has a ground-truth
            document). False for uploaded tests.
        createdAt:
          type: string
          format: date-time
        deletedAt:
          type: string
          format: date-time
          nullable: true
      required:
        - id
        - productId
        - userId
        - name
        - type
        - models
        - groundTruthUri
        - uri
        - error
        - status
        - fewShot
        - languageCode
        - backgroundNoiseProfile
        - backgroundNoiseLevel
        - variants
        - customVariantDescription
        - strategies
        - customUserPersona
        - maxTestCases
        - sourceTestId
        - dataCatalogUri
        - metadata
        - specificationIds
        - specificationId
        - isExtendable
        - createdAt
        - deletedAt
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key authorization. Pass your API key in the Authorization header as
        a Bearer token. Both new (`gsk_*`) and legacy (`gsk-`) API keys are
        accepted, e.g. `Authorization: Bearer gsk_...` or `Authorization: Bearer
        gsk-...`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.