Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
|
@@ -536,18 +536,26 @@ def _build_clarifying_message() -> str:
|
|
| 536 |
|
| 537 |
|
| 538 |
|
|
|
|
| 539 |
def _build_tracking_descriptions(issue_text: str, resolved_text: str) -> Tuple[str, str]:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 540 |
issue = (issue_text or "").strip()
|
| 541 |
resolved = (resolved_text or "").strip()
|
| 542 |
|
| 543 |
-
# Always
|
| 544 |
-
|
|
|
|
| 545 |
|
| 546 |
long_desc = (
|
| 547 |
f'User reported: "{issue}". '
|
| 548 |
f'User confirmation: "{resolved}". '
|
| 549 |
f"Tracking record created automatically by NOVA."
|
| 550 |
).strip()
|
|
|
|
| 551 |
return short_desc, long_desc
|
| 552 |
|
| 553 |
|
|
@@ -983,7 +991,7 @@ async def chat_with_ai(input_data: ChatInput):
|
|
| 983 |
if said_not_resolved:
|
| 984 |
# Suppress the long error bullets reply; let the frontend card handle this flow.
|
| 985 |
return {
|
| 986 |
-
"bot_response":
|
| 987 |
"status": "OK",
|
| 988 |
"context_found": False,
|
| 989 |
"ask_resolved": False,
|
|
|
|
| 536 |
|
| 537 |
|
| 538 |
|
| 539 |
+
|
| 540 |
def _build_tracking_descriptions(issue_text: str, resolved_text: str) -> Tuple[str, str]:
|
| 541 |
+
"""
|
| 542 |
+
Build the short and long descriptions for the tracking incident.
|
| 543 |
+
- ShortDescription should always reflect the original issue/query (not the resolution message).
|
| 544 |
+
- DetailedDescription will record both the user's original issue and their resolution confirmation.
|
| 545 |
+
"""
|
| 546 |
issue = (issue_text or "").strip()
|
| 547 |
resolved = (resolved_text or "").strip()
|
| 548 |
|
| 549 |
+
# Always use the original issue as the short description.
|
| 550 |
+
# If the frontend didn't pass last_issue, do NOT use the resolved text; use a neutral fallback.
|
| 551 |
+
short_desc = issue[:100] if issue else "Original issue description not available (user confirmed resolution)"
|
| 552 |
|
| 553 |
long_desc = (
|
| 554 |
f'User reported: "{issue}". '
|
| 555 |
f'User confirmation: "{resolved}". '
|
| 556 |
f"Tracking record created automatically by NOVA."
|
| 557 |
).strip()
|
| 558 |
+
|
| 559 |
return short_desc, long_desc
|
| 560 |
|
| 561 |
|
|
|
|
| 991 |
if said_not_resolved:
|
| 992 |
# Suppress the long error bullets reply; let the frontend card handle this flow.
|
| 993 |
return {
|
| 994 |
+
"bot_response": "\u200B", # zero-width space → no visible bubble; no "No response text"
|
| 995 |
"status": "OK",
|
| 996 |
"context_found": False,
|
| 997 |
"ask_resolved": False,
|