> ## 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.

# Create Test Case

> Create a test case for your dataset.

## Returns

Returns a [TestCase](/concepts/product/dataset/test-case) object for the given parameters.

## Example

```python theme={"system"}
test_case = galtea.test_cases.create(
    dataset_id=dataset_id,
    input="What is the capital of France?",
    expected_output="Paris",
    context="Geography facts",
    variant="original",
)
```

## Parameters

<ResponseField name="dataset_id" type="string" required>
  The ID of the dataset you want to create the test case for.

  <Note>Deprecated alias: `test_id`.</Note>
</ResponseField>

<ResponseField name="input" type="string" optional>
  The input for the test case. For Accuracy and Safety datasets, this is the question or prompt you want to send to your model for evaluation. For Behavior datasets, this is the first user message to use in the conversation (bypassing the simulator for the first turn).
</ResponseField>

<ResponseField name="input_file_paths" type="list[string]" optional>
  Files to attach to the input, for a product that reads documents. Each entry is a local path the SDK uploads, or a storage URI from an earlier upload, which is attached without uploading the file again. `input` stays optional, so a test case may hold files and no text at all. Galtea sends each attachment to your endpoint when the [endpoint connection template](/concepts/product/endpoint-connection-template-syntax#attached-files-and-audio) names `input_files`.

  At most 20 files totalling 20 MB, of these types: `pdf`, `docx`, `xlsx`, `pptx`, `rtf`, `png`, `jpg`, `jpeg`, `tiff`, `tif`, `bmp`, `webp`, `heic`, `heif`, `gif`, `txt`, `csv`, `md`, `html`, `xml`, `json`, `eml`. To attach one already-uploaded file to several test cases, use [Upload Input File](/sdk/api/test-case/upload-input-file) instead.

  <Warning>
    Evaluators cannot read files yet, so the judge is given the text of your conversation turns with the files stripped out. A metric that reads the input is **skipped** when no turn is left with text of its own, which is what a single-turn document run always looks like. This is true for both run styles: your own pipeline, and Galtea calling your endpoint. Log the text your pipeline extracted as the turn input, without the file, to have it scored, or use a metric that reads only the output. See [File inputs](/concepts/product/dataset/test-case#file-inputs).
  </Warning>
</ResponseField>

<ResponseField name="expected_output" type="string" optional>
  The expected output for the input given. This is the correct answer or response you want to evaluate against.
</ResponseField>

<ResponseField name="expected_tools" type="list[string]" optional>
  The expected tools for the input given. This is the list of tools that the model should use to generate the expected output.
</ResponseField>

<ResponseField name="context" type="string" optional>
  The context for the test case. This is the additional information that can help the model generate the expected output.
</ResponseField>

<ResponseField name="variant" type="string" optional>
  An optional variant to categorize or label the test case (e.g., "original", "paraphrased").
</ResponseField>

<ResponseField name="reviewed_by_id" type="string" optional>
  The ID of the user who has reviewed and validated this test case.
</ResponseField>

<ResponseField name="language" type="string" optional>
  Language for the test case. Accepts a [BCP-47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag): a bare ISO 639-1 code (`"es"`) or a code with a region subtag (`"es-MX"`, `"en-GB"`). The region subtag selects the regional variety in the simulated user's messages and in voice synthesis (the accent the simulated caller speaks with); 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 that language's European variety in the simulated user's messages only (`pt` → `pt-PT`); an explicit region always overrides it, and neither voice synthesis nor the stored value is affected.
</ResponseField>

<ResponseField name="gender" type="string" optional>
  Persona gender, `"MALE"` or `"FEMALE"`, for voice evaluations: it selects the male or female synthesized voice for the simulated caller. Stored only for now — voice selection is not active yet. Text evaluations ignore it. When unset, the voice uses the default for the language.
</ResponseField>

<ResponseField name="background_noise_profile" type="string" optional>
  Background noise mixed into the simulated caller's audio for voice evaluations run over a [phone connection](/concepts/product/phone-connection). Ignored for test cases that don't run over a phone connection.

  * Clip-backed: `office`, `street`, `car`
  * Synthetic: `white`, `pink`

  <Note>
    This method creates the test case directly, so it does **not** inherit the parent [dataset](/concepts/product/dataset)'s background noise — omitting this parameter leaves the test case with no noise. (Test cases generated by Galtea from a ground truth file or a CSV upload do inherit the dataset's noise automatically; this only applies to cases created one-by-one through this method.)

    Must be set together with `background_noise_level` — passing only one of the two is rejected by the API.
  </Note>
</ResponseField>

<ResponseField name="background_noise_level" type="string" optional>
  How loud the background noise is relative to the caller's speech, as a fixed signal-to-noise ratio per level. One of `light`, `medium`, or `heavy`. Must be set together with `background_noise_profile`.
</ResponseField>

<ResponseField name="user_score" type="int" optional>
  User vote for the test case (1 for good quality, -1 for bad quality, 0 for unreviewed).
</ResponseField>

<ResponseField name="user_score_reason" type="string" optional>
  Reason for the user vote given.
</ResponseField>

<ResponseField name="confidence" type="float" optional>
  Confidence for the test case.
</ResponseField>

<ResponseField name="confidence_reason" type="string" optional>
  Reason for the confidence given.
</ResponseField>

<ResponseField name="goal" type="string" optional>
  The user's objective for behavior datasets. Used when creating BEHAVIOR test cases.
</ResponseField>

<ResponseField name="user_persona" type="string" optional>
  Description of the user persona used to generate scenario-based test cases.
</ResponseField>

<ResponseField name="scenario" type="string" optional>
  Description of the scenario context for scenario-based test cases.
</ResponseField>

<ResponseField name="stopping_criterias" type="list[string]" optional>
  List of criteria to end the conversation in scenario-based simulations.
</ResponseField>
