Assistant playground
curl --request POST \
--url https://app.yampi.ai/api/v1/accounts/{account_id}/captain/assistants/{id}/playground \
--header 'Content-Type: application/json' \
--header 'api_access_token: <api-key>' \
--data '
{
"assistant": {
"message_content": "<string>",
"request_id": "<string>",
"message_history": [
{
"role": "<string>",
"content": "<string>",
"agent_name": "<string>"
}
],
"playground_config": {
"scenario_ids": [
123
],
"temporary_scenarios": [
{
"client_id": "<string>",
"title": "<string>",
"description": "<string>",
"instruction": "<string>"
}
],
"response_guidelines": [
"<string>"
],
"guardrails": [
"<string>"
],
"knowledge_text": "<string>"
}
}
}
'const options = {
method: 'POST',
headers: {api_access_token: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
assistant: {
message_content: '<string>',
request_id: '<string>',
message_history: [{role: '<string>', content: '<string>', agent_name: '<string>'}],
playground_config: {
scenario_ids: [123],
temporary_scenarios: [
{
client_id: '<string>',
title: '<string>',
description: '<string>',
instruction: '<string>'
}
],
response_guidelines: ['<string>'],
guardrails: ['<string>'],
knowledge_text: '<string>'
}
}
})
};
fetch('https://app.yampi.ai/api/v1/accounts/{account_id}/captain/assistants/{id}/playground', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.yampi.ai/api/v1/accounts/{account_id}/captain/assistants/{id}/playground"
payload = { "assistant": {
"message_content": "<string>",
"request_id": "<string>",
"message_history": [
{
"role": "<string>",
"content": "<string>",
"agent_name": "<string>"
}
],
"playground_config": {
"scenario_ids": [123],
"temporary_scenarios": [
{
"client_id": "<string>",
"title": "<string>",
"description": "<string>",
"instruction": "<string>"
}
],
"response_guidelines": ["<string>"],
"guardrails": ["<string>"],
"knowledge_text": "<string>"
}
} }
headers = {
"api_access_token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"request_id": "<string>"
}{
"description": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
}{}{
"error": "<string>",
"errors": {}
}{
"error": "<string>"
}Livia
Assistant playground
Queue one playground turn: the assistant answers a throwaway message under an optional, session-only test setup. No conversation is written. The reply is delivered to the requesting user over Action Cable as the captain.playground.response event, carrying the same request_id plus either response, agent_name and run_details, or error (and errors when the test setup stopped being valid).
POST
/
api
/
v1
/
accounts
/
{account_id}
/
captain
/
assistants
/
{id}
/
playground
Assistant playground
curl --request POST \
--url https://app.yampi.ai/api/v1/accounts/{account_id}/captain/assistants/{id}/playground \
--header 'Content-Type: application/json' \
--header 'api_access_token: <api-key>' \
--data '
{
"assistant": {
"message_content": "<string>",
"request_id": "<string>",
"message_history": [
{
"role": "<string>",
"content": "<string>",
"agent_name": "<string>"
}
],
"playground_config": {
"scenario_ids": [
123
],
"temporary_scenarios": [
{
"client_id": "<string>",
"title": "<string>",
"description": "<string>",
"instruction": "<string>"
}
],
"response_guidelines": [
"<string>"
],
"guardrails": [
"<string>"
],
"knowledge_text": "<string>"
}
}
}
'const options = {
method: 'POST',
headers: {api_access_token: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
assistant: {
message_content: '<string>',
request_id: '<string>',
message_history: [{role: '<string>', content: '<string>', agent_name: '<string>'}],
playground_config: {
scenario_ids: [123],
temporary_scenarios: [
{
client_id: '<string>',
title: '<string>',
description: '<string>',
instruction: '<string>'
}
],
response_guidelines: ['<string>'],
guardrails: ['<string>'],
knowledge_text: '<string>'
}
}
})
};
fetch('https://app.yampi.ai/api/v1/accounts/{account_id}/captain/assistants/{id}/playground', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.yampi.ai/api/v1/accounts/{account_id}/captain/assistants/{id}/playground"
payload = { "assistant": {
"message_content": "<string>",
"request_id": "<string>",
"message_history": [
{
"role": "<string>",
"content": "<string>",
"agent_name": "<string>"
}
],
"playground_config": {
"scenario_ids": [123],
"temporary_scenarios": [
{
"client_id": "<string>",
"title": "<string>",
"description": "<string>",
"instruction": "<string>"
}
],
"response_guidelines": ["<string>"],
"guardrails": ["<string>"],
"knowledge_text": "<string>"
}
} }
headers = {
"api_access_token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"request_id": "<string>"
}{
"description": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
}{}{
"error": "<string>",
"errors": {}
}{
"error": "<string>"
}Was this page helpful?