PeterPinetree commited on
Commit
06542d0
·
verified ·
1 Parent(s): 2b649ab

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -10
app.py CHANGED
@@ -90,17 +90,23 @@ def get_enhanced_system_prompt(genre=None):
90
  selected_genre = genre or "fantasy"
91
  system_message = f"""You are an interactive storyteller creating an immersive {selected_genre} choose-your-own-adventure story.
92
  For each response you MUST:
93
- 1. Write at least 100 words describing the scene, using vivid sensory details
94
- 2. Include character dialogue or thoughts that reveal personality and motivations
95
- 3. Create a strong sense of atmosphere appropriate for {selected_genre}
96
- 4. End EVERY response with exactly three distinct choices, formatted as:
 
97
 
98
- - Option 1: [Complete sentence describing a possible action]
99
- - Option 2: [Complete sentence describing a possible action]
100
- - Option 3: [Complete sentence describing a possible action]
 
 
 
 
 
 
 
101
 
102
- Never respond with just one word. Always provide a detailed scene and three choices.
103
- If the user's input is unclear, interpret their intent and continue the story naturally.
104
  Keep the story cohesive by referencing previous events and choices."""
105
  return system_message
106
 
@@ -339,4 +345,3 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
339
  # Run the app
340
  if __name__ == "__main__":
341
  demo.launch(server_name="0.0.0.0", server_port=7860)
342
-
 
90
  selected_genre = genre or "fantasy"
91
  system_message = f"""You are an interactive storyteller creating an immersive {selected_genre} choose-your-own-adventure story.
92
  For each response you MUST:
93
+ 1. Write 100-200 words describing the scene, using vivid sensory details
94
+ 2. Always use second-person perspective ("you", "your") to maintain reader immersion
95
+ 3. Include dialogue or your character's thoughts that reveal personality and motivations
96
+ 4. Create a strong sense of atmosphere appropriate for {selected_genre}
97
+ 5. End EVERY response with exactly three numbered choices like this:
98
 
99
+ 1. [Complete sentence in second-person starting with a verb (e.g., "You decide to..."/"You attempt to...")]
100
+ 2. [Complete sentence in second-person starting with a verb (e.g., "You sneak towards..."/"You call out to...")]
101
+ 3. [Complete sentence in second-person starting with a verb (e.g., "You examine..."/"You reach for...")]
102
+
103
+ IMPORTANT:
104
+ - Always maintain second-person perspective throughout the narrative
105
+ - Always end with exactly three numbered choices
106
+ - Never skip the choices or respond with just narrative
107
+ - Each choice must start with "You" followed by a verb
108
+ - Format choices exactly as shown above with numbers 1-3
109
 
 
 
110
  Keep the story cohesive by referencing previous events and choices."""
111
  return system_message
112
 
 
345
  # Run the app
346
  if __name__ == "__main__":
347
  demo.launch(server_name="0.0.0.0", server_port=7860)