
    i                     <    d dl mZ d dlmZ d dlmZ  G d d      Zy)    )	KBService)IntentService)ChatResponsec                   $    e Zd ZddZdedefdZy)TroubleshootingServicereturnNc                 "    t               | _        y )N)r   kb)selfs    X/home/techsaathi/public_html/it_helpdesk_chatbot/app/services/troubleshooting_service.py__init__zTroubleshootingService.__init__   s    +    messagec                    | j                   j                         }t        |      }|j                  |      }|st	        dg dd      S |j                  dg       }d|j                  d       d}t	        |j                  d	      |j                  d      |j                  d
      ||g d|j                  dd            S )NzI could not identify the exact issue. Please describe whether it is related to Laptop, Desktop, Wi-Fi, VPN, Printer, Outlook, Login, Shared Drive, or Network.)zLaptop slowzWi-Fi no internetzVPN not connectingzOutlook not openingzPrinter offlinezShared drive inaccessibleCreate ticketT)replyoptionsticket_suggestionstepsz%I found a troubleshooting guide for: issue_titlez$

Please try these steps one by one.codecategory)ResolvedzNot resolvedr   auto_ticket_on_failure)
issue_coder   detected_categoryr   r   r   r   )r
   get_all_flowsr   detect_issuer   get)r   r   flowsintent_serviceissuer   formatted_replys          r   process_messagez&TroubleshootingService.process_message
   s    %%'&u-++G4N #' $ 		'2&3EIIm4L3M N1 1 	
 yy(		-0#ii
3!A#ii(@$G
 	
r   )r   N)__name__
__module____qualname__r   strr   r$    r   r   r   r      s    &
s &
| &
r   r   N)app.services.kb_servicer   app.services.intent_servicer   app.schemas.chatr   r   r)   r   r   <module>r-      s    - 5 )*
 *
r   