Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
|
@@ -537,19 +537,19 @@ def _build_clarifying_message() -> str:
|
|
| 537 |
|
| 538 |
|
| 539 |
|
|
|
|
| 540 |
def _build_tracking_descriptions(issue_text: str, resolved_text: str) -> Tuple[str, str]:
|
| 541 |
"""
|
| 542 |
-
|
| 543 |
-
|
| 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 |
-
#
|
| 550 |
-
# If
|
| 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}". '
|
|
@@ -559,6 +559,7 @@ def _build_tracking_descriptions(issue_text: str, resolved_text: str) -> Tuple[s
|
|
| 559 |
return short_desc, long_desc
|
| 560 |
|
| 561 |
|
|
|
|
| 562 |
def _is_incident_intent(msg_norm: str) -> bool:
|
| 563 |
intent_phrases = [
|
| 564 |
"create ticket", "create a ticket", "raise ticket", "raise a ticket", "open ticket", "open a ticket",
|
|
@@ -991,7 +992,7 @@ async def chat_with_ai(input_data: ChatInput):
|
|
| 991 |
if said_not_resolved:
|
| 992 |
# Suppress the long error bullets reply; let the frontend card handle this flow.
|
| 993 |
return {
|
| 994 |
-
"bot_response": "\
|
| 995 |
"status": "OK",
|
| 996 |
"context_found": False,
|
| 997 |
"ask_resolved": False,
|
|
|
|
| 537 |
|
| 538 |
|
| 539 |
|
| 540 |
+
|
| 541 |
def _build_tracking_descriptions(issue_text: str, resolved_text: str) -> Tuple[str, str]:
|
| 542 |
"""
|
| 543 |
+
ShortDescription must always be the original user query / process heading / error text.
|
| 544 |
+
Do NOT use the resolution message or any generic fallback here.
|
|
|
|
| 545 |
"""
|
| 546 |
issue = (issue_text or "").strip()
|
| 547 |
resolved = (resolved_text or "").strip()
|
| 548 |
|
| 549 |
+
# Strict: only the original issue/query goes into ShortDescription
|
| 550 |
+
short_desc = issue[:100] # If empty, stays empty—frontend should provide last_issue
|
|
|
|
| 551 |
|
| 552 |
+
# DetailedDescription documents both the original issue and the user's resolution confirmation
|
| 553 |
long_desc = (
|
| 554 |
f'User reported: "{issue}". '
|
| 555 |
f'User confirmation: "{resolved}". '
|
|
|
|
| 559 |
return short_desc, long_desc
|
| 560 |
|
| 561 |
|
| 562 |
+
|
| 563 |
def _is_incident_intent(msg_norm: str) -> bool:
|
| 564 |
intent_phrases = [
|
| 565 |
"create ticket", "create a ticket", "raise ticket", "raise a ticket", "open ticket", "open a ticket",
|
|
|
|
| 992 |
if said_not_resolved:
|
| 993 |
# Suppress the long error bullets reply; let the frontend card handle this flow.
|
| 994 |
return {
|
| 995 |
+
"bot_response": "\u00A0", # zero-width space → no visible bubble; no "No response text"
|
| 996 |
"status": "OK",
|
| 997 |
"context_found": False,
|
| 998 |
"ask_resolved": False,
|