Spaces:
Sleeping
Sleeping
kwabs22
commited on
Commit
·
3e45414
1
Parent(s):
00cf370
Config based info to help users
Browse files
app.py
CHANGED
@@ -707,8 +707,8 @@ with gr.Blocks() as demo:
|
|
707 |
with gr.Accordion("Config Crafting Progerssion - click to open", open=False):
|
708 |
gr.HTML("Example of how to advance a game config with LLM - end goal is to have automatic worflow that takes these considerations into account <br> Things missing from the game engine - Economics and Basic Politics (NPC affiliation)")
|
709 |
originalconfigatbeinningofthisspace = """{
|
710 |
-
|
711 |
-
|
712 |
"description": "You wake up in a small village. You hear a rumor about a lost treasure.",
|
713 |
"choices": ['explore village', 'gather supplies', 'rest'],
|
714 |
"transitions": {'explore village': 'village_rumor', 'gather supplies': 'village_supplies', 'rest': 'village_start'},
|
@@ -717,7 +717,7 @@ with gr.Blocks() as demo:
|
|
717 |
},
|
718 |
"media": []
|
719 |
},
|
720 |
-
|
721 |
"description": "You hear more details about the treasure hidden in the ancient ruins nearby.",
|
722 |
"choices": ['decide to go', 'ignore'],
|
723 |
"transitions": {'decide to go': 'village_supplies', 'ignore': 'village_start'},
|
@@ -726,41 +726,41 @@ with gr.Blocks() as demo:
|
|
726 |
},
|
727 |
"media": []
|
728 |
},
|
729 |
-
|
730 |
"description": "You gather supplies for your journey.",
|
731 |
"choices": ['head to forest', 'stay in village'],
|
732 |
"transitions": {'head to forest': 'forest_forest', 'stay in village': 'village_start'},
|
733 |
"media": []
|
734 |
},
|
735 |
},
|
736 |
-
|
737 |
-
|
738 |
"description": "You enter the dense forest, heading towards the ruins.",
|
739 |
"choices": ['travel further', 'return to village'],
|
740 |
"transitions": {'travel further': 'ruins_ruins', 'return to village': 'village_start'},
|
741 |
"media": []
|
742 |
},
|
743 |
},
|
744 |
-
|
745 |
-
|
746 |
"description": "You reach the ancient ruins. The entrance is dark and eerie.",
|
747 |
"choices": ['enter ruins', 'return to forest'],
|
748 |
"transitions": {'enter ruins': 'ruins_explore', 'return to forest': 'forest_forest'},
|
749 |
"media": []
|
750 |
},
|
751 |
-
|
752 |
"description": "You explore the ruins, encountering traps and puzzles.",
|
753 |
"choices": ['solve puzzle', 'avoid traps'],
|
754 |
"transitions": {'solve puzzle': 'ruins_hiddenPassage', 'avoid traps': 'ruins_ruins'},
|
755 |
"media": []
|
756 |
},
|
757 |
-
|
758 |
"description": "You solve a challenging puzzle and unlock a hidden passage.",
|
759 |
"choices": ['enter passage', 'go back'],
|
760 |
"transitions": {'enter passage': 'ruins_treasureRoom', 'go back': 'ruins_explore'},
|
761 |
"media": []
|
762 |
},
|
763 |
-
|
764 |
"description": "You enter the treasure room and find the treasure chest.",
|
765 |
"choices": ['take treasure', 'leave'],
|
766 |
"transitions": {'take treasure': 'ruins_celebrate', 'leave': 'ruins_ruins'},
|
@@ -769,23 +769,23 @@ with gr.Blocks() as demo:
|
|
769 |
},
|
770 |
"media": []
|
771 |
},
|
772 |
-
|
773 |
"description": "You celebrate your discovery and decide to bring the treasure back to the village.",
|
774 |
"choices": ['return to village'],
|
775 |
"transitions": {'return to village': 'village_return'},
|
776 |
"media": []
|
777 |
},
|
778 |
},
|
779 |
-
|
780 |
-
|
781 |
"description": "You return to the village with the treasure and share it with the villagers.",
|
782 |
"choices": ['end adventure'],
|
783 |
"transitions": {'end adventure': 'end_end'},
|
784 |
"media": []
|
785 |
},
|
786 |
},
|
787 |
-
|
788 |
-
|
789 |
"description": "Your adventure ends here. The villagers are grateful and everyone's lives improve.",
|
790 |
"choices": [],
|
791 |
"transitions": {},
|
@@ -1089,8 +1089,8 @@ Would you like me to elaborate on any of these ideas or show how to implement th
|
|
1089 |
"""
|
1090 |
|
1091 |
tipsupdatedconfigatbeinningofthisspace = """{
|
1092 |
-
|
1093 |
-
|
1094 |
"description": "You wake up in a small village. You hear a rumor about a lost treasure.",
|
1095 |
"choices": ['explore village', 'gather supplies', 'rest', 'look around'],
|
1096 |
"transitions": {'explore village': 'village_rumor', 'gather supplies': 'village_supplies', 'rest': 'village_start', 'look around': 'village_help_lost_child'},
|
@@ -1099,7 +1099,7 @@ Would you like me to elaborate on any of these ideas or show how to implement th
|
|
1099 |
},
|
1100 |
"media": []
|
1101 |
},
|
1102 |
-
|
1103 |
"description": "You hear more details about the treasure hidden in the ancient ruins nearby.",
|
1104 |
"choices": ['decide to go', 'ignore'],
|
1105 |
"transitions": {'decide to go': 'village_supplies', 'ignore': 'village_start'},
|
@@ -1108,13 +1108,13 @@ Would you like me to elaborate on any of these ideas or show how to implement th
|
|
1108 |
},
|
1109 |
"media": []
|
1110 |
},
|
1111 |
-
|
1112 |
"description": "You gather supplies for your journey.",
|
1113 |
"choices": ['head to forest', 'stay in village'],
|
1114 |
"transitions": {'head to forest': 'forest_forest', 'stay in village': 'village_start'},
|
1115 |
"media": []
|
1116 |
},
|
1117 |
-
|
1118 |
"description": "You encounter a crying child in the village square. They seem to have lost their way home.",
|
1119 |
"choices": ['help child', 'ignore and continue'],
|
1120 |
"transitions": {
|
@@ -1126,7 +1126,7 @@ Would you like me to elaborate on any of these ideas or show how to implement th
|
|
1126 |
},
|
1127 |
"media": []
|
1128 |
},
|
1129 |
-
|
1130 |
"description": "You decide to help the lost child. After asking around and searching the village, you finally locate their home.",
|
1131 |
"choices": ['return child', 'ask for reward'],
|
1132 |
"transitions": {
|
@@ -1135,7 +1135,7 @@ Would you like me to elaborate on any of these ideas or show how to implement th
|
|
1135 |
},
|
1136 |
"media": []
|
1137 |
},
|
1138 |
-
|
1139 |
"description": "You return the child to their grateful parents. They thank you profusely for your kindness.",
|
1140 |
"choices": ['accept thanks', 'request reward'],
|
1141 |
"transitions": {
|
@@ -1147,7 +1147,7 @@ Would you like me to elaborate on any of these ideas or show how to implement th
|
|
1147 |
},
|
1148 |
"media": []
|
1149 |
},
|
1150 |
-
|
1151 |
"description": "The child's parents offer you a small pouch of coins as a reward for your help.",
|
1152 |
"choices": ['accept reward', 'decline reward'],
|
1153 |
"transitions": {
|
@@ -1161,34 +1161,34 @@ Would you like me to elaborate on any of these ideas or show how to implement th
|
|
1161 |
"media": []
|
1162 |
},
|
1163 |
},
|
1164 |
-
|
1165 |
-
|
1166 |
"description": "You enter the dense forest, heading towards the ruins.",
|
1167 |
"choices": ['travel further', 'return to village'],
|
1168 |
"transitions": {'travel further': 'ruins_ruins', 'return to village': 'village_start'},
|
1169 |
"media": []
|
1170 |
},
|
1171 |
},
|
1172 |
-
|
1173 |
-
|
1174 |
"description": "You reach the ancient ruins. The entrance is dark and eerie.",
|
1175 |
"choices": ['enter ruins', 'return to forest'],
|
1176 |
"transitions": {'enter ruins': 'ruins_explore', 'return to forest': 'forest_forest'},
|
1177 |
"media": []
|
1178 |
},
|
1179 |
-
|
1180 |
"description": "You explore the ruins, encountering traps and puzzles.",
|
1181 |
"choices": ['solve puzzle', 'avoid traps'],
|
1182 |
"transitions": {'solve puzzle': 'ruins_hiddenPassage', 'avoid traps': 'ruins_ruins'},
|
1183 |
"media": []
|
1184 |
},
|
1185 |
-
|
1186 |
"description": "You solve a challenging puzzle and unlock a hidden passage.",
|
1187 |
"choices": ['enter passage', 'go back'],
|
1188 |
"transitions": {'enter passage': 'ruins_treasureRoom', 'go back': 'ruins_explore'},
|
1189 |
"media": []
|
1190 |
},
|
1191 |
-
|
1192 |
"description": "You enter the treasure room and find the treasure chest.",
|
1193 |
"choices": ['take treasure', 'leave'],
|
1194 |
"transitions": {'take treasure': 'ruins_celebrate', 'leave': 'ruins_ruins'},
|
@@ -1204,16 +1204,16 @@ Would you like me to elaborate on any of these ideas or show how to implement th
|
|
1204 |
"media": []
|
1205 |
},
|
1206 |
},
|
1207 |
-
|
1208 |
-
|
1209 |
"description": "You return to the village with the treasure and share it with the villagers.",
|
1210 |
"choices": ['end adventure'],
|
1211 |
"transitions": {'end adventure': 'end_end'},
|
1212 |
"media": []
|
1213 |
},
|
1214 |
},
|
1215 |
-
|
1216 |
-
|
1217 |
"description": "Your adventure ends here. The villagers are grateful and everyone's lives improve.",
|
1218 |
"choices": [],
|
1219 |
"transitions": {},
|
@@ -1224,16 +1224,18 @@ Would you like me to elaborate on any of these ideas or show how to implement th
|
|
1224 |
|
1225 |
with gr.Row():
|
1226 |
with gr.Column(scale=1):
|
1227 |
-
display_originalconfigatbeinningofthisspace = originalconfigatbeinningofthisspace.replace(' ', ' ').replace('\n', '<br>')
|
1228 |
-
|
1229 |
-
#gr.
|
|
|
1230 |
with gr.Column(scale=2):
|
1231 |
display_claude3_5_06072024configtips = claude3_5_06072024configtips.replace(' ', ' ').replace('\n', '<br>')
|
1232 |
gr.HTML(f"<pre>{display_claude3_5_06072024configtips}</pre>")
|
1233 |
with gr.Column(scale=1):
|
1234 |
-
display_tipsupdatedconfigatbeinningofthisspace = tipsupdatedconfigatbeinningofthisspace.replace(' ', ' ').replace('\n', '<br>')
|
1235 |
-
|
1236 |
-
#gr.
|
|
|
1237 |
|
1238 |
with gr.Tab("Test and Edit Config"):
|
1239 |
gr.HTML("The main issue is frequent changes add more chances for bugs in how ")
|
|
|
707 |
with gr.Accordion("Config Crafting Progerssion - click to open", open=False):
|
708 |
gr.HTML("Example of how to advance a game config with LLM - end goal is to have automatic worflow that takes these considerations into account <br> Things missing from the game engine - Economics and Basic Politics (NPC affiliation)")
|
709 |
originalconfigatbeinningofthisspace = """{
|
710 |
+
"village": {
|
711 |
+
"start": {
|
712 |
"description": "You wake up in a small village. You hear a rumor about a lost treasure.",
|
713 |
"choices": ['explore village', 'gather supplies', 'rest'],
|
714 |
"transitions": {'explore village': 'village_rumor', 'gather supplies': 'village_supplies', 'rest': 'village_start'},
|
|
|
717 |
},
|
718 |
"media": []
|
719 |
},
|
720 |
+
"rumor": {
|
721 |
"description": "You hear more details about the treasure hidden in the ancient ruins nearby.",
|
722 |
"choices": ['decide to go', 'ignore'],
|
723 |
"transitions": {'decide to go': 'village_supplies', 'ignore': 'village_start'},
|
|
|
726 |
},
|
727 |
"media": []
|
728 |
},
|
729 |
+
"supplies": {
|
730 |
"description": "You gather supplies for your journey.",
|
731 |
"choices": ['head to forest', 'stay in village'],
|
732 |
"transitions": {'head to forest': 'forest_forest', 'stay in village': 'village_start'},
|
733 |
"media": []
|
734 |
},
|
735 |
},
|
736 |
+
"forest": {
|
737 |
+
"forest": {
|
738 |
"description": "You enter the dense forest, heading towards the ruins.",
|
739 |
"choices": ['travel further', 'return to village'],
|
740 |
"transitions": {'travel further': 'ruins_ruins', 'return to village': 'village_start'},
|
741 |
"media": []
|
742 |
},
|
743 |
},
|
744 |
+
"ruins": {
|
745 |
+
"ruins": {
|
746 |
"description": "You reach the ancient ruins. The entrance is dark and eerie.",
|
747 |
"choices": ['enter ruins', 'return to forest'],
|
748 |
"transitions": {'enter ruins': 'ruins_explore', 'return to forest': 'forest_forest'},
|
749 |
"media": []
|
750 |
},
|
751 |
+
"explore": {
|
752 |
"description": "You explore the ruins, encountering traps and puzzles.",
|
753 |
"choices": ['solve puzzle', 'avoid traps'],
|
754 |
"transitions": {'solve puzzle': 'ruins_hiddenPassage', 'avoid traps': 'ruins_ruins'},
|
755 |
"media": []
|
756 |
},
|
757 |
+
"hiddenPassage": {
|
758 |
"description": "You solve a challenging puzzle and unlock a hidden passage.",
|
759 |
"choices": ['enter passage', 'go back'],
|
760 |
"transitions": {'enter passage': 'ruins_treasureRoom', 'go back': 'ruins_explore'},
|
761 |
"media": []
|
762 |
},
|
763 |
+
"treasureRoom": {
|
764 |
"description": "You enter the treasure room and find the treasure chest.",
|
765 |
"choices": ['take treasure', 'leave'],
|
766 |
"transitions": {'take treasure': 'ruins_celebrate', 'leave': 'ruins_ruins'},
|
|
|
769 |
},
|
770 |
"media": []
|
771 |
},
|
772 |
+
"celebrate": {
|
773 |
"description": "You celebrate your discovery and decide to bring the treasure back to the village.",
|
774 |
"choices": ['return to village'],
|
775 |
"transitions": {'return to village': 'village_return'},
|
776 |
"media": []
|
777 |
},
|
778 |
},
|
779 |
+
"village_return": {
|
780 |
+
"village_return": {
|
781 |
"description": "You return to the village with the treasure and share it with the villagers.",
|
782 |
"choices": ['end adventure'],
|
783 |
"transitions": {'end adventure': 'end_end'},
|
784 |
"media": []
|
785 |
},
|
786 |
},
|
787 |
+
"end": {
|
788 |
+
"end": {
|
789 |
"description": "Your adventure ends here. The villagers are grateful and everyone's lives improve.",
|
790 |
"choices": [],
|
791 |
"transitions": {},
|
|
|
1089 |
"""
|
1090 |
|
1091 |
tipsupdatedconfigatbeinningofthisspace = """{
|
1092 |
+
"village": {
|
1093 |
+
"start": {
|
1094 |
"description": "You wake up in a small village. You hear a rumor about a lost treasure.",
|
1095 |
"choices": ['explore village', 'gather supplies', 'rest', 'look around'],
|
1096 |
"transitions": {'explore village': 'village_rumor', 'gather supplies': 'village_supplies', 'rest': 'village_start', 'look around': 'village_help_lost_child'},
|
|
|
1099 |
},
|
1100 |
"media": []
|
1101 |
},
|
1102 |
+
"rumor": {
|
1103 |
"description": "You hear more details about the treasure hidden in the ancient ruins nearby.",
|
1104 |
"choices": ['decide to go', 'ignore'],
|
1105 |
"transitions": {'decide to go': 'village_supplies', 'ignore': 'village_start'},
|
|
|
1108 |
},
|
1109 |
"media": []
|
1110 |
},
|
1111 |
+
"supplies": {
|
1112 |
"description": "You gather supplies for your journey.",
|
1113 |
"choices": ['head to forest', 'stay in village'],
|
1114 |
"transitions": {'head to forest': 'forest_forest', 'stay in village': 'village_start'},
|
1115 |
"media": []
|
1116 |
},
|
1117 |
+
"help_lost_child": {
|
1118 |
"description": "You encounter a crying child in the village square. They seem to have lost their way home.",
|
1119 |
"choices": ['help child', 'ignore and continue'],
|
1120 |
"transitions": {
|
|
|
1126 |
},
|
1127 |
"media": []
|
1128 |
},
|
1129 |
+
"child_quest": {
|
1130 |
"description": "You decide to help the lost child. After asking around and searching the village, you finally locate their home.",
|
1131 |
"choices": ['return child', 'ask for reward'],
|
1132 |
"transitions": {
|
|
|
1135 |
},
|
1136 |
"media": []
|
1137 |
},
|
1138 |
+
"child_reunion": {
|
1139 |
"description": "You return the child to their grateful parents. They thank you profusely for your kindness.",
|
1140 |
"choices": ['accept thanks', 'request reward'],
|
1141 |
"transitions": {
|
|
|
1147 |
},
|
1148 |
"media": []
|
1149 |
},
|
1150 |
+
"child_reward": {
|
1151 |
"description": "The child's parents offer you a small pouch of coins as a reward for your help.",
|
1152 |
"choices": ['accept reward', 'decline reward'],
|
1153 |
"transitions": {
|
|
|
1161 |
"media": []
|
1162 |
},
|
1163 |
},
|
1164 |
+
"forest": {
|
1165 |
+
"forest": {
|
1166 |
"description": "You enter the dense forest, heading towards the ruins.",
|
1167 |
"choices": ['travel further', 'return to village'],
|
1168 |
"transitions": {'travel further': 'ruins_ruins', 'return to village': 'village_start'},
|
1169 |
"media": []
|
1170 |
},
|
1171 |
},
|
1172 |
+
"ruins": {
|
1173 |
+
"ruins": {
|
1174 |
"description": "You reach the ancient ruins. The entrance is dark and eerie.",
|
1175 |
"choices": ['enter ruins', 'return to forest'],
|
1176 |
"transitions": {'enter ruins': 'ruins_explore', 'return to forest': 'forest_forest'},
|
1177 |
"media": []
|
1178 |
},
|
1179 |
+
"explore": {
|
1180 |
"description": "You explore the ruins, encountering traps and puzzles.",
|
1181 |
"choices": ['solve puzzle', 'avoid traps'],
|
1182 |
"transitions": {'solve puzzle': 'ruins_hiddenPassage', 'avoid traps': 'ruins_ruins'},
|
1183 |
"media": []
|
1184 |
},
|
1185 |
+
"hiddenPassage": {
|
1186 |
"description": "You solve a challenging puzzle and unlock a hidden passage.",
|
1187 |
"choices": ['enter passage', 'go back'],
|
1188 |
"transitions": {'enter passage': 'ruins_treasureRoom', 'go back': 'ruins_explore'},
|
1189 |
"media": []
|
1190 |
},
|
1191 |
+
"treasureRoom": {
|
1192 |
"description": "You enter the treasure room and find the treasure chest.",
|
1193 |
"choices": ['take treasure', 'leave'],
|
1194 |
"transitions": {'take treasure': 'ruins_celebrate', 'leave': 'ruins_ruins'},
|
|
|
1204 |
"media": []
|
1205 |
},
|
1206 |
},
|
1207 |
+
"village_return": {
|
1208 |
+
"village_return": {
|
1209 |
"description": "You return to the village with the treasure and share it with the villagers.",
|
1210 |
"choices": ['end adventure'],
|
1211 |
"transitions": {'end adventure': 'end_end'},
|
1212 |
"media": []
|
1213 |
},
|
1214 |
},
|
1215 |
+
"end": {
|
1216 |
+
"end": {
|
1217 |
"description": "Your adventure ends here. The villagers are grateful and everyone's lives improve.",
|
1218 |
"choices": [],
|
1219 |
"transitions": {},
|
|
|
1224 |
|
1225 |
with gr.Row():
|
1226 |
with gr.Column(scale=1):
|
1227 |
+
#display_originalconfigatbeinningofthisspace = originalconfigatbeinningofthisspace.replace(' ', ' ').replace('\n', '<br>')
|
1228 |
+
display_originalconfigatbeinningofthisspace = json.loads(originalconfigatbeinningofthisspace)
|
1229 |
+
#gr.HTML(f"<pre>{display_originalconfigatbeinningofthisspace}</pre>")
|
1230 |
+
gr.Code(value=json.dumps(display_originalconfigatbeinningofthisspace, indent=2), language="json") #originalconfigatbeinningofthisspace)
|
1231 |
with gr.Column(scale=2):
|
1232 |
display_claude3_5_06072024configtips = claude3_5_06072024configtips.replace(' ', ' ').replace('\n', '<br>')
|
1233 |
gr.HTML(f"<pre>{display_claude3_5_06072024configtips}</pre>")
|
1234 |
with gr.Column(scale=1):
|
1235 |
+
#display_tipsupdatedconfigatbeinningofthisspace = tipsupdatedconfigatbeinningofthisspace.replace(' ', ' ').replace('\n', '<br>')
|
1236 |
+
display_tipsupdatedconfigatbeinningofthisspace = json.loads(tipsupdatedconfigatbeinningofthisspace)
|
1237 |
+
#gr.HTML(f"<pre>{display_tipsupdatedconfigatbeinningofthisspace}</pre>")
|
1238 |
+
gr.Code(value=json.dumps(display_tipsupdatedconfigatbeinningofthisspace, indent=2), language="json")
|
1239 |
|
1240 |
with gr.Tab("Test and Edit Config"):
|
1241 |
gr.HTML("The main issue is frequent changes add more chances for bugs in how ")
|