deleted multiple versions
This commit is contained in:
@@ -1,51 +0,0 @@
|
||||
# Telegram Inference Bot Refactoring
|
||||
|
||||
This repository contains a refactored version of the Telegram Inference Bot, which now uses a more flexible and maintainable approach for handling different AI providers.
|
||||
|
||||
## Changes
|
||||
|
||||
1. Introduced an abstract `AIProvider` class and concrete implementations for Anthropic and OpenAI.
|
||||
2. Refactored the main bot code to use the new AI provider classes.
|
||||
3. Implemented a factory function `create_ai_provider` for easy provider instantiation.
|
||||
4. Updated command handlers to work with the new AI provider system.
|
||||
|
||||
## How to Use
|
||||
|
||||
1. Set up your environment variables in a `.env` file:
|
||||
```
|
||||
TELEGRAM_BOT_TOKEN=your_telegram_bot_token
|
||||
ANTHROPIC_API_KEY=your_anthropic_api_key
|
||||
OPENAI_API_KEY=your_openai_api_key
|
||||
```
|
||||
|
||||
2. Install the required dependencies:
|
||||
```
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
|
||||
3. Run the bot:
|
||||
```
|
||||
python telegram_inference_bot.py
|
||||
```
|
||||
|
||||
## Commands
|
||||
|
||||
- `/start`: Start the bot and receive a welcome message.
|
||||
- `/clear`: Clear the conversation history and any stored images.
|
||||
- `/switch`: Switch between smart and regular models (OpenAI only).
|
||||
- `/toggle`: Toggle between Anthropic and OpenAI providers.
|
||||
- `/status`: Display the current AI provider and model being used.
|
||||
|
||||
## Extending the Bot
|
||||
|
||||
To add a new AI provider:
|
||||
|
||||
1. Create a new class in `ai_providers.py` that inherits from `AIProvider`.
|
||||
2. Implement the required methods: `get_chat_response`, `format_messages`, `format_tool_calls`, etc.
|
||||
3. Update the `create_ai_provider` function to include the new provider.
|
||||
|
||||
## Future Improvements
|
||||
|
||||
- Implement more robust error handling and logging.
|
||||
- Add unit tests for the AI provider classes and main bot functionality.
|
||||
- Extend the README with more detailed usage instructions and examples.
|
||||
@@ -1,19 +0,0 @@
|
||||
## Setting up the environment (Windows)
|
||||
|
||||
1. Run `python setup_venv.py` to create the virtual environment and install dependencies.
|
||||
2. To activate the virtual environment, run `activate_venv` in the Windows Terminal.
|
||||
3. To deactivate the virtual environment, simply type `deactivate`.
|
||||
|
||||
|
||||
## Running the code (Any)
|
||||
1. Run telegram_inference_bot.py after entering the environment
|
||||
2. now we're cooking with gas!
|
||||
|
||||
## Tools Overview
|
||||
|
||||
The `tools` directory contains essential utilities that extend the capabilities of the main application. Below are key Python files and their roles:
|
||||
1. **tools/base_tool.py**:
|
||||
- **Purpose**: Serves as an abstract base class for other tools.
|
||||
- **Core Methods**:
|
||||
`get_functions()`: Abstract method to list available functions.
|
||||
`execute(function_name, **kwargs)`: Abstract method to execute a specified function with given arguments.
|
||||
Reference in New Issue
Block a user