agent-studio
Create Session
Start a design session: from a template, reopened on a processor (optionally seeded with a flag’s context — R6), or BLANK when neither is given — an empty draft the brain grounds from the first message/doc.
POST
/
api
/
v1
/
agent-studio
/
sessions
Create Session
import requests
url = "https://www.datalab.to/api/v1/agent-studio/sessions"
payload = {
"template": "<string>",
"processor_id": "<string>",
"flag_id": 123,
"title": "<string>"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)curl --request POST \
--url https://www.datalab.to/api/v1/agent-studio/sessions \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"template": "<string>",
"processor_id": "<string>",
"flag_id": 123,
"title": "<string>"
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
template: '<string>',
processor_id: '<string>',
flag_id: 123,
title: '<string>'
})
};
fetch('https://www.datalab.to/api/v1/agent-studio/sessions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://www.datalab.to/api/v1/agent-studio/sessions"
payload := strings.NewReader("{\n \"template\": \"<string>\",\n \"processor_id\": \"<string>\",\n \"flag_id\": 123,\n \"title\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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))
}{
"session": {
"id": 123,
"title": "<string>",
"status": "active",
"phase": "grounding",
"draft_contract": {
"goal": "<string>",
"output_shape": "parse",
"output_schema": "<string>",
"rules": [
{
"id": "<string>",
"text": "<string>",
"source": "user"
}
],
"parse_params": {},
"knobs": {
"max_turns": 2,
"timeout_s": 2,
"model": "<string>"
}
},
"template_id": "<string>",
"base_profile": "<string>",
"processor_id": "<string>",
"draft_checks": [
{
"id": "<string>",
"label": "<string>",
"kind": "code",
"description": "",
"blocking": false,
"source": "base",
"modified_from_base": true
}
],
"pending": {},
"docs": [
{
"id": 123,
"name": "<string>",
"page_count": 123,
"doc_kind": "page",
"role": "process",
"role_locked": false,
"created": "2023-11-07T05:31:56Z"
}
],
"versions": [
{
"label": "<string>",
"state": "draft",
"contract": {
"goal": "<string>",
"output_shape": "parse",
"output_schema": "<string>",
"rules": [
{
"id": "<string>",
"text": "<string>",
"source": "user"
}
],
"parse_params": {},
"knobs": {
"max_turns": 2,
"timeout_s": 2,
"model": "<string>"
}
},
"checks": [
{
"id": "<string>",
"label": "<string>",
"kind": "code",
"description": "",
"blocking": false,
"source": "base",
"modified_from_base": true
}
],
"caused_by": {},
"created": "2023-11-07T05:31:56Z"
}
],
"jobs": [
{
"id": 123,
"label": "<string>",
"status": "running",
"kind": "doc_run",
"pinned_version": "<string>",
"run_id": 123,
"doc_name": "<string>",
"started": "2023-11-07T05:31:56Z",
"finished": "2023-11-07T05:31:56Z"
}
],
"rescores": [
{
"run_id": 123,
"verify_id": 123,
"status": "queued",
"checks_fingerprint": "<string>",
"counts": {},
"results": [
{}
],
"created": "2023-11-07T05:31:56Z"
}
],
"draft_checks_fingerprint": "",
"token_usage": {},
"last_consumed_seq": 0,
"created": "2023-11-07T05:31:56Z",
"updated": "2023-11-07T05:31:56Z"
},
"cursor": 123,
"events": [
{
"id": 123,
"seq": 123,
"kind": "<string>",
"actor": "user",
"ts": "2023-11-07T05:31:56Z",
"text": "<string>",
"payload": {},
"refs": {}
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Body
application/json
Start a session from a template, reopen one on a processor, or — with NEITHER — start a blank session (empty draft, grounding welcome). At most one of template / processor_id.
Template id: picky-tables | extract-schema | jats-fork | wcag | segment.
Public processor id (slug) to reopen a design session on.
Optional flag to seed the reopened session's context (only with processor_id).
Maximum string length:
255Was this page helpful?
⌘I
Create Session
import requests
url = "https://www.datalab.to/api/v1/agent-studio/sessions"
payload = {
"template": "<string>",
"processor_id": "<string>",
"flag_id": 123,
"title": "<string>"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)curl --request POST \
--url https://www.datalab.to/api/v1/agent-studio/sessions \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"template": "<string>",
"processor_id": "<string>",
"flag_id": 123,
"title": "<string>"
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
template: '<string>',
processor_id: '<string>',
flag_id: 123,
title: '<string>'
})
};
fetch('https://www.datalab.to/api/v1/agent-studio/sessions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://www.datalab.to/api/v1/agent-studio/sessions"
payload := strings.NewReader("{\n \"template\": \"<string>\",\n \"processor_id\": \"<string>\",\n \"flag_id\": 123,\n \"title\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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))
}{
"session": {
"id": 123,
"title": "<string>",
"status": "active",
"phase": "grounding",
"draft_contract": {
"goal": "<string>",
"output_shape": "parse",
"output_schema": "<string>",
"rules": [
{
"id": "<string>",
"text": "<string>",
"source": "user"
}
],
"parse_params": {},
"knobs": {
"max_turns": 2,
"timeout_s": 2,
"model": "<string>"
}
},
"template_id": "<string>",
"base_profile": "<string>",
"processor_id": "<string>",
"draft_checks": [
{
"id": "<string>",
"label": "<string>",
"kind": "code",
"description": "",
"blocking": false,
"source": "base",
"modified_from_base": true
}
],
"pending": {},
"docs": [
{
"id": 123,
"name": "<string>",
"page_count": 123,
"doc_kind": "page",
"role": "process",
"role_locked": false,
"created": "2023-11-07T05:31:56Z"
}
],
"versions": [
{
"label": "<string>",
"state": "draft",
"contract": {
"goal": "<string>",
"output_shape": "parse",
"output_schema": "<string>",
"rules": [
{
"id": "<string>",
"text": "<string>",
"source": "user"
}
],
"parse_params": {},
"knobs": {
"max_turns": 2,
"timeout_s": 2,
"model": "<string>"
}
},
"checks": [
{
"id": "<string>",
"label": "<string>",
"kind": "code",
"description": "",
"blocking": false,
"source": "base",
"modified_from_base": true
}
],
"caused_by": {},
"created": "2023-11-07T05:31:56Z"
}
],
"jobs": [
{
"id": 123,
"label": "<string>",
"status": "running",
"kind": "doc_run",
"pinned_version": "<string>",
"run_id": 123,
"doc_name": "<string>",
"started": "2023-11-07T05:31:56Z",
"finished": "2023-11-07T05:31:56Z"
}
],
"rescores": [
{
"run_id": 123,
"verify_id": 123,
"status": "queued",
"checks_fingerprint": "<string>",
"counts": {},
"results": [
{}
],
"created": "2023-11-07T05:31:56Z"
}
],
"draft_checks_fingerprint": "",
"token_usage": {},
"last_consumed_seq": 0,
"created": "2023-11-07T05:31:56Z",
"updated": "2023-11-07T05:31:56Z"
},
"cursor": 123,
"events": [
{
"id": 123,
"seq": 123,
"kind": "<string>",
"actor": "user",
"ts": "2023-11-07T05:31:56Z",
"text": "<string>",
"payload": {},
"refs": {}
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}