import { SyllableSDK } from "syllable-sdk";
const syllableSDK = new SyllableSDK({
apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
});
async function run() {
const result = await syllableSDK.dataSources.update({
name: "Rain",
description: "Information about rain.",
labels: [
"Weather Info",
],
chunk: false,
chunkDelimiter: "",
id: 1,
editComments: "Added new info",
text: "The following are names and addresses of pizza shops.\n\nCool Pizza, 123 Main St.\n\nReally Good Pizza, 456 Water St.\n\nThe Best Pizza, 789 Circle Dr.",
});
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.data_sources.update(request={
"name": "Rain",
"description": "Information about rain.",
"labels": [
"Weather Info",
],
"chunk": False,
"chunk_delimiter": "",
"id": 1,
"edit_comments": "Added new info",
"text": "The following are names and addresses of pizza shops.\n\nCool Pizza, 123 Main St.\n\nReally Good Pizza, 456 Water St.\n\nThe Best Pizza, 789 Circle Dr.",
})
# Handle response
print(res)curl --request PUT \
--url https://api.syllable.cloud/api/v1/data_sources/ \
--header 'Content-Type: application/json' \
--header 'Syllable-API-Key: <api-key>' \
--data '
{
"name": "Rain",
"chunk": false,
"id": 1,
"text": "The following are names and addresses of pizza shops.\n\nCool Pizza, 123 Main St.\n\nReally Good Pizza, 456 Water St.\n\nThe Best Pizza, 789 Circle Dr.",
"description": "Information about rain.",
"labels": [
"Weather Info"
],
"chunk_delimiter": "",
"edit_comments": "Added new info"
}
'const options = {
method: 'PUT',
headers: {'Syllable-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Rain',
chunk: false,
id: 1,
text: 'The following are names and addresses of pizza shops.\n\nCool Pizza, 123 Main St.\n\nReally Good Pizza, 456 Water St.\n\nThe Best Pizza, 789 Circle Dr.',
description: 'Information about rain.',
labels: ['Weather Info'],
chunk_delimiter: '',
edit_comments: 'Added new info'
})
};
fetch('https://api.syllable.cloud/api/v1/data_sources/', 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/data_sources/",
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' => 'Rain',
'chunk' => false,
'id' => 1,
'text' => 'The following are names and addresses of pizza shops.
Cool Pizza, 123 Main St.
Really Good Pizza, 456 Water St.
The Best Pizza, 789 Circle Dr.',
'description' => 'Information about rain.',
'labels' => [
'Weather Info'
],
'chunk_delimiter' => '',
'edit_comments' => 'Added new info'
]),
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/data_sources/"
payload := strings.NewReader("{\n \"name\": \"Rain\",\n \"chunk\": false,\n \"id\": 1,\n \"text\": \"The following are names and addresses of pizza shops.\\n\\nCool Pizza, 123 Main St.\\n\\nReally Good Pizza, 456 Water St.\\n\\nThe Best Pizza, 789 Circle Dr.\",\n \"description\": \"Information about rain.\",\n \"labels\": [\n \"Weather Info\"\n ],\n \"chunk_delimiter\": \"\",\n \"edit_comments\": \"Added new info\"\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/data_sources/")
.header("Syllable-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Rain\",\n \"chunk\": false,\n \"id\": 1,\n \"text\": \"The following are names and addresses of pizza shops.\\n\\nCool Pizza, 123 Main St.\\n\\nReally Good Pizza, 456 Water St.\\n\\nThe Best Pizza, 789 Circle Dr.\",\n \"description\": \"Information about rain.\",\n \"labels\": [\n \"Weather Info\"\n ],\n \"chunk_delimiter\": \"\",\n \"edit_comments\": \"Added new info\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.syllable.cloud/api/v1/data_sources/")
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\": \"Rain\",\n \"chunk\": false,\n \"id\": 1,\n \"text\": \"The following are names and addresses of pizza shops.\\n\\nCool Pizza, 123 Main St.\\n\\nReally Good Pizza, 456 Water St.\\n\\nThe Best Pizza, 789 Circle Dr.\",\n \"description\": \"Information about rain.\",\n \"labels\": [\n \"Weather Info\"\n ],\n \"chunk_delimiter\": \"\",\n \"edit_comments\": \"Added new info\"\n}"
response = http.request(request)
puts response.read_body{
"name": "Rain",
"chunk": false,
"id": 1,
"updated_at": "2023-11-07T05:31:56Z",
"last_updated_by": "user@email.com",
"text": "<string>",
"description": "Information about rain.",
"labels": [
"Weather Info"
],
"chunk_delimiter": "",
"edit_comments": "Added new info"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Update Data Source
Update an existing data source.
import { SyllableSDK } from "syllable-sdk";
const syllableSDK = new SyllableSDK({
apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
});
async function run() {
const result = await syllableSDK.dataSources.update({
name: "Rain",
description: "Information about rain.",
labels: [
"Weather Info",
],
chunk: false,
chunkDelimiter: "",
id: 1,
editComments: "Added new info",
text: "The following are names and addresses of pizza shops.\n\nCool Pizza, 123 Main St.\n\nReally Good Pizza, 456 Water St.\n\nThe Best Pizza, 789 Circle Dr.",
});
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.data_sources.update(request={
"name": "Rain",
"description": "Information about rain.",
"labels": [
"Weather Info",
],
"chunk": False,
"chunk_delimiter": "",
"id": 1,
"edit_comments": "Added new info",
"text": "The following are names and addresses of pizza shops.\n\nCool Pizza, 123 Main St.\n\nReally Good Pizza, 456 Water St.\n\nThe Best Pizza, 789 Circle Dr.",
})
# Handle response
print(res)curl --request PUT \
--url https://api.syllable.cloud/api/v1/data_sources/ \
--header 'Content-Type: application/json' \
--header 'Syllable-API-Key: <api-key>' \
--data '
{
"name": "Rain",
"chunk": false,
"id": 1,
"text": "The following are names and addresses of pizza shops.\n\nCool Pizza, 123 Main St.\n\nReally Good Pizza, 456 Water St.\n\nThe Best Pizza, 789 Circle Dr.",
"description": "Information about rain.",
"labels": [
"Weather Info"
],
"chunk_delimiter": "",
"edit_comments": "Added new info"
}
'const options = {
method: 'PUT',
headers: {'Syllable-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Rain',
chunk: false,
id: 1,
text: 'The following are names and addresses of pizza shops.\n\nCool Pizza, 123 Main St.\n\nReally Good Pizza, 456 Water St.\n\nThe Best Pizza, 789 Circle Dr.',
description: 'Information about rain.',
labels: ['Weather Info'],
chunk_delimiter: '',
edit_comments: 'Added new info'
})
};
fetch('https://api.syllable.cloud/api/v1/data_sources/', 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/data_sources/",
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' => 'Rain',
'chunk' => false,
'id' => 1,
'text' => 'The following are names and addresses of pizza shops.
Cool Pizza, 123 Main St.
Really Good Pizza, 456 Water St.
The Best Pizza, 789 Circle Dr.',
'description' => 'Information about rain.',
'labels' => [
'Weather Info'
],
'chunk_delimiter' => '',
'edit_comments' => 'Added new info'
]),
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/data_sources/"
payload := strings.NewReader("{\n \"name\": \"Rain\",\n \"chunk\": false,\n \"id\": 1,\n \"text\": \"The following are names and addresses of pizza shops.\\n\\nCool Pizza, 123 Main St.\\n\\nReally Good Pizza, 456 Water St.\\n\\nThe Best Pizza, 789 Circle Dr.\",\n \"description\": \"Information about rain.\",\n \"labels\": [\n \"Weather Info\"\n ],\n \"chunk_delimiter\": \"\",\n \"edit_comments\": \"Added new info\"\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/data_sources/")
.header("Syllable-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Rain\",\n \"chunk\": false,\n \"id\": 1,\n \"text\": \"The following are names and addresses of pizza shops.\\n\\nCool Pizza, 123 Main St.\\n\\nReally Good Pizza, 456 Water St.\\n\\nThe Best Pizza, 789 Circle Dr.\",\n \"description\": \"Information about rain.\",\n \"labels\": [\n \"Weather Info\"\n ],\n \"chunk_delimiter\": \"\",\n \"edit_comments\": \"Added new info\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.syllable.cloud/api/v1/data_sources/")
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\": \"Rain\",\n \"chunk\": false,\n \"id\": 1,\n \"text\": \"The following are names and addresses of pizza shops.\\n\\nCool Pizza, 123 Main St.\\n\\nReally Good Pizza, 456 Water St.\\n\\nThe Best Pizza, 789 Circle Dr.\",\n \"description\": \"Information about rain.\",\n \"labels\": [\n \"Weather Info\"\n ],\n \"chunk_delimiter\": \"\",\n \"edit_comments\": \"Added new info\"\n}"
response = http.request(request)
puts response.read_body{
"name": "Rain",
"chunk": false,
"id": 1,
"updated_at": "2023-11-07T05:31:56Z",
"last_updated_by": "user@email.com",
"text": "<string>",
"description": "Information about rain.",
"labels": [
"Weather Info"
],
"chunk_delimiter": "",
"edit_comments": "Added new info"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Body
Request model to update an existing data source.
The data source name. Must be unique within suborg. Cannot contain whitespace.
"Rain"
Whether the content should be split into smaller chunks. (This feature is coming in the future - currently this value will always be treated as False.)
false
The data source ID.
1
Information that the data source will provide to the agent accessing it. It is recommended to include a sentence at the beginning providing context to the LLM for the information in the data source.
"The following are names and addresses of pizza shops.\n\nCool Pizza, 123 Main St.\n\nReally Good Pizza, 456 Water St.\n\nThe Best Pizza, 789 Circle Dr."
The description of the data source.
"Information about rain."
Searchable labels for the data source. Can be included in agent.prompt_tool_defaults for a given tool to give the agent access to data sources with those labels when calling that tool.
["Weather Info"]
String that should be treated as delimiter between intended chunks. (This feature is coming in the future - currently this value will always be treated as None.)
""
The comments for the most recent edit to the data source
"Added new info"
Response
Successful Response
Metadata about a data source, along with the text. A data source is a blob of text that can be made available to an agent's general info tools to provide more context to the agent when generating its responses. For more information, see Console docs.
The data source name. Must be unique within suborg. Cannot contain whitespace.
"Rain"
Whether the content should be split into smaller chunks. (This feature is coming in the future - currently this value will always be treated as False.)
false
The data source ID.
1
Timestamp of most recent update
Email of the user who last updated the data source
"user@email.com"
Information that the data source will provide to the agent accessing it.
The description of the data source.
"Information about rain."
Searchable labels for the data source. Can be included in agent.prompt_tool_defaults for a given tool to give the agent access to data sources with those labels when calling that tool.
["Weather Info"]
String that should be treated as delimiter between intended chunks. (This feature is coming in the future - currently this value will always be treated as None.)
""
The comments for the most recent edit to the data source
"Added new info"

