POST
/
api
/
v1
/
data_sources
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.create(request={
        "name": "Rain",
        "description": "Information about rain.",
        "labels": [
            "Weather Info",
        ],
        "chunk": False,
        "chunk_delimiter": "",
        "text": ("The following are names and addresses of pizza shops.\n"
        "\n"
        "Cool Pizza, 123 Main St.\n"
        "\n"
        "Really Good Pizza, 456 Water St.\n"
        "\n"
        "The Best Pizza, 789 Circle Dr."),
    })

    # Handle response
    print(res)
{
  "name": "Rain",
  "description": "Information about rain.",
  "labels": [
    "Weather Info"
  ],
  "chunk": false,
  "chunk_delimiter": "",
  "id": 1,
  "edit_comments": "Added new info",
  "updated_at": "2023-11-07T05:31:56Z",
  "last_updated_by": "user@email.com",
  "text": "<string>"
}

Authorizations

Syllable-API-Key
string
header
required

Body

application/json

Request model to create a data source.

name
string
required

The data source name. Must be unique within suborg. Cannot contain whitespace.

Example:

"Rain"

chunk
boolean
required

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.)

Example:

false

text
string
required

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.

Example:

"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
string | null

The description of the data source.

Example:

"Information about rain."

labels
string[]

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.

Example:
["Weather Info"]
chunk_delimiter
string | null

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.)

Example:

""

Response

200
application/json
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.

name
string
required

The data source name. Must be unique within suborg. Cannot contain whitespace.

Example:

"Rain"

chunk
boolean
required

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.)

Example:

false

id
integer
required

The data source ID.

Example:

1

updated_at
string
required

Timestamp of most recent update

last_updated_by
string | null
required

Email of the user who last updated the data source

Example:

"user@email.com"

text
string
required

Information that the data source will provide to the agent accessing it.

description
string | null

The description of the data source.

Example:

"Information about rain."

labels
string[]

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.

Example:
["Weather Info"]
chunk_delimiter
string | null

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.)

Example:

""

edit_comments
string | null

The comments for the most recent edit to the data source

Example:

"Added new info"