Skip to main content

@wildix/xbees-users-client > CreateBotCommand

CreateBotCommand class

Signature:

export declare class CreateBotCommand extends CreateBotCommand_base 

Extends: CreateBotCommand_base

Example

Use a bare-bones client and the command you need to make an API call.

import { UsersClient, CreateBotCommand } from "@wildix/xbees-users-client"; // ES Modules import
// const { UsersClient, CreateBotCommand } = require("@wildix/xbees-users-client"); // CommonJS import
const client = new UsersClient(config);
const input = { // CreateBotInput
name: "STRING_VALUE", // required
picture: "STRING_VALUE",
searchable: true || false,
access: "EVERYBODY" || "ORGANIZATION",
company: "STRING_VALUE",
callback: { // BotCallback
endpoint: { // BotEndpoint Union: only one key present
llm: { // BotLlmEndpoint
prompt: "STRING_VALUE", // required
embeddedTools: [ // BotLlmEmbeddedToolsList
{ // BotLlmEmbeddedTool
type: "HANDOVER" || "DELEGATE" || "SUGGESTIONS", // required
name: "STRING_VALUE", // required
parameters: "DOCUMENT_VALUE",
},
],
tools: [ // BotLlmToolsList
{ // BotLlmTool
type: "function", // required
function: { // BotLlmFunctionDefinition
name: "STRING_VALUE", // required
description: "STRING_VALUE",
parameters: "DOCUMENT_VALUE",
integration: { // BotLlmFunctionIntegration Union: only one key present
webhook: { // BotLlmFunctionIntegrationWebhook
url: "STRING_VALUE", // required
method: "get" || "post" || "put" || "delete" || "patch",
async: true || false,
authorization: { // BotLlmFunctionIntegrationWebhookAuthorization Union: only one key present
bearer: { // BotLlmFunctionIntegrationWebhookAuthorizationBearer
token: "STRING_VALUE", // required
},
basic: { // BotLlmFunctionIntegrationWebhookAuthorizationBasic
username: "STRING_VALUE", // required
password: "STRING_VALUE", // required
},
oauth: { // BotLlmFunctionIntegrationWebhookAuthorizationOAuth
clientId: "STRING_VALUE", // required
clientSecret: "STRING_VALUE", // required
endpointUrl: "STRING_VALUE", // required
scope: "STRING_VALUE",
},
},
headers: [ // BotLlmFunctionIntegrationWebhookHeadersList
{ // BotLlmFunctionIntegrationWebhookHeader
key: "STRING_VALUE", // required
value: "STRING_VALUE", // required
},
],
parameters: "DOCUMENT_VALUE",
},
},
},
},
],
},
dialogflowCx: { // BotDialogflowCxEndpoint
credentials: "DOCUMENT_VALUE", // required
agent: "STRING_VALUE", // required
location: "STRING_VALUE", // required
language: "STRING_VALUE", // required
},
openAiAssistant: { // BotOpenAiAssistantEndpoint
key: "STRING_VALUE", // required
assistantId: "STRING_VALUE", // required
},
webhook: { // BotWebhookEndpoint
url: "STRING_VALUE", // required
secret: "STRING_VALUE", // required
},
sqs: { // BotSqsEndpoint
url: "STRING_VALUE", // required
key: "STRING_VALUE", // required
secret: "STRING_VALUE", // required
},
},
},
};
const command = new CreateBotCommand(input);
const response = await client.send(command);
// { // CreateBotOutput
// bot: { // Bot
// name: "STRING_VALUE", // required
// picture: "STRING_VALUE",
// searchable: true || false,
// access: "EVERYBODY" || "ORGANIZATION",
// id: "STRING_VALUE", // required
// integrationType: "LLM" || "DIALOGFLOW_CX" || "OPEN_AI_ASSISTANT" || "WEBHOOK" || "SQS", // required
// integrationApiKeysCount: Number("int"), // required
// createdAt: "STRING_VALUE", // required
// updated: "STRING_VALUE",
// },
// };