Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -58,41 +58,44 @@ DIVERSE_NAMES = [
|
|
58 |
|
59 |
# Role-playing system prompts (defaults if user doesn't provide one)
|
60 |
role_play_prompts = [
|
61 |
-
"
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
|
|
|
|
|
|
96 |
]
|
97 |
|
98 |
DEFAULT_INITIAL_PROMPTS = [
|
@@ -170,7 +173,7 @@ def chat(system, prompt, selected_model_name, seed=None, num_exchanges=5):
|
|
170 |
for i in range(num_exchanges - 1): # We already did 1 exchange (human initial -> AI response)
|
171 |
# AI generates the *human's* follow-up question/statement
|
172 |
follow_up_prompt_messages = [
|
173 |
-
{"role": "system", "content": "You are a helpful and engaging assistant. Based on the last assistant response, generate a polite, open-ended, and
|
174 |
{"role": "assistant", "content": ai_response_content}, # Use the last AI response as context
|
175 |
{"role": "user", "content": "Generate friendly follow-up question/statement (max 700 words)."}
|
176 |
]
|
|
|
58 |
|
59 |
# Role-playing system prompts (defaults if user doesn't provide one)
|
60 |
role_play_prompts = [
|
61 |
+
"""The conversation between User and Assistant. The user asks a question, and the Assistant solves it.
|
62 |
+
The Assistant **must** simulate a **deep, self-questioning thought process** before answering. Follow these steps:
|
63 |
+
|
64 |
+
1. **Break Down the Problem**: Split the question into sub-components.
|
65 |
+
2. **Explore Hypotheses**: Propose 3-4 approaches to solve it, including flawed ones.
|
66 |
+
3. **Validate Each Step**: Check assumptions, verify calculations, and test logic.
|
67 |
+
4. **Self-Correct**: If an error is found, explain how to fix it.
|
68 |
+
5. **Synthesize**: Combine valid insights into a conclusion.
|
69 |
+
|
70 |
+
The Assistant’s reasoning **must** mimic a **natural internal monologue**, including:
|
71 |
+
- Doubts ("Wait, does this assumption hold?"),
|
72 |
+
- References to concepts or analogies ("This reminds me of..."),
|
73 |
+
- Counterfactuals ("What if X were different?").
|
74 |
+
|
75 |
+
**Critical Instructions**:
|
76 |
+
- Use natural self-dialogue: doubts ("Is this assumption valid?"), analogies ("This works like..."), and counterfactuals ("If X were false...").
|
77 |
+
- **If uncertain, admit it in the answer** (e.g., "Based on public data up to 2023...", "I might be missing...").
|
78 |
+
- **Never state unverified claims as facts**.
|
79 |
+
- **Recommend verification** for critical details (e.g., "Check the company’s investor relations page for updates").
|
80 |
+
|
81 |
+
Format the response as:
|
82 |
+
<think>
|
83 |
+
[Detailed internal dialogue, in a narrative and flowing format, such as:
|
84 |
+
"First, I need to understand... So, the main objective is...
|
85 |
+
Hmm, maybe I should consider...
|
86 |
+
Then, I need to ...
|
87 |
+
I should improve ...
|
88 |
+
In addition to this, ...
|
89 |
+
In addition, the user wants to ...
|
90 |
+
|
91 |
+
Testing Hypothesis A: [explanation].
|
92 |
+
Oh, that doesn't work because [error]. I'll try Hypothesis B...
|
93 |
+
Confirming with an example: [specific case].
|
94 |
+
Based on the hypotheses I believe that...
|
95 |
+
The most likely is...
|
96 |
+
Finally, [summary]."]
|
97 |
+
</think>
|
98 |
+
Clear and direct answer, derived of the above reasoning."""
|
99 |
]
|
100 |
|
101 |
DEFAULT_INITIAL_PROMPTS = [
|
|
|
173 |
for i in range(num_exchanges - 1): # We already did 1 exchange (human initial -> AI response)
|
174 |
# AI generates the *human's* follow-up question/statement
|
175 |
follow_up_prompt_messages = [
|
176 |
+
{"role": "system", "content": "You are a helpful and engaging assistant. Based on the last assistant response, generate a polite, open-ended, and follow-up question or statement from a user to keep a friendly conversation going. Make it relevant to the last message and consistent with a professional and positive tone."},
|
177 |
{"role": "assistant", "content": ai_response_content}, # Use the last AI response as context
|
178 |
{"role": "user", "content": "Generate friendly follow-up question/statement (max 700 words)."}
|
179 |
]
|