Skip to content

Latest commit

 

History

History
387 lines (273 loc) · 45.2 KB

README.md

File metadata and controls

387 lines (273 loc) · 45.2 KB

Chatbot

(chatbot)

Available Operations

postChatbotCreate

Create Chatbot

Example Usage

import { AthenaCopilot } from "@athena-ai/sdk";

const athenaCopilot = new AthenaCopilot({
  security: {
    username: "<YOUR_USERNAME_HERE>",
    password: "<YOUR_PASSWORD_HERE>",
  },
});

async function run() {
  const result = await athenaCopilot.chatbot.postChatbotCreate({
    name: "Chatbot -1",
    brainId: "1f1d7a6a-e45b-4974-a0ba-98935650cb9c",
    urls: [
      "https://byteleap.co",
      "https://ayushgoyal.dev",
    ],
  });

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

run();

Parameters

Parameter Type Required Description
request operations.PostChatbotCreateRequestBody ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options 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.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.PostChatbotCreateResponse>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

getChatbotList

List Chatbots

Example Usage

import { AthenaCopilot } from "@athena-ai/sdk";

const athenaCopilot = new AthenaCopilot({
  security: {
    username: "<YOUR_USERNAME_HERE>",
    password: "<YOUR_PASSWORD_HERE>",
  },
});

async function run() {
  const result = await athenaCopilot.chatbot.getChatbotList("<value>");

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

run();

Parameters

Parameter Type Required Description
brainId string The ID of the brain to filter chatbots
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options 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.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.GetChatbotListResponse>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

postChatbotGet

Get Chatbot

Example Usage

import { AthenaCopilot } from "@athena-ai/sdk";

const athenaCopilot = new AthenaCopilot({
  security: {
    username: "<YOUR_USERNAME_HERE>",
    password: "<YOUR_PASSWORD_HERE>",
  },
});

async function run() {
  const result = await athenaCopilot.chatbot.postChatbotGet("7a2e792d-cf48-49d2-a36d-186be034a9dc");

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

run();

Parameters

Parameter Type Required Description Example
chatbotId string N/A [object Object]
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options 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.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.PostChatbotGetResponse>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

getChatbotAnalytics

Get Chatbot analytics

Example Usage

import { AthenaCopilot } from "@athena-ai/sdk";

const athenaCopilot = new AthenaCopilot({
  security: {
    username: "<YOUR_USERNAME_HERE>",
    password: "<YOUR_PASSWORD_HERE>",
  },
});

async function run() {
  const result = await athenaCopilot.chatbot.getChatbotAnalytics("1a718a80-71c0-414b-915c-5c5991597ac7");

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

run();

Parameters

Parameter Type Required Description Example
chatbotId string N/A [object Object]
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options 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.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.GetChatbotAnalyticsResponse>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

getChatbotGetMessages

note: there is a limit of 10000 messages

Example Usage

import { AthenaCopilot } from "@athena-ai/sdk";

const athenaCopilot = new AthenaCopilot({
  security: {
    username: "<YOUR_USERNAME_HERE>",
    password: "<YOUR_PASSWORD_HERE>",
  },
});

async function run() {
  const result = await athenaCopilot.chatbot.getChatbotGetMessages("1a718a80-71c0-414b-915c-5c5991597ac7");

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

run();

Parameters

Parameter Type Required Description Example
chatbotId string N/A [object Object]
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options 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.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.GetChatbotGetMessagesResponse>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

postChatbotUpdate

Update Chatbot

Example Usage

import { AthenaCopilot } from "@athena-ai/sdk";

const athenaCopilot = new AthenaCopilot({
  security: {
    username: "<YOUR_USERNAME_HERE>",
    password: "<YOUR_PASSWORD_HERE>",
  },
});

async function run() {
  const result = await athenaCopilot.chatbot.postChatbotUpdate({
    chatbotId: "1a718a80-71c0-414b-915c-5c5991597ac7",
    name: "Chatbot -1",
    urls: [
      "https://byteleap.co",
      "https://anshgoyal.com",
    ],
  });

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

run();

Parameters

Parameter Type Required Description
request operations.PostChatbotUpdateRequestBody ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options 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.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.PostChatbotUpdateResponse>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

postChatbotDelete

Delete Chatbot

Example Usage

import { AthenaCopilot } from "@athena-ai/sdk";

const athenaCopilot = new AthenaCopilot({
  security: {
    username: "<YOUR_USERNAME_HERE>",
    password: "<YOUR_PASSWORD_HERE>",
  },
});

async function run() {
  const result = await athenaCopilot.chatbot.postChatbotDelete("2de69bc3-3f60-46a2-be30-e95c98ab7a87");

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

run();

Parameters

Parameter Type Required Description Example
chatbotId string N/A [object Object]
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options 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.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.PostChatbotDeleteResponse>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

postChatbotReset

Reset Token

Example Usage

import { AthenaCopilot } from "@athena-ai/sdk";

const athenaCopilot = new AthenaCopilot({
  security: {
    username: "<YOUR_USERNAME_HERE>",
    password: "<YOUR_PASSWORD_HERE>",
  },
});

async function run() {
  const result = await athenaCopilot.chatbot.postChatbotReset("c7af119a-a5c6-47a4-a5fd-fbf96ef08851");

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

run();

Parameters

Parameter Type Required Description Example
chatbotId string N/A [object Object]
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options 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.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.PostChatbotResetResponse>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /