This endpoint allows you to create a dataset with a given name from a provided file.
The dataset can contain the following attributes:
evaluated_model_system_prompt
- textevaluated_model_retrieved_context
- text arrayevaluated_model_input
- textevaluated_model_output
- textevaluated_model_gold_answer
- textmeta_evaluated_model_name
- textmeta_evaluated_model_provider
-textmeta_evaluated_model_selected_model
- textmeta_evaluated_model_params
- map (string -> text | number)
All attributes are optional, but in principle, at least evaluated_model_input
or evaluated_model_output
should be provided.
Whether other fields are required depends on the evaluations you plan to perform.
Some evaluators require retrieved context, so evaluated_model_retrieved_context
must be provided for them.
For exact field requirements, see the evaluators' documentation.
File Format
The uploaded file should be in CSV or JSONL format.
-
CSV file should contain a header row with the attributes defined above.
Fieldsevaluated_model_retrieved_context
andmeta_evaluated_model_params
must be JSON encoded.
The CSV should use commas as separators. -
JSONL file should have JSON-encoded objects with keys set to the attributes defined above.
JSON objects should be separated by a new line.
Limits
The file size cannot be larger than 20 MiB. The file cannot contain more than 30 000 samples.
Custom Field Mapping
The custom_field_mapping
field is optional.
It should be a JSON-encoded string where the key is the standardized field name (as defined above)
and the value is the custom field name present in the provided dataset file.
This mapping allows for flexible field naming in your dataset.
The mapping value can be also a list, in that way the fields will be concatenated depending on a field type.
Example request
curl -X POST https://api.patronus.ai/v1/datasets \
-H "x-api-key: <your_api_key>" \
-F "file=@<path_to_your_file>" \
-F "dataset_name=<name for created dataset>" \
-F 'custom_field_mapping={"evaluated_model_output": ["my-custom-field-name", "another-field"]}'