Conversations
Complete Conversation Message
Send and receive a conversation response
Authorization
ChatBotKit API Secret * Required
HTTP Authorization Scheme: bearer
Path Parameters
conversationIdstring* Required
The ID of the conversation to receive message from
X-Timezonestring
Request Body * Required
Request Body Schema: application/json
textstring
The text of the message to send
entitiesarray
Known entities
typestring
The entity type
beginnumber
Start offset
endnumber
End offset
textstring
The text value of the entity
replacementobject
beginnumber
Start offset
endnumber
End offset
textstring
The text value of the replacement
functionsarray
An array of functions to be added to the conversation
namestring
The name of the function (must be a valid JS identifier, max 64 chars)
descriptionstring
The description of the function
parametersobject
JSON Schema definition for the function parameters
typestring
The schema type, must be "object"
propertiesobject
Object property definitions
requiredarray
Required property names
result
The result of the function execution
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
import { ChatBotKit } from '@chatbotkit/sdk'
const cbk = new ChatBotKit({
secret: process.env.CHATBOTKIT_API_KEY!
})
const response = await cbk.conversation.complete(
conversationId,{)"text":"string","entities":[{],"type":"string","begin":"number","end":"number","text":"string",}"replacement":{"begin":"number","end":"number",}"text":"string""functions":[{],"name":"string","description":"string","parameters":{"type":"string","properties":"object",},"required":["string"]}"result":""}"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"
{"id":"string","text":"string","usage":{"token":"number"}}