From f869740f551d8e193ebf0580305aaec1e5b076ab Mon Sep 17 00:00:00 2001 From: Farouk Adeleke Date: Sun, 9 Nov 2025 04:54:51 -0500 Subject: [PATCH] update README.md --- README.md | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- main.py | 2 +- 2 files changed, 67 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2faf7a1..bead005 100644 --- a/README.md +++ b/README.md @@ -10,8 +10,73 @@ A DSPy module that wraps the OpenAI Codex SDK with a signature-driven interface. - **Rich outputs** - Get typed results + execution trace + token usage - **Multi-turn conversations** - Context preserved across calls - **Output field descriptions** - Automatically enhance prompts +- **Modaic integration** - Deploy and share agents on the Modaic hub -## Installation +## Quick Start with Modaic + +The fastest way to use CodexAgent is through [Modaic](https://docs.modaic.dev/), which allows you to pull pre-packaged agents from the hub. + +### 1. Set up environment variables + +Create a `.env` file with your API keys: + +```bash +# Copy the example file +cp .env.example .env + +# Edit .env with your keys +MODAIC_TOKEN="" +CODEX_API_KEY="" +``` + +- Get your **MODAIC_TOKEN** from [Modaic dashboard](https://modaic.dev/) +- Get your **CODEX_API_KEY** (OpenAI API key) from [OpenAI platform](https://platform.openai.com/api-keys) + +### 2. Install dependencies + +```bash +pip install modaic dspy python-dotenv +``` + +### 3. Use the agent + +```python +from modaic import AutoAgent +import dspy +from pydantic import BaseModel +from dotenv import load_dotenv + +load_dotenv() + +class Dependencies(BaseModel): + dependencies: list[str] + +def main(): + sig = dspy.Signature("message:str -> answer:Dependencies") + codex_agent = AutoAgent.from_precompiled( + "darinkishore/codex-agent", + config_options={ + "signature": sig, + "working_directory": ".", + "model": "gpt-4o", + "codex_path_override": "/opt/homebrew/bin/codex" # Optional: customize codex binary path + }, + ) + + result = codex_agent(message="check the pyproject.toml for this projects dependencies") + print(result.answer.dependencies) # Typed Pydantic output + print(result.trace) # Execution items (commands, files, etc.) + print(result.usage) # Token counts + +if __name__ == "__main__": + main() +``` + +**Note**: Make sure the Codex CLI is installed and accessible. On macOS with Homebrew, it's typically at `/opt/homebrew/bin/codex`. Use `which codex` to find your path. + +## Local Installation & Development + +If you want to develop or modify the agent locally: ```bash # Install dependencies diff --git a/main.py b/main.py index 744620b..d85f1ab 100644 --- a/main.py +++ b/main.py @@ -7,7 +7,7 @@ codex_agent = CodexAgent(CodexAgentConfig()) def main(): - codex_agent.push_to_hub("darinkishore/codex-agent", with_code=True, commit_message="fix thread error") + codex_agent.push_to_hub("darinkishore/codex-agent", with_code=True, commit_message="update README.md") #result = codex_agent(message="What files are in this directory?") #print(result.answer) # String response #print(result.trace) # Execution items (commands, files, etc.)