Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -698,6 +698,7 @@ CRITICAL RULES:
|
|
| 698 |
4. **JSON SERIALIZATION:** Before adding data to your final dictionary for JSON conversion, you MUST convert any pandas-specific types (like `int64`) to standard Python types using `.item()` for single values or `.tolist()` for lists.
|
| 699 |
5. **SINGLE JSON OUTPUT:** Print exactly ONE JSON object at the end of your script. Do not print debug statements or multiple JSON objects.
|
| 700 |
6. **VALID JSON STRUCTURE:** The output MUST be a dictionary/object, not an array or primitive value.
|
|
|
|
| 701 |
|
| 702 |
--- USER'S SCENARIO ---
|
| 703 |
{user_scenario}
|
|
@@ -941,8 +942,8 @@ SLEEK_CSS = """
|
|
| 941 |
|
| 942 |
.right .tabs { height: 100%; display: flex; flex-direction: column; }
|
| 943 |
.right .tabitem { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
|
| 944 |
-
#chatbot_container { flex: 1; min-height:
|
| 945 |
-
#chatbot_container > * { min-height:
|
| 946 |
|
| 947 |
.hr { height: 1px; background: #16203b; margin: 10px 0; }
|
| 948 |
.voice-hint { font-size: 12px; color:#9fb0cc; margin-top: 4px; }
|
|
|
|
| 698 |
4. **JSON SERIALIZATION:** Before adding data to your final dictionary for JSON conversion, you MUST convert any pandas-specific types (like `int64`) to standard Python types using `.item()` for single values or `.tolist()` for lists.
|
| 699 |
5. **SINGLE JSON OUTPUT:** Print exactly ONE JSON object at the end of your script. Do not print debug statements or multiple JSON objects.
|
| 700 |
6. **VALID JSON STRUCTURE:** The output MUST be a dictionary/object, not an array or primitive value.
|
| 701 |
+
7. **SAFE DATA JOINING:** When joining/merging dataframes or looking up values across dataframes, ALWAYS check if matches exist before accessing with `.iloc[0]`. Use `.merge()` with `how='left'` or check `len(filtered_df) > 0` before accessing rows. Never assume keys will match exactly between dataframes.
|
| 702 |
|
| 703 |
--- USER'S SCENARIO ---
|
| 704 |
{user_scenario}
|
|
|
|
| 942 |
|
| 943 |
.right .tabs { height: 100%; display: flex; flex-direction: column; }
|
| 944 |
.right .tabitem { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
|
| 945 |
+
#chatbot_container { flex: 1; min-height: 600px; max-height: calc(100vh - 150px); overflow-y: auto; }
|
| 946 |
+
#chatbot_container > * { min-height: 600px; }
|
| 947 |
|
| 948 |
.hr { height: 1px; background: #16203b; margin: 10px 0; }
|
| 949 |
.voice-hint { font-size: 12px; color:#9fb0cc; margin-top: 4px; }
|