Add graded sessions to a dataset
Experimental: datasets’ operations, fields and limits can change between releases. An organization not enabled for fine-tuning receives 400 invalid_request on every dataset operation. Adds graded sessions to the dataset as rows and answers 201 with the new ready version, built before the call returns. Each session becomes one row for each stretch of its conversation between context summaries (one row if it was never summarized). A row holds the agent’s system prompt, the conversation up to the last assistant reply of that stretch (a stretch after a summary starts with the summary), the tools the session was set up with, the files attached to the session by id, and the evaluation that graded it: its criteria as the row’s grader and its verdicts as the row’s reward. The conversation is read up to the point the evaluation judged, which source.eventId names. When a session has several evaluations, the newest one you can read that recorded its criteria is used. A row’s id comes from the session and the row’s number within it. Adding a session again replaces its rows only if they changed, and drops rows the session no longer has; rows already in the dataset stay; a call that changes nothing creates no version, and the 201 returns the current one. Every session must be a top-level session of your organization that you can read, graded by an evaluation you can read, with an agent version (and environment, if it has one) that still exist, and not restricted to approved model providers (sessions started through an application link are). Each session that does not qualify answers 400 with a details.lineErrors entry whose line is its position in sessionIds, and no version is created. A session is also refused when its conversation holds an event too large to read, or a row the dataset cannot hold (an image-only user turn, a repeated tool call id, a criterion over 1,000 characters, more than 100 attached files). At most 1,000 sessions per call, 50,000 rows in the resulting version and 64 MiB of rows per call. A baseVersion that is no longer the latest ready version, or a version still being built for the dataset, answers 409 conflict. Idempotency-Key is required.
Authorizations
Headers
Replay-protection key scoped to the verified tenant, organization, principal, this operation and the dataset: the same key from another caller, for another operation or for another dataset is a new request. It must contain 1 to 256 visible ASCII characters and be sent as exactly one header value. Request identity is the exact HTTP method, escaped path, raw query, and raw body bytes. The same request replays the original successful response; any different request returns 409 idempotency_conflict, and an active matching request returns 409 idempotency_in_progress. Completed receipts are retained for approximately 24 hours, pending claims may be reclaimed after approximately 1 hour, and no deduplication is guaranteed after expiry.
1 - 256^[!-~]+$Body
Split of every added row. Omit to keep the split of the session's rows already in the dataset, and otherwise to assign the session's rows to held_out when a hash of the session id says so (about 1 in 10), else to train, so a session's segments share one split.
train, held_out Response
Created