blob: 8d6829dd6e56813aae9d86533bf533f3fbfc21e8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
from agent import Agent
from identity import load_agent_identity, load_user_profile
from llm import LLM
from tools import CalculatorTool, HelloTool, ToolRegistry
llm = LLM(
"http://localhost:8080/v1/chat/completions",
)
agent_identity = load_agent_identity("agent.toml")
user_profile = load_user_profile("user.toml")
tools = ToolRegistry()
tools.register(HelloTool())
tools.register(CalculatorTool())
agent = Agent(
llm,
agent_identity,
user_profile,
tools,
)
while True:
user_input = input("You: ")
if user_input.lower() in {"exit", "quit"}:
break
answer = agent.chat(user_input)
print(f"Agent: {answer}")
|