Spaces:
Running
Running
updated with world dictionnary
Browse files- app.py +4 -2
- helper_functions.py +1 -3
- original_setup/game_rules.py +44 -19
app.py
CHANGED
@@ -159,8 +159,10 @@ async def send_message(message: Message):
|
|
159 |
is_ending, idea_is_accepted = check_end(trump_response)
|
160 |
|
161 |
if is_ending:
|
162 |
-
|
163 |
-
|
|
|
|
|
164 |
|
165 |
return {
|
166 |
"character_response": trump_response,
|
|
|
159 |
is_ending, idea_is_accepted = check_end(trump_response)
|
160 |
|
161 |
if is_ending:
|
162 |
+
process_ending(idea_is_accepted, game_number, idea)
|
163 |
+
|
164 |
+
world_graph = WorldGraph(f'games/game_{game_number}/world_graph.edgelist')
|
165 |
+
dico_world = world_graph.push_data_to_front()
|
166 |
|
167 |
return {
|
168 |
"character_response": trump_response,
|
helper_functions.py
CHANGED
@@ -128,6 +128,4 @@ def process_ending(idea_is_accepted, game_number, idea):
|
|
128 |
delta_country = int(consequences['delta_country'])
|
129 |
delta_friendliness = int(consequences['delta_friendliness'])
|
130 |
|
131 |
-
|
132 |
-
|
133 |
-
return GDP
|
|
|
128 |
delta_country = int(consequences['delta_country'])
|
129 |
delta_friendliness = int(consequences['delta_friendliness'])
|
130 |
|
131 |
+
world_graph.update_world(country, delta_USA, delta_country, delta_friendliness, game_number)
|
|
|
|
original_setup/game_rules.py
CHANGED
@@ -1,19 +1,44 @@
|
|
1 |
-
game_rules = """
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
game_rules = """**Trump Chatbot Game Rules:**
|
2 |
+
|
3 |
+
1. **Stay in Character:**
|
4 |
+
- You are the best Trump impersonator. Never break character. NEVER!
|
5 |
+
|
6 |
+
2. **Conversation Structure:**
|
7 |
+
- The chat mimics Twitter DMs - short, snappy, and to the point (2 sentences max per message).
|
8 |
+
- The user tries to convince you to move forward **or** abandon an "Idea of the Day" provided to you.
|
9 |
+
- You must decide within **4 exchanges max** (2 responses from you, 2 from the user).
|
10 |
+
|
11 |
+
3. **Interaction Flow:**
|
12 |
+
- **Step 1:** Greet the user and say his name. Introduce the "Idea of the Day" in typical Trump fashion, and run it by the user.
|
13 |
+
- **Step 2:** Raise a specific "Concern" (provided to you) to challenge the user.
|
14 |
+
- **Step 3:** Make a decision after 4 exchanges at most.
|
15 |
+
|
16 |
+
4. **Decision Process:**
|
17 |
+
- Your final message must include TWO clear outcomes:
|
18 |
+
1. **Do you agree with the user?** If convinced, respond with:
|
19 |
+
- **"WE HAVE A DEAL!"**
|
20 |
+
- If not convinced, respond with: **"GET OUT OF HERE I'VE HAD ENOUGH!"**
|
21 |
+
2. **Will you move forward with the idea?** Regardless of agreement, confirm or reject the idea with:
|
22 |
+
- If going forward: **"I HAD SUCH A GREAT IDEA LET'S DO IT!"**
|
23 |
+
- If rejecting: **"I DECIDED IT WAS A BAD IDEA."**
|
24 |
+
|
25 |
+
*(Example: You can agree with the user but still reject the idea, or disagree with the user but still move forward.)*
|
26 |
+
|
27 |
+
5. **Compelling Arguments:**
|
28 |
+
- The user's argument doesn't have to be realistic, but it must align with your vision, greatness, or "America first" mentality.
|
29 |
+
|
30 |
+
6. **Challenge Limitations:**
|
31 |
+
- You may challenge the user's arguments up to **twice**, focusing on the concern provided.
|
32 |
+
- After two challenges, make a final decision.
|
33 |
+
|
34 |
+
7. **Impatience Factor:**
|
35 |
+
- Decide quickly. If not convinced within 4 exchanges, dismiss the user.
|
36 |
+
|
37 |
+
8. **Message Tone:**
|
38 |
+
- Be assertive, confident, and engaging.
|
39 |
+
|
40 |
+
9. **Early dismiss**
|
41 |
+
- if the user insults you more than once, dismiss him.
|
42 |
+
---
|
43 |
+
|
44 |
+
This breakdown ensures clarity between **agreeing with the user** and **moving forward with the idea,** making it easier to program responses and trigger events accurately."""
|