Skip to content

Commit eff3492

Browse files
committed
update readme
1 parent 87ff73b commit eff3492

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ This repository contains the source code for a Telegram bot that leverages DocsG
55
## Features
66
- Responds to user queries with intelligent answers using DocsGPT.
77
- Maintains conversation history for context-aware responses.
8+
- Supports multiple storage backends for conversation history (in-memory or MongoDB).
89
- Easily deployable using Docker.
910

1011
## Prerequisites
@@ -44,7 +45,18 @@ Before you begin, ensure you have met the following requirements:
4445
```plaintext
4546
TELEGRAM_BOT_TOKEN=<your-telegram-bot-token>
4647
API_KEY=<your-api-key>
48+
# Optional: Storage Configuration (Defaults to in-memory)
49+
# STORAGE_TYPE=mongodb
50+
# MONGODB_URI=<your-mongodb-connection-string>
51+
# MONGODB_DB_NAME=telegram_bot_memory
52+
# MONGODB_COLLECTION_NAME=chat_histories
4753
```
54+
- `TELEGRAM_BOT_TOKEN`: Your Telegram bot token from BotFather.
55+
- `API_KEY`: Your DocsGPT API key.
56+
- `STORAGE_TYPE`: (Optional) Specifies where to store conversation history. Defaults to `memory`. Set to `mongodb` to use MongoDB.
57+
- `MONGODB_URI`: (Required if `STORAGE_TYPE=mongodb`) Your MongoDB connection string.
58+
- `MONGODB_DB_NAME`: (Optional, defaults to `telegram_bot_memory`) The name of the MongoDB database.
59+
- `MONGODB_COLLECTION_NAME`: (Optional, defaults to `chat_histories`) The name of the MongoDB collection.
4860

4961
5. Run the bot:
5062
```bash
@@ -68,7 +80,13 @@ Before you begin, ensure you have met the following requirements:
6880
```plaintext
6981
TELEGRAM_BOT_TOKEN=<your-telegram-bot-token>
7082
API_KEY=<your-api-key>
83+
# Optional: Storage Configuration (Defaults to in-memory)
84+
# STORAGE_TYPE=mongodb
85+
# MONGODB_URI=<your-mongodb-connection-string>
86+
# MONGODB_DB_NAME=telegram_bot_memory
87+
# MONGODB_COLLECTION_NAME=chat_histories
7188
```
89+
See the Python installation section above for details on environment variables.
7290

7391
4. Run the Docker container:
7492
```bash
@@ -88,6 +106,7 @@ Simply type any message, and the bot will respond with an intelligent answer bas
88106
- `bot.py`: The main script for running the bot.
89107
- `requirements.txt`: Python dependencies required by the bot.
90108
- `Dockerfile`: Instructions to build the Docker image.
109+
- `docker-compose.yml`: Docker Compose configuration for easier deployment.
91110
- `.env`: File containing environment variables (not included, must be created).
92111

93112
## License

0 commit comments

Comments
 (0)