OpenAI o4-mini
Add the following code to your Python file
1from kern.agent import Agent2from kern.models.openai.responses import OpenAIResponses34agent = Agent(model=OpenAIResponses(id="o4-mini"))56agent.print_response(7 "Solve the trolley problem. Evaluate multiple ethical frameworks. "8 "Include an ASCII diagram of your solution.",9 stream=True,10)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 openaiExport 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