diff options
Diffstat (limited to 'client.py')
| -rw-r--r-- | client.py | 20 |
1 files changed, 12 insertions, 8 deletions
@@ -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}") |
