Ingest from SDK

Append dataset rows from Node.js or Python — auto-create datasets by name, push golden sets from CI, or capture production inputs into a reusable test set.

Push rows from your own pipeline with the SDK. Authenticated by your site ID, same as the rest of the Trodo SDK. Each appended item has the same shape as a row in the dashboard grid.

Common uses:

  • Seed a golden set from a fixture file in CI.
  • Capture failing production inputs into a regression dataset.
  • Sync evaluation cases from an external CMS or ticket system.

This API appends rows to a dataset. To submit experiment outputs for scoring (when your agent runs outside Trodo), use experiment ingest instead.

Item shape

Each item is:

{
  input: { query: "...", locale: "en" },   // required — variable map
  expected_output?: "30 days.",            // optional ground truth
  metadata?: { category: "billing" },      // optional free-form JSON
  tags?: ["billing", "regression"],        // optional labels
  source_trace_ref?: { span_id: "..." },   // optional provenance
}

input is the same { variable: value } map the dashboard stores. Keys bind to prompt {{variables}} by name at experiment time.

Append by name or id

ref is a dataset name or UUID. When ref is a name that doesn't exist yet, Trodo auto-creates the dataset (pass create: false to require it to already exist).

Install the package:

npm install trodo-node
import trodo from 'trodo-node';

// Append items to a dataset by name (auto-created if it doesn't exist yet).
await trodo.datasets.append('qa-golden-set', [
  {
    input: { query: 'What is your refund window?', locale: 'en' },
    expected_output: '30 days.',
    metadata: { category: 'billing' },
    tags: ['billing', 'golden'],
  },
]);
// → { dataset_id, dataset_name, appended, item_count }

trodo.datasets.append(ref, items, { create? }) — a single item may be passed directly instead of an array. Pass { create: false } to error if the dataset doesn't exist.

Install the package:

pip install trodo-python
import trodo

# Append items to a dataset by name (auto-created if it doesn't exist yet).
trodo.append_dataset("qa-golden-set", [
    {
        "input": {"query": "What is your refund window?", "locale": "en"},
        "expected_output": "30 days.",
        "metadata": {"category": "billing"},
        "tags": ["billing", "golden"],
    },
])
# → {"dataset_id", "dataset_name", "appended", "item_count"}

append_dataset(ref, items, create=True) — a single dict may be passed directly. Pass create=False to require the dataset to already exist.

HTTP endpoint

The SDK calls:

POST /api/sdk/datasets/:ref/items

:ref is URL-encoded automatically when it's a name. Authenticate with your site credentials the same way as tracing and prompt fetch.

Origin tracking

SDK-appended rows show SDK in the dataset grid's Origin column (toggle via Display in the toolbar). You can also pass source_trace_ref to link a row back to a specific span.

Setup

You need a Trodo site ID. If you haven't wired the SDK yet, start with Get started with observability — the same init and credentials work for datasets.

Next

On this page