incrediblemohnish5 /
Smart-Drip-Irrigation-System-
An IoT powered Smart Drip Irrigation System designed to optimize water usage through usage of AI model and sensors
53/100 healthLoading repository data…
johndotpub / repository
An Opensource AI bot that uses GPT models to provide chat-based interactions with users in Discord channels and via DMs. Supports a hybrid mode with OpenAI and Perplexity API backends!
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
Selected from shared topics, language and repository description—not editorial ratings.
incrediblemohnish5 /
An IoT powered Smart Drip Irrigation System designed to optimize water usage through usage of AI model and sensors
53/100 healthDiscordianAI is a production-ready Discord bot that blends OpenAI GPT-5 frontier models with Perplexity Sonar-Pro web search. It focuses on conversation consistency, deterministic routing, and Discord-native formatting so answers stay contextual, accurate, and easy to read.
config.ini drives every runtime mode, and validators catch unsupported parameters early.| Mode | Description |
|---|---|
| 🧠 Smart Hybrid | Analyze each message, then route to GPT-5 or Sonar-Pro with follow-up consistency. |
| 🤖 OpenAI Only | Force GPT-5 for every response; great for creative and coding-focused servers. |
| 🔍 Perplexity Only | Force Sonar-Pro for every response; ideal for research or news-heavy servers. |
pip install -e .[dev]cp config.ini.example config.iniconfig.ini (Discord, OpenAI, Perplexity as needed).python -m src.main --conf config.inipytest (coverage gate: 84% via tox/Codecov)Need the full Discord bot creation walkthrough and environment prep? See docs/Setup.md.
python -m src.main --conf config.ini --folder /path/to/base/folder
--conf points at the config file.--folder (optional) makes config/log paths relative to a base directory (useful for Docker or systemd units).The included discordian.sh script handles Python environment resolution, venv bootstrapping, and process management automatically:
# Foreground (development)
./discordian.sh -c config.ini
# Daemon mode (cron, background)
./discordian.sh -d -c config.ini
# Specify project directory explicitly
./discordian.sh -d -c production.ini -f /opt/discordianai
# Install a systemd service (auto-detects paths)
./discordian.sh --install-systemd bot.ini
The launcher resolves Python in this order: pyenv → project-local .venv → shell venv → system python3. It creates a .venv/ automatically if none exists. It also ensures the working directory is correct — no more ModuleNotFoundError: No module named 'src' when running from cron.
--install-systemd generates a complete systemd user unit from the config file name (e.g., bot.ini → discordian-bot@bot.service), writes it to ~/.config/systemd/user/, enables it, and prints management commands. See docs/Daemon.md for both cron and systemd setup.
| Key | Purpose |
|---|---|
DISCORD_TOKEN | Bot authentication token from the Discord Developer Portal. |
GPT_MODEL | GPT-5 series model (gpt-5-mini, gpt-5, gpt-5-nano, gpt-5-chat). |
PERPLEXITY_MODEL | Perplexity Sonar model (sonar-pro default, sonar fallback). |
INPUT_TOKENS / OUTPUT_TOKENS | Caps for prompt and completion tokens (GPT-5 uses max_completion_tokens). |
LOOKBACK_MESSAGES_FOR_CONSISTENCY | How many prior turns to inspect when enforcing AI service consistency. |
OPENAI_MAX_CONNECTIONS / PERPLEXITY_MAX_CONNECTIONS | HTTP/2 pooling limits for each API client. |
ALLOWED_CHANNELS matches channel names.ALLOWED_CHANNEL_IDS matches channel IDs and takes precedence when set.[Discord]
DISCORD_TOKEN=your_discord_bot_token
[Default]
OPENAI_API_KEY=sk-your-openai-key
OPENAI_API_URL=https://api.openai.com/v1/
GPT_MODEL=gpt-5-mini
PERPLEXITY_API_KEY=pplx-your-perplexity-key
PERPLEXITY_MODEL=sonar-pro
INPUT_TOKENS=120000
OUTPUT_TOKENS=8000
SYSTEM_MESSAGE=You are a helpful assistant with access to current web information.
[Limits]
RATE_LIMIT=10
RATE_LIMIT_PER=60
smart_orchestrator.py routes messages via semantic analysis, entity detection, and follow-up tracking.message_processor.py normalizes Discord input, calls the orchestrator, and records AI metadata for future turns.openai_processing.py and perplexity_processing.py build strictly supported API payloads (GPT-5 ignores temperature, Sonar-Pro sampling is managed server-side).discord_embeds.py formats Perplexity citations into clean embeds with automatic suppression when multiple links exist.message_splitter.py enforces Discord limits (2000 / 3840 / 4096 chars) with code-block and citation awareness.message_router.py centralizes mention handling, DM routing, and rate-limit responses.connection_pool.py exposes tuned HTTP/2 clients (50/10 connections for OpenAI, 30/5 for Perplexity).health_checks.py verifies API reachability and validates GPT-5/Sonar configurations at startup.api_validation.py guards against unsupported model strings; structured error metadata and classification is centralized in error_handling.py.| Topic | Reference |
|---|---|
| Setup & onboarding | docs/Setup.md |
| Architecture & flow | docs/Architecture.md |
| Smart routing internals | docs/HybridMode.md |
| Configuration deep dive | docs/Configuration.md |
| OpenAI usage | docs/OpenAI.md |
| Perplexity usage & citations | docs/Perplexity.md |
| Message splitting & embeds | docs/MessageSplitting.md, docs/EmbedLimits.md |
| Web scraping pipeline | docs/WebScraping.md |
| Connection pooling & HTTP/2 | docs/ConnectionPooling.md |
| Docker & daemonization | docs/Docker.md, docs/Daemon.md |
| Security & rate limiting | docs/Security.md |
| Development workflow | docs/Development.md |
| API parameter validation | docs/API_Validation.md |
# Install dev extras
pip install -e .[dev]
# Lint & format
ruff check --fix .
black .
# Run the targeted suites
pytest -q
pytest tests/test_smart_orchestrator_coverage.py
Use tox for the CI matrix (tox, tox -e py312, tox --parallel auto, tox -e audit). CI runs Ruff, Black, pytest with coverage, and pip-audit; locally run tox -e audit to scan runtime + dev deps.
config.ini out of version control; copy from config.ini.example and set chmod 600 config.ini on servers.export DISCORD_TOKEN=...).sk-...) and Perplexity (pplx-...) keys regularly; validators will reject malformed prefixes.ALLOWED_CHANNEL_IDS for precise channel targeting in shared or multi-server deployments.RATE_LIMIT / RATE_LIMIT_PER accordingly.