agent-studio
Get Session Snapshot
The whole session view-model in one poll: state (draft, pending, docs, versions, jobs) + the events past the cursor.
GET
/
api
/
v1
/
agent-studio
/
sessions
/
{session_id}
/
snapshot
Get Session Snapshot
import requests
url = "https://www.datalab.to/api/v1/agent-studio/sessions/{session_id}/snapshot"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)curl --request GET \
--url https://www.datalab.to/api/v1/agent-studio/sessions/{session_id}/snapshot \
--header 'X-API-Key: <api-key>'const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://www.datalab.to/api/v1/agent-studio/sessions/{session_id}/snapshot', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://www.datalab.to/api/v1/agent-studio/sessions/{session_id}/snapshot"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
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
Path Parameters
Query Parameters
Return events with seq > since_seq (poll cursor).
Required range:
x >= 0Was this page helpful?
⌘I
Get Session Snapshot
import requests
url = "https://www.datalab.to/api/v1/agent-studio/sessions/{session_id}/snapshot"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)curl --request GET \
--url https://www.datalab.to/api/v1/agent-studio/sessions/{session_id}/snapshot \
--header 'X-API-Key: <api-key>'const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://www.datalab.to/api/v1/agent-studio/sessions/{session_id}/snapshot', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://www.datalab.to/api/v1/agent-studio/sessions/{session_id}/snapshot"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
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": {}
}
]
}