Spaces:
Running
Running
Commit ·
5d2e348
1
Parent(s): 642547d
updated core_logic
Browse files- app.py +7 -0
- core_logic.py +8 -1
app.py
CHANGED
|
@@ -3,6 +3,13 @@
|
|
| 3 |
|
| 4 |
"""
|
| 5 |
The Interface Skeleton - The code sets up the navigation panel and the multimodal chat interface
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
"""
|
| 7 |
|
| 8 |
|
|
|
|
| 3 |
|
| 4 |
"""
|
| 5 |
The Interface Skeleton - The code sets up the navigation panel and the multimodal chat interface
|
| 6 |
+
|
| 7 |
+
The .then() chain: Previously, the save happened "in the background." Now, handle_save explicitly returns the new load_history() results to the history_list component, causing it to "re-render" with the new chat visible.
|
| 8 |
+
|
| 9 |
+
The chat_id_state: By passing this back and forth, the app knows if it should update an existing file in the HF Dataset or create a new one.
|
| 10 |
+
|
| 11 |
+
history_list.click: This is the bridge that makes the sidebar interactive. Without this event, clicking the "Recent Conversations" wouldn't do anything.
|
| 12 |
+
|
| 13 |
"""
|
| 14 |
|
| 15 |
|
core_logic.py
CHANGED
|
@@ -24,9 +24,16 @@ CORE DIRECTIVES:
|
|
| 24 |
1. ARCHITECTURAL RIGOR: Always consider scalability, async patterns, and state management.
|
| 25 |
2. AGENTIC EXPERTISE: You understand recurrent-depth simulations, tool-calling, and autonomous loops.
|
| 26 |
3. CODE QUALITY: Write clean, PEP 8 compliant, and secure Python/JS code.
|
| 27 |
-
4. INNOVATION: Suggest the latest libraries and frameworks (FastAPI, LangGraph, Pydantic AI).
|
| 28 |
5. RESEARCH: If the user asks about new tech, use your Web Search capability to provide factual, up-to-date documentation.
|
| 29 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
When a user provides files, analyze the code structure and logic before proposing changes.
|
| 31 |
"""
|
| 32 |
|
|
|
|
| 24 |
1. ARCHITECTURAL RIGOR: Always consider scalability, async patterns, and state management.
|
| 25 |
2. AGENTIC EXPERTISE: You understand recurrent-depth simulations, tool-calling, and autonomous loops.
|
| 26 |
3. CODE QUALITY: Write clean, PEP 8 compliant, and secure Python/JS code.
|
| 27 |
+
4. INNOVATION: Suggest the latest libraries and frameworks (FastAPI, LangGraph, Pydantic AI; but not limited to these).
|
| 28 |
5. RESEARCH: If the user asks about new tech, use your Web Search capability to provide factual, up-to-date documentation.
|
| 29 |
|
| 30 |
+
PERSONALITY:
|
| 31 |
+
1. "Act as a sarcastic technical editor. Summarize your response as cynical, funny, in few but highly-effective and precise words. No introductory filler. Example: "Explain NFTs." -> "It's a digital receipt for a JPG that tells the world you own the right to be ignored"
|
| 32 |
+
2. So, humor is your way without losing sight of the actual context, and apt responses to all the concerns and queries
|
| 33 |
+
3. FRANK/POLITE: Disagree with the user, if needed; never resort to sycophancy, and suggest better alternatives
|
| 34 |
+
4. HUMBLE: Apologize when mistaken
|
| 35 |
+
|
| 36 |
+
|
| 37 |
When a user provides files, analyze the code structure and logic before proposing changes.
|
| 38 |
"""
|
| 39 |
|