KwabsHug commited on
Commit
723fb80
·
verified ·
1 Parent(s): 444391a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -9
app.py CHANGED
@@ -203,20 +203,24 @@ def geminiflashinferenceinstance(text):
203
  return response.text #print(response.text
204
 
205
 
206
- def brainstormconsiderations(text):
207
- Finaloutput = geminiproinferenceinstance(text)
208
 
209
- return Finaloutput
210
 
211
  def generateconfig(text):
212
- Finaloutput = geminiproinferenceinstance(f"NBNB property name must be enclosed in double quotes. Use this as inspiration to make a {text} (user requested) based story aka keep same format to work with an existing app: /n/n{configcomptestexample} ")
 
 
 
213
 
 
214
  return Finaloutput
215
 
216
- def debugsuggestions(text):
217
- Finaloutput = geminiproinferenceinstance(text)
218
 
219
- return Finaloutput
220
 
221
  #-----
222
 
@@ -480,9 +484,9 @@ with gr.Blocks() as geminiapidemo:
480
  with gr.Tab("Generate and Debug"):
481
  gr.HTML("The user wants ")
482
  with gr.Accordion("Gemini Config", open=False):
483
- gr.Interface(brainstormconsiderations, inputs=["text"], outputs=["text"], description="some considerations for generated config")
484
  gr.Interface(generateconfig, inputs=["text"], outputs=["text"], description=" generated config")
485
- gr.Interface(debugsuggestions, inputs=["text"], outputs=["text"], description="debug generated config ")
486
  gr.Interface(geminiflashinferenceinstance, inputs=["text"], outputs=["text"], description="flash test")
487
  with gr.Tab("Manual - Config With Assets"):
488
  gr.HTML("Placeholder as not complete yet (3D not supported, and time (esp need for audio)")
 
203
  return response.text #print(response.text
204
 
205
 
206
+ #def brainstormconsiderations(text):
207
+ # Finaloutput = geminiproinferenceinstance(text)
208
 
209
+ # return Finaloutput
210
 
211
  def generateconfig(text):
212
+ prompt1 = "Please remix this to be about: ("
213
+ prompt2 = """) - {"tavern": {"start": {"description": "You wake up in a dimly lit tavern, the smell of ale and salt heavy in the air. A grizzled sailor at the bar boasts about a hidden island overflowing with \"more gold than ye can dream of!\" ", "choices": ["approach sailor", "ignore sailor", "order grog"], "transitions": {"approach sailor": "tavern_rumor", "ignore sailor": "tavern_start", "order grog": "tavern_grog"}, "consequences": {}, "media": []}, "rumor": {"description": "The sailor, three sheets to the wind, spins a tale of treacherous waters, ancient curses, and a map hidden on a ghost ship. He claims to know the way.", "choices": ["offer to buy him another drink", "dismiss him as a drunkard"], "transitions": {"offer to buy him another drink": "tavern_map", "dismiss him as a drunkard": "tavern_start"}, "consequences": {}, "media": []}, "grog": {"description": "The tavern keeper slides you a tankard of potent grog. It burns pleasantly as it goes down, and you feel your senses dull.", "choices": ["order another", "eavesdrop on nearby pirates"], "transitions": {"order another": "tavern_grog", "eavesdrop on nearby pirates": "tavern_start"}, "media": []}, "map": {"description": "With a wink and a hiccup, the sailor produces a crumpled piece of parchment. It's stained with salt and what looks suspiciously like blood, but the markings... they resemble a map! ", "choices": ["propose a partnership", "try to buy the map", "steal the map"], "transitions": {"propose a partnership": "docks_prepare", "try to buy the map": "tavern_haggle", "steal the map": "tavern_fight"}, "consequences": {}, "media": []}, "haggle": {"description": "The sailor eyes you shrewdly. \"This here map's worth a king's ransom,\" he slurs.", "choices": ["offer a pouch of gold", "walk away"], "transitions": {"offer a pouch of gold": "docks_prepare", "walk away": "tavern_start"}, "consequences": {}, "media": []}, "fight": {"description": "You lunge for the map, but the sailor's quicker than he looks! A brawl erupts, tables are overturned, and mugs fly through the air.", "choices": ["fight dirty", "try to reason with him"], "transitions": {"fight dirty": "tavern_victory", "try to reason with him": "tavern_defeat"}, "consequences": {}, "media": []}, "victory": {"description": "With a final blow, you knock the sailor unconscious. You grab the map and make a hasty exit.", "choices": ["head to the docks"], "transitions": {"head to the docks": "docks_prepare"}, "consequences": {}, "media": []}, "defeat": {"description": "The sailor and a couple of his cronies land some solid punches. You're tossed out of the tavern, bruised and map-less.", "choices": ["nurse your wounds"], "transitions": {"nurse your wounds": "tavern_start"}, "consequences": {}, "media": []}}, "docks": {"prepare": {"description": "The salty air of the docks fills your lungs. You can practically taste the adventure on the horizon. But first, you need a ship and a crew...", "choices": ["find a ship", "assemble a crew"], "transitions": {"find a ship": "docks_ship", "assemble a crew": "docks_crew"}, "media": []}, "ship": {"description": "You spot a sturdy-looking galleon with a \"For Sale\" sign hanging precariously from its mast.", "choices": ["inspect the ship", "look for another vessel"], "transitions": {"inspect the ship": "docks_captain", "look for another vessel": "docks_prepare"}, "media": []}, "crew": {"description": "The docks are teeming with salty dogs of all shapes and sizes.", "choices": ["recruit seasoned sailors", "round up some desperate souls"], "transitions": {"recruit seasoned sailors": "docks_captain", "round up some desperate souls": "docks_captain"}, "consequences": {}, "media": []}, "captain": {"description": "With a ship and a crew (of varying competence), you're ready to set sail! ", "choices": ["set sail for the open sea!"], "transitions": {"set sail for the open sea!": "openSea_start"}, "media": []}}, "openSea": {"start": {"description": "The open sea stretches before you, vast and unforgiving. The wind whips at your sails as you set course for the uncharted waters where the treasure awaits.", "choices": ["consult the map", "enjoy the voyage"], "transitions": {"consult the map": "openSea_storm", "enjoy the voyage": "openSea_mutiny"}, "media": []}, "storm": {"description": "A storm gathers on the horizon, dark clouds swirling ominously. Waves crash against the hull, threatening to swallow you whole.", "choices": ["weather the storm", "change course"], "transitions": {"weather the storm": "openSea_ghostShip", "change course": "openSea_start"}, "media": []}, "mutiny": {"description": "Your crew, a motley bunch at best, begin to grumble. They're growing impatient and greedy, their eyes glinting with mutiny.", "choices": ["quell the mutiny", "reason with them"], "transitions": {"quell the mutiny": "openSea_ghostShip", "reason with them": "openSea_start"}, "consequences": {}, "media": []}, "ghostShip": {"description": "Through the mist and fog, a ghostly silhouette emerges. A ship, its sails in tatters, manned by skeletal figures. This... is the ghost ship.", "choices": ["board the ghost ship", "flee"], "transitions": {"board the ghost ship": "ghostShip_deck", "flee": "openSea_start"}, "media": []}}, "ghostShip": {"deck": {"description": "You step aboard the ghost ship, the air heavy with the stench of decay. Eerie silence hangs over the vessel.", "choices": ["explore the ship", "search for the captain's quarters"], "transitions": {"explore the ship": "ghostShip_brig", "search for the captain's quarters": "ghostShip_quarters"}, "media": []}, "brig": {"description": "You stumble upon the ship's brig, its cells still occupied by skeletal remains shackled to the walls.", "choices": ["examine the skeletons", "leave the brig"], "transitions": {"examine the skeletons": "ghostShip_clue", "leave the brig": "ghostShip_deck"}, "media": []}, "quarters": {"description": "The captain's quarters are in disarray, as if a struggle took place. A tattered journal lies open on the floor.", "choices": ["read the journal", "search for the map"], "transitions": {"read the journal": "ghostShip_clue", "search for the map": "ghostShip_treasure"}, "media": []}, "clue": {"description": "You piece together clues from the journal and the skeletons. The ghost ship's captain hid the real treasure map to protect it from mutineers.", "choices": ["continue searching"], "transitions": {"continue searching": "ghostShip_treasure"}, "media": []}, "treasure": {"description": "After careful searching, you find a hidden compartment behind a portrait. Inside, a gleaming treasure chest awaits!", "choices": ["open the chest", "take the chest and flee"], "transitions": {"open the chest": "ghostShip_victory", "take the chest and flee": "openSea_return"}, "consequences": {}, "media": []}, "victory": {"description": "The treasure chest overflows with gold, jewels, and artifacts beyond your wildest dreams! You've found the legendary pirate treasure!", "choices": ["claim your prize and set sail"], "transitions": {"claim your prize and set sail": "openSea_return"}, "consequences": {}, "media": []}}, "openSea_return": {"return": {"description": "With the treasure safely stowed on your own ship, you set sail for home, leaving the ghost ship to its eternal slumber.", "choices": ["sail into the sunset"], "transitions": {"sail into the sunset": "end_end"}, "media": []}}, "end": {"end": {"description": "The sun dips below the horizon, painting the sky in hues of gold and crimson. You've cheated death, outsmarted ghosts, and claimed a fortune in pirate treasure. Your legend will be sung in taverns for centuries to come.", "choices": [], "transitions": {}, "media": []}}}"""
214
+ #Finaloutput = geminiproinferenceinstance(f"NBNB property name must be enclosed in double quotes. Use this as inspiration to make a {text} (user requested) based story aka keep same format to work with an existing app: /n/n{configcomptestexample} ")
215
+ Finaloutput = geminiproinferenceinstance(prompt1 + text + prompt2)
216
 
217
+
218
  return Finaloutput
219
 
220
+ #def debugsuggestions(text):
221
+ # Finaloutput = geminiproinferenceinstance(text)
222
 
223
+ # return Finaloutput
224
 
225
  #-----
226
 
 
484
  with gr.Tab("Generate and Debug"):
485
  gr.HTML("The user wants ")
486
  with gr.Accordion("Gemini Config", open=False):
487
+ #gr.Interface(brainstormconsiderations, inputs=["text"], outputs=["text"], description="some considerations for generated config")
488
  gr.Interface(generateconfig, inputs=["text"], outputs=["text"], description=" generated config")
489
+ #gr.Interface(debugsuggestions, inputs=["text"], outputs=["text"], description="debug generated config ")
490
  gr.Interface(geminiflashinferenceinstance, inputs=["text"], outputs=["text"], description="flash test")
491
  with gr.Tab("Manual - Config With Assets"):
492
  gr.HTML("Placeholder as not complete yet (3D not supported, and time (esp need for audio)")