Bot Request Entity
The BotRequest entity records each interaction between the bot and the user. It captures the user's inputs, which may include text, numerical data, or uploaded files, then transforms this data into a structured prompt for the bot. The bot's subsequent response is also logged.
Bot Request Attributes
bot
ObjectId - Bot
Reference to the Bot object. This is required.
createdBy
ObjectId - User
ID of the user who created the request.
organization
ObjectId - Organization
ID of the organization related to the request.
inputs
Object
Object storing inputs for the bot request.
invoice
ObjectId - Invoice
ID of the invoice related to the request.
images
Array[ObjectId] - Array[File]
Array of files associated with the request.
ip
String
IP address from which the request was made. This is required.
prompt
String
Prompt for the request.
success
Boolean
Indicates whether the request was successful. This is required.
response
Mixed
The response of the bot request. This is required.
originalRequest
ObjectId - BotRequest
ID of the original bot request in case this request is a follow-up.
relatedRequests
Array[ObjectId] - Array[BotRequest]
Array of bot requests related to this request.
{
"images": [
{
"createdBy": "64483f3290c195691be41d57",
"fileName": "e24faa5b-fa69-4024-8e10-abcd",
"s3Key": "e24faa5b-fa69-4024-8e10-abcdefg",
"createdAt": "2023-06-28T05:38:06.880Z",
"updatedAt": "2023-06-28T05:38:06.880Z",
"id": "649bc73e58b7391cbaa55609"
}
],
"success": true,
"relatedRequests": [],
"bot": {
"creditCost": 10,
"inputs": [
{
"inputGroup": 0,
"inputType": "text",
"step": 1,
"bot": {
"id": "64880aac2f5e4553ddac6eaf"
},
"label": "Colour",
"name": "color",
"defaultValue": "Green",
"placeholder": "black",
"required": true,
"options": [],
"id": "64880bc32f5e4553ddac6ec1"
}
],
"name": "Hellow world bot",
"slug": "hellow_world_bot",
"id": "64880aac2f5e4553ddac6eaf"
},
"createdBy": {
"name": "John Doe",
"id": "64483f3290c195691be41d57"
},
"organization": {
"name": "Test",
"id": "644853d690c195691be42075"
},
"inputs": {
"color": "Green"
},
"ip": "29.251.124.244",
"response": {
"message": "Hellow word"
},
"createdAt": "2023-06-28T05:38:00.418Z",
"updatedAt": "2023-06-28T05:38:06.922Z",
"id": "649bc73858b7391cbaa555ff"
}