Conversations
Compact Conversation Stateless
Compact an array of messages into a single summary
Authorization
ChatBotKit API Secret * Required
HTTP Authorization Scheme: bearer
Path Parameters
X-Timezonestring
Request Body * Required
Request Body Schema: application/json
messagesarray
An array of messages to be compacted
typestring
The type of the message
textstring
The text of the message
metaobject
Meta data information
extensionsobject
Extensions to enhance the bot's capabilities
backstorystring
Additional backstory for the bot
datasetsarray
Inline datasets to provide additional context
namestring
The name of the dataset
descriptionstring
The description of the dataset
recordsarray
The records in the dataset
textstring
The text content of the record
metaobject
Additional metadata for the record
skillsetsarray
Inline skillsets to provide additional abilities
namestring
The name of the skillset
descriptionstring
The description of the skillset
abilitiesarray
The abilities in the skillset
namestring
The name of the ability
descriptionstring
The description of the ability
instructionstring
The instruction for the ability
secretIdstring
Optional secret ID for the ability
metaobject
Additional metadata for the ability
featuresarray
Feature flags to enable specific bot capabilities
namestring
The name of the feature to enable
optionsobject
Optional configuration options for the feature
botIdstring
The ID of the bot this configuration is using
import { ChatBotKit } from '@chatbotkit/sdk'
const cbk = new ChatBotKit({
secret: process.env.CHATBOTKIT_API_KEY!
})
const response = await cbk.conversation.compact(
{)"messages":[{],"type":"string","text":"string",}"meta":"object""extensions":{"backstory":"string","datasets":[{],"name":"string","description":"string",}"records":[{]"text":"string",}"meta":"object""skillsets":[{],"name":"string","description":"string",}"abilities":[{]"name":"string","description":"string","instruction":"string","secretId":"string",}"meta":"object"},"features":[{]"name":"string",}"options":"object"}"botId":"string"
{"text":"string","usage":{"token":"number"}}