Update README.md

This commit is contained in:
first 2025-01-09 07:56:06 +00:00
parent 68efaf3279
commit a418aaa029

View file

@ -1,48 +1,38 @@
To use this bot: To use this bot:
1. Set your Venice API key as an environment variable: 1. Set up your environment:
```bash ```bash
export VENICE_API_KEY="your-api-key-here" export VENICE_API_KEY="your_venice_api_key_here"
``` ```
2. Install the required dependencies: 2. Build and run the bot using Stack or Cabal.
```bash
pip install aiohttp simplexmq
```
3. Run the bot:
```bash
python venice_bot.py
```
Key features of this implementation: Key features of this implementation:
1. Uses ```/ask``` as the command prefix to trigger the bot 1. The bot only responds to messages prefixed with ```/bot``` [^1]
2. Implements async/await for better performance 2. It uses the Venice.ai API for generating responses [^2]
3. Includes error handling for API calls 3. The API key is loaded from environment variables for security
4. Shows typing indicators while processing 4. Error handling for API calls is implemented
5. Uses environment variables for secure API key storage 5. The bot maintains the SimpleX chat protocol while adding Venice.ai integration
6. Maintains a persistent SimpleX connection
To use the bot in a SimpleX chat: Usage example:
1. Start the bot
2. Use the displayed bot address to add it to your SimpleX chat
3. Send messages with the format: ```/ask your question here```
For example:
``` ```
/ask What is the weather like today? User: /bot What is the capital of France?
Bot: Paris is the capital of France.
User: regular message
Bot: (no response)
``` ```
The bot will then process your question through the Venice API and respond with the generated answer. To improve this further, you could:
Note: You'll need to handle the actual SimpleX integration details based on your specific SimpleX setup and requirements. The ```simplexmq``` package used in this example is a placeholder - you'll need to use the actual SimpleX client library or API that matches your setup. [^1] 1. Add rate limiting
2. Implement conversation history
3. Add more command options (like ```/bot help```, ```/bot reset```)
4. Add error logging
5. Implement retry logic for failed API calls
Remember to: Let me know if you need any clarification or have questions about specific parts of the implementation!
- Keep your API keys secure
- Implement rate limiting if needed
- Add logging for debugging
- Consider adding more error handling and retry logic for robustness
- Add moderation features if needed for your use case
[^1]: [Venice API Docs](https://docs.venice.ai/api-reference/api-spec#:~:text=Full%20document,more%20information.) [^1]: [simplex-chat/apps/simplex-bot/Main.hs at stable · simplex-chat/simplex-chat](https://github.com/simplex-chat/simplex-chat/blob/stable/apps/simplex-bot/Main.hs#:~:text=Full%20document,more%20information.)
[^2]: [Venice API Docs](https://docs.venice.ai/api-reference/api-spec#:~:text=Full%20document,more%20information.)