summaryrefslogtreecommitdiff
path: root/client.py
diff options
context:
space:
mode:
Diffstat (limited to 'client.py')
-rw-r--r--client.py20
1 files changed, 12 insertions, 8 deletions
diff --git a/client.py b/client.py
index c983db1..8d6829d 100644
--- a/client.py
+++ b/client.py
@@ -1,16 +1,24 @@
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",)
+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:
@@ -18,10 +26,6 @@ while True:
if user_input.lower() in {"exit", "quit"}:
break
-
- print("Agent: ", end="", flush=True)
-
- for chunk in agent.chat(user_input):
- print(chunk, end="", flush=True)
-
- print()
+
+ answer = agent.chat(user_input)
+ print(f"Agent: {answer}")