Async Tool Use
Code
1import asyncio23from kern.agent import Agent4from kern.models.neosantara import Neosantara5from kern.tools.duckduckgo import DuckDuckGoTools67agent = Agent(8 model=Neosantara(id="grok-4.1-fast-non-reasoning"),9 tools=[DuckDuckGoTools()],10 markdown=True,11)1213# Print the response in the terminal14asyncio.run(15 agent.aprint_response("What is the current stock price of NVDA?", stream=True)16)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 NEOSANTARA_API_KEY=xxxInstall dependencies
1uv pip install -U openai ddgs kern-aiRun Agent
1python cookbook/90_models/neosantara/async_tool_use.py