(chat)
- createChatThread - Create New Chat Thread
- listChatThreads - List Chat Threads
- getChatThread - Get Chat Thread
- updateChatThread - Update Chat Thread
- deleteChatThread - Delete Chat Thread
- createChatThreadWithMsg - Create New Chat Thread With Message
- sendChatMessage - Send Chat Message
- getChat - Get Chat Interactions
Create a new chat instance
import { Isosceles } from "@isosceles-ai/sdk";
const isosceles = new Isosceles({
security: {
username: process.env["ACP_USERNAME"] ?? "",
password: process.env["ACP_PASSWORD"] ?? "",
},
});
async function run() {
const result = await isosceles.chat.createChatThread({
brainId: "d42bca76-67d9-4ba4-9c13-b8e5d5f97744",
name: "Test API Chat Thread",
chatMessageType: "TEXT",
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { IsoscelesCore } from "@isosceles-ai/sdk/core.js";
import { chatCreateChatThread } from "@isosceles-ai/sdk/funcs/chatCreateChatThread.js";
// Use `IsoscelesCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const isosceles = new IsoscelesCore({
security: {
username: process.env["ACP_USERNAME"] ?? "",
password: process.env["ACP_PASSWORD"] ?? "",
},
});
async function run() {
const res = await chatCreateChatThread(isosceles, {
brainId: "d42bca76-67d9-4ba4-9c13-b8e5d5f97744",
name: "Test API Chat Thread",
chatMessageType: "TEXT",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.CreateChatThreadRequestBody | ✔️ | 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. |
Promise<operations.CreateChatThreadResponseBody>
Error Type | Status Code | Content Type |
---|---|---|
errors.SDKError | 4XX, 5XX | */* |
List chat threads for the current user id
import { Isosceles } from "@isosceles-ai/sdk";
const isosceles = new Isosceles({
security: {
username: process.env["ACP_USERNAME"] ?? "",
password: process.env["ACP_PASSWORD"] ?? "",
},
});
async function run() {
const result = await isosceles.chat.listChatThreads();
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { IsoscelesCore } from "@isosceles-ai/sdk/core.js";
import { chatListChatThreads } from "@isosceles-ai/sdk/funcs/chatListChatThreads.js";
// Use `IsoscelesCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const isosceles = new IsoscelesCore({
security: {
username: process.env["ACP_USERNAME"] ?? "",
password: process.env["ACP_PASSWORD"] ?? "",
},
});
async function run() {
const res = await chatListChatThreads(isosceles);
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
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. |
Promise<components.Chat[]>
Error Type | Status Code | Content Type |
---|---|---|
errors.SDKError | 4XX, 5XX | */* |
Get Chat Thread
import { Isosceles } from "@isosceles-ai/sdk";
const isosceles = new Isosceles({
security: {
username: process.env["ACP_USERNAME"] ?? "",
password: process.env["ACP_PASSWORD"] ?? "",
},
});
async function run() {
const result = await isosceles.chat.getChatThread({
chatId: "{{chat_id}}",
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { IsoscelesCore } from "@isosceles-ai/sdk/core.js";
import { chatGetChatThread } from "@isosceles-ai/sdk/funcs/chatGetChatThread.js";
// Use `IsoscelesCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const isosceles = new IsoscelesCore({
security: {
username: process.env["ACP_USERNAME"] ?? "",
password: process.env["ACP_PASSWORD"] ?? "",
},
});
async function run() {
const res = await chatGetChatThread(isosceles, {
chatId: "{{chat_id}}",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.GetChatThreadRequest | ✔️ | 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. |
Promise<components.Chat>
Error Type | Status Code | Content Type |
---|---|---|
errors.SDKError | 4XX, 5XX | */* |
Update Chat Thread
import { Isosceles } from "@isosceles-ai/sdk";
const isosceles = new Isosceles({
security: {
username: process.env["ACP_USERNAME"] ?? "",
password: process.env["ACP_PASSWORD"] ?? "",
},
});
async function run() {
const result = await isosceles.chat.updateChatThread({
chatId: "{{chat_id}}",
requestBody: {
responseLength: "SHORT",
temperature: 0.3,
systemMessage: "You are a customer support bot for ByteLeap.",
},
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { IsoscelesCore } from "@isosceles-ai/sdk/core.js";
import { chatUpdateChatThread } from "@isosceles-ai/sdk/funcs/chatUpdateChatThread.js";
// Use `IsoscelesCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const isosceles = new IsoscelesCore({
security: {
username: process.env["ACP_USERNAME"] ?? "",
password: process.env["ACP_PASSWORD"] ?? "",
},
});
async function run() {
const res = await chatUpdateChatThread(isosceles, {
chatId: "{{chat_id}}",
requestBody: {
responseLength: "SHORT",
temperature: 0.3,
systemMessage: "You are a customer support bot for ByteLeap.",
},
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.UpdateChatThreadRequest | ✔️ | 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. |
Promise<components.Chat>
Error Type | Status Code | Content Type |
---|---|---|
errors.SDKError | 4XX, 5XX | */* |
Delete Chat Thread
import { Isosceles } from "@isosceles-ai/sdk";
const isosceles = new Isosceles({
security: {
username: process.env["ACP_USERNAME"] ?? "",
password: process.env["ACP_PASSWORD"] ?? "",
},
});
async function run() {
const result = await isosceles.chat.deleteChatThread({
chatId: "8474f310-a2a9-4cf8-b16f-8d01a5a6b5fa",
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { IsoscelesCore } from "@isosceles-ai/sdk/core.js";
import { chatDeleteChatThread } from "@isosceles-ai/sdk/funcs/chatDeleteChatThread.js";
// Use `IsoscelesCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const isosceles = new IsoscelesCore({
security: {
username: process.env["ACP_USERNAME"] ?? "",
password: process.env["ACP_PASSWORD"] ?? "",
},
});
async function run() {
const res = await chatDeleteChatThread(isosceles, {
chatId: "8474f310-a2a9-4cf8-b16f-8d01a5a6b5fa",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.DeleteChatThreadRequest | ✔️ | 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. |
Promise<components.Chat>
Error Type | Status Code | Content Type |
---|---|---|
errors.SDKError | 4XX, 5XX | */* |
Create a new chat with the specified brain and message.
import { Isosceles } from "@isosceles-ai/sdk";
const isosceles = new Isosceles({
security: {
username: process.env["ACP_USERNAME"] ?? "",
password: process.env["ACP_PASSWORD"] ?? "",
},
});
async function run() {
const result = await isosceles.chat.createChatThreadWithMsg({
brainId: "<id>",
name: "Slack Chat - 2024-06-26T12:34:56.789Z",
message: "<value>",
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { IsoscelesCore } from "@isosceles-ai/sdk/core.js";
import { chatCreateChatThreadWithMsg } from "@isosceles-ai/sdk/funcs/chatCreateChatThreadWithMsg.js";
// Use `IsoscelesCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const isosceles = new IsoscelesCore({
security: {
username: process.env["ACP_USERNAME"] ?? "",
password: process.env["ACP_PASSWORD"] ?? "",
},
});
async function run() {
const res = await chatCreateChatThreadWithMsg(isosceles, {
brainId: "<id>",
name: "Slack Chat - 2024-06-26T12:34:56.789Z",
message: "<value>",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.CreateChatThreadWithMsgRequestBody | ✔️ | 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. |
Promise<components.ChatInteraction[]>
Error Type | Status Code | Content Type |
---|---|---|
errors.SDKError | 4XX, 5XX | */* |
Send Chat Message
import { Isosceles } from "@isosceles-ai/sdk";
const isosceles = new Isosceles({
security: {
username: process.env["ACP_USERNAME"] ?? "",
password: process.env["ACP_PASSWORD"] ?? "",
},
});
async function run() {
const result = await isosceles.chat.sendChatMessage({
chatThreadId: "6b6a092d-8f6e-48e8-bde8-b013a211b6ae",
text: "What is the customer motto of Amazon in one line",
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { IsoscelesCore } from "@isosceles-ai/sdk/core.js";
import { chatSendChatMessage } from "@isosceles-ai/sdk/funcs/chatSendChatMessage.js";
// Use `IsoscelesCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const isosceles = new IsoscelesCore({
security: {
username: process.env["ACP_USERNAME"] ?? "",
password: process.env["ACP_PASSWORD"] ?? "",
},
});
async function run() {
const res = await chatSendChatMessage(isosceles, {
chatThreadId: "6b6a092d-8f6e-48e8-bde8-b013a211b6ae",
text: "What is the customer motto of Amazon in one line",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.SendChatMessageRequestBody | ✔️ | 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. |
Promise<components.ChatInteraction[]>
Error Type | Status Code | Content Type |
---|---|---|
errors.SDKError | 4XX, 5XX | */* |
Get Chat Interactions
import { Isosceles } from "@isosceles-ai/sdk";
const isosceles = new Isosceles({
security: {
username: process.env["ACP_USERNAME"] ?? "",
password: process.env["ACP_PASSWORD"] ?? "",
},
});
async function run() {
const result = await isosceles.chat.getChat({
chatId: "<value>",
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { IsoscelesCore } from "@isosceles-ai/sdk/core.js";
import { chatGetChat } from "@isosceles-ai/sdk/funcs/chatGetChat.js";
// Use `IsoscelesCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const isosceles = new IsoscelesCore({
security: {
username: process.env["ACP_USERNAME"] ?? "",
password: process.env["ACP_PASSWORD"] ?? "",
},
});
async function run() {
const res = await chatGetChat(isosceles, {
chatId: "<value>",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.GetChatRequest | ✔️ | 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. |
Promise<components.ChatInteraction[]>
Error Type | Status Code | Content Type |
---|---|---|
errors.SDKError | 4XX, 5XX | */* |