import { SyllableSDK } from "syllable-sdk";
const syllableSDK = new SyllableSDK({
apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
});
async function run() {
const result = await syllableSDK.prompts.create({
name: "Weather Agent Prompt",
description: "Prompt for a weather agent.",
type: "prompt_v1",
context: "You are a weather agent. Answer the user's questions about weather and nothing else.",
tools: [],
llmConfig: {
apiVersion: "2024-06-01",
temperature: 1,
seed: 123,
},
sessionEndToolId: 1,
editComments: "Updated prompt text to include requirement to not answer questions that aren't about weather.",
});
console.log(result);
}
run();import os
from syllable_sdk import SyllableSDK
with SyllableSDK(
api_key_header=os.getenv("SYLLABLESDK_API_KEY_HEADER", ""),
) as ss_client:
res = ss_client.prompts.create(request={
"name": "Weather Agent Prompt",
"description": "Prompt for a weather agent.",
"type": "prompt_v1",
"context": "You are a weather agent. Answer the user's questions about weather and nothing else.",
"tools": [],
"llm_config": {
"api_version": "2024-06-01",
"temperature": 1,
"seed": 123,
},
"session_end_tool_id": 1,
"edit_comments": "Updated prompt text to include requirement to not answer questions that aren't about weather.",
})
# Handle response
print(res)curl --request POST \
--url https://api.syllable.cloud/api/v1/prompts/ \
--header 'Content-Type: application/json' \
--header 'Syllable-API-Key: <api-key>' \
--data @- <<EOF
{
"name": "Weather Agent Prompt",
"type": "prompt_v1",
"llm_config": {
"model": "gpt-4o",
"provider": "openai",
"version": "2024-08-06"
},
"description": "Prompt for a weather agent.",
"context": "You are a weather agent. Answer the user's questions about weather and nothing else.",
"tools": [],
"session_end_enabled": false,
"session_end_tool_id": 1,
"edit_comments": "Updated prompt text to include requirement to not answer questions that aren't about weather.",
"include_default_tools": true
}
EOFconst options = {
method: 'POST',
headers: {'Syllable-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Weather Agent Prompt',
type: 'prompt_v1',
llm_config: {model: 'gpt-4o', provider: 'openai', version: '2024-08-06'},
description: 'Prompt for a weather agent.',
context: 'You are a weather agent. Answer the user\'s questions about weather and nothing else.',
tools: [],
session_end_enabled: false,
session_end_tool_id: 1,
edit_comments: 'Updated prompt text to include requirement to not answer questions that aren\'t about weather.',
include_default_tools: true
})
};
fetch('https://api.syllable.cloud/api/v1/prompts/', 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.syllable.cloud/api/v1/prompts/",
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([
'name' => 'Weather Agent Prompt',
'type' => 'prompt_v1',
'llm_config' => [
'model' => 'gpt-4o',
'provider' => 'openai',
'version' => '2024-08-06'
],
'description' => 'Prompt for a weather agent.',
'context' => 'You are a weather agent. Answer the user\'s questions about weather and nothing else.',
'tools' => [
],
'session_end_enabled' => false,
'session_end_tool_id' => 1,
'edit_comments' => 'Updated prompt text to include requirement to not answer questions that aren\'t about weather.',
'include_default_tools' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Syllable-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.syllable.cloud/api/v1/prompts/"
payload := strings.NewReader("{\n \"name\": \"Weather Agent Prompt\",\n \"type\": \"prompt_v1\",\n \"llm_config\": {\n \"model\": \"gpt-4o\",\n \"provider\": \"openai\",\n \"version\": \"2024-08-06\"\n },\n \"description\": \"Prompt for a weather agent.\",\n \"context\": \"You are a weather agent. Answer the user's questions about weather and nothing else.\",\n \"tools\": [],\n \"session_end_enabled\": false,\n \"session_end_tool_id\": 1,\n \"edit_comments\": \"Updated prompt text to include requirement to not answer questions that aren't about weather.\",\n \"include_default_tools\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Syllable-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.syllable.cloud/api/v1/prompts/")
.header("Syllable-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Weather Agent Prompt\",\n \"type\": \"prompt_v1\",\n \"llm_config\": {\n \"model\": \"gpt-4o\",\n \"provider\": \"openai\",\n \"version\": \"2024-08-06\"\n },\n \"description\": \"Prompt for a weather agent.\",\n \"context\": \"You are a weather agent. Answer the user's questions about weather and nothing else.\",\n \"tools\": [],\n \"session_end_enabled\": false,\n \"session_end_tool_id\": 1,\n \"edit_comments\": \"Updated prompt text to include requirement to not answer questions that aren't about weather.\",\n \"include_default_tools\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.syllable.cloud/api/v1/prompts/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Syllable-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Weather Agent Prompt\",\n \"type\": \"prompt_v1\",\n \"llm_config\": {\n \"model\": \"gpt-4o\",\n \"provider\": \"openai\",\n \"version\": \"2024-08-06\"\n },\n \"description\": \"Prompt for a weather agent.\",\n \"context\": \"You are a weather agent. Answer the user's questions about weather and nothing else.\",\n \"tools\": [],\n \"session_end_enabled\": false,\n \"session_end_tool_id\": 1,\n \"edit_comments\": \"Updated prompt text to include requirement to not answer questions that aren't about weather.\",\n \"include_default_tools\": true\n}"
response = http.request(request)
puts response.read_body{
"name": "Weather Agent Prompt",
"type": "prompt_v1",
"llm_config": {
"model": "gpt-4o",
"provider": "openai",
"version": "2024-08-06"
},
"id": 1,
"last_updated": "2024-01-01T12:00:00Z",
"description": "Prompt for a weather agent.",
"context": "You are a weather agent. Answer the user's questions about weather and nothing else.",
"tools": "hangup",
"session_end_enabled": false,
"session_end_tool_id": 1,
"edit_comments": "Updated prompt text to include requirement to not answer questions that aren't about weather.",
"last_updated_by": "user@email.com",
"session_end_tool": {
"name": "Weather Fetcher",
"definition": {
"endpoint": {
"argument_location": "query",
"method": "get",
"url": "https://api.open-meteo.com/v1/forecast"
},
"static_parameters": [
{
"default": "fahrenheit",
"description": "Whether the temperature information should be fetched in Celsius or Fahrenheit",
"name": "temperature_unit",
"required": false,
"type": "string"
}
],
"tool": {
"function": {
"description": "Get the weather for a city",
"name": "get_weather",
"parameters": {
"properties": {
"latitude": {
"description": "Latitude of the city",
"type": "number"
},
"longitude": {
"description": "Longitude of the city",
"type": "number"
},
"current": {
"default": "temperature_2m,relative_humidity_2m,precipitation,rain,showers",
"description": "Information to retrieve from the open-meteo API, comma-separated",
"type": "string"
}
},
"required": [
"latitude",
"longitude",
"current"
],
"type": "object"
}
},
"type": "function"
},
"type": "endpoint"
},
"service_id": 1,
"id": 1,
"last_updated": "2023-11-07T05:31:56Z",
"last_updated_by": "user@email.com",
"version_number": 1,
"last_updated_comments": "Updated to use new API endpoint",
"service_name": "<string>",
"prompts_info": [
{
"id": 1,
"name": "Test Prompt"
}
],
"agents_info": [
{
"id": 1,
"name": "Test Agent"
}
]
},
"agent_count": 5,
"version_number": 1,
"tools_full": [
{
"name": "Weather Fetcher",
"definition": {
"endpoint": {
"argument_location": "query",
"method": "get",
"url": "https://api.open-meteo.com/v1/forecast"
},
"static_parameters": [
{
"default": "fahrenheit",
"description": "Whether the temperature information should be fetched in Celsius or Fahrenheit",
"name": "temperature_unit",
"required": false,
"type": "string"
}
],
"tool": {
"function": {
"description": "Get the weather for a city",
"name": "get_weather",
"parameters": {
"properties": {
"latitude": {
"description": "Latitude of the city",
"type": "number"
},
"longitude": {
"description": "Longitude of the city",
"type": "number"
},
"current": {
"default": "temperature_2m,relative_humidity_2m,precipitation,rain,showers",
"description": "Information to retrieve from the open-meteo API, comma-separated",
"type": "string"
}
},
"required": [
"latitude",
"longitude",
"current"
],
"type": "object"
}
},
"type": "function"
},
"type": "endpoint"
},
"service_id": 1,
"id": 1,
"last_updated": "2023-11-07T05:31:56Z",
"last_updated_by": "user@email.com",
"version_number": 1,
"last_updated_comments": "Updated to use new API endpoint",
"service_name": "<string>",
"prompts_info": [
{
"id": 1,
"name": "Test Prompt"
}
],
"agents_info": [
{
"id": 1,
"name": "Test Agent"
}
],
"validation_issues": [
{
"id": "<string>",
"message": "<string>",
"severity": "error",
"path": "<string>",
"value": "<string>"
}
]
}
],
"validation_issues": [
{
"id": "<string>",
"message": "<string>",
"severity": "error",
"path": "<string>",
"value": "<string>"
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Create Prompt
Create a new prompt
import { SyllableSDK } from "syllable-sdk";
const syllableSDK = new SyllableSDK({
apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
});
async function run() {
const result = await syllableSDK.prompts.create({
name: "Weather Agent Prompt",
description: "Prompt for a weather agent.",
type: "prompt_v1",
context: "You are a weather agent. Answer the user's questions about weather and nothing else.",
tools: [],
llmConfig: {
apiVersion: "2024-06-01",
temperature: 1,
seed: 123,
},
sessionEndToolId: 1,
editComments: "Updated prompt text to include requirement to not answer questions that aren't about weather.",
});
console.log(result);
}
run();import os
from syllable_sdk import SyllableSDK
with SyllableSDK(
api_key_header=os.getenv("SYLLABLESDK_API_KEY_HEADER", ""),
) as ss_client:
res = ss_client.prompts.create(request={
"name": "Weather Agent Prompt",
"description": "Prompt for a weather agent.",
"type": "prompt_v1",
"context": "You are a weather agent. Answer the user's questions about weather and nothing else.",
"tools": [],
"llm_config": {
"api_version": "2024-06-01",
"temperature": 1,
"seed": 123,
},
"session_end_tool_id": 1,
"edit_comments": "Updated prompt text to include requirement to not answer questions that aren't about weather.",
})
# Handle response
print(res)curl --request POST \
--url https://api.syllable.cloud/api/v1/prompts/ \
--header 'Content-Type: application/json' \
--header 'Syllable-API-Key: <api-key>' \
--data @- <<EOF
{
"name": "Weather Agent Prompt",
"type": "prompt_v1",
"llm_config": {
"model": "gpt-4o",
"provider": "openai",
"version": "2024-08-06"
},
"description": "Prompt for a weather agent.",
"context": "You are a weather agent. Answer the user's questions about weather and nothing else.",
"tools": [],
"session_end_enabled": false,
"session_end_tool_id": 1,
"edit_comments": "Updated prompt text to include requirement to not answer questions that aren't about weather.",
"include_default_tools": true
}
EOFconst options = {
method: 'POST',
headers: {'Syllable-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Weather Agent Prompt',
type: 'prompt_v1',
llm_config: {model: 'gpt-4o', provider: 'openai', version: '2024-08-06'},
description: 'Prompt for a weather agent.',
context: 'You are a weather agent. Answer the user\'s questions about weather and nothing else.',
tools: [],
session_end_enabled: false,
session_end_tool_id: 1,
edit_comments: 'Updated prompt text to include requirement to not answer questions that aren\'t about weather.',
include_default_tools: true
})
};
fetch('https://api.syllable.cloud/api/v1/prompts/', 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.syllable.cloud/api/v1/prompts/",
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([
'name' => 'Weather Agent Prompt',
'type' => 'prompt_v1',
'llm_config' => [
'model' => 'gpt-4o',
'provider' => 'openai',
'version' => '2024-08-06'
],
'description' => 'Prompt for a weather agent.',
'context' => 'You are a weather agent. Answer the user\'s questions about weather and nothing else.',
'tools' => [
],
'session_end_enabled' => false,
'session_end_tool_id' => 1,
'edit_comments' => 'Updated prompt text to include requirement to not answer questions that aren\'t about weather.',
'include_default_tools' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Syllable-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.syllable.cloud/api/v1/prompts/"
payload := strings.NewReader("{\n \"name\": \"Weather Agent Prompt\",\n \"type\": \"prompt_v1\",\n \"llm_config\": {\n \"model\": \"gpt-4o\",\n \"provider\": \"openai\",\n \"version\": \"2024-08-06\"\n },\n \"description\": \"Prompt for a weather agent.\",\n \"context\": \"You are a weather agent. Answer the user's questions about weather and nothing else.\",\n \"tools\": [],\n \"session_end_enabled\": false,\n \"session_end_tool_id\": 1,\n \"edit_comments\": \"Updated prompt text to include requirement to not answer questions that aren't about weather.\",\n \"include_default_tools\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Syllable-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.syllable.cloud/api/v1/prompts/")
.header("Syllable-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Weather Agent Prompt\",\n \"type\": \"prompt_v1\",\n \"llm_config\": {\n \"model\": \"gpt-4o\",\n \"provider\": \"openai\",\n \"version\": \"2024-08-06\"\n },\n \"description\": \"Prompt for a weather agent.\",\n \"context\": \"You are a weather agent. Answer the user's questions about weather and nothing else.\",\n \"tools\": [],\n \"session_end_enabled\": false,\n \"session_end_tool_id\": 1,\n \"edit_comments\": \"Updated prompt text to include requirement to not answer questions that aren't about weather.\",\n \"include_default_tools\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.syllable.cloud/api/v1/prompts/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Syllable-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Weather Agent Prompt\",\n \"type\": \"prompt_v1\",\n \"llm_config\": {\n \"model\": \"gpt-4o\",\n \"provider\": \"openai\",\n \"version\": \"2024-08-06\"\n },\n \"description\": \"Prompt for a weather agent.\",\n \"context\": \"You are a weather agent. Answer the user's questions about weather and nothing else.\",\n \"tools\": [],\n \"session_end_enabled\": false,\n \"session_end_tool_id\": 1,\n \"edit_comments\": \"Updated prompt text to include requirement to not answer questions that aren't about weather.\",\n \"include_default_tools\": true\n}"
response = http.request(request)
puts response.read_body{
"name": "Weather Agent Prompt",
"type": "prompt_v1",
"llm_config": {
"model": "gpt-4o",
"provider": "openai",
"version": "2024-08-06"
},
"id": 1,
"last_updated": "2024-01-01T12:00:00Z",
"description": "Prompt for a weather agent.",
"context": "You are a weather agent. Answer the user's questions about weather and nothing else.",
"tools": "hangup",
"session_end_enabled": false,
"session_end_tool_id": 1,
"edit_comments": "Updated prompt text to include requirement to not answer questions that aren't about weather.",
"last_updated_by": "user@email.com",
"session_end_tool": {
"name": "Weather Fetcher",
"definition": {
"endpoint": {
"argument_location": "query",
"method": "get",
"url": "https://api.open-meteo.com/v1/forecast"
},
"static_parameters": [
{
"default": "fahrenheit",
"description": "Whether the temperature information should be fetched in Celsius or Fahrenheit",
"name": "temperature_unit",
"required": false,
"type": "string"
}
],
"tool": {
"function": {
"description": "Get the weather for a city",
"name": "get_weather",
"parameters": {
"properties": {
"latitude": {
"description": "Latitude of the city",
"type": "number"
},
"longitude": {
"description": "Longitude of the city",
"type": "number"
},
"current": {
"default": "temperature_2m,relative_humidity_2m,precipitation,rain,showers",
"description": "Information to retrieve from the open-meteo API, comma-separated",
"type": "string"
}
},
"required": [
"latitude",
"longitude",
"current"
],
"type": "object"
}
},
"type": "function"
},
"type": "endpoint"
},
"service_id": 1,
"id": 1,
"last_updated": "2023-11-07T05:31:56Z",
"last_updated_by": "user@email.com",
"version_number": 1,
"last_updated_comments": "Updated to use new API endpoint",
"service_name": "<string>",
"prompts_info": [
{
"id": 1,
"name": "Test Prompt"
}
],
"agents_info": [
{
"id": 1,
"name": "Test Agent"
}
]
},
"agent_count": 5,
"version_number": 1,
"tools_full": [
{
"name": "Weather Fetcher",
"definition": {
"endpoint": {
"argument_location": "query",
"method": "get",
"url": "https://api.open-meteo.com/v1/forecast"
},
"static_parameters": [
{
"default": "fahrenheit",
"description": "Whether the temperature information should be fetched in Celsius or Fahrenheit",
"name": "temperature_unit",
"required": false,
"type": "string"
}
],
"tool": {
"function": {
"description": "Get the weather for a city",
"name": "get_weather",
"parameters": {
"properties": {
"latitude": {
"description": "Latitude of the city",
"type": "number"
},
"longitude": {
"description": "Longitude of the city",
"type": "number"
},
"current": {
"default": "temperature_2m,relative_humidity_2m,precipitation,rain,showers",
"description": "Information to retrieve from the open-meteo API, comma-separated",
"type": "string"
}
},
"required": [
"latitude",
"longitude",
"current"
],
"type": "object"
}
},
"type": "function"
},
"type": "endpoint"
},
"service_id": 1,
"id": 1,
"last_updated": "2023-11-07T05:31:56Z",
"last_updated_by": "user@email.com",
"version_number": 1,
"last_updated_comments": "Updated to use new API endpoint",
"service_name": "<string>",
"prompts_info": [
{
"id": 1,
"name": "Test Prompt"
}
],
"agents_info": [
{
"id": 1,
"name": "Test Agent"
}
],
"validation_issues": [
{
"id": "<string>",
"message": "<string>",
"severity": "error",
"path": "<string>",
"value": "<string>"
}
]
}
],
"validation_issues": [
{
"id": "<string>",
"message": "<string>",
"severity": "error",
"path": "<string>",
"value": "<string>"
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Body
Request model to create a prompt.
The prompt name
"Weather Agent Prompt"
The type of the prompt
"prompt_v1"
The configuration for the LLM that the prompt uses
Show child attributes
Show child attributes
{
"model": "gpt-4o",
"provider": "openai",
"version": "2024-08-06"
}
The description of the prompt
"Prompt for a weather agent."
The prompt text that will be sent to the LLM at the beginning of the conversation
"You are a weather agent. Answer the user's questions about weather and nothing else."
Names of tools to which the prompt has access
[]
Whether session end functionality is enabled for this prompt
false
ID of the optional session end tool associated with the prompt
1
The comments for the most recent edit to the prompt
"Updated prompt text to include requirement to not answer questions that aren't about weather."
Whether to include the default tools (hangup) in the list of tools for the prompt (also includes set_current_language if any of the agents assigned to the prompt have Dynamic Language Switching enabled). If you disable this during creation, you might want to disable it during updates as well; otherwise the default tools will be added when updating the prompt.
true
Response
Successful Response
Response model for prompt operations. A prompt defines the behavior of an agent by delivering instructions to the LLM about how the agent should behave. A prompt can be linked to one or more agents. A prompt can also be linked to tools to allow an agent using it to use those tools. For more information, see Console docs.
The prompt name
"Weather Agent Prompt"
The type of the prompt
"prompt_v1"
The configuration for the LLM that the prompt uses
Show child attributes
Show child attributes
{
"model": "gpt-4o",
"provider": "openai",
"version": "2024-08-06"
}
The internal ID of the prompt
1
The last updated date of the prompt
"2024-01-01T12:00:00Z"
The description of the prompt
"Prompt for a weather agent."
The prompt text that will be sent to the LLM at the beginning of the conversation
"You are a weather agent. Answer the user's questions about weather and nothing else."
Names of the tools to which the prompt has access (DEPRECATED - use information from full tools field instead)
"hangup"
"summary"
Whether session end functionality is enabled for this prompt
false
ID of the optional session end tool associated with the prompt
1
The comments for the most recent edit to the prompt
"Updated prompt text to include requirement to not answer questions that aren't about weather."
Email address of the user who most recently updated the prompt
"user@email.com"
The session end tool associated with the prompt
Show child attributes
Show child attributes
The number of agents using the prompt
5
The version number of the current version of the prompt
1
Full definitions of tools to which the prompt has access
Show child attributes
Show child attributes
Non-blocking findings for the saved prompt (e.g. a deprecated model warning). Warnings and infos are informational; errors block the save.
Show child attributes
Show child attributes

