This commit is contained in:
Nick
2019-09-16 19:48:34 -06:00
2 changed files with 8 additions and 1 deletions
+1 -1
View File
@@ -16,7 +16,6 @@ GOOGLE_CRED_LOCATION = "./AI-Adventure-2bb65e3a4e2f.json"
def story_init(session, seed):
pass
# Routes to index
@app.route('/')
def root():
@@ -47,6 +46,7 @@ def index():
def about():
return render_template('about.html')
# Bread and butter of app, updates story and returns based on choice
@app.route('/choose', methods=['POST'])
def story_request():
+7
View File
@@ -1,6 +1,12 @@
from story.utils import *
from other.cacher import *
import json
<<<<<<< HEAD
=======
prompts = [
"You enter a dungeon with your trusty sword and shield. You are searching for the evil necromancer who killed your family. You've heard that he resides at the bottom of the dungeon, guarded by legions of the undead. You enter the first door and see"]
>>>>>>> cc28b3787ca6c0614066ca4af4501b4d9ece8ff7
prompts = [
"You enter a dungeon with your trusty sword and shield. You are searching for the evil necromancer who killed your family. You've heard that he resides at the bottom of the dungeon, guarded by legions of the undead. You enter the first door and see"]
@@ -170,6 +176,7 @@ class CachedStoryManager(ConstrainedStoryManager):
if response is not None:
action_results = json.loads(response)
else:
print("Not found in cache. Generating...")
action_results = super().get_action_results()
response = json.dumps(action_results)
self.cacher.cache_file(self.seed, self.prompt_num, self.choices, response, "choices")