Chatbot Operations
Retrain an existing chatbot
The Chatbot Retrain API enables you to retrain an existing chatbot. This API is applicable for chatbots with the custom-data-upload model. It allows you to update the chatbot's knowledge base with new information or remove existing data.
You can provide new training data through various methods:
- Text data via sourceText
- URLs to scrape via urlsToScrape
- Product information via products
- Q&A pairs via qAndAs
You can also remove specific knowledge chunks using the deletes array.
Note: The amount of new data you can add is subject to character limits based on your plan.
post/retrain-chatbot
Request
- Base URL: https://api.chat-data.com/api/v2
- URL: https://api.chat-data.com/api/v2/retrain-chatbot
- Auth: HTTP bearer
Request body
Example request
{
"sourceText": "Holiday hours: our support team is closed on December 25 and January 1. Orders placed on those days ship the next business day.",
"urlsToScrape": [
"https://www.example.com/help/warranty",
"https://www.example.com/help/size-guide"
],
"options": {
"Cookies": "session_id=9f8e7d6c5b4a3f2e1d0c; theme=dark",
"includeOnlyTags": "div.site-content",
"excludeTags": "div#sidebar"
},
"products": [
{
"id": "shopify_1234567",
"information": {
"id": "shopify_1234567",
"name": "Fleece Drawstring Joggers",
"color": "white"
}
}
],
"qAndAs": [
{
"question": "Do you ship internationally?",
"answer": "Yes, we ship to over 40 countries. International orders usually arrive within 7-14 business days."
}
],
"deletes": [
{
"type": "website",
"url": "https://www.example.com/help/old-returns-policy"
},
{
"type": "product",
"id": "shopify_7654321"
}
]
}Response
The new data was accepted. Training runs in the background; poll GET /chatbot/status/{chatbotId} for progress.
Example response
{
"chatbotId": "6650f1c2a9e4b83d2c7a1f05",
"consumedCharacters": 156,
"remainingCharacters": 999844,
"dataSources": [
{
"characters": 156,
"type": "text"
},
{
"name": "https://www.example.com/help/shipping",
"characters": 0,
"type": "website"
}
]
}Changes
No recorded changes to this operation across all 1 revision of this API.