Agent with Async Tool Usage
Code
1"""Run `uv pip install kern-ai llama-api-client` to install dependencies."""23import asyncio45from kern.agent import Agent6from kern.models.meta import Llama7from kern.tools.hackernews import HackerNewsTools89agent = Agent(10 model=Llama(id="Llama-4-Maverick-17B-128E-Instruct-FP8"),11 tools=[HackerNewsTools()],12 debug_mode=True,13)14asyncio.run(agent.aprint_response("Whats happening in UK and in USA?"))Usage
Set up your virtual environment
1uv venv --python 3.122source .venv/bin/activate1uv venv --python 3.122.venv\Scripts\activateSet your LLAMA API key
1export LLAMA_API_KEY=YOUR_API_KEYInstall dependencies
1uv pip install llama-api-client kern-aiRun Agent
1python cookbook/11_models/meta/async_tool_use.py