{"id":25001500,"url":"https://github.com/mansionnet/mistralbot","last_synced_at":"2025-03-29T19:45:15.825Z","repository":{"id":270611690,"uuid":"910916200","full_name":"MansionNET/MistralBot","owner":"MansionNET","description":"A sophisticated IRC bot powered by Mistral AI that provides intelligent chat assistance and code help. MistralBot brings the power of large language models to IRC channels through a simple interface.","archived":false,"fork":false,"pushed_at":"2025-01-06T19:10:55.000Z","size":29,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-04T20:38:03.602Z","etag":null,"topics":["ai","ai-assistant","chatbot","irc","irc-bot","llm","mistral-ai","mistral-api","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MansionNET.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-01T19:23:53.000Z","updated_at":"2025-01-06T19:10:58.000Z","dependencies_parsed_at":"2025-01-01T20:24:04.867Z","dependency_job_id":"8a7e7b9f-017d-40bd-afed-1ee74f0adfc4","html_url":"https://github.com/MansionNET/MistralBot","commit_stats":null,"previous_names":["mansionnet/mistralbot"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MansionNET%2FMistralBot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MansionNET%2FMistralBot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MansionNET%2FMistralBot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MansionNET%2FMistralBot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MansionNET","download_url":"https://codeload.github.com/MansionNET/MistralBot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246237428,"owners_count":20745348,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","ai-assistant","chatbot","irc","irc-bot","llm","mistral-ai","mistral-api","python"],"created_at":"2025-02-04T20:35:22.568Z","updated_at":"2025-03-29T19:45:15.792Z","avatar_url":"https://github.com/MansionNET.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MistralBot\n\nA sophisticated IRC bot powered by Mistral AI that provides intelligent chat assistance and code help. MistralBot brings the power of large language models to IRC channels through a simple interface.\n\n![Python](https://img.shields.io/badge/python-3.8%2B-blue)\n\n## IRC Server Details\n\nJoin us on MansionNET IRC to chat with us, test the bot, and play some trivia! \n\n🌐 **Server:** irc.inthemansion.com  \n🔒 **Port:** 6697 (SSL)  \n📝 **Channel:** #opers, #general, #welcome, #devs (and many others)\n\n## Features\n\n- AI-powered chat assistance using Mistral AI\n- Code explanation and generation\n- Built-in rate limiting and user quotas\n- SSL/TLS support for secure IRC connections\n- Customizable prompt templates\n- Smart message handling for IRC message length limits\n- Debug logging\n\n## Requirements\n\n- Python 3.8 or higher\n- Mistral AI API key ([Get one here](https://mistral.ai))\n- `requests` and `python-dotenv` libraries\n- SSL-enabled IRC server\n\n## Installation\n\n1. Clone the repository:\n```bash\ngit clone https://github.com/MansionNET/mistralbot.git\ncd mistralbot\n```\n\n2. Create and activate a virtual environment (recommended):\n```bash\npython -m venv venv\nsource venv/bin/activate  # On Windows use: venv\\Scripts\\activate\n```\n\n3. Install dependencies:\n```bash\npip install -r requirements.txt\n```\n\n4. Set up your environment variables:\n```bash\ncp .env.example .env\n```\n\n5. Edit `.env` and add your Mistral AI API key:\n```env\nMISTRAL_API_KEY=your_api_key_here\n```\n\n## Usage\n\nStart the bot:\n```bash\npython mistralbot.py\n```\n\n### Available Commands\n\nIn any channel where the bot is present:\n\n- `!ask \u003cquestion\u003e` - Ask a general question to the AI\n  - Example: `!ask What is the capital of France?`\n  - Example: `!ask Can you explain quantum computing?`\n\n- `!code \u003cquestion\u003e` - Get programming help with code examples\n  - Example: `!code How do I read a file in Python?`\n  - Example: `!code Write a simple web server`\n\n- `!help` - Display available commands and usage information\n\n## Configuration\n\nThe bot can be configured through environment variables or by editing the code:\n\n### Environment Variables\n- `MISTRAL_API_KEY` (required): Your Mistral AI API key\n\n### Code Configuration\n- IRC Server settings\n  - Server address\n  - Port\n  - Nickname\n  - Channels to join\n\n- Rate Limiting\n  - Requests per minute (default: 10)\n  - Requests per day (default: 1000)\n  - Per-user daily limit (default: 50)\n\n- Prompt Templates\n  - Default conversation template\n  - Code explanation template\n  - Custom templates can be added\n\n## Rate Limits\n\nTo prevent abuse and ensure fair usage, MistralBot implements several rate limits:\n\n- Global limits:\n  - 10 requests per minute\n  - 1000 requests per day\n\n- Per-user limits:\n  - 50 requests per day\n  - 3-second cooldown between commands\n\n## Prompt Templates\n\nMistralBot uses customizable prompt templates for different types of queries:\n\n```python\nprompt_templates = {\n    \"default\": \"You are a helpful assistant. Provide clear, direct responses without unnecessary detail. Question: {query}\",\n    \"code\": \"You are a programming teacher. First give a ONE-SENTENCE explanation. Then after 'CODE:', show simple, practical code examples with minimal comments. Keep both explanation and code concise. Question: {query}\",\n    \"explain\": \"Explain this concept in 2-3 short, clear sentences: {query}\"\n}\n```\n\nYou can modify these templates or add new ones to customize the bot's responses.\n\n## API Usage\n\nMistralBot uses the Mistral AI API with the following configuration:\n\n- Model: mistral-tiny\n- Max tokens: 300\n- Temperature: 0.7\n\nPlease review [Mistral AI's pricing](https://mistral.ai/pricing/) and terms of service before deployment.\n\n## Contributing\n\nWe welcome contributions! Please read our [Contributing Guide](CONTRIBUTING.md) for details on:\n\n- Code style\n- Pull request process\n- Development setup\n- Testing requirements\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Security\n\nNever share your Mistral AI API key or commit it to version control. Always use environment variables or secure configuration management.\n\n## Project Status\n\nThis project is actively maintained. For support:\n\n- Open an issue for bugs or feature requests\n- Check existing issues before creating new ones\n- Follow the contribution guidelines when submitting code\n\n## Acknowledgments\n\n- Mistral AI for providing the language model API\n- The IRC community for continued support\n- All contributors to the project\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmansionnet%2Fmistralbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmansionnet%2Fmistralbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmansionnet%2Fmistralbot/lists"}