Minimal coding, computer-use, and research agents using the OpenAI Agents SDK.
- code.py - A minimal coding agent in 200 lines of Python code.
- cua.py - A minimal computer-use agent in 100 lines of Python code.
- research.py - A minimal research agent in 100 lines of Python code.
Clone this repository, install the OpenAI Agents SDK, and set the OpenAI API key
git clone https://github.com/lutzroeder/agents
pip install openai-agents
# Windows
set OPENAI_API_KEY=...
# macOS/Linux
export OPENAI_API_KEY=...A minimal coding agent inspired by Raising the bar on SWE-bench in 200 lines of Python code.
python code.py <directory>π€ User: Explain this code to me
π€ I'll help you understand the code in this repository. Let's first explore the repository structure to get a better understanding of what we're looking at.
π > view .
Let's check the main code file, gpt2.py:
π > view gpt2.py
Let's also check the README to understand more about this project:
π > view README.md
This repository contains a minimalist implementation of OpenAI's GPT-2 language model using PyTorch.
...
A minimal computer-use agent in 100 lines of Python code.
pip install pyautogui
python cua.pyπ€ User: Open browser at lutzroeder.com
screenshot {}
π€ Action: Opening web browser, checking Edge icon
click {'button': 'left', 'x': 1388, 'y': 1544}
wait {}
π€ Action: Navigating to lutzroeder.com in Edge
click {'button': 'left', 'x': 1056, 'y': 104}
type {'text': 'lutzroeder.com'}
keypress {'keys': ['ENTER']}
wait {}
π€ Agent: The website lutzroeder.com is open in the browser...
π€ User:
A minimal research agent in 100 lines of Python code.
python research.pyπ€ User: top news today
π€ Planning β
π Searching β
π Summarizing β
This comprehensive report synthesizes today's top news...