Create a new tool
import os
import syllable_sdk
from syllable_sdk import SyllableSDK
with SyllableSDK(
api_key_header=os.getenv("SYLLABLESDK_API_KEY_HEADER", ""),
) as ss_client:
res = ss_client.tools.create(request={
"name": "Weather Fetcher",
"definition": {
"type": syllable_sdk.Type.ENDPOINT,
"tool": {
"function": {
"name": "get_weather",
"description": "Get the weather for a city",
"parameters": {
},
},
},
"endpoint": {
"url": "https://api.example.com",
"method": syllable_sdk.ToolHTTPMethod.POST,
"argument_location": syllable_sdk.ToolArgumentLocation.PATH,
},
"defaults": "<value>",
"static_parameters": [
{
"name": "temperature_unit",
"description": "Whether the temperature information should be fetched in Celsius or Fahrenheit",
"required": False,
"type": syllable_sdk.StaticToolParameterType.STRING,
"default": "fahrenheit",
},
],
},
"service_id": 1,
})
# Handle response
print(res)
{
"name": "Weather Fetcher",
"definition": {
"endpoint": {
"argument_location": "query",
"method": "get",
"url": "https://api.open-meteo.com/v1/forecast"
},
"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_comments": "Updated to use new API endpoint",
"service_name": "<string>",
"prompts_info": [
{
"id": 1,
"name": "Test Prompt"
}
],
"agents_info": [
{
"id": 1,
"name": "Test Agent"
}
],
"last_updated": "2023-11-07T05:31:56Z",
"last_updated_by": "user@email.com"
}
Request model to create a tool.
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.
import os
import syllable_sdk
from syllable_sdk import SyllableSDK
with SyllableSDK(
api_key_header=os.getenv("SYLLABLESDK_API_KEY_HEADER", ""),
) as ss_client:
res = ss_client.tools.create(request={
"name": "Weather Fetcher",
"definition": {
"type": syllable_sdk.Type.ENDPOINT,
"tool": {
"function": {
"name": "get_weather",
"description": "Get the weather for a city",
"parameters": {
},
},
},
"endpoint": {
"url": "https://api.example.com",
"method": syllable_sdk.ToolHTTPMethod.POST,
"argument_location": syllable_sdk.ToolArgumentLocation.PATH,
},
"defaults": "<value>",
"static_parameters": [
{
"name": "temperature_unit",
"description": "Whether the temperature information should be fetched in Celsius or Fahrenheit",
"required": False,
"type": syllable_sdk.StaticToolParameterType.STRING,
"default": "fahrenheit",
},
],
},
"service_id": 1,
})
# Handle response
print(res)
{
"name": "Weather Fetcher",
"definition": {
"endpoint": {
"argument_location": "query",
"method": "get",
"url": "https://api.open-meteo.com/v1/forecast"
},
"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_comments": "Updated to use new API endpoint",
"service_name": "<string>",
"prompts_info": [
{
"id": 1,
"name": "Test Prompt"
}
],
"agents_info": [
{
"id": 1,
"name": "Test Agent"
}
],
"last_updated": "2023-11-07T05:31:56Z",
"last_updated_by": "user@email.com"
}
Create a new tool
import os
import syllable_sdk
from syllable_sdk import SyllableSDK
with SyllableSDK(
api_key_header=os.getenv("SYLLABLESDK_API_KEY_HEADER", ""),
) as ss_client:
res = ss_client.tools.create(request={
"name": "Weather Fetcher",
"definition": {
"type": syllable_sdk.Type.ENDPOINT,
"tool": {
"function": {
"name": "get_weather",
"description": "Get the weather for a city",
"parameters": {
},
},
},
"endpoint": {
"url": "https://api.example.com",
"method": syllable_sdk.ToolHTTPMethod.POST,
"argument_location": syllable_sdk.ToolArgumentLocation.PATH,
},
"defaults": "<value>",
"static_parameters": [
{
"name": "temperature_unit",
"description": "Whether the temperature information should be fetched in Celsius or Fahrenheit",
"required": False,
"type": syllable_sdk.StaticToolParameterType.STRING,
"default": "fahrenheit",
},
],
},
"service_id": 1,
})
# Handle response
print(res)
{
"name": "Weather Fetcher",
"definition": {
"endpoint": {
"argument_location": "query",
"method": "get",
"url": "https://api.open-meteo.com/v1/forecast"
},
"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_comments": "Updated to use new API endpoint",
"service_name": "<string>",
"prompts_info": [
{
"id": 1,
"name": "Test Prompt"
}
],
"agents_info": [
{
"id": 1,
"name": "Test Agent"
}
],
"last_updated": "2023-11-07T05:31:56Z",
"last_updated_by": "user@email.com"
}
Request model to create a tool.
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.
import os
import syllable_sdk
from syllable_sdk import SyllableSDK
with SyllableSDK(
api_key_header=os.getenv("SYLLABLESDK_API_KEY_HEADER", ""),
) as ss_client:
res = ss_client.tools.create(request={
"name": "Weather Fetcher",
"definition": {
"type": syllable_sdk.Type.ENDPOINT,
"tool": {
"function": {
"name": "get_weather",
"description": "Get the weather for a city",
"parameters": {
},
},
},
"endpoint": {
"url": "https://api.example.com",
"method": syllable_sdk.ToolHTTPMethod.POST,
"argument_location": syllable_sdk.ToolArgumentLocation.PATH,
},
"defaults": "<value>",
"static_parameters": [
{
"name": "temperature_unit",
"description": "Whether the temperature information should be fetched in Celsius or Fahrenheit",
"required": False,
"type": syllable_sdk.StaticToolParameterType.STRING,
"default": "fahrenheit",
},
],
},
"service_id": 1,
})
# Handle response
print(res)
{
"name": "Weather Fetcher",
"definition": {
"endpoint": {
"argument_location": "query",
"method": "get",
"url": "https://api.open-meteo.com/v1/forecast"
},
"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_comments": "Updated to use new API endpoint",
"service_name": "<string>",
"prompts_info": [
{
"id": 1,
"name": "Test Prompt"
}
],
"agents_info": [
{
"id": 1,
"name": "Test Agent"
}
],
"last_updated": "2023-11-07T05:31:56Z",
"last_updated_by": "user@email.com"
}