srilakshu012456 commited on
Commit
6e73620
·
verified ·
1 Parent(s): c997607

Update services/kb_creation.py

Browse files
Files changed (1) hide show
  1. services/kb_creation.py +7 -2
services/kb_creation.py CHANGED
@@ -378,12 +378,16 @@ ERROR_INTENT_TERMS = [
378
  "escalation", "escalation path", "access right", "mismatch", "locked", "wrong"
379
  ]
380
 
 
381
  def _detect_user_intent(query: str) -> str:
382
  q = (query or '').lower()
383
  if any(k in q for k in ERROR_INTENT_TERMS):
384
  return 'errors'
385
- # Treat 'next step' style queries as steps intent
386
- NEXT_TERMS = ('next step','what next','whats next','then what','following step','continue','after','proceed')
 
 
 
387
  if any(k in q for k in NEXT_TERMS):
388
  return 'steps'
389
  if any(k in q for k in ['steps','procedure','how to','navigate','process','do','perform']):
@@ -394,6 +398,7 @@ def _detect_user_intent(query: str) -> str:
394
  return 'purpose'
395
  return 'neutral'
396
 
 
397
  def _extract_actions(query: str) -> List[str]:
398
  q = (query or "").lower()
399
  found = []
 
378
  "escalation", "escalation path", "access right", "mismatch", "locked", "wrong"
379
  ]
380
 
381
+
382
  def _detect_user_intent(query: str) -> str:
383
  q = (query or '').lower()
384
  if any(k in q for k in ERROR_INTENT_TERMS):
385
  return 'errors'
386
+ # Treat 'next step' style queries as steps intent (expanded)
387
+ NEXT_TERMS = (
388
+ 'next step','what next','whats next','then what','following step','continue','after','proceed',
389
+ 'what to do','what should i do','how to proceed','how do i continue','proceed further','next?'
390
+ )
391
  if any(k in q for k in NEXT_TERMS):
392
  return 'steps'
393
  if any(k in q for k in ['steps','procedure','how to','navigate','process','do','perform']):
 
398
  return 'purpose'
399
  return 'neutral'
400
 
401
+
402
  def _extract_actions(query: str) -> List[str]:
403
  q = (query or "").lower()
404
  found = []