Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -311,14 +311,15 @@ Provide the best solution with explanation and consider edge cases."""
|
|
| 311 |
def generate_error_response(self, lang: str, lang_data: dict, query: str, code: str) -> str:
|
| 312 |
"""Generate detailed error explanation and solution"""
|
| 313 |
common_errors = lang_data.get('common_errors', [])
|
| 314 |
-
|
| 315 |
-
response =
|
| 316 |
-
|
| 317 |
-
|
| 318 |
-
First, let's identify the error type and root cause. Common {lang} errors include
|
| 319 |
-
{', '.join([e.get('name', 'Unknown') for e in common_errors[:3]])}
|
| 320 |
-
|
| 321 |
-
|
| 322 |
-
|
| 323 |
-
|
| 324 |
-
|
|
|
|
|
|
| 311 |
def generate_error_response(self, lang: str, lang_data: dict, query: str, code: str) -> str:
|
| 312 |
"""Generate detailed error explanation and solution"""
|
| 313 |
common_errors = lang_data.get('common_errors', [])
|
| 314 |
+
|
| 315 |
+
response = (
|
| 316 |
+
f"Let me help you debug this {lang} code. Here's a systematic approach:\n\n"
|
| 317 |
+
"**Error Analysis:**\n"
|
| 318 |
+
f"First, let's identify the error type and root cause. Common {lang} errors include:\n"
|
| 319 |
+
f"{', '.join([e.get('name', 'Unknown') for e in common_errors[:3]])}\n\n"
|
| 320 |
+
"**Code Inspection:**\n"
|
| 321 |
+
"For the provided code:\n"
|
| 322 |
+
f"```{lang}\n"
|
| 323 |
+
f"{code if code else '# No code provided'}\n"
|
| 324 |
+
"```\n"
|
| 325 |
+
)
|