Vercel with Reasoning Tools

Add the following code to your Python file

1from kern.agent import Agent
2from kern.models.vercel import v0
3from kern.tools.hackernews import HackerNewsTools
4from kern.tools.reasoning import ReasoningTools
5
6reasoning_agent = Agent(
7 model=v0(id="v0-1.0-md"),
8 tools=[
9 ReasoningTools(add_instructions=True, add_few_shot=True),
10 HackerNewsTools(),
11 ],
12 instructions=[
13 "Use tables to display data",
14 "Only output the report, no other text",
15 ],
16 markdown=True,
17)
18
19reasoning_agent.print_response(
20 "Write a report on TSLA",
21 stream=True,
22 show_full_reasoning=True,
23)

Set up your virtual environment

1uv venv --python 3.12
2source .venv/bin/activate
1uv venv --python 3.12
2.venv\Scripts\activate

Install dependencies

1uv pip install -U kern-ai openai ddgs

Export your V0 API key

1export V0_API_KEY="your_v0_api_key_here"
1$Env:V0_API_KEY="your_v0_api_key_here"

Run Agent

1python vercel_reasoning_tools.py