This repository demonstrates how to run the Wrunity Helper agent locally using the Python OpenAI Agent Development Kit (ADK) together with Poetry for dependency management. It now includes a Discord integration so the same agent can answer questions directly inside a Discord server.
- Language & Runtime: Python 3.12 (compatible with 3.10+)
- Agent: Wrunity Helper, powered by
openai-agents - Interfaces:
test_agent.py: interactive CLI workflow for quick local testingbot_wrunity_helper.py: Discord bot that forwards guild questions to the agent
Use this project as a reference for wiring OpenAI agents to multiple front-ends while keeping configuration secure via environment variables.
- Python 3.10 or later (3.12.2 recommended)
- Poetry 1.6+
- A valid OpenAI API key with ADK access
- Discord Bot token (if you plan to run the Discord integration)
git clone https://github.com/elgolfillo/openai-agent-builder-onboarding.git
cd openai-agent-builder-onboarding
poetry installAll project dependencies are described in pyproject.toml and pinned in poetry.lock.
Create a .env file in the project root (never commit it) and provide the required secrets:
OPENAI_API_KEY=your_openai_key_here
DISCORD_TOKEN=your_discord_bot_token_here # Optional unless you run the Discord botThe application uses python-dotenv to load these variables on startup. Tokens are read only at runtime and are not logged.
Run the interactive terminal experience:
poetry run python test_agent.pyYou will get an initial answer from the agent and can continue the conversation in the same session. Exit with an empty line or Ctrl+C.
Ensure both OPENAI_API_KEY and DISCORD_TOKEN are set, then start the bot:
poetry run python bot_wrunity_helper.pyInvite the bot to your server and use:
!ask How do I deploy FastAPI on AWS?
The bot streams the prompt through the same agent workflow and replies in the channel.
test_agent.py: defines the Wrunity Helper agent, validates inputs, and exposesrun_workflow()which executes the OpenAI ADK pipeline.bot_wrunity_helper.py: loads environment variables, ensures both secrets are present, registers a!askcommand viadiscord.ext.commands, and relays questions torun_workflow().
Both entry points share the same agent configuration to guarantee consistent behaviour across local CLI sessions and Discord interactions.
- Keep
.envlocal;.gitignorealready prevents it from being tracked. - Rotate API keys periodically and restrict Discord bot permissions to the commands it needs.
- When publishing the repository, update the GitHub description and topics to highlight “OpenAI Agent Builder”, “Discord bot”, and “Poetry” for easier discovery.
If you capture screenshots or GIFs of the Discord bot in action, place them under a docs/ directory and reference them here. Avoid embedding tokens or channel identifiers in media assets.
openai-agentsfor agent orchestrationdiscord.pyfor Discord integrationpydanticfor payload validationpython-dotenvfor environment management
- Customize the agent’s instructions and toolset in
test_agent.py. - Add tests (e.g., with
pytest) to validate prompts and error handling. - Extend the Discord bot with role-based permissions or additional slash commands.
Distributed under the MIT License for educational and demonstration purposes.