Define what done looks like for a session
Defines what done looks like for an existing session and returns the stored outcome. Outcomes chain rather than run concurrently: the request is rejected while the session still has a non-terminal outcome, so define the next one only after the previous is graded.
Authorizations
A Recursion API key, created in the console under API keys.
Path Parameters
Session id (UUID) as returned by startSession or listSessions.
Body
- Option 1
- Option 2
A definition of done for a session -- the task plus the rubric it is graded against. Accepted both when starting a session and when adding an outcome to a running one. Exactly one of rubric and rubric_ref is required.
The objective the agent works toward, and the statement of it the grader is given. It opens the session when the start request carries no message.
1Markdown the grader scores the work against. Criteria must be independently checkable: 'the CSV has a numeric price column' can be verified, 'the data looks good' cannot. Send this or rubric_ref.
1Model reference for the grader. Defaults to the session's model.
Ceiling on grader passes before the outcome ends as max_iterations_reached. Omit it, or send 0, to revise until the grader is satisfied, which is the default. Set a number only to cap a rubric you are not sure can be met.
x >= 0The rubric as a file instead of inline markdown: the file's text is read once, when the outcome is defined, and recorded as the rubric. Exactly one of rubric and rubric_ref is required.
Response
A session's definition of done: the task to achieve plus a rubric a grader scores the work against, tracked through its own grading lifecycle. Defined when the session starts, and read back to see whether the work was accepted.
A session's definition of done: the task to achieve plus a rubric a grader scores the work against, tracked through its own grading lifecycle. Defined when the session starts, and read back to see whether the work was accepted.
RFC 3339 timestamp of when this record was created. Server-assigned.
Objective the agent works toward, in prose, and the statement of it quoted to the grader. Opens the session when the start request carries no message.
Ceiling on grader passes before the outcome ends as max_iterations_reached. Zero means unbounded, which is the default: the loop runs until the grader is satisfied.
Organization that owns this record. Resolved from the API key; never accepted from the caller.
Identifier for this outcome (UUID). Server-assigned.
Markdown rubric the grader scores the work against. Write independently checkable criteria; vague criteria produce noisy revision loops.
Session this outcome belongs to (UUID).
Where the outcome is in its grading lifecycle: pending (no grader has looked at it), running (the agent is working toward it), evaluating (a grader pass is in flight), or terminal (grading finished; read terminal_result).
pending, running, evaluating, terminal RFC 3339 timestamp of the last change to this record. Server-assigned.
Agent this outcome belongs to (UUID), copied from the session that defined it.
Event in the session's log that defined this outcome (UUID).
RFC 3339 timestamp of when grading reached a terminal result. Absent while the outcome is still open.
Grader passes in order, newest last. Returned only by reads that ask for evaluations, and empty until a grader has run.
Model reference the grader runs on (UUID), letting grading use a different model than the agent doing the work. Defaults to the session's model.
Where the rubric text came from when it was not sent inline: file:<file_id> for a rubric read from a file when the outcome was defined. rubric always carries the text; later changes to the file do not move the bar.
Lowercase SHA-256 digest of the uploaded file the rubric was read from, for matching it to the file. Not a digest of rubric: the recorded text is the file's minus a byte-order mark and with line endings normalized.
Final verdict, set only once status is terminal: satisfied, max_iterations_reached, failed, or interrupted. Empty before then.
satisfied, max_iterations_reached, failed, interrupted