Async Tool Use
Code
1import asyncio23from kern.agent import Agent4from kern.models.litellm import LiteLLM5from kern.tools.hackernews import HackerNewsTools67agent = Agent(8 model=LiteLLM(9 id="gpt-5-mini",10 name="LiteLLM",11 ),12 markdown=True,13 tools=[HackerNewsTools()],14)1516# Ask a question that would likely trigger tool use17asyncio.run(agent.aprint_response("What is happening in France?"))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 LITELLM_API_KEY=xxxInstall dependencies
1uv pip install -U litellm kern-aiRun Agent
1python cookbook/11_models/litellm/async_tool_use.py