-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathtest_chat.py
More file actions
32 lines (22 loc) · 785 Bytes
/
test_chat.py
File metadata and controls
32 lines (22 loc) · 785 Bytes
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
32
import time
from colorama import Fore, Style
from src.conversational_routing.main import ChatFlow
messages = [
"Hello",
"Tell me about benefits",
"Is there an extended warranty protection?",
"What are coverage limits?",
# "Tell me about travel insurance",
]
session_id = None
for i, message in enumerate(messages):
print(f"\n{Fore.BLUE}{Style.BRIGHT}Question #{i + 1}{Style.RESET_ALL}")
chat_flow = ChatFlow()
inputs = {"current_message": message}
if session_id is not None:
inputs["id"] = session_id
response = chat_flow.kickoff(inputs=inputs)
print(f"{Style.BRIGHT}Response:{Style.RESET_ALL} ", response)
print(f"{Style.DIM}{chat_flow.state}{Style.RESET_ALL}")
session_id = chat_flow.state.id
# time.sleep(5)