Agents

Appends a revision to an agent, instructions or code, and makes it the one runs use. Revisions are never changed or removed.

post/agents/{agent_id}/revisions

Request

Path parameters

agent_idstring uuid required

The agent's id.

Request body

codestring

The script, for a code revision.

instructionsstring

The task, for an instructions revision.

kind'code' | 'instructions' required

code needs code; instructions needs instructions.

messagestring

A note on the revision.

on_failure'fail' | 'ask' | 'repair'

For a code revision, what a run does when a step fails. fail fails the run. ask pauses the run for a person (reason step_check_failed), who retries the step or completes the run with its output. repair hands the run to the agent, which finishes the task and proposes a fixed revision for a person to promote. Defaults to the current revision's, or fail.

Response

Created

agent_idstring uuid required

The agent the revision belongs to.

author_user_idstring uuid nullable required

The user who added the revision. Null once they have deleted their account.

base_revision_idstring uuid

On a proposed fix, the revision the repaired run ran.

codestring

The script, on a code revision.

created_atstring date-time required

When the revision was added.

idstring uuid required

The revision's id.

instructionsstring

The task, on an instructions revision.

kind'code' | 'instructions' required

code: the revision is a script. instructions: the revision is a task the agent works through a model.

messagestring

The author's note on the revision.

on_failure'fail' | 'ask' | 'repair'

On a code revision, what a run does when a step fails: fail the run, ask (pause for a person, who retries the step or completes the run), or repair (the agent takes over and proposes a fix).

promoted_atstring date-time

On a proposed fix, when it was promoted to current.

proposal_state'waiting' | 'superseded' | 'promoted'

Set when the revision is a fix a repair proposed, which is not current until promoted: waiting to be promoted, superseded (the agent has moved on from the revision it fixes, so it can't be promoted), or promoted.

revisioninteger required

The revision's number within the agent, from 1.

source_run_idstring uuid

The run the revision came from: on a proposed fix, the run whose repair wrote it; on an agent saved from a run, that run.

Changes