(agents.test)

Overview

Operations for testing agents with live text. These endpoints allow sending messages to an agent and receiving its responses.

Available Operations

sendTestMessage

Send a new message

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.test.sendTestMessage({
    serviceName: "<value>",
    source: "<value>",
    testId: "<id>",
    agentId: "<id>",
    orgName: "<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 { agentsTestSendTestMessage } from "syllable-sdk/funcs/agentsTestSendTestMessage.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 agentsTestSendTestMessage(syllableSDK, {
    serviceName: "<value>",
    source: "<value>",
    testId: "<id>",
    agentId: "<id>",
    orgName: "<value>",
  });

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

  const { value: result } = res;

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

run();

Parameters

ParameterTypeRequiredDescription
requestcomponents.TestMessageTRUEThe 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.TestMessageResponse>

Errors

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