When a user interacts with the Syllable system, they do so by communicating with an agent. An agent is linked to a prompt, a custom message, and one or more channel targets to define its behavior and capabilities.

Example Usage

import { AgentResponse } from "syllable-sdk/models/components";

let value: AgentResponse = {
  name: "<value>",
  type: "ca_v1",
  promptId: 602763,
  customMessageId: 544883,
  timezone: "America/New_York",
  languages: [
    "en-US",
    "es-US",
  ],
  variables: {
    "key": "<value>",
  },
  toolHeaders: {
    "key": "<value>",
  },
  id: 645894,
  updatedAt: new Date("2024-04-24T14:17:38.418Z"),
  lastUpdatedBy: "<value>",
  prompt: {
    name: "<value>",
    type: "<value>",
    llmConfig: {
      version: "2024-05-13",
      apiVersion: "2024-06-01",
    },
    id: 891773,
    lastUpdated: "<value>",
    lastUpdatedBy: "user@email.com",
  },
  customMessage: {
    name: "<value>",
    text: "<value>",
    rules: [
      {
        description:
          "busily jive hawk gee basic minus hence for know gleefully",
        timeRangeStart: "09:00",
        timeRangeEnd: "17:00",
        date: "2025-01-01",
        daysOfWeek: [
          "mo",
          "tu",
          "we",
          "th",
          "fr",
        ],
        invert: false,
        text: "Sorry, we're closed today",
      },
    ],
    id: 118727,
    updatedAt: new Date("2023-12-15T12:13:46.383Z"),
    lastUpdatedBy: "user@email.com",
  },
  channelTargets: [],
  tools: [
    {
      name: "Weather Fetcher",
      definition: {
        tool: {
          function: {
            name: "weather_fetcher",
            description: "Fetches weather data",
            parameters: "<value>",
          },
        },
        endpoint: {
          url: "https://api.example.com",
          method: "get",
          argumentLocation: "body",
        },
        defaults: {
          "key": {
            transform: {
              action: "default",
              when: {
                key: "key",
                value: "value",
              },
            },
          },
        },
      },
      serviceId: 566602,
      id: 265389,
      lastUpdated: new Date("2024-07-27T11:31:00.474Z"),
      lastUpdatedBy: "user@email.com",
    },
  ],
};

Fields

FieldTypeRequiredDescriptionExample
namestringTRUEThe agent name
descriptionstringFALSEThe agent description
labelstringFALSEThe agent label
typestringTRUEThe agent type. Can be an arbitrary stringca_v1
promptIdnumberTRUEID of the prompt associated with the agent
customMessageIdnumberTRUEID of the custom message that should be delivered at the beginning of a conversation with the agent
timezonestringTRUEThe time zone in which the agent operatesAmerica/New_York
promptToolDefaultscomponents.AgentToolDefaults[]FALSEUser-configured parameter values for the agent’s tools
languagesstring[]FALSEBCP 47 codes of languages the agent supports[
“en-US”,
“es-US”
]
variablesRecordTRUECustom context variables for the conversation session. Keys should be prefixed with “vars.”.
toolHeadersRecordTRUEOptional headers to include in tool calls for agent.
agentInitiatedbooleanFALSEWhether the agent initiates conversation with a user after the custom_message is delivered
idnumberTRUEThe agent ID
updatedAtDateTRUETimestamp of most recent update
lastUpdatedBystringTRUEEmail of the user who last updated the agent
promptcomponents.PromptResponseFALSEThe prompt associated with the agent.
customMessagecomponents.CustomMessageResponseFALSEThe custom message associated with the agent. Will be delivered as a greeting at the beginning of a conversation.
channelTargetscomponents.ChannelTargetResponse[]FALSEChannel targets associated with the agent
toolscomponents.ToolResponse[]FALSETools associated with the agent