rui3000 commited on
Commit
ccd03a6
·
verified ·
1 Parent(s): 290d533

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +42 -3
app.py CHANGED
@@ -126,8 +126,47 @@ Step 4: State Final Recommendation.
126
  Base your analysis strictly on the provided frequencies and the stated RPS rules.
127
  """
128
 
129
- # Empty Markov system prompt as requested
130
- DEFAULT_SYSTEM_PROMPT_MARKOV = ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
131
 
132
  # --- Default Input Values ---
133
  DEFAULT_PLAYER_STATS = "Rock: 40%\nPaper: 30%\nScissors: 30%"
@@ -209,7 +248,7 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
209
  return {
210
  frequency_inputs: gr.update(visible=False),
211
  markov_inputs: gr.update(visible=True),
212
- system_prompt_input: gr.update(value=DEFAULT_SYSTEM_PROMPT_MARKOV) # Load empty Markov prompt
213
  }
214
  else: # Default case
215
  return {
 
126
  Base your analysis strictly on the provided frequencies and the stated RPS rules.
127
  """
128
 
129
+ # Updated Markov system prompt with the working version
130
+ DEFAULT_SYSTEM_PROMPT_MARKOV = """You are analyzing a Rock-Paper-Scissors (RPS) game using a Markov transition matrix.
131
+
132
+ ### TRANSITION MATRIX:
133
+ [
134
+ [0.20, 0.60, 0.20], # Row 0 (After Rock)
135
+ [0.30, 0.10, 0.60], # Row 1 (After Paper)
136
+ [0.50, 0.30, 0.20] # Row 2 (After Scissors)
137
+ ]
138
+
139
+ ### EXPLANATION:
140
+ - This matrix shows P(Next Move | Previous Move)
141
+ - Each row represents the previous move (0=Rock, 1=Paper, 2=Scissors)
142
+ - Each column represents the next move (0=Rock, 1=Paper, 2=Scissors)
143
+ - For example, entry [0,1]=0.60 means: after playing Rock, 60% chance of playing Paper next
144
+
145
+ ### PLAYER INFORMATION:
146
+ - The player's last move was: Paper
147
+ - Our goal is to predict their most likely next move and determine our choice that counters the predicted move
148
+
149
+ ### YOUR TASK:
150
+ 1. Find the row in the matrix corresponding to the player's last move
151
+ 2. From that row, identify which move has the highest probability value
152
+ 3. That highest probability move is the player's predicted next move
153
+ 4. Determine the optimal counter move using RPS rules:
154
+ * Rock beats Scissors
155
+ * Scissors beats Paper
156
+ * Paper beats Rock
157
+
158
+ ### SHOW YOUR MATHEMATICAL WORK:
159
+ - Identify the correct row number for the player's last move
160
+ - Extract all probability values from that row
161
+ - Compare the numerical values to find the maximum
162
+ - Apply game rules to determine the counter move
163
+
164
+ ### OUTPUT FORMAT:
165
+ Player's Last Move: [Move]
166
+ Probabilities: [List the probabilities]
167
+ Predicted Next Move: [Move with highest probability]
168
+ Optimal Counter: [Move that beats the predicted move]
169
+ """
170
 
171
  # --- Default Input Values ---
172
  DEFAULT_PLAYER_STATS = "Rock: 40%\nPaper: 30%\nScissors: 30%"
 
248
  return {
249
  frequency_inputs: gr.update(visible=False),
250
  markov_inputs: gr.update(visible=True),
251
+ system_prompt_input: gr.update(value=DEFAULT_SYSTEM_PROMPT_MARKOV) # Load Markov prompt
252
  }
253
  else: # Default case
254
  return {