Tool Use Gpt 5
Code
1from kern.agent import Agent2from kern.models.openai import OpenAIResponses3from kern.tools.yfinance import YFinanceTools45agent = Agent(6 model=OpenAIResponses(id="gpt-5"),7 tools=[YFinanceTools(cache_results=True)],8 markdown=True,9 telemetry=False,10)1112agent.print_response("What is the current price of TSLA?", stream=True)Usage
Set up your virtual environment
1uv venv --python 3.122source .venv/bin/activate1uv venv --python 3.122.venv\Scripts\activateSet your API key
1export OPENAI_API_KEY=xxxInstall dependencies
1uv pip install -U openai kern-aiRun Agent
1python cookbook/11_models/openai/responses/tool_use_gpt_5.py