import { SyllableSDK } from "syllable-sdk";
const syllableSDK = new SyllableSDK({
apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
});
async function run() {
const result = await syllableSDK.tools.update({
name: "Weather Fetcher",
definition: {
type: "endpoint",
tool: {
function: {
name: "get_weather",
description: "Get the weather for a city",
parameters: {
},
},
},
endpoint: {
url: "https://api.example.com",
method: "get",
argumentLocation: "form",
timeout: 45,
},
context: {
task: {
type: "import",
version: "v1alpha",
file: "<value>",
},
},
defaults: "<value>",
staticParameters: [
{
name: "temperature_unit",
description: "Whether the temperature information should be fetched in Celsius or Fahrenheit",
required: false,
type: "string",
default: "fahrenheit",
},
],
},
serviceId: 1,
id: 1,
lastUpdatedComments: "Updated to use new API endpoint",
});
console.log(result);
}
run();import os
from syllable_sdk import SyllableSDK, models
with SyllableSDK(
api_key_header=os.getenv("SYLLABLESDK_API_KEY_HEADER", ""),
) as ss_client:
res = ss_client.tools.update(request=models.ToolUpdateRequest(
name="Weather Fetcher",
definition=models.ToolDefinition(
type=models.ToolDefinitionType.ENDPOINT,
tool=models.InternalTool(
function=models.ToolFunction(
name="get_weather",
description="Get the weather for a city",
parameters={
},
),
),
endpoint=models.ToolHTTPEndpoint(
url="https://api.example.com",
method=models.ToolHTTPMethod.GET,
argument_location=models.ToolArgumentLocation.FORM,
timeout=45,
),
context=models.Context(
task=models.LoadToolFromFileTask(
file="<value>",
),
),
defaults="<value>",
static_parameters=[
models.StaticToolParameter(
name="temperature_unit",
description="Whether the temperature information should be fetched in Celsius or Fahrenheit",
required=False,
type=models.StaticToolParameterType.STRING,
default="fahrenheit",
),
],
),
service_id=1,
id=1,
last_updated_comments="Updated to use new API endpoint",
))
# Handle response
print(res)curl --request PUT \
--url https://api.syllable.cloud/api/v1/tools/ \
--header 'Content-Type: application/json' \
--header 'Syllable-API-Key: <api-key>' \
--data '
{
"name": "<string>",
"definition": {
"tool": {
"function": {
"name": "<string>",
"description": "<string>",
"parameters": "<unknown>"
},
"type": "function"
},
"type": "endpoint",
"endpoint": {
"url": "<string>",
"timeout": 45
},
"context": {
"task": {
"id": "<string>",
"config": {},
"variables": [
{
"name": "<string>",
"value": "<unknown>",
"valueFrom": "inputs.provided_dob == patient_dob",
"description": "<string>",
"title": "<string>",
"format": "<string>",
"pattern": "<string>",
"enum": [
"<string>"
],
"examples": [
"<unknown>"
]
}
],
"metadata": {
"priority": 123
},
"tool": {
"name": "<string>",
"description": "<string>"
},
"type": "expression",
"version": "v1alpha",
"inputs": [
{
"name": "<string>",
"description": "<string>",
"title": "<string>",
"format": "<string>",
"pattern": "<string>",
"enum": [
"<string>"
],
"examples": [
"<unknown>"
],
"required": true
}
],
"expression": "inputs.can_sign_consent == `true`",
"output": null,
"on": {
"start": [
{
"name": "<string>",
"value": "<unknown>",
"valueFrom": "inputs.provided_dob == patient_dob",
"if": "inputs.can_sign_consent == `true`",
"action": "set"
}
],
"submit": [
{
"name": "<string>",
"value": "<unknown>",
"valueFrom": "inputs.provided_dob == patient_dob",
"if": "inputs.can_sign_consent == `true`",
"action": "set"
}
]
}
}
},
"defaults": "<unknown>",
"static_parameters": [
{
"default": "fahrenheit",
"description": "Whether the temperature information should be fetched in Celsius or Fahrenheit",
"name": "temperature_unit",
"required": false,
"type": "string"
}
],
"result": "<unknown>",
"options": {
"propagate_tool_result": false
}
},
"service_id": 123,
"id": 123,
"last_updated_comments": "Updated to use new API endpoint"
}
'const options = {
method: 'PUT',
headers: {'Syllable-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
definition: {
tool: {
function: {name: '<string>', description: '<string>', parameters: '<unknown>'},
type: 'function'
},
type: 'endpoint',
endpoint: {url: '<string>', timeout: 45},
context: {
task: {
id: '<string>',
config: {},
variables: [
{
name: '<string>',
value: '<unknown>',
valueFrom: 'inputs.provided_dob == patient_dob',
description: '<string>',
title: '<string>',
format: '<string>',
pattern: '<string>',
enum: ['<string>'],
examples: ['<unknown>']
}
],
metadata: {priority: 123},
tool: {name: '<string>', description: '<string>'},
type: 'expression',
version: 'v1alpha',
inputs: [
{
name: '<string>',
description: '<string>',
title: '<string>',
format: '<string>',
pattern: '<string>',
enum: ['<string>'],
examples: ['<unknown>'],
required: true
}
],
expression: 'inputs.can_sign_consent == `true`',
output: null,
on: {
start: [
{
name: '<string>',
value: '<unknown>',
valueFrom: 'inputs.provided_dob == patient_dob',
if: 'inputs.can_sign_consent == `true`',
action: 'set'
}
],
submit: [
{
name: '<string>',
value: '<unknown>',
valueFrom: 'inputs.provided_dob == patient_dob',
if: 'inputs.can_sign_consent == `true`',
action: 'set'
}
]
}
}
},
defaults: '<unknown>',
static_parameters: [
{
default: 'fahrenheit',
description: 'Whether the temperature information should be fetched in Celsius or Fahrenheit',
name: 'temperature_unit',
required: false,
type: 'string'
}
],
result: '<unknown>',
options: {propagate_tool_result: false}
},
service_id: 123,
id: 123,
last_updated_comments: 'Updated to use new API endpoint'
})
};
fetch('https://api.syllable.cloud/api/v1/tools/', 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/tools/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'definition' => [
'tool' => [
'function' => [
'name' => '<string>',
'description' => '<string>',
'parameters' => '<unknown>'
],
'type' => 'function'
],
'type' => 'endpoint',
'endpoint' => [
'url' => '<string>',
'timeout' => 45
],
'context' => [
'task' => [
'id' => '<string>',
'config' => [
],
'variables' => [
[
'name' => '<string>',
'value' => '<unknown>',
'valueFrom' => 'inputs.provided_dob == patient_dob',
'description' => '<string>',
'title' => '<string>',
'format' => '<string>',
'pattern' => '<string>',
'enum' => [
'<string>'
],
'examples' => [
'<unknown>'
]
]
],
'metadata' => [
'priority' => 123
],
'tool' => [
'name' => '<string>',
'description' => '<string>'
],
'type' => 'expression',
'version' => 'v1alpha',
'inputs' => [
[
'name' => '<string>',
'description' => '<string>',
'title' => '<string>',
'format' => '<string>',
'pattern' => '<string>',
'enum' => [
'<string>'
],
'examples' => [
'<unknown>'
],
'required' => true
]
],
'expression' => 'inputs.can_sign_consent == `true`',
'output' => null,
'on' => [
'start' => [
[
'name' => '<string>',
'value' => '<unknown>',
'valueFrom' => 'inputs.provided_dob == patient_dob',
'if' => 'inputs.can_sign_consent == `true`',
'action' => 'set'
]
],
'submit' => [
[
'name' => '<string>',
'value' => '<unknown>',
'valueFrom' => 'inputs.provided_dob == patient_dob',
'if' => 'inputs.can_sign_consent == `true`',
'action' => 'set'
]
]
]
]
],
'defaults' => '<unknown>',
'static_parameters' => [
[
'default' => 'fahrenheit',
'description' => 'Whether the temperature information should be fetched in Celsius or Fahrenheit',
'name' => 'temperature_unit',
'required' => false,
'type' => 'string'
]
],
'result' => '<unknown>',
'options' => [
'propagate_tool_result' => false
]
],
'service_id' => 123,
'id' => 123,
'last_updated_comments' => 'Updated to use new API endpoint'
]),
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/tools/"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"definition\": {\n \"tool\": {\n \"function\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": \"<unknown>\"\n },\n \"type\": \"function\"\n },\n \"type\": \"endpoint\",\n \"endpoint\": {\n \"url\": \"<string>\",\n \"timeout\": 45\n },\n \"context\": {\n \"task\": {\n \"id\": \"<string>\",\n \"config\": {},\n \"variables\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<unknown>\",\n \"valueFrom\": \"inputs.provided_dob == patient_dob\",\n \"description\": \"<string>\",\n \"title\": \"<string>\",\n \"format\": \"<string>\",\n \"pattern\": \"<string>\",\n \"enum\": [\n \"<string>\"\n ],\n \"examples\": [\n \"<unknown>\"\n ]\n }\n ],\n \"metadata\": {\n \"priority\": 123\n },\n \"tool\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n },\n \"type\": \"expression\",\n \"version\": \"v1alpha\",\n \"inputs\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"title\": \"<string>\",\n \"format\": \"<string>\",\n \"pattern\": \"<string>\",\n \"enum\": [\n \"<string>\"\n ],\n \"examples\": [\n \"<unknown>\"\n ],\n \"required\": true\n }\n ],\n \"expression\": \"inputs.can_sign_consent == `true`\",\n \"output\": null,\n \"on\": {\n \"start\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<unknown>\",\n \"valueFrom\": \"inputs.provided_dob == patient_dob\",\n \"if\": \"inputs.can_sign_consent == `true`\",\n \"action\": \"set\"\n }\n ],\n \"submit\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<unknown>\",\n \"valueFrom\": \"inputs.provided_dob == patient_dob\",\n \"if\": \"inputs.can_sign_consent == `true`\",\n \"action\": \"set\"\n }\n ]\n }\n }\n },\n \"defaults\": \"<unknown>\",\n \"static_parameters\": [\n {\n \"default\": \"fahrenheit\",\n \"description\": \"Whether the temperature information should be fetched in Celsius or Fahrenheit\",\n \"name\": \"temperature_unit\",\n \"required\": false,\n \"type\": \"string\"\n }\n ],\n \"result\": \"<unknown>\",\n \"options\": {\n \"propagate_tool_result\": false\n }\n },\n \"service_id\": 123,\n \"id\": 123,\n \"last_updated_comments\": \"Updated to use new API endpoint\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.syllable.cloud/api/v1/tools/")
.header("Syllable-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"definition\": {\n \"tool\": {\n \"function\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": \"<unknown>\"\n },\n \"type\": \"function\"\n },\n \"type\": \"endpoint\",\n \"endpoint\": {\n \"url\": \"<string>\",\n \"timeout\": 45\n },\n \"context\": {\n \"task\": {\n \"id\": \"<string>\",\n \"config\": {},\n \"variables\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<unknown>\",\n \"valueFrom\": \"inputs.provided_dob == patient_dob\",\n \"description\": \"<string>\",\n \"title\": \"<string>\",\n \"format\": \"<string>\",\n \"pattern\": \"<string>\",\n \"enum\": [\n \"<string>\"\n ],\n \"examples\": [\n \"<unknown>\"\n ]\n }\n ],\n \"metadata\": {\n \"priority\": 123\n },\n \"tool\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n },\n \"type\": \"expression\",\n \"version\": \"v1alpha\",\n \"inputs\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"title\": \"<string>\",\n \"format\": \"<string>\",\n \"pattern\": \"<string>\",\n \"enum\": [\n \"<string>\"\n ],\n \"examples\": [\n \"<unknown>\"\n ],\n \"required\": true\n }\n ],\n \"expression\": \"inputs.can_sign_consent == `true`\",\n \"output\": null,\n \"on\": {\n \"start\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<unknown>\",\n \"valueFrom\": \"inputs.provided_dob == patient_dob\",\n \"if\": \"inputs.can_sign_consent == `true`\",\n \"action\": \"set\"\n }\n ],\n \"submit\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<unknown>\",\n \"valueFrom\": \"inputs.provided_dob == patient_dob\",\n \"if\": \"inputs.can_sign_consent == `true`\",\n \"action\": \"set\"\n }\n ]\n }\n }\n },\n \"defaults\": \"<unknown>\",\n \"static_parameters\": [\n {\n \"default\": \"fahrenheit\",\n \"description\": \"Whether the temperature information should be fetched in Celsius or Fahrenheit\",\n \"name\": \"temperature_unit\",\n \"required\": false,\n \"type\": \"string\"\n }\n ],\n \"result\": \"<unknown>\",\n \"options\": {\n \"propagate_tool_result\": false\n }\n },\n \"service_id\": 123,\n \"id\": 123,\n \"last_updated_comments\": \"Updated to use new API endpoint\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.syllable.cloud/api/v1/tools/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Syllable-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"definition\": {\n \"tool\": {\n \"function\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": \"<unknown>\"\n },\n \"type\": \"function\"\n },\n \"type\": \"endpoint\",\n \"endpoint\": {\n \"url\": \"<string>\",\n \"timeout\": 45\n },\n \"context\": {\n \"task\": {\n \"id\": \"<string>\",\n \"config\": {},\n \"variables\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<unknown>\",\n \"valueFrom\": \"inputs.provided_dob == patient_dob\",\n \"description\": \"<string>\",\n \"title\": \"<string>\",\n \"format\": \"<string>\",\n \"pattern\": \"<string>\",\n \"enum\": [\n \"<string>\"\n ],\n \"examples\": [\n \"<unknown>\"\n ]\n }\n ],\n \"metadata\": {\n \"priority\": 123\n },\n \"tool\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n },\n \"type\": \"expression\",\n \"version\": \"v1alpha\",\n \"inputs\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"title\": \"<string>\",\n \"format\": \"<string>\",\n \"pattern\": \"<string>\",\n \"enum\": [\n \"<string>\"\n ],\n \"examples\": [\n \"<unknown>\"\n ],\n \"required\": true\n }\n ],\n \"expression\": \"inputs.can_sign_consent == `true`\",\n \"output\": null,\n \"on\": {\n \"start\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<unknown>\",\n \"valueFrom\": \"inputs.provided_dob == patient_dob\",\n \"if\": \"inputs.can_sign_consent == `true`\",\n \"action\": \"set\"\n }\n ],\n \"submit\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<unknown>\",\n \"valueFrom\": \"inputs.provided_dob == patient_dob\",\n \"if\": \"inputs.can_sign_consent == `true`\",\n \"action\": \"set\"\n }\n ]\n }\n }\n },\n \"defaults\": \"<unknown>\",\n \"static_parameters\": [\n {\n \"default\": \"fahrenheit\",\n \"description\": \"Whether the temperature information should be fetched in Celsius or Fahrenheit\",\n \"name\": \"temperature_unit\",\n \"required\": false,\n \"type\": \"string\"\n }\n ],\n \"result\": \"<unknown>\",\n \"options\": {\n \"propagate_tool_result\": false\n }\n },\n \"service_id\": 123,\n \"id\": 123,\n \"last_updated_comments\": \"Updated to use new API endpoint\"\n}"
response = http.request(request)
puts response.read_body{
"name": "<string>",
"definition": {
"tool": {
"function": {
"name": "<string>",
"description": "<string>",
"parameters": "<unknown>"
},
"type": "function"
},
"type": "endpoint",
"endpoint": {
"url": "<string>",
"timeout": 45
},
"context": {
"task": {
"id": "<string>",
"config": {},
"variables": [
{
"name": "<string>",
"value": "<unknown>",
"valueFrom": "inputs.provided_dob == patient_dob",
"description": "<string>",
"title": "<string>",
"format": "<string>",
"pattern": "<string>",
"enum": [
"<string>"
],
"examples": [
"<unknown>"
]
}
],
"metadata": {
"priority": 123
},
"tool": {
"name": "<string>",
"description": "<string>"
},
"type": "expression",
"version": "v1alpha",
"inputs": [
{
"name": "<string>",
"description": "<string>",
"title": "<string>",
"format": "<string>",
"pattern": "<string>",
"enum": [
"<string>"
],
"examples": [
"<unknown>"
],
"required": true
}
],
"expression": "inputs.can_sign_consent == `true`",
"output": null,
"on": {
"start": [
{
"name": "<string>",
"value": "<unknown>",
"valueFrom": "inputs.provided_dob == patient_dob",
"if": "inputs.can_sign_consent == `true`",
"action": "set"
}
],
"submit": [
{
"name": "<string>",
"value": "<unknown>",
"valueFrom": "inputs.provided_dob == patient_dob",
"if": "inputs.can_sign_consent == `true`",
"action": "set"
}
]
}
}
},
"defaults": "<unknown>",
"static_parameters": [
{
"default": "fahrenheit",
"description": "Whether the temperature information should be fetched in Celsius or Fahrenheit",
"name": "temperature_unit",
"required": false,
"type": "string"
}
],
"result": "<unknown>",
"options": {
"propagate_tool_result": false
}
},
"service_id": 123,
"id": 123,
"last_updated": "2023-11-07T05:31:56Z",
"last_updated_by": "<string>",
"version_number": 123,
"last_updated_comments": "Updated to use new API endpoint",
"service_name": "<string>",
"prompts_info": [
{
"id": 123,
"name": "<string>"
}
],
"agents_info": [
{
"id": 123,
"name": "<string>"
}
],
"validation_issues": [
{
"id": "<string>",
"message": "<string>",
"severity": "error",
"path": "<string>",
"value": "<string>"
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Update Tool
Update an existing tool
import { SyllableSDK } from "syllable-sdk";
const syllableSDK = new SyllableSDK({
apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
});
async function run() {
const result = await syllableSDK.tools.update({
name: "Weather Fetcher",
definition: {
type: "endpoint",
tool: {
function: {
name: "get_weather",
description: "Get the weather for a city",
parameters: {
},
},
},
endpoint: {
url: "https://api.example.com",
method: "get",
argumentLocation: "form",
timeout: 45,
},
context: {
task: {
type: "import",
version: "v1alpha",
file: "<value>",
},
},
defaults: "<value>",
staticParameters: [
{
name: "temperature_unit",
description: "Whether the temperature information should be fetched in Celsius or Fahrenheit",
required: false,
type: "string",
default: "fahrenheit",
},
],
},
serviceId: 1,
id: 1,
lastUpdatedComments: "Updated to use new API endpoint",
});
console.log(result);
}
run();import os
from syllable_sdk import SyllableSDK, models
with SyllableSDK(
api_key_header=os.getenv("SYLLABLESDK_API_KEY_HEADER", ""),
) as ss_client:
res = ss_client.tools.update(request=models.ToolUpdateRequest(
name="Weather Fetcher",
definition=models.ToolDefinition(
type=models.ToolDefinitionType.ENDPOINT,
tool=models.InternalTool(
function=models.ToolFunction(
name="get_weather",
description="Get the weather for a city",
parameters={
},
),
),
endpoint=models.ToolHTTPEndpoint(
url="https://api.example.com",
method=models.ToolHTTPMethod.GET,
argument_location=models.ToolArgumentLocation.FORM,
timeout=45,
),
context=models.Context(
task=models.LoadToolFromFileTask(
file="<value>",
),
),
defaults="<value>",
static_parameters=[
models.StaticToolParameter(
name="temperature_unit",
description="Whether the temperature information should be fetched in Celsius or Fahrenheit",
required=False,
type=models.StaticToolParameterType.STRING,
default="fahrenheit",
),
],
),
service_id=1,
id=1,
last_updated_comments="Updated to use new API endpoint",
))
# Handle response
print(res)curl --request PUT \
--url https://api.syllable.cloud/api/v1/tools/ \
--header 'Content-Type: application/json' \
--header 'Syllable-API-Key: <api-key>' \
--data '
{
"name": "<string>",
"definition": {
"tool": {
"function": {
"name": "<string>",
"description": "<string>",
"parameters": "<unknown>"
},
"type": "function"
},
"type": "endpoint",
"endpoint": {
"url": "<string>",
"timeout": 45
},
"context": {
"task": {
"id": "<string>",
"config": {},
"variables": [
{
"name": "<string>",
"value": "<unknown>",
"valueFrom": "inputs.provided_dob == patient_dob",
"description": "<string>",
"title": "<string>",
"format": "<string>",
"pattern": "<string>",
"enum": [
"<string>"
],
"examples": [
"<unknown>"
]
}
],
"metadata": {
"priority": 123
},
"tool": {
"name": "<string>",
"description": "<string>"
},
"type": "expression",
"version": "v1alpha",
"inputs": [
{
"name": "<string>",
"description": "<string>",
"title": "<string>",
"format": "<string>",
"pattern": "<string>",
"enum": [
"<string>"
],
"examples": [
"<unknown>"
],
"required": true
}
],
"expression": "inputs.can_sign_consent == `true`",
"output": null,
"on": {
"start": [
{
"name": "<string>",
"value": "<unknown>",
"valueFrom": "inputs.provided_dob == patient_dob",
"if": "inputs.can_sign_consent == `true`",
"action": "set"
}
],
"submit": [
{
"name": "<string>",
"value": "<unknown>",
"valueFrom": "inputs.provided_dob == patient_dob",
"if": "inputs.can_sign_consent == `true`",
"action": "set"
}
]
}
}
},
"defaults": "<unknown>",
"static_parameters": [
{
"default": "fahrenheit",
"description": "Whether the temperature information should be fetched in Celsius or Fahrenheit",
"name": "temperature_unit",
"required": false,
"type": "string"
}
],
"result": "<unknown>",
"options": {
"propagate_tool_result": false
}
},
"service_id": 123,
"id": 123,
"last_updated_comments": "Updated to use new API endpoint"
}
'const options = {
method: 'PUT',
headers: {'Syllable-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
definition: {
tool: {
function: {name: '<string>', description: '<string>', parameters: '<unknown>'},
type: 'function'
},
type: 'endpoint',
endpoint: {url: '<string>', timeout: 45},
context: {
task: {
id: '<string>',
config: {},
variables: [
{
name: '<string>',
value: '<unknown>',
valueFrom: 'inputs.provided_dob == patient_dob',
description: '<string>',
title: '<string>',
format: '<string>',
pattern: '<string>',
enum: ['<string>'],
examples: ['<unknown>']
}
],
metadata: {priority: 123},
tool: {name: '<string>', description: '<string>'},
type: 'expression',
version: 'v1alpha',
inputs: [
{
name: '<string>',
description: '<string>',
title: '<string>',
format: '<string>',
pattern: '<string>',
enum: ['<string>'],
examples: ['<unknown>'],
required: true
}
],
expression: 'inputs.can_sign_consent == `true`',
output: null,
on: {
start: [
{
name: '<string>',
value: '<unknown>',
valueFrom: 'inputs.provided_dob == patient_dob',
if: 'inputs.can_sign_consent == `true`',
action: 'set'
}
],
submit: [
{
name: '<string>',
value: '<unknown>',
valueFrom: 'inputs.provided_dob == patient_dob',
if: 'inputs.can_sign_consent == `true`',
action: 'set'
}
]
}
}
},
defaults: '<unknown>',
static_parameters: [
{
default: 'fahrenheit',
description: 'Whether the temperature information should be fetched in Celsius or Fahrenheit',
name: 'temperature_unit',
required: false,
type: 'string'
}
],
result: '<unknown>',
options: {propagate_tool_result: false}
},
service_id: 123,
id: 123,
last_updated_comments: 'Updated to use new API endpoint'
})
};
fetch('https://api.syllable.cloud/api/v1/tools/', 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/tools/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'definition' => [
'tool' => [
'function' => [
'name' => '<string>',
'description' => '<string>',
'parameters' => '<unknown>'
],
'type' => 'function'
],
'type' => 'endpoint',
'endpoint' => [
'url' => '<string>',
'timeout' => 45
],
'context' => [
'task' => [
'id' => '<string>',
'config' => [
],
'variables' => [
[
'name' => '<string>',
'value' => '<unknown>',
'valueFrom' => 'inputs.provided_dob == patient_dob',
'description' => '<string>',
'title' => '<string>',
'format' => '<string>',
'pattern' => '<string>',
'enum' => [
'<string>'
],
'examples' => [
'<unknown>'
]
]
],
'metadata' => [
'priority' => 123
],
'tool' => [
'name' => '<string>',
'description' => '<string>'
],
'type' => 'expression',
'version' => 'v1alpha',
'inputs' => [
[
'name' => '<string>',
'description' => '<string>',
'title' => '<string>',
'format' => '<string>',
'pattern' => '<string>',
'enum' => [
'<string>'
],
'examples' => [
'<unknown>'
],
'required' => true
]
],
'expression' => 'inputs.can_sign_consent == `true`',
'output' => null,
'on' => [
'start' => [
[
'name' => '<string>',
'value' => '<unknown>',
'valueFrom' => 'inputs.provided_dob == patient_dob',
'if' => 'inputs.can_sign_consent == `true`',
'action' => 'set'
]
],
'submit' => [
[
'name' => '<string>',
'value' => '<unknown>',
'valueFrom' => 'inputs.provided_dob == patient_dob',
'if' => 'inputs.can_sign_consent == `true`',
'action' => 'set'
]
]
]
]
],
'defaults' => '<unknown>',
'static_parameters' => [
[
'default' => 'fahrenheit',
'description' => 'Whether the temperature information should be fetched in Celsius or Fahrenheit',
'name' => 'temperature_unit',
'required' => false,
'type' => 'string'
]
],
'result' => '<unknown>',
'options' => [
'propagate_tool_result' => false
]
],
'service_id' => 123,
'id' => 123,
'last_updated_comments' => 'Updated to use new API endpoint'
]),
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/tools/"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"definition\": {\n \"tool\": {\n \"function\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": \"<unknown>\"\n },\n \"type\": \"function\"\n },\n \"type\": \"endpoint\",\n \"endpoint\": {\n \"url\": \"<string>\",\n \"timeout\": 45\n },\n \"context\": {\n \"task\": {\n \"id\": \"<string>\",\n \"config\": {},\n \"variables\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<unknown>\",\n \"valueFrom\": \"inputs.provided_dob == patient_dob\",\n \"description\": \"<string>\",\n \"title\": \"<string>\",\n \"format\": \"<string>\",\n \"pattern\": \"<string>\",\n \"enum\": [\n \"<string>\"\n ],\n \"examples\": [\n \"<unknown>\"\n ]\n }\n ],\n \"metadata\": {\n \"priority\": 123\n },\n \"tool\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n },\n \"type\": \"expression\",\n \"version\": \"v1alpha\",\n \"inputs\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"title\": \"<string>\",\n \"format\": \"<string>\",\n \"pattern\": \"<string>\",\n \"enum\": [\n \"<string>\"\n ],\n \"examples\": [\n \"<unknown>\"\n ],\n \"required\": true\n }\n ],\n \"expression\": \"inputs.can_sign_consent == `true`\",\n \"output\": null,\n \"on\": {\n \"start\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<unknown>\",\n \"valueFrom\": \"inputs.provided_dob == patient_dob\",\n \"if\": \"inputs.can_sign_consent == `true`\",\n \"action\": \"set\"\n }\n ],\n \"submit\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<unknown>\",\n \"valueFrom\": \"inputs.provided_dob == patient_dob\",\n \"if\": \"inputs.can_sign_consent == `true`\",\n \"action\": \"set\"\n }\n ]\n }\n }\n },\n \"defaults\": \"<unknown>\",\n \"static_parameters\": [\n {\n \"default\": \"fahrenheit\",\n \"description\": \"Whether the temperature information should be fetched in Celsius or Fahrenheit\",\n \"name\": \"temperature_unit\",\n \"required\": false,\n \"type\": \"string\"\n }\n ],\n \"result\": \"<unknown>\",\n \"options\": {\n \"propagate_tool_result\": false\n }\n },\n \"service_id\": 123,\n \"id\": 123,\n \"last_updated_comments\": \"Updated to use new API endpoint\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.syllable.cloud/api/v1/tools/")
.header("Syllable-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"definition\": {\n \"tool\": {\n \"function\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": \"<unknown>\"\n },\n \"type\": \"function\"\n },\n \"type\": \"endpoint\",\n \"endpoint\": {\n \"url\": \"<string>\",\n \"timeout\": 45\n },\n \"context\": {\n \"task\": {\n \"id\": \"<string>\",\n \"config\": {},\n \"variables\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<unknown>\",\n \"valueFrom\": \"inputs.provided_dob == patient_dob\",\n \"description\": \"<string>\",\n \"title\": \"<string>\",\n \"format\": \"<string>\",\n \"pattern\": \"<string>\",\n \"enum\": [\n \"<string>\"\n ],\n \"examples\": [\n \"<unknown>\"\n ]\n }\n ],\n \"metadata\": {\n \"priority\": 123\n },\n \"tool\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n },\n \"type\": \"expression\",\n \"version\": \"v1alpha\",\n \"inputs\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"title\": \"<string>\",\n \"format\": \"<string>\",\n \"pattern\": \"<string>\",\n \"enum\": [\n \"<string>\"\n ],\n \"examples\": [\n \"<unknown>\"\n ],\n \"required\": true\n }\n ],\n \"expression\": \"inputs.can_sign_consent == `true`\",\n \"output\": null,\n \"on\": {\n \"start\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<unknown>\",\n \"valueFrom\": \"inputs.provided_dob == patient_dob\",\n \"if\": \"inputs.can_sign_consent == `true`\",\n \"action\": \"set\"\n }\n ],\n \"submit\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<unknown>\",\n \"valueFrom\": \"inputs.provided_dob == patient_dob\",\n \"if\": \"inputs.can_sign_consent == `true`\",\n \"action\": \"set\"\n }\n ]\n }\n }\n },\n \"defaults\": \"<unknown>\",\n \"static_parameters\": [\n {\n \"default\": \"fahrenheit\",\n \"description\": \"Whether the temperature information should be fetched in Celsius or Fahrenheit\",\n \"name\": \"temperature_unit\",\n \"required\": false,\n \"type\": \"string\"\n }\n ],\n \"result\": \"<unknown>\",\n \"options\": {\n \"propagate_tool_result\": false\n }\n },\n \"service_id\": 123,\n \"id\": 123,\n \"last_updated_comments\": \"Updated to use new API endpoint\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.syllable.cloud/api/v1/tools/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Syllable-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"definition\": {\n \"tool\": {\n \"function\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": \"<unknown>\"\n },\n \"type\": \"function\"\n },\n \"type\": \"endpoint\",\n \"endpoint\": {\n \"url\": \"<string>\",\n \"timeout\": 45\n },\n \"context\": {\n \"task\": {\n \"id\": \"<string>\",\n \"config\": {},\n \"variables\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<unknown>\",\n \"valueFrom\": \"inputs.provided_dob == patient_dob\",\n \"description\": \"<string>\",\n \"title\": \"<string>\",\n \"format\": \"<string>\",\n \"pattern\": \"<string>\",\n \"enum\": [\n \"<string>\"\n ],\n \"examples\": [\n \"<unknown>\"\n ]\n }\n ],\n \"metadata\": {\n \"priority\": 123\n },\n \"tool\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n },\n \"type\": \"expression\",\n \"version\": \"v1alpha\",\n \"inputs\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"title\": \"<string>\",\n \"format\": \"<string>\",\n \"pattern\": \"<string>\",\n \"enum\": [\n \"<string>\"\n ],\n \"examples\": [\n \"<unknown>\"\n ],\n \"required\": true\n }\n ],\n \"expression\": \"inputs.can_sign_consent == `true`\",\n \"output\": null,\n \"on\": {\n \"start\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<unknown>\",\n \"valueFrom\": \"inputs.provided_dob == patient_dob\",\n \"if\": \"inputs.can_sign_consent == `true`\",\n \"action\": \"set\"\n }\n ],\n \"submit\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<unknown>\",\n \"valueFrom\": \"inputs.provided_dob == patient_dob\",\n \"if\": \"inputs.can_sign_consent == `true`\",\n \"action\": \"set\"\n }\n ]\n }\n }\n },\n \"defaults\": \"<unknown>\",\n \"static_parameters\": [\n {\n \"default\": \"fahrenheit\",\n \"description\": \"Whether the temperature information should be fetched in Celsius or Fahrenheit\",\n \"name\": \"temperature_unit\",\n \"required\": false,\n \"type\": \"string\"\n }\n ],\n \"result\": \"<unknown>\",\n \"options\": {\n \"propagate_tool_result\": false\n }\n },\n \"service_id\": 123,\n \"id\": 123,\n \"last_updated_comments\": \"Updated to use new API endpoint\"\n}"
response = http.request(request)
puts response.read_body{
"name": "<string>",
"definition": {
"tool": {
"function": {
"name": "<string>",
"description": "<string>",
"parameters": "<unknown>"
},
"type": "function"
},
"type": "endpoint",
"endpoint": {
"url": "<string>",
"timeout": 45
},
"context": {
"task": {
"id": "<string>",
"config": {},
"variables": [
{
"name": "<string>",
"value": "<unknown>",
"valueFrom": "inputs.provided_dob == patient_dob",
"description": "<string>",
"title": "<string>",
"format": "<string>",
"pattern": "<string>",
"enum": [
"<string>"
],
"examples": [
"<unknown>"
]
}
],
"metadata": {
"priority": 123
},
"tool": {
"name": "<string>",
"description": "<string>"
},
"type": "expression",
"version": "v1alpha",
"inputs": [
{
"name": "<string>",
"description": "<string>",
"title": "<string>",
"format": "<string>",
"pattern": "<string>",
"enum": [
"<string>"
],
"examples": [
"<unknown>"
],
"required": true
}
],
"expression": "inputs.can_sign_consent == `true`",
"output": null,
"on": {
"start": [
{
"name": "<string>",
"value": "<unknown>",
"valueFrom": "inputs.provided_dob == patient_dob",
"if": "inputs.can_sign_consent == `true`",
"action": "set"
}
],
"submit": [
{
"name": "<string>",
"value": "<unknown>",
"valueFrom": "inputs.provided_dob == patient_dob",
"if": "inputs.can_sign_consent == `true`",
"action": "set"
}
]
}
}
},
"defaults": "<unknown>",
"static_parameters": [
{
"default": "fahrenheit",
"description": "Whether the temperature information should be fetched in Celsius or Fahrenheit",
"name": "temperature_unit",
"required": false,
"type": "string"
}
],
"result": "<unknown>",
"options": {
"propagate_tool_result": false
}
},
"service_id": 123,
"id": 123,
"last_updated": "2023-11-07T05:31:56Z",
"last_updated_by": "<string>",
"version_number": 123,
"last_updated_comments": "Updated to use new API endpoint",
"service_name": "<string>",
"prompts_info": [
{
"id": 123,
"name": "<string>"
}
],
"agents_info": [
{
"id": 123,
"name": "<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 update an existing tool.
The name of the tool
"Weather Fetcher"
The definition of the tool
Show child attributes
Show child attributes
{
"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"
}Internal ID of the service to which the tool belongs
1
The internal ID of the tool
1
Comments for the most recent edit to the tool.
"Updated to use new API endpoint"
Response
Successful Response
Response model for tool operations. A tool is a function that an agent can call to perform actions like accessing databases, making API calls, or processing data. For an agent to have access to a tool, the prompt associated with that agent should be linked to the tool and include instructions to use it. For more information, see Console docs.
The name of the tool
"Weather Fetcher"
The definition of the tool
Show child attributes
Show child attributes
{
"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"
}Internal ID of the service to which the tool belongs
1
The internal ID of the tool
1
The timestamp of the most recent update to the tool
The email of the user who last updated the tool
"user@email.com"
Highest tools_history snapshot version for this tool; the tools row defaults to 1.
1
Comments for the most recent edit to the tool.
"Updated to use new API endpoint"
The name of the service to which the tool belongs
IDs and names of the prompts linked to the tool
Show child attributes
Show child attributes
IDs and names of the agents linked to the tool via a prompt
Show child attributes
Show child attributes
Validation issues found in the tool definition. Warnings and infos are informational; errors block the save.
Show child attributes
Show child attributes

