Serverless AI Bot Action
AI powered bot action service that determines which actions are relevant based on user input and provides explanations with confidence scores.
Endpoint
Determine relevant actions based on user input
POSThttps://api.xtartapp.com/bot/action
*Authentication
You must use a Bearer token provided by the dashboard to use for authentication. Add the token to the Authorization header.
Request body
Name | Type | Required | Max | Description |
---|---|---|---|---|
ask | string | Yes | 500 | The user input message |
actions | array of objects | Yes | 10 | List of possible actions to evaluate |
actions[].name | string | Yes | 50 | The name of the action |
actions[].objective | string | Yes | 100 | The objective of the action |
actions[].parameters | array of strings | No | 50 | List of parameter names that can be used with this action. Parameters must be meaningful and relevant to its objective or intent. |
history | array of objects | No | 15 | Previous conversation history between user and bot |
history[].role | string | Yes | - | The role of the message sender (user or bot) |
history[].content | string | Yes | 500 | The message content |
context | array of strings | No | 25 | Additional context information for action evaluation |
context[] | string | Yes | 500 | Additional context information for action evaluation |
language | string | No | - | The language code for the response |
Response
Name | Type | Description |
---|---|---|
data | object | The action response data |
data.actions | array | Array of relevant actions with explanations and confidence scores |
data.actions[].name | string | The name of the relevant action |
data.actions[].explanation | string | Explanation of why the action is relevant |
data.actions[].confidence | number | Confidence score between 0 and 1 |
data.actions[].payload | object | The parsed parameters as a JSON object containing the matched action's parameter values |
data.response | string | The response to the user message |
metadata | object | Metadata about the action process |
metadata.cost | number | The cost of the action request |
Errors
{
"error": "string",
"code": "string"
}
HTTP Status | Error Code | Message |
---|---|---|
400 | INVALID_PAYLOAD | Occurs when the payload is invalid. |
400 | INVALID_REQUEST | Ex.: The request is invalid. |
400 | BOT_ACTION_ERROR | Ex: could not determine actions | parsing error |
400 | HARM_CONTENT | Ex.: The content is harmful and cannot be processed. |
400 | INSUFFICIENT_BALANCE | The user has insufficient balance |
400 | INPUT_TOO_LONG | The input text exceeds the maximum length |
401 | UNAUTHORIZED | Ex.: The token is invalid. |
429 | TOO_MANY_REQUESTS | Ex.: The request limit has been reached. |