Async Tool Use
Code
1"""Run `uv pip install` to install dependencies."""23import asyncio45from kern.agent import Agent6from kern.models.openai import OpenAIResponses7from kern.tools.hackernews import HackerNewsTools89agent = Agent(10 model=OpenAIResponses(id="gpt-5-mini"),11 tools=[HackerNewsTools()],12 markdown=True,13)14asyncio.run(agent.aprint_response("Whats happening in France?", 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/async_tool_use.py