-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_patterns.py
More file actions
40 lines (33 loc) · 1.05 KB
/
test_patterns.py
File metadata and controls
40 lines (33 loc) · 1.05 KB
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
from agent_repl import TravelBookingAgent
agent = TravelBookingAgent()
test_phrases = [
"provide all my bookings",
"provide all bookings",
"all my bookings",
"show my bookings",
"show bookings for nikitha",
"all bookings for nikitha"
]
print("Testing pattern matching:")
print("=" * 50)
for phrase in test_phrases:
intent, params = agent.parse_natural_language(phrase)
print(f"'{phrase}' -> Intent: {intent}, Params: {params}")
print("\n" + "=" * 50)
print("Testing actual execution:")
# Test the new provide all bookings pattern
print("\nExecuting: 'provide all my bookings'")
try:
result = agent.process_command('provide all my bookings', 'local')
print(f"Result type: {type(result)}")
print(f"Result: {result}")
except Exception as e:
print(f"Error: {e}")
print("\n" + "=" * 30)
print("Testing: 'provide all bookings'")
try:
result = agent.process_command('provide all bookings', 'local')
print(f"Result type: {type(result)}")
print(f"Result: {result}")
except Exception as e:
print(f"Error: {e}")