OpenAI o4-mini with reasoning summary
Add the following code to your Python file
1from kern.agent import Agent2from kern.models.openai import OpenAIResponses3from kern.tools.hackernews import HackerNewsTools45# Setup the reasoning Agent6agent = Agent(7 model=OpenAIResponses(8 id="o4-mini",9 reasoning_summary="auto", # Requesting a reasoning summary10 ),11 tools=[HackerNewsTools()],12 instructions="Use tables to display the analysis",13 markdown=True,14)1516agent.print_response(17 "Write a brief report comparing NVDA to TSLA",18 stream=True,19)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