srilakshu012456 commited on
Commit
0703877
·
verified ·
1 Parent(s): 3a47483

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +8 -7
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
- 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}". '
@@ -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": "\u200B", # zero-width space → no visible bubble; no "No response text"
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,