curl --request POST \
--url https://api.example.com/sop/runs/{sop_run_id}/verdict \
--header 'Content-Type: application/json' \
--header 'x-user-id: <x-user-id>' \
--data '
{
"step_index": 1,
"passed": true,
"message": ""
}
'import requests
url = "https://api.example.com/sop/runs/{sop_run_id}/verdict"
payload = {
"step_index": 1,
"passed": True,
"message": ""
}
headers = {
"x-user-id": "<x-user-id>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-user-id': '<x-user-id>', 'Content-Type': 'application/json'},
body: JSON.stringify({step_index: 1, passed: true, message: ''})
};
fetch('https://api.example.com/sop/runs/{sop_run_id}/verdict', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/sop/runs/{sop_run_id}/verdict",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'step_index' => 1,
'passed' => true,
'message' => ''
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-user-id: <x-user-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/sop/runs/{sop_run_id}/verdict"
payload := strings.NewReader("{\n \"step_index\": 1,\n \"passed\": true,\n \"message\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-user-id", "<x-user-id>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/sop/runs/{sop_run_id}/verdict")
.header("x-user-id", "<x-user-id>")
.header("Content-Type", "application/json")
.body("{\n \"step_index\": 1,\n \"passed\": true,\n \"message\": \"\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/sop/runs/{sop_run_id}/verdict")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-user-id"] = '<x-user-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"step_index\": 1,\n \"passed\": true,\n \"message\": \"\"\n}"
response = http.request(request)
puts response.read_body{
"user_id": "<string>",
"sop_id": "<string>",
"definition": {
"name": "<string>",
"steps": [
{
"subject": "<string>",
"description": "<string>",
"executor": {
"agent_id": "<string>",
"session_key": "<string>"
},
"version": "v1",
"verifier": {
"agent": {
"agent_id": "<string>",
"session_key": "<string>"
},
"type": "agent",
"criteria": ""
},
"max_attempts": 3
}
],
"description": "",
"workspace_grain": "run",
"session_settings": {}
},
"id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"sessions": {},
"state": {
"phase": "pending",
"id": "<string>",
"inputs": [
{
"name": "<string>",
"content": [
{
"text": "<string>",
"type": "text",
"id": "<string>",
"created_at": "<string>",
"finished_at": "<string>"
}
],
"role": "user",
"id": "<string>",
"metadata": {},
"created_at": "<string>",
"usage": {
"input_tokens": 123,
"output_tokens": 123,
"cache_input_tokens": 0,
"cache_creation_input_tokens": 0
},
"finished_at": "<string>",
"finished_reason": "completed",
"structured_output": {},
"error": {
"message": "<string>",
"type": "unknown"
}
}
],
"steps": [
{
"phase": "pending",
"given": [
{
"name": "<string>",
"content": [
{
"text": "<string>",
"type": "text",
"id": "<string>",
"created_at": "<string>",
"finished_at": "<string>"
}
],
"role": "user",
"id": "<string>",
"metadata": {},
"created_at": "<string>",
"usage": {
"input_tokens": 123,
"output_tokens": 123,
"cache_input_tokens": 0,
"cache_creation_input_tokens": 0
},
"finished_at": "<string>",
"finished_reason": "completed",
"structured_output": {},
"error": {
"message": "<string>",
"type": "unknown"
}
}
],
"submission": [
{
"text": "<string>",
"type": "text",
"id": "<string>",
"created_at": "<string>",
"finished_at": "<string>"
}
],
"verifications": [
{
"passed": true,
"message": "",
"verifier": "",
"created_at": "<string>"
}
]
}
],
"created_at": "<string>"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}File a person's verdict on a step
Answer a step that was waiting on a person.
Returns once the verdict is recorded; the run carries on in the background.
Args:
sop_run_id (str):
The run being judged.
body (SubmitVerdictRequest):
Which step, and what was decided.
user_id (str):
Injected authenticated user id.
service (SOPService):
Injected SOP service.
Returns:
SOPRunRecord:
The run with the verdict recorded on it.
Raises:
HTTPException:
404 if there is no such run or step, 409 if the step is
not waiting on a person.
curl --request POST \
--url https://api.example.com/sop/runs/{sop_run_id}/verdict \
--header 'Content-Type: application/json' \
--header 'x-user-id: <x-user-id>' \
--data '
{
"step_index": 1,
"passed": true,
"message": ""
}
'import requests
url = "https://api.example.com/sop/runs/{sop_run_id}/verdict"
payload = {
"step_index": 1,
"passed": True,
"message": ""
}
headers = {
"x-user-id": "<x-user-id>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-user-id': '<x-user-id>', 'Content-Type': 'application/json'},
body: JSON.stringify({step_index: 1, passed: true, message: ''})
};
fetch('https://api.example.com/sop/runs/{sop_run_id}/verdict', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/sop/runs/{sop_run_id}/verdict",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'step_index' => 1,
'passed' => true,
'message' => ''
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-user-id: <x-user-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/sop/runs/{sop_run_id}/verdict"
payload := strings.NewReader("{\n \"step_index\": 1,\n \"passed\": true,\n \"message\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-user-id", "<x-user-id>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/sop/runs/{sop_run_id}/verdict")
.header("x-user-id", "<x-user-id>")
.header("Content-Type", "application/json")
.body("{\n \"step_index\": 1,\n \"passed\": true,\n \"message\": \"\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/sop/runs/{sop_run_id}/verdict")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-user-id"] = '<x-user-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"step_index\": 1,\n \"passed\": true,\n \"message\": \"\"\n}"
response = http.request(request)
puts response.read_body{
"user_id": "<string>",
"sop_id": "<string>",
"definition": {
"name": "<string>",
"steps": [
{
"subject": "<string>",
"description": "<string>",
"executor": {
"agent_id": "<string>",
"session_key": "<string>"
},
"version": "v1",
"verifier": {
"agent": {
"agent_id": "<string>",
"session_key": "<string>"
},
"type": "agent",
"criteria": ""
},
"max_attempts": 3
}
],
"description": "",
"workspace_grain": "run",
"session_settings": {}
},
"id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"sessions": {},
"state": {
"phase": "pending",
"id": "<string>",
"inputs": [
{
"name": "<string>",
"content": [
{
"text": "<string>",
"type": "text",
"id": "<string>",
"created_at": "<string>",
"finished_at": "<string>"
}
],
"role": "user",
"id": "<string>",
"metadata": {},
"created_at": "<string>",
"usage": {
"input_tokens": 123,
"output_tokens": 123,
"cache_input_tokens": 0,
"cache_creation_input_tokens": 0
},
"finished_at": "<string>",
"finished_reason": "completed",
"structured_output": {},
"error": {
"message": "<string>",
"type": "unknown"
}
}
],
"steps": [
{
"phase": "pending",
"given": [
{
"name": "<string>",
"content": [
{
"text": "<string>",
"type": "text",
"id": "<string>",
"created_at": "<string>",
"finished_at": "<string>"
}
],
"role": "user",
"id": "<string>",
"metadata": {},
"created_at": "<string>",
"usage": {
"input_tokens": 123,
"output_tokens": 123,
"cache_input_tokens": 0,
"cache_creation_input_tokens": 0
},
"finished_at": "<string>",
"finished_reason": "completed",
"structured_output": {},
"error": {
"message": "<string>",
"type": "unknown"
}
}
],
"submission": [
{
"text": "<string>",
"type": "text",
"id": "<string>",
"created_at": "<string>",
"finished_at": "<string>"
}
],
"verifications": [
{
"passed": true,
"message": "",
"verifier": "",
"created_at": "<string>"
}
]
}
],
"created_at": "<string>"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Headers
Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.
Path Parameters
Body
Response
Successful Response
One run of a procedure.
A procedure: its milestones, in order.
Show child attributes
Show child attributes
Unique identifier for the credential.
Show child attributes
Show child attributes
One execution of a SOP, and the whole of what is worth saving.
It covers the SOP's own state and nothing below it: an executor that
keeps state of its own (an :class:~..agent.Agent does) is persisted
by whoever built it, the same way it is built.
Show child attributes
Show child attributes