Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -190,11 +190,10 @@ def save_story(chat_history):
|
|
190 |
return None
|
191 |
|
192 |
story_text = "# My Interactive Adventure\n\n"
|
193 |
-
# Process in
|
194 |
-
for
|
195 |
-
|
196 |
-
|
197 |
-
story_text += f"**Story:** {chat_history[i+1]}\n\n---\n\n"
|
198 |
|
199 |
# Return as bytes for download
|
200 |
return story_text.encode('utf-8')
|
|
|
190 |
return None
|
191 |
|
192 |
story_text = "# My Interactive Adventure\n\n"
|
193 |
+
# Process chat history (already in tuples of user, bot messages)
|
194 |
+
for user_msg, bot_msg in chat_history:
|
195 |
+
story_text += f"**Player:** {user_msg}\n\n"
|
196 |
+
story_text += f"**Story:** {bot_msg}\n\n---\n\n"
|
|
|
197 |
|
198 |
# Return as bytes for download
|
199 |
return story_text.encode('utf-8')
|