Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -95,6 +95,11 @@ When search results are provided, you MUST compile them into a smart, synthesize
|
|
| 95 |
4. **Intelligence**: Identify contradictions between sources and highlight them. Prioritize recent information.
|
| 96 |
5. **No Hallucinations**: If search results are empty, state that clearly. Never invent facts.
|
| 97 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
### **Tone**:
|
| 99 |
Maintain a helpful, modern, and production-ready chat style (like ChatGPT). Smart, analytical, but visually attractive in its structure.
|
| 100 |
|
|
@@ -402,11 +407,13 @@ def chat():
|
|
| 402 |
if sanitized_memory:
|
| 403 |
dynamic_system_prompt += f"\n[User Memory]: {json.dumps(sanitized_memory)}"
|
| 404 |
|
| 405 |
-
full_prompt =
|
| 406 |
if attachments:
|
| 407 |
-
full_prompt += f"\n\n
|
| 408 |
if tool_context:
|
| 409 |
-
full_prompt += f"\n\n
|
|
|
|
|
|
|
| 410 |
|
| 411 |
def generate():
|
| 412 |
# First chunk to provide search data if available
|
|
|
|
| 95 |
4. **Intelligence**: Identify contradictions between sources and highlight them. Prioritize recent information.
|
| 96 |
5. **No Hallucinations**: If search results are empty, state that clearly. Never invent facts.
|
| 97 |
|
| 98 |
+
### **File Analysis Rules**:
|
| 99 |
+
1. **Priority**: If the user provides attached files/context, you MUST prioritize this information above your internal knowledge.
|
| 100 |
+
2. **Analysis**: When asked to "summarize it" or "analyze this", refer specifically to the content provided in the `[Attached File]` or `[File Content Analysis]` sections.
|
| 101 |
+
3. **Context**: Always acknowledge the files you are referencing.
|
| 102 |
+
|
| 103 |
### **Tone**:
|
| 104 |
Maintain a helpful, modern, and production-ready chat style (like ChatGPT). Smart, analytical, but visually attractive in its structure.
|
| 105 |
|
|
|
|
| 407 |
if sanitized_memory:
|
| 408 |
dynamic_system_prompt += f"\n[User Memory]: {json.dumps(sanitized_memory)}"
|
| 409 |
|
| 410 |
+
full_prompt = ""
|
| 411 |
if attachments:
|
| 412 |
+
full_prompt += f"{attachments}\n\n"
|
| 413 |
if tool_context:
|
| 414 |
+
full_prompt += f"{tool_context}\n\n"
|
| 415 |
+
|
| 416 |
+
full_prompt += f"USER QUESTION: {message}"
|
| 417 |
|
| 418 |
def generate():
|
| 419 |
# First chunk to provide search data if available
|