Spaces:
Sleeping
Sleeping
drakosfire
commited on
Commit
•
53e55d4
1
Parent(s):
a59b358
updated prompt in store_helper to add inventory prompt in, prior had been split into two seperate prompts to generate store description and inventory seperately. This needs significant testing
Browse files- store_helper.py +76 -7
store_helper.py
CHANGED
@@ -27,11 +27,9 @@ def load_llm(user_input, prompt_instructions):
|
|
27 |
return response.choices[0].message.content
|
28 |
# Call the LLM and store its output
|
29 |
def call_llm_and_cleanup(user_input, inventory = False):
|
30 |
-
if not inventory :
|
31 |
-
prompt_instructions = f"{initial_prompt_instructions} {store_description}"
|
32 |
-
else : prompt_instructions = f"{inventory_prompt_instructions} {inventory_description}"
|
33 |
|
34 |
-
|
|
|
35 |
llm_output = load_llm(user_input, prompt_instructions)
|
36 |
llm_output = "".join(llm_output)
|
37 |
print(llm_output)
|
@@ -101,6 +99,11 @@ Image Generation Prompt Examples :
|
|
101 |
5. sd_prompts should specify race or species
|
102 |
6. quests MUST be detailed, and interesting, preferably unexpected, delightful and memorable.
|
103 |
7. The reward for the quest MUST be specific and detailed!
|
|
|
|
|
|
|
|
|
|
|
104 |
"""
|
105 |
|
106 |
store_description = {
|
@@ -176,12 +179,78 @@ store_description = {
|
|
176 |
"description": "",
|
177 |
"price": ""
|
178 |
}
|
179 |
-
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
180 |
}
|
181 |
|
182 |
inventory_prompt_instructions = """
|
183 |
-
|
184 |
-
Core Inventory is a simple list of the very standard things a shop might carry.
|
185 |
|
186 |
1. Only output file structure starting with { and ending with } it is CRITICAL to end with a }, DO NOT say anything, don't add ''' or json"
|
187 |
2. DO NOT use null, use "".
|
|
|
27 |
return response.choices[0].message.content
|
28 |
# Call the LLM and store its output
|
29 |
def call_llm_and_cleanup(user_input, inventory = False):
|
|
|
|
|
|
|
30 |
|
31 |
+
prompt_instructions = f"{initial_prompt_instructions} {store_description}"
|
32 |
+
|
33 |
llm_output = load_llm(user_input, prompt_instructions)
|
34 |
llm_output = "".join(llm_output)
|
35 |
print(llm_output)
|
|
|
99 |
5. sd_prompts should specify race or species
|
100 |
6. quests MUST be detailed, and interesting, preferably unexpected, delightful and memorable.
|
101 |
7. The reward for the quest MUST be specific and detailed!
|
102 |
+
|
103 |
+
Inventory Instructions:
|
104 |
+
1. Core Inventory should include at least five items.
|
105 |
+
2.Many categories of items wont make sense for most stores. IE Butchers Shops do not need magic items and potions. They might have them, but they would be very specific and probably not for sale at a reasonable price. Similarly a weapon shop does not need to sell basic traveling goods.
|
106 |
+
3.. ALL items have "properties :"
|
107 |
"""
|
108 |
|
109 |
store_description = {
|
|
|
179 |
"description": "",
|
180 |
"price": ""
|
181 |
}
|
182 |
+
],
|
183 |
+
|
184 |
+
"inventory": {
|
185 |
+
"core_inventory":[
|
186 |
+
{
|
187 |
+
"name": "",
|
188 |
+
"type": "",
|
189 |
+
"cost": "",
|
190 |
+
"properties": []
|
191 |
+
}
|
192 |
+
],
|
193 |
+
"weapons": [
|
194 |
+
{
|
195 |
+
"name": "",
|
196 |
+
"type": "",
|
197 |
+
"cost": "",
|
198 |
+
"properties": []
|
199 |
+
}
|
200 |
+
],
|
201 |
+
"armor": [
|
202 |
+
{
|
203 |
+
"name": "",
|
204 |
+
"type": "",
|
205 |
+
"cost": "",
|
206 |
+
"properties": []
|
207 |
+
}
|
208 |
+
],
|
209 |
+
"potions": [
|
210 |
+
{
|
211 |
+
"name": "",
|
212 |
+
"type": "",
|
213 |
+
"cost": "",
|
214 |
+
"properties": []
|
215 |
+
}
|
216 |
+
],
|
217 |
+
"scrolls": [
|
218 |
+
{
|
219 |
+
"name": "",
|
220 |
+
"type": "",
|
221 |
+
"cost": "",
|
222 |
+
"properties": []
|
223 |
+
}
|
224 |
+
],
|
225 |
+
"magical_items": [
|
226 |
+
{
|
227 |
+
"name": "",
|
228 |
+
"type": "",
|
229 |
+
"cost": "",
|
230 |
+
"properties": []
|
231 |
+
}
|
232 |
+
],
|
233 |
+
"mundane_items": [
|
234 |
+
{
|
235 |
+
"name": "",
|
236 |
+
"type": "",
|
237 |
+
"cost": "",
|
238 |
+
"properties": []
|
239 |
+
}
|
240 |
+
],
|
241 |
+
"miscellaneous_items": [
|
242 |
+
{
|
243 |
+
"name": "",
|
244 |
+
"type": "",
|
245 |
+
"cost": "",
|
246 |
+
"properties": []
|
247 |
+
}
|
248 |
+
]
|
249 |
+
}
|
250 |
}
|
251 |
|
252 |
inventory_prompt_instructions = """
|
253 |
+
|
|
|
254 |
|
255 |
1. Only output file structure starting with { and ending with } it is CRITICAL to end with a }, DO NOT say anything, don't add ''' or json"
|
256 |
2. DO NOT use null, use "".
|