Skip to main content
Opik Documentation

Search documentation

Type to search this documentation.

Create dataset items from traces

POST/v1/private/datasets/{dataset_id}/items/from-tracesCreate dataset items from traces

Create dataset items from traces with enriched metadata

Parameters

dataset_idstring · uuidpathrequired

Request body

application/json
objectCreateDatasetItemsFromTracesRequest
enrichment_optionsobjectrequired

Options for enriching trace data

Show child attributes
includeCommentsboolean
includeFeedbackScoresboolean
includeMetadataboolean
includeSpansboolean
includeTagsboolean
includeUsageboolean
evaluatorsarray of object

Optional evaluators to apply to the created items

Show child attributes
Show array items
configobjectrequired
namestringrequired

minLength 1

typestringrequired

one of "llm_judge", "code_metric"

execution_policyobject
Show child attributes
pass_thresholdinteger · int32

maximum 100 · minimum 1

runs_per_iteminteger · int32

maximum 100 · minimum 1

field_mappingsobject

Optional mapping of dataset item field name to a path into the trace, e.g. 'input.input_text'. Takes precedence over the fields produced by enrichment_options. Ignored for test suite datasets.

trace_idsarray of string · uuidrequired

Set of trace IDs to add to the dataset

minItems 1 · uniqueItems true

Show child attributes

minItems 1 · uniqueItems true

Example request
{
  "enrichment_options": {
    "includeComments": true,
    "includeFeedbackScores": true,
    "includeMetadata": true,
    "includeSpans": true,
    "includeTags": true,
    "includeUsage": true
  },
  "evaluators": [
    {
      "config": {},
      "name": "string",
      "type": "code_metric"
    }
  ],
  "execution_policy": {
    "pass_threshold": 0,
    "runs_per_item": 0
  },
  "field_mappings": {
    "additionalProp1": "string"
  },
  "trace_ids": [
    "00000000-0000-0000-0000-000000000000"
  ]
}

Responses

204No content
Documentation menu