(languageGroups)

Overview

Operations related to language groups. A language group is a collection of language, voice, and DTMF configuration that can be linked to an agent to define the languages and voices it supports.

Available Operations

  • list - List Language Groups
  • create - Create Language Group
  • update - Update Language Group
  • getById - Get Language Group
  • delete - Delete Language Group

list

Fetch language groups.

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.languageGroups.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 { languageGroupsList } from "syllable-sdk/funcs/languageGroupsList.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 languageGroupsList(syllableSDK, {});

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

  const { value: result } = res;

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

run();

Parameters

ParameterTypeRequiredDescription
requestoperations.LanguageGroupsListRequestTRUEThe 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.ListResponseLanguageGroupResponse>

Errors

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

create

Create a new language group.

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.languageGroups.create({
    name: "Call Center 1 Languages",
    description: "Languages spoken by operators at Call Center 1",
    languageConfigs: [
      {
        languageCode: "es-US",
        voiceProvider: "ElevenLabs",
        voiceDisplayName: "Brian",
        dtmfCode: 1,
      },
    ],
    skipCurrentLanguageInMessage: true,
  });

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

run();

Standalone function

The standalone function version of this method:

import { SyllableSDKCore } from "syllable-sdk/core.js";
import { languageGroupsCreate } from "syllable-sdk/funcs/languageGroupsCreate.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 languageGroupsCreate(syllableSDK, {
    name: "Call Center 1 Languages",
    description: "Languages spoken by operators at Call Center 1",
    languageConfigs: [
      {
        languageCode: "es-US",
        voiceProvider: "ElevenLabs",
        voiceDisplayName: "Brian",
        dtmfCode: 1,
      },
    ],
    skipCurrentLanguageInMessage: true,
  });

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

  const { value: result } = res;

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

run();

Parameters

ParameterTypeRequiredDescription
requestcomponents.LanguageGroupCreateRequestTRUEThe 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.LanguageGroupResponse>

Errors

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

update

Update an existing language group

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.languageGroups.update({
    name: "Call Center 1 Languages",
    description: "Languages spoken by operators at Call Center 1",
    languageConfigs: [
      {
        languageCode: "es-US",
        voiceProvider: "ElevenLabs",
        voiceDisplayName: "Will",
        dtmfCode: 1,
      },
      {
        languageCode: "es-US",
        voiceProvider: "ElevenLabs",
        voiceDisplayName: "Will",
        dtmfCode: 1,
      },
      {
        languageCode: "yue-HK",
        voiceProvider: "Google",
        voiceDisplayName: "George",
        dtmfCode: 1,
      },
    ],
    skipCurrentLanguageInMessage: true,
    id: 1,
    editComments: "Added Spanish support.",
  });

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

run();

Standalone function

The standalone function version of this method:

import { SyllableSDKCore } from "syllable-sdk/core.js";
import { languageGroupsUpdate } from "syllable-sdk/funcs/languageGroupsUpdate.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 languageGroupsUpdate(syllableSDK, {
    name: "Call Center 1 Languages",
    description: "Languages spoken by operators at Call Center 1",
    languageConfigs: [
      {
        languageCode: "es-US",
        voiceProvider: "ElevenLabs",
        voiceDisplayName: "Will",
        dtmfCode: 1,
      },
      {
        languageCode: "es-US",
        voiceProvider: "ElevenLabs",
        voiceDisplayName: "Will",
        dtmfCode: 1,
      },
      {
        languageCode: "yue-HK",
        voiceProvider: "Google",
        voiceDisplayName: "George",
        dtmfCode: 1,
      },
    ],
    skipCurrentLanguageInMessage: true,
    id: 1,
    editComments: "Added Spanish support.",
  });

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

  const { value: result } = res;

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

run();

Parameters

ParameterTypeRequiredDescription
requestcomponents.LanguageGroupUpdateRequestTRUEThe 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.LanguageGroupResponse>

Errors

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

getById

Fetch a given language group.

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.languageGroups.getById({
    languageGroupId: 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 { languageGroupsGetById } from "syllable-sdk/funcs/languageGroupsGetById.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 languageGroupsGetById(syllableSDK, {
    languageGroupId: 931598,
  });

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

  const { value: result } = res;

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

run();

Parameters

ParameterTypeRequiredDescription
requestoperations.LanguageGroupsGetByIdRequestTRUEThe 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.LanguageGroupResponse>

Errors

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

delete

Delete a language group.

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.languageGroups.delete({
    languageGroupId: 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 { languageGroupsDelete } from "syllable-sdk/funcs/languageGroupsDelete.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 languageGroupsDelete(syllableSDK, {
    languageGroupId: 545907,
    reason: "<value>",
  });

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

  const { value: result } = res;

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

run();

Parameters

ParameterTypeRequiredDescription
requestoperations.LanguageGroupsDeleteRequestTRUEThe 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*/*