(agents)

Overview

Operations related to agent configuration. 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.

Available Operations

list

List the existing agents

Example Usage

import { SyllableSDK } from "syllable-sdk";

const syllableSDK = new SyllableSDK({
  apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
});

async function run() {
  const result = await syllableSDK.agents.list({});

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { SyllableSDKCore } from "syllable-sdk/core.js";
import { agentsList } from "syllable-sdk/funcs/agentsList.js";

// Use `SyllableSDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const syllableSDK = new SyllableSDKCore({
  apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
});

async function run() {
  const res = await agentsList(syllableSDK, {});

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

ParameterTypeRequiredDescription
requestoperations.AgentListRequestTRUEThe request object to use for the request.
optionsRequestOptionsFALSEUsed to set various options for making HTTP requests.
options.fetchOptionsRequestInitFALSEOptions that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retriesRetryConfigFALSEEnables retrying HTTP requests under certain failure conditions.

Response

Promise<components.ListResponseAgentResponse>

Errors

Error TypeStatus CodeContent Type
errors.HTTPValidationError422application/json
errors.SDKError4XX, 5XX*/*

create

Create a new agent

Example Usage

import { SyllableSDK } from "syllable-sdk";

const syllableSDK = new SyllableSDK({
  apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
});

async function run() {
  const result = await syllableSDK.agents.create({
    name: "<value>",
    type: "ca_v1",
    promptId: 486589,
    customMessageId: 638424,
    timezone: "America/New_York",
    languages: [
      "en-US",
      "es-US",
    ],
    variables: {

    },
    toolHeaders: {
      "key": "<value>",
      "key1": "<value>",
    },
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { SyllableSDKCore } from "syllable-sdk/core.js";
import { agentsCreate } from "syllable-sdk/funcs/agentsCreate.js";

// Use `SyllableSDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const syllableSDK = new SyllableSDKCore({
  apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
});

async function run() {
  const res = await agentsCreate(syllableSDK, {
    name: "<value>",
    type: "ca_v1",
    promptId: 486589,
    customMessageId: 638424,
    timezone: "America/New_York",
    languages: [
      "en-US",
      "es-US",
    ],
    variables: {
  
    },
    toolHeaders: {
      "key": "<value>",
      "key1": "<value>",
    },
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

ParameterTypeRequiredDescription
requestcomponents.AgentCreateTRUEThe request object to use for the request.
optionsRequestOptionsFALSEUsed to set various options for making HTTP requests.
options.fetchOptionsRequestInitFALSEOptions that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retriesRetryConfigFALSEEnables retrying HTTP requests under certain failure conditions.

Response

Promise<components.AgentResponse>

Errors

Error TypeStatus CodeContent Type
errors.HTTPValidationError422application/json
errors.SDKError4XX, 5XX*/*

update

Update an existing agent

Example Usage

import { SyllableSDK } from "syllable-sdk";

const syllableSDK = new SyllableSDK({
  apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
});

async function run() {
  const result = await syllableSDK.agents.update({
    name: "<value>",
    type: "ca_v1",
    promptId: 857478,
    customMessageId: 597129,
    timezone: "America/Chicago",
    languages: [
      "en-US",
      "es-US",
    ],
    variables: {
      "key": "<value>",
      "key1": "<value>",
      "key2": "<value>",
    },
    toolHeaders: {
      "key": "<value>",
      "key1": "<value>",
    },
    id: 488852,
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { SyllableSDKCore } from "syllable-sdk/core.js";
import { agentsUpdate } from "syllable-sdk/funcs/agentsUpdate.js";

// Use `SyllableSDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const syllableSDK = new SyllableSDKCore({
  apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
});

async function run() {
  const res = await agentsUpdate(syllableSDK, {
    name: "<value>",
    type: "ca_v1",
    promptId: 857478,
    customMessageId: 597129,
    timezone: "America/Chicago",
    languages: [
      "en-US",
      "es-US",
    ],
    variables: {
      "key": "<value>",
      "key1": "<value>",
      "key2": "<value>",
    },
    toolHeaders: {
      "key": "<value>",
      "key1": "<value>",
    },
    id: 488852,
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

ParameterTypeRequiredDescription
requestcomponents.AgentUpdateTRUEThe request object to use for the request.
optionsRequestOptionsFALSEUsed to set various options for making HTTP requests.
options.fetchOptionsRequestInitFALSEOptions that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retriesRetryConfigFALSEEnables retrying HTTP requests under certain failure conditions.

Response

Promise<components.AgentResponse>

Errors

Error TypeStatus CodeContent Type
errors.HTTPValidationError422application/json
errors.SDKError4XX, 5XX*/*

getById

Get an agent by ID.

Example Usage

import { SyllableSDK } from "syllable-sdk";

const syllableSDK = new SyllableSDK({
  apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
});

async function run() {
  const result = await syllableSDK.agents.getById({
    agentId: 931598,
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { SyllableSDKCore } from "syllable-sdk/core.js";
import { agentsGetById } from "syllable-sdk/funcs/agentsGetById.js";

// Use `SyllableSDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const syllableSDK = new SyllableSDKCore({
  apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
});

async function run() {
  const res = await agentsGetById(syllableSDK, {
    agentId: 931598,
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

ParameterTypeRequiredDescription
requestoperations.AgentGetByIdRequestTRUEThe request object to use for the request.
optionsRequestOptionsFALSEUsed to set various options for making HTTP requests.
options.fetchOptionsRequestInitFALSEOptions that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retriesRetryConfigFALSEEnables retrying HTTP requests under certain failure conditions.

Response

Promise<components.AgentResponse>

Errors

Error TypeStatus CodeContent Type
errors.HTTPValidationError422application/json
errors.SDKError4XX, 5XX*/*

delete

Delete Agent

Example Usage

import { SyllableSDK } from "syllable-sdk";

const syllableSDK = new SyllableSDK({
  apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
});

async function run() {
  const result = await syllableSDK.agents.delete({
    agentId: 545907,
    reason: "<value>",
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { SyllableSDKCore } from "syllable-sdk/core.js";
import { agentsDelete } from "syllable-sdk/funcs/agentsDelete.js";

// Use `SyllableSDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const syllableSDK = new SyllableSDKCore({
  apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
});

async function run() {
  const res = await agentsDelete(syllableSDK, {
    agentId: 545907,
    reason: "<value>",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

ParameterTypeRequiredDescription
requestoperations.AgentDeleteRequestTRUEThe request object to use for the request.
optionsRequestOptionsFALSEUsed to set various options for making HTTP requests.
options.fetchOptionsRequestInitFALSEOptions that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retriesRetryConfigFALSEEnables retrying HTTP requests under certain failure conditions.

Response

Promise\ANY>

Errors

Error TypeStatus CodeContent Type
errors.HTTPValidationError422application/json
errors.SDKError4XX, 5XX*/*

agentGetAvailableVoices

Get available agent voices.

Example Usage

import { SyllableSDK } from "syllable-sdk";

const syllableSDK = new SyllableSDK({
  apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
});

async function run() {
  const result = await syllableSDK.agents.agentGetAvailableVoices();

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { SyllableSDKCore } from "syllable-sdk/core.js";
import { agentsAgentGetAvailableVoices } from "syllable-sdk/funcs/agentsAgentGetAvailableVoices.js";

// Use `SyllableSDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const syllableSDK = new SyllableSDKCore({
  apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
});

async function run() {
  const res = await agentsAgentGetAvailableVoices(syllableSDK);

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

ParameterTypeRequiredDescription
optionsRequestOptionsFALSEUsed to set various options for making HTTP requests.
options.fetchOptionsRequestInitFALSEOptions that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retriesRetryConfigFALSEEnables retrying HTTP requests under certain failure conditions.

Response

Promise<components.AgentVoice[]>

Errors

Error TypeStatus CodeContent Type
errors.SDKError4XX, 5XX*/*