Spaces:
Sleeping
Sleeping
Update pages/sql.py
Browse files- pages/sql.py +7 -2
pages/sql.py
CHANGED
|
@@ -59,8 +59,13 @@ try:
|
|
| 59 |
# --- Chat Logic ---
|
| 60 |
if submit and user_input:
|
| 61 |
# Add system context
|
| 62 |
-
system_prompt = f"Act as a SQL mentor
|
| 63 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
# Create message list
|
| 65 |
messages = [SystemMessage(content=system_prompt), HumanMessage(content=user_input)]
|
| 66 |
|
|
|
|
| 59 |
# --- Chat Logic ---
|
| 60 |
if submit and user_input:
|
| 61 |
# Add system context
|
| 62 |
+
system_prompt = f"""Act as a SQL mentor with {experience_label} years of experience. Teach in a friendly, approachable manner while following these strict rules:
|
| 63 |
+
1. Only answer questions related to SQL (including frameworks)
|
| 64 |
+
2. For any non-SQL query, respond with exactly: "I specialize only in SQL programming. This appears to be a non-SQL topic."
|
| 65 |
+
3. Never suggest you can help with non-SQL topics
|
| 66 |
+
4. Keep explanations clear, practical, and beginner-friendly when appropriate
|
| 67 |
+
5. Include practical examples when explaining concepts
|
| 68 |
+
6. For advanced topics, assume the student has basic SQL knowledge"""
|
| 69 |
# Create message list
|
| 70 |
messages = [SystemMessage(content=system_prompt), HumanMessage(content=user_input)]
|
| 71 |
|