-
Notifications
You must be signed in to change notification settings - Fork 6
/
chat.py
30 lines (21 loc) · 761 Bytes
/
chat.py
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
from llm_agent import LLMAgent
from embedder import HFEmbedder
from search_engine import SearchEngine
from summarizer import Summarizer
from db import DBInstance
from dotenv import dotenv_values
env = dotenv_values(".env")
def chat():
while True:
user_text_request = input("You > ")
bot_text_response = llm_agent.generate(user_text_request)
print(f"Bot < {bot_text_response}")
if __name__ == "__main__":
embedder = HFEmbedder()
search_engine = SearchEngine()
summarizer = Summarizer()
db_instance = DBInstance("long-term-memory", embedder=embedder)
llm_agent = LLMAgent(
env["LLM_PATH"], db_instance, summarizer, search_engine, use_summarizer=False
)
chat()