Decisions

Create Decision

Answer typed questions about a state

post
/v1/decision/create

Authorization

ChatBotKit API Secret * Required

HTTP Authorization Scheme: bearer

Request Body * Required

Request Body Schema: application/json

modelstring

The decision model to use

stateunknown

The content to decide about, as text or a JSON object or array of related context

questionsobject

The questions to answer keyed by a name of your choice

import { ChatBotKit } from '@chatbotkit/sdk'

const cbk = new ChatBotKit({

token: process.env.CHATBOTKIT_API_TOKEN!

})

const response = await cbk.decision.create(

{
"model":"string",
"state":"",
"questions":"object"
}
)
{
"answers":"object",
"usage":{
"model":"string",
"inputTokens":"number",
"outputTokens":"number"
}
}
The decision was created successfully