Azure OpenAI with Reasoning Tools
Add the following code to your Python file
1from kern.agent import Agent2from kern.models.azure.openai_chat import AzureOpenAI3from kern.tools.hackernews import HackerNewsTools4from kern.tools.reasoning import ReasoningTools56reasoning_agent = Agent(7 model=AzureOpenAI(id="gpt-5.2"),8 tools=[9 HackerNewsTools(),10 ReasoningTools(11 think=True,12 analyze=True,13 add_instructions=True,14 add_few_shot=True,15 ),16 ],17 instructions="Use tables where possible. Think about the problem step by step.",18 markdown=True,19)2021reasoning_agent.print_response(22 "Write a report comparing NVDA to TSLA.",23 stream=True,24 show_full_reasoning=True,25)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 anthropic ddgsExport your API keys
1export OPENAI_API_KEY="your_openai_api_key_here"2 export ANTHROPIC_API_KEY="your_anthropic_api_key_here"1$Env:OPENAI_API_KEY="your_openai_api_key_here"2$Env:ANTHROPIC_API_KEY="your_anthropic_api_key_here" Run Agent
1python azure_openai_reasoning_tools.py