Skip to content

jinggc03/openai-agent-builder-onboarding

Repository files navigation

🧠 Wrunity Helper Agent (OpenAI Agent Builder Onboarding)

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.


🚀 Overview

  • 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 testing
    • bot_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.


📦 Requirements

  • 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)

🔧 Installation

git clone https://github.com/elgolfillo/openai-agent-builder-onboarding.git
cd openai-agent-builder-onboarding
poetry install

All project dependencies are described in pyproject.toml and pinned in poetry.lock.


🔐 Environment Configuration

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 bot

The application uses python-dotenv to load these variables on startup. Tokens are read only at runtime and are not logged.


▶️ Usage

CLI Agent

Run the interactive terminal experience:

poetry run python test_agent.py

You 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.

Discord Bot

Ensure both OPENAI_API_KEY and DISCORD_TOKEN are set, then start the bot:

poetry run python bot_wrunity_helper.py

Invite 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.


🧱 Architecture

  • test_agent.py: defines the Wrunity Helper agent, validates inputs, and exposes run_workflow() which executes the OpenAI ADK pipeline.
  • bot_wrunity_helper.py: loads environment variables, ensures both secrets are present, registers a !ask command via discord.ext.commands, and relays questions to run_workflow().

Both entry points share the same agent configuration to guarantee consistent behaviour across local CLI sessions and Discord interactions.


🛡️ Security & Best Practices

  • Keep .env local; .gitignore already 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.

📸 Optional Evidence

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.


🧰 Tech Stack

  • openai-agents for agent orchestration
  • discord.py for Discord integration
  • pydantic for payload validation
  • python-dotenv for environment management

✨ Next Steps

  • 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.

🪪 License

Distributed under the MIT License for educational and demonstration purposes.

About

Practical onboarding project for the OpenAI Agent Builder SDK (GPT-5).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages