OpenAI gpt-5-mini with reasoning effort
Add the following code to your Python file
1from kern.agent import Agent2from kern.models.openai import OpenAIResponses3from kern.tools.hackernews import HackerNewsTools45agent = Agent(6 model=OpenAIResponses(id="gpt-5.2", openai="high"),7 tools=[HackerNewsTools()],8 instructions="Use tables to display data.",9 markdown=True,10)1112agent.print_response("Write a report comparing NVDA to TSLA", stream=True)Set up your virtual environment
1uv venv --python 3.122source .venv/bin/activate1uv venv --python 3.122.venv\Scripts\activateInstall dependencies
1uv pip install -U kern-ai openai ddgsExport your OpenAI API key
1export OPENAI_API_KEY="your_openai_api_key_here"1$Env:OPENAI_API_KEY="your_openai_api_key_here"Run Agent
1python openai.py