curl --request GET \
--url https://davinci-app.com/api/v2/projects/{projectId}/sessions/{sessionId}/messages \
--header 'Authorization: Bearer <token>'import os
from davinci_sdk import DavinciClient
with DavinciClient(api_key=os.environ["DAVINCI_API_KEY"]) as client:
session = client.sessions.resume(project_id, session_id)
transcript = session.messages(limit=20)
for entry in transcript.messages:
print(entry.role, entry.kind, entry.text)
import { DavinciClient } from '@celedon/davinci-sdk';
const client = new DavinciClient({
apiKey: process.env.DAVINCI_API_KEY!,
});
const session = await client.sessions.get(projectId, sessionId);
const transcript = await session.messages({ limit: 20 });
for (const entry of transcript.messages) {
console.log(entry.role, entry.kind, entry.text);
}
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://davinci-app.com/api/v2/projects/{projectId}/sessions/{sessionId}/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"sessionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"taskId": "<string>",
"source": "live",
"status": "no_session",
"entryCount": 1,
"messages": [
{
"index": 1,
"role": "user",
"kind": "<string>",
"text": "<string>",
"timestamp": 123,
"messageId": "<string>",
"tool": {
"name": "<string>",
"status": "<string>",
"params": "<unknown>",
"result": "<unknown>",
"error": "<string>"
}
}
]
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}Read the session's conversation
The transcript: your prompts, the agent’s replies and reasoning, and every tool it used with the result.
source tells you where the answer came from. live is the running agent’s own
copy and is current. persisted is the saved copy, which is written when a run
ends — so it is complete for a finished run but behind for a running one. none
means there is no conversation yet.
Entries are ordered oldest to newest and limit takes the most recent, which is
usually what you want after a run.
curl --request GET \
--url https://davinci-app.com/api/v2/projects/{projectId}/sessions/{sessionId}/messages \
--header 'Authorization: Bearer <token>'import os
from davinci_sdk import DavinciClient
with DavinciClient(api_key=os.environ["DAVINCI_API_KEY"]) as client:
session = client.sessions.resume(project_id, session_id)
transcript = session.messages(limit=20)
for entry in transcript.messages:
print(entry.role, entry.kind, entry.text)
import { DavinciClient } from '@celedon/davinci-sdk';
const client = new DavinciClient({
apiKey: process.env.DAVINCI_API_KEY!,
});
const session = await client.sessions.get(projectId, sessionId);
const transcript = await session.messages({ limit: 20 });
for (const entry of transcript.messages) {
console.log(entry.role, entry.kind, entry.text);
}
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://davinci-app.com/api/v2/projects/{projectId}/sessions/{sessionId}/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"sessionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"taskId": "<string>",
"source": "live",
"status": "no_session",
"entryCount": 1,
"messages": [
{
"index": 1,
"role": "user",
"kind": "<string>",
"text": "<string>",
"timestamp": 123,
"messageId": "<string>",
"tool": {
"name": "<string>",
"status": "<string>",
"params": "<unknown>",
"result": "<unknown>",
"error": "<string>"
}
}
]
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}Authorizations
Personal access token. The scopes granted at issuance determine both which
operations the key may call and the ceiling on the resource permissions it
can exercise. Each scope family is a ladder: projects:manage implies
projects:write and projects:read; cards:manage implies cards:write
and cards:read; and teams:manage implies teams:write and teams:read.
These are named API capability bundles, not blanket domain roles:
manage exposes only the permissions enumerated for that scope and never
bypasses the acting user's current role-based access.
Path Parameters
Project id. May be compound in the form {projectId}--{branchName}.
1Session id from createSession.
Query Parameters
Most recent entries to return.
1 <= x <= 500Response
The conversation.
Where the answer came from. live is current; persisted is the copy saved
when a run ended, and so lags a run in progress.
live, persisted, none no_session— the machine has no record of this session; it lapsed or the project restarted. Create a new one.project_not_running— the session is known but its project has unloaded.idle— the session is live and no run has been started.starting— a run is being set up.running— a run is in progress.paused— a run was stopped and can be continued with a new prompt.completed— the run finished.failed— the run ended in an error. The transcript says why.unknown— the machine could not be reached for this field. Retry; anything else in the same response is still valid.
paused, completed, and failed are terminal for a run.
no_session, project_not_running, idle, starting, running, paused, completed, failed, unknown Entries in the whole conversation, not just the returned window.
x >= 0Oldest first. Bounded by limit, taken from the end.
Hide child attributes
Hide child attributes
Position in the whole conversation, so a window can be placed.
x >= 0user, agent text for what was said, thought for the agent's reasoning, tool for a
tool it used, error for a failure it hit. Treat an unrecognized value as
informational rather than as a problem — new kinds can appear.
The content. For a tool entry, the tool's name.
Milliseconds since the epoch.
Present on your own prompts, matching what you sent.
Present only on entries whose kind is tool.
Hide child attributes
Hide child attributes
working while it runs, complete when it succeeded, otherwise the severity
of what went wrong.
The arguments the agent chose. Null when the tool takes none.
What the tool returned. Shape is the tool's own.
Present when the tool failed.