-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprompts.py
More file actions
132 lines (101 loc) Β· 5.54 KB
/
prompts.py
File metadata and controls
132 lines (101 loc) Β· 5.54 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
def extractor_llm_prompt(input_sentence):
return f'''
Assume you are an expert in extracting keywords from the given input. You task is to extract \n
following fields from the given sentence.
*** Input Sentence ***
<input>
I live near 'Kingdom Care Center 11700 Beltsville Drive Beltsville Prince George's County MD 20705', \n
find me some place where I can go every Thursady to get food
</input>
*** Tasks ***
You are tasked to extract following information from the <input>
<tasks>
1. Address : address given in the input. Return type is string. If empty then return empty string.
2. Region : from the address you need to figure out if it belongs to any of the following regions
['DC', 'MD', 'VA']. Return type is string. If empty then return empty string.
3. County : from the address you need to figure out if it belongs to any of the following counties
['Outside CAFB Service Area','Ward 1', 'Ward 2', 'Ward 3', 'Ward 4', 'Ward 5', 'Ward 6', 'Ward 7', 'Ward 8',
'Montgomery County', 'Prince George's County', 'Arlington County', 'City of Alexandria', 'City of Manassas',
'Fairfax County', 'Falls Church City', 'Manassas City', 'Prince William County']. Return type is string.
If empty then return empty string.
4. Day of Week : it can be one of the following ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'].
Return type is string. If empty then return empty string.
5. Distribution Mode : it can be following (can be multiple too) ['Drive Through', 'Home Delivery', 'Walk Up'].
Return type is string. If empty then return empty string. If multiple then return a list of strings.
6. Geo_Address : address given in the input but in a specific format i.e. <street_number> <stree_name> <region> <pincode>. Return type is string. If empty then return empty string.
</tasks>
*** Output Format ***
Make sure your output is in JSON format and if you dont find any of the field then return empty
string for it
<output>
"address" : "Kingdom Care Center 11700 Beltsville Drive Beltsville Prince George's County MD 20705",
"region" : "MD",
"county" : "Prince George's County",
"day" : "Thursday",
"distribution_mode" : "",
"geo_address" : "11700 Beltsville Drive Beltsville MD 20705"
</output>
** Example Input **
I live near Manassas City Mary Bull Run Unitarian Universalists 9350 Main
Street Manassas VA 20110 and I want to go to a food distribution center on Fridays only and I can only go
via walking.
** Example Output **
{ 'address': 'Ward 5 Mary House 4303 13th st NE Washington DC 20017',
'region': 'DC',
'county': 'Ward 5',
'day': 'Friday',
'distribution_mode': 'Walk Up',
'geo_address': '4303 13th st NE Washington DC 20017'
}
*** Now can you do this for this input sentence ***
{input_sentence}
'''
def summary_llm_prompt(input_sentence, llm1_output, nearest_neighbours):
return f'''
given following input sentence :
<input>{input_sentence}</input>
And following extracted information from the input sentence :
<extracted_info>{llm1_output}</extracted_info>
You are also provided with some closest food stores near the input address and some information about these food stores :
<nearest_neighbours>{nearest_neighbours}</nearest_neighbours>
Your task is to recommend top 5 (OR LESS i.e. HOWMUCH EVER FITS THE CRITERIA) food stores from the given list which <IMP>fits all the criterias given in the input sentence</IMP>.
For instance if the input sentence says 'I need food every Monday' then you need to find the food stores which are open on Monday only and so on.
Output the recommendations in such a format that it is readable, uses emojis and well formatted.
Give important information about the food store like its
- address
- contact details
- what ids you need to bring
- start time and end time
- distribution mode
- other important information
If you find any of the information missing then dont include it in the output.
<>Sample Output<>
Based on your location and preferences, here are the food distribution centers that you can visit:
1. π **Mary House - Ward 5**
- π Address: 4303 13th st NE Washington DC 20017
- π Contact: (202) 635-9025
- π Time: Tuesday, 1st and 3rd of the Month, 10:00 AM - 01:00 PM
- π Distribution Mode: Home Delivery, Walk up
2. π **Northeastern Presbyterian Church**
- π Address: 2112 Varnum St. NE Washington DC 20018
- π Contact: (202) 316-8744
- π Time: Saturday, 3rd of the Month, 10:00 AM - 12:00 PM
- πΆββοΈ Distribution Mode: Walk up
3. π **McKendree-Simms-Brookland United Methodist Church**
- π Address: 2411 Lawrence St NE Washington DC 20018
- π Contact: (202) 526-3685
- π Time: Friday, Tuesday, 10:00 AM - 02:00 PM
- π ID Required: Yes, Zip Code
- πΆββοΈ Distribution Mode: Walk up (Only for Ward Five residents)
4. π **Metropolis Club**
- π Address: 938 Rhode Island Ave NE Washington DC 20018
- π Contact: (301) 793-4236
- π Time: Friday, Monday, Saturday, Sunday, Thursday, Tuesday, Wednesday, 07:00 AM - 08:00 PM
- πΆββοΈ Distribution Mode: Walk up
5. π **Plenty to Eat**
- π Address: 2315 18th Place NE Washington DC 20018
- π Contact: (202) 556-0662
- π Time: Tuesday, Wednesday, 11:00 AM - 03:00 PM
- π ID Required: Yes, Zip Code
- πΆββοΈ Distribution Mode: Walk up
'''