summaryrefslogtreecommitdiff
path: root/client.py
blob: c983db16782c98e93bd724af9fa09095da059ce9 (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
from agent import Agent
from identity import load_agent_identity, load_user_profile
from llm import LLM

llm = LLM("http://localhost:8080/v1/chat/completions",)

agent_identity = load_agent_identity("agent.toml")
user_profile = load_user_profile("user.toml")

agent = Agent(
    llm,
    agent_identity,
    user_profile,
)

while True:
    user_input = input("You: ")

    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()