-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest__database_schema_creator.py
50 lines (47 loc) · 1.84 KB
/
test__database_schema_creator.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
44
45
46
47
48
49
50
from config__database_schema_creator import EXPERT_COMMANDS
import core
def test():
command_messages = core.create_command_messages(EXPERT_COMMANDS)
tests = [
{
"name": "General DB question",
"prompts": [
"I want to set up my database",
"help me build my application"
]
},
{
"name": "App creation - Car-Parts-Inc",
"prompts": [
"My application is called Car-Parts-Inc. It needs to manage Cars, Wheels, Tyres, windscreens and accessories.",
"A car has four wheels and one windscreen and many accessories. A wheel has one tyre.",
"Write the SQL to create the tables and populate with test data",
"Create the test data in CSV format",
]
},
{
"name": "App creation - Euro-Shop",
"prompts": [
"My application is called Euro-Shop. The shop sells household items which each have a price and unit volume.",
"Show me how to create the database with some test data",
]
},
{
"name": "Irrelevant prompts",
"prompts": [
# other prompts, that should NOT be handled by the Commands:
"what is 2 + 5 divided by 10 ?",
"Who won the battle of Agincourt, and why was it fought?",
"What is my favourite color?",
]
},
]
for test in tests:
previous_messages = []
print(f"[[[TEST {test['name']}]]]")
for user_prompt in test['prompts']:
print("---")
print(f">> {user_prompt}")
# should route to the right 'expert' chain!
rsp = core.execute_prompt(user_prompt, previous_messages, command_messages)
print(rsp)