-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_message_format.py
43 lines (35 loc) · 1.12 KB
/
test_message_format.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
31
32
33
34
35
36
37
38
39
40
41
42
43
from chat2apply.bot import Bot
messages = [
"I want to find a job",
"Chicago",
"Waiter",
"full-time",
"I am legally eligible to work in the USA",
]
bot = Bot(company_name="company_name", bot_name="GeniusBot")
failed_cases = []
total_cases_count = 100
for loop in range(total_cases_count):
called = False
conversion = []
for message in messages:
bot.console.user_print(message)
conversion.append(message)
response = bot.run(message)
bot.console.ai_print(response["text"])
conversion.append(response["text"])
calling = response["function_calling"]
__import__("pprint").pprint(calling)
if calling:
called = True
__import__("pprint").pprint(calling)
bot.memory.clear()
print(
"------------------------------------------------------------------------------------------------"
)
if not called:
failed_cases.append(conversion)
failed_cases_count = len(failed_cases)
print(f"Failed cases count: {failed_cases_count}")
print(f"Failed cases count: {total_cases_count}")
# bot.run_interactively()