curl --request GET \
--url https://davinci-app.com/api/v2/projects/{projectId}/personas \
--header 'Authorization: Bearer <token>'import os
from davinci_sdk import DavinciClient
with DavinciClient(api_key=os.environ["DAVINCI_API_KEY"]) as client:
result = client.projects.list_personas(project_id)
for persona in result.personas:
marker = "*" if persona.id == result.default_persona_id else " "
print(marker, persona.name)
import { DavinciClient } from '@celedon/davinci-sdk';
const client = new DavinciClient({
apiKey: process.env.DAVINCI_API_KEY!,
});
const { personas, defaultPersonaId } = await client.projects.listPersonas(projectId);
for (const persona of personas) {
console.log(persona.id === defaultPersonaId ? '*' : ' ', persona.name);
}
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://davinci-app.com/api/v2/projects/{projectId}/personas', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"personas": [
{
"id": "reviewer",
"name": "Reviewer",
"builtIn": true
}
],
"defaultPersonaId": "<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": {}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}List personas
Returns the personas a prompt can name in persona when sending a message,
and the project’s default persona for new chats.
The built-in Davinci persona comes first, with id standard and builtIn
true. It is not stored with the project, and it is always available. The
branch’s own personas follow in the order the project stores them.
Personas belong to the branch, so this reads the running project: it opens
the project if it is not already open, and it includes uncommitted edits.
That is the same list a sent message’s persona is checked against.
defaultPersonaId is the project-wide default for new chats. It is
standard when the project has none, or when the branch does not define
the persona it names. It is always one of the listed ids.
curl --request GET \
--url https://davinci-app.com/api/v2/projects/{projectId}/personas \
--header 'Authorization: Bearer <token>'import os
from davinci_sdk import DavinciClient
with DavinciClient(api_key=os.environ["DAVINCI_API_KEY"]) as client:
result = client.projects.list_personas(project_id)
for persona in result.personas:
marker = "*" if persona.id == result.default_persona_id else " "
print(marker, persona.name)
import { DavinciClient } from '@celedon/davinci-sdk';
const client = new DavinciClient({
apiKey: process.env.DAVINCI_API_KEY!,
});
const { personas, defaultPersonaId } = await client.projects.listPersonas(projectId);
for (const persona of personas) {
console.log(persona.id === defaultPersonaId ? '*' : ' ', persona.name);
}
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://davinci-app.com/api/v2/projects/{projectId}/personas', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"personas": [
{
"id": "reviewer",
"name": "Reviewer",
"builtIn": true
}
],
"defaultPersonaId": "<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": {}
}
}{
"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
Response
The personas a prompt can name, and the project default.
The built-in persona first, then the branch's own.