Create or update LLM state
curl --request POST \
--url https://api.puretalk.ai/api/ai-assistants/llm-states/{assistant_id} \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"llm_states": [
{
"state_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"prompt": "<string>",
"children": "<array>",
"parameters": {},
"position": {
"x": 123,
"y": 123
},
"tools": [
{
"type": "<string>",
"functionId": "<string>",
"function": {
"name": "<string>",
"description": "<string>",
"parameters": {
"start_time": "<string>",
"end_time": "<string>"
}
}
}
]
}
]
}
'import requests
url = "https://api.puretalk.ai/api/ai-assistants/llm-states/{assistant_id}"
payload = { "llm_states": [
{
"state_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"prompt": "<string>",
"children": "<array>",
"parameters": {},
"position": {
"x": 123,
"y": 123
},
"tools": [
{
"type": "<string>",
"functionId": "<string>",
"function": {
"name": "<string>",
"description": "<string>",
"parameters": {
"start_time": "<string>",
"end_time": "<string>"
}
}
}
]
}
] }
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
llm_states: [
{
state_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: '<string>',
description: '<string>',
prompt: '<string>',
children: '<array>',
parameters: {},
position: {x: 123, y: 123},
tools: [
{
type: '<string>',
functionId: '<string>',
function: {
name: '<string>',
description: '<string>',
parameters: {start_time: '<string>', end_time: '<string>'}
}
}
]
}
]
})
};
fetch('https://api.puretalk.ai/api/ai-assistants/llm-states/{assistant_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.puretalk.ai/api/ai-assistants/llm-states/{assistant_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'llm_states' => [
[
'state_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => '<string>',
'description' => '<string>',
'prompt' => '<string>',
'children' => '<array>',
'parameters' => [
],
'position' => [
'x' => 123,
'y' => 123
],
'tools' => [
[
'type' => '<string>',
'functionId' => '<string>',
'function' => [
'name' => '<string>',
'description' => '<string>',
'parameters' => [
'start_time' => '<string>',
'end_time' => '<string>'
]
]
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.puretalk.ai/api/ai-assistants/llm-states/{assistant_id}"
payload := strings.NewReader("{\n \"llm_states\": [\n {\n \"state_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"prompt\": \"<string>\",\n \"children\": \"<array>\",\n \"parameters\": {},\n \"position\": {\n \"x\": 123,\n \"y\": 123\n },\n \"tools\": [\n {\n \"type\": \"<string>\",\n \"functionId\": \"<string>\",\n \"function\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {\n \"start_time\": \"<string>\",\n \"end_time\": \"<string>\"\n }\n }\n }\n ]\n }\n ]\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))
}HttpResponse<String> response = Unirest.post("https://api.puretalk.ai/api/ai-assistants/llm-states/{assistant_id}")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"llm_states\": [\n {\n \"state_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"prompt\": \"<string>\",\n \"children\": \"<array>\",\n \"parameters\": {},\n \"position\": {\n \"x\": 123,\n \"y\": 123\n },\n \"tools\": [\n {\n \"type\": \"<string>\",\n \"functionId\": \"<string>\",\n \"function\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {\n \"start_time\": \"<string>\",\n \"end_time\": \"<string>\"\n }\n }\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.puretalk.ai/api/ai-assistants/llm-states/{assistant_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"llm_states\": [\n {\n \"state_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"prompt\": \"<string>\",\n \"children\": \"<array>\",\n \"parameters\": {},\n \"position\": {\n \"x\": 123,\n \"y\": 123\n },\n \"tools\": [\n {\n \"type\": \"<string>\",\n \"functionId\": \"<string>\",\n \"function\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {\n \"start_time\": \"<string>\",\n \"end_time\": \"<string>\"\n }\n }\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"err": true,
"msg": "<string>"
}{
"err": true,
"msg": "<string>"
}Multi-Task Assistants
Add/Update Task
Creates a new LLM state for the specified assistant, or update an existing one.
POST
/
ai-assistants
/
llm-states
/
{assistant_id}
Create or update LLM state
curl --request POST \
--url https://api.puretalk.ai/api/ai-assistants/llm-states/{assistant_id} \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"llm_states": [
{
"state_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"prompt": "<string>",
"children": "<array>",
"parameters": {},
"position": {
"x": 123,
"y": 123
},
"tools": [
{
"type": "<string>",
"functionId": "<string>",
"function": {
"name": "<string>",
"description": "<string>",
"parameters": {
"start_time": "<string>",
"end_time": "<string>"
}
}
}
]
}
]
}
'import requests
url = "https://api.puretalk.ai/api/ai-assistants/llm-states/{assistant_id}"
payload = { "llm_states": [
{
"state_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"prompt": "<string>",
"children": "<array>",
"parameters": {},
"position": {
"x": 123,
"y": 123
},
"tools": [
{
"type": "<string>",
"functionId": "<string>",
"function": {
"name": "<string>",
"description": "<string>",
"parameters": {
"start_time": "<string>",
"end_time": "<string>"
}
}
}
]
}
] }
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
llm_states: [
{
state_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: '<string>',
description: '<string>',
prompt: '<string>',
children: '<array>',
parameters: {},
position: {x: 123, y: 123},
tools: [
{
type: '<string>',
functionId: '<string>',
function: {
name: '<string>',
description: '<string>',
parameters: {start_time: '<string>', end_time: '<string>'}
}
}
]
}
]
})
};
fetch('https://api.puretalk.ai/api/ai-assistants/llm-states/{assistant_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.puretalk.ai/api/ai-assistants/llm-states/{assistant_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'llm_states' => [
[
'state_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => '<string>',
'description' => '<string>',
'prompt' => '<string>',
'children' => '<array>',
'parameters' => [
],
'position' => [
'x' => 123,
'y' => 123
],
'tools' => [
[
'type' => '<string>',
'functionId' => '<string>',
'function' => [
'name' => '<string>',
'description' => '<string>',
'parameters' => [
'start_time' => '<string>',
'end_time' => '<string>'
]
]
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.puretalk.ai/api/ai-assistants/llm-states/{assistant_id}"
payload := strings.NewReader("{\n \"llm_states\": [\n {\n \"state_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"prompt\": \"<string>\",\n \"children\": \"<array>\",\n \"parameters\": {},\n \"position\": {\n \"x\": 123,\n \"y\": 123\n },\n \"tools\": [\n {\n \"type\": \"<string>\",\n \"functionId\": \"<string>\",\n \"function\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {\n \"start_time\": \"<string>\",\n \"end_time\": \"<string>\"\n }\n }\n }\n ]\n }\n ]\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))
}HttpResponse<String> response = Unirest.post("https://api.puretalk.ai/api/ai-assistants/llm-states/{assistant_id}")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"llm_states\": [\n {\n \"state_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"prompt\": \"<string>\",\n \"children\": \"<array>\",\n \"parameters\": {},\n \"position\": {\n \"x\": 123,\n \"y\": 123\n },\n \"tools\": [\n {\n \"type\": \"<string>\",\n \"functionId\": \"<string>\",\n \"function\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {\n \"start_time\": \"<string>\",\n \"end_time\": \"<string>\"\n }\n }\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.puretalk.ai/api/ai-assistants/llm-states/{assistant_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"llm_states\": [\n {\n \"state_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"prompt\": \"<string>\",\n \"children\": \"<array>\",\n \"parameters\": {},\n \"position\": {\n \"x\": 123,\n \"y\": 123\n },\n \"tools\": [\n {\n \"type\": \"<string>\",\n \"functionId\": \"<string>\",\n \"function\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {\n \"start_time\": \"<string>\",\n \"end_time\": \"<string>\"\n }\n }\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"err": true,
"msg": "<string>"
}{
"err": true,
"msg": "<string>"
}Children Schema
TheChildren schema represents a state in the LLM (Language Learning Model) with various properties such as state_id, name, description, prompt, parameters, position, and tools.
Recursive Children Property
One of the key features of theChildren schema is the children property. This property allows a children to have nested childrens, creating a hierarchical structure. Each children can, in turn, have its own children, allowing for a recursive definition of states.
{
"state_id": "a4a4f3fd-cc53-421e-a794-cf6ec47e96b1",
"name": "warm_intro",
"description": "warm_intro description",
"prompt": "## Background about Property...",
"children": [
{
"state_id": "abe03fd0-e093-4bd7-bda0-583c31eed973",
"name": "callback",
"description": "Transition to schedule a callback",
"prompt": "## Background\nBusiness Hour:...",
"children": []
},
{
"state_id": "3d084435-e5b6-4691-b9ea-b773e2726ebe",
"name": "schedule_tour",
"description": "Transition to schedule an in person tour",
"prompt": "## Background about Property...",
"children": []
}
]
}
Authorizations
Authorization header containing API key. You can find your API key in the dashboard under 'API Keys'.
Path Parameters
The ID of the assistant
Body
application/json
Show child attributes
Show child attributes
Was this page helpful?
⌘I