Chat Agent API Documentation
This document explains how to interact with the Lyzr Chatbot API using Python scripts. The examples use the requests
library to perform HTTP requests to the API endpoints.
Prerequisites
-
Ensure that the Docker container is running.
-
Install the
requests
library if you haven’t already:
Base URL
Update the BASE_URL
variable to match the server’s actual address if necessary.
Creating a Chatbot Configuration
Sample Configuration
To create a new chatbot configuration, send a POST request to the /create/config
endpoint.
Creating a Chatbot from PDF Files
To create a new chatbot instance from multiple PDF files, send a POST request to the /create/from-pdf/{config_id}
endpoint.
Checking Chatbot Status
To check if a chatbot instance exists, send a GET request to the /check/{chatbot_id}
endpoint.
Chatting with the Chatbot
To interact with a specific chatbot instance, send a POST request to the /chat/{chatbot_id}
endpoint with a message and chat history.
Health Check
To perform a health check on the API, send a GET request to the /health
endpoint.
Recreating a Chatbot with New Configuration
To recreate a chatbot instance with a new configuration, send a POST request to the /recreate/{chatbot_id}/{config_id}
endpoint with the new configuration.
Creating a Chatbot from DOCX Files
To create a new chatbot instance from multiple DOCX files, send a POST request to the /create/from-docx/{config_id}
endpoint.
Creating a Chatbot from Text Files
To create a new chatbot instance from multiple text files, send a POST request to the /create/from-text/{config_id}
endpoint.
This documentation provides step-by-step instructions on how to interact with the Chatbot API using Python scripts. Adjust the BASE_URL
as necessary to match the server’s actual address.