1from textwrap import dedent
2
3from kern.agent import Agent
4from kern.models.groq import Groq
5from kern.tools.hackernews import HackerNewsTools
6from kern.tools.reasoning import ReasoningTools
7
8thinking_llama = Agent(
9 model=Groq(id="meta-llama/llama-4-scout-17b-16e-instruct"),
10 tools=[
11 ReasoningTools(),
12 HackerNewsTools(),
13 ],
14 instructions=dedent("""\
15 ## General Instructions
16 - Always start by using the think tool to map out the steps needed to complete the task.
17 - After receiving tool results, use the think tool as a scratchpad to validate the results for correctness
18 - Before responding to the user, use the think tool to jot down final thoughts and ideas.
19 - Present final outputs in well-organized tables whenever possible.
20
21 ## Using the think tool
22 At every step, use the think tool as a scratchpad to:
23 - Restate the object in your own words to ensure full comprehension.
24 - List the specific rules that apply to the current request
25 - Check if all required information is collected and is valid
26 - Verify that the planned action completes the task\
27 """),
28 markdown=True,
29)
30thinking_llama.print_response("Write a report comparing NVDA to TSLA", stream=True)