
    :~j                     r   d dl mZ d dlmZmZ d dlmZmZmZm	Z	m
Z
  G d de          Z G d de          Z G d d	e          Z G d
 de          Z G d de          Z G d de          Z G d de          Z G d de          Z G d de          Z G d de          Z G d de          ZdS )    )Enum)	BaseModelField)AnyDictListLiteralOptionalc                   r    e Zd ZU eed<   dZee         ed<    ee          Z	e
eeef                  ed<   dS )ChatRequestqueryN
session_iddefault_factoryhistory)__name__
__module____qualname__str__annotations__r   r
   r   listr   r   r   r        0/var/www/html/ls-pms-bot-apis/app/models/chat.pyr   r      sY         JJJ $J$$$$)E$$?$?$?GT$sCx.!?????r   r   c                       e Zd ZU eed<   dZee         ed<    ee          Z	e
eeef                  ed<    edd          Zeeeef                  ed<   dS )	HotelChatRequestr   Nr   r   r   zGuest lookup fields used by get_reservation_details and get_available_addons: email, confirmation_number, hotel_id, and sub_hotel_id. Optional authorization/token may be included for LS catalog APIs.defaultdescriptionreservation_details)r   r   r   r   r   r   r
   r   r   r   r   r   r   r    r   r   r   r   r      s         JJJ $J$$$$)E$$?$?$?GT$sCx.!???49EP5 5 5$sCx.1     r   r   c                   X    e Zd ZU ed         ed<    ed          Zeee	f         ed<   dS )HotelChatResponse)answerlookup_answersupport_escalationeventzQContains `answer` (assistant reply) and `history` (updated conversation history).r   dataN)
r   r   r   r	   r   r   r(   r   r   r   r   r   r   r"   r"      sZ         BCCCC 5g  D$sCx.     r   r"   c                   $    e Zd ZU eed<   eed<   dS )MessagerolecontentN)r   r   r   r   r   r   r   r   r*   r*      s"         
IIILLLLLr   r*   c                   @    e Zd ZU eed<   g Zeee                  ed<   dS )ChatResponser#   sourcesN)	r   r   r   r   r   r/   r
   r   intr   r   r   r.   r.   #   s4         KKK#%GXd3i %%%%%r   r.   c                       e Zd ZU  ed          Zeed<    edd          Zee         ed<    edd          Z	ee         ed	<    edd
          Z
ee         ed<    ed          Zed         ed<    eg d          Zee         ed<   dS )ClassifyResponsezA clear, accurate, and self-contained answer to the user's question, based only on the provided context. Do not include information not present in the context.r'   r#   Na  Start timestamp of the relevant segment in the video. always return the video start timestamp if answer is related to a video. if answer is not related to a video, return null.
Rules:
- Format: MM:SS or HH:MM:SS
- provide me exact timestamp in the format MM:SS or HH:MM:SS where the answer is related to a video.
- Do NOT include in the answer text.
- Return null if not confidently available.
r   video_start_timestampa	  End timestamp of the relevant segment in the video. always return the video end timestamp if answer is related to a video. if answer is not related to a video, return null.
Rules:
- Format: MM:SS or HH:MM:SS
- Must be >= start timestamp.
- If unclear, return null.
video_end_timestampzVideo URL associated with the answer. always return the video URL if present in the context and video context is related to a user query and includes the user query solution else return null.	video_urlzLanguage of the user query.
Rules:
- 'en' for English
- 'hi' for Hindi
- 'gu' for Gujarati
- Must match the answer language exactly.
)enhigulanguageaS  Generate up to 3 highly relevant follow-up questions based ONLY on the below topics and context. Rules:
- Questions must stay within the SAME feature/module as the answer.
- Do NOT switch to a different feature.
- Prefer task-based or action-based questions.
- Use the SAME language as the user.
AND: TOPIC IS THIS: 
- Reservations / bookings
- Create promotions
- Create room
- email templates
- Customer management
- Dashboard
- Add product
- Gift cards
- Gift shop / POS
- payment methods
- rate calendar
- revenue dashboard
- tape chart
- policies
- reports
- subscribers
- negotiated customers management
- restrictions
- modify cancel reservation
- hold and block reservation
- housekeeping
- generate invoice
- email confirmation
Don't add the residence related questions in the next possible questions unless the user asks about the residence.next_possible_questions)r   r   r   r   r#   r   r   r3   r
   r4   r5   r9   r	   r:   r   r   r   r   r2   r2   '   sP        %i  FC    ,15<
, 
, 
,8C= 
 
 
 */+	* 	* 	*# 	 	 	  %u N     Ix}    +0%:	+ 	+ 	+Hg&' 	 	 	 */A#* #* #*T#Y # # # # #r   r2   c                   T    e Zd ZU  ed          Zeed<    ed          Zeed<   dS )AgentRetrieverResponsea  Convert the user's request into a concise, keyword-based standalone search query in ENGLISH. If the user input is in other languages, translate it into English first.Focus on key actions, entities, and system features. Use short phrases, not full sentences.r'   r   zRewrite the latest user query in english language but rephrase it to make it a standalone question and help better similarity search.questionN)r   r   r   r   r   r   r   r=   r   r   r   r<   r<   }   sq         5  E3    E \  Hc     r   r<   c                   2    e Zd ZU  ed          Zeed<   dS )HumanEscalationArgsa  Concise work request for the hotel staff describing only unresolved guest action(s). Exclude requests already acknowledged in Admin: system messages. Do not write a full conversation summary.don't generate any query like i added or  confirmed becuase it's added by hotel admin or staffr'   r   N)r   r   r   r   r   r   r   r   r   r   r?   r?      sC         m  E3     r   r?   c                       e Zd ZdZdS )GetReservationDetailsArgszGNo arguments. Reservation context comes from the current guest session.Nr   r   r   __doc__r   r   r   rA   rA      s        QQDr   rA   c                       e Zd ZdZdS )GetAvailableAddonsArgsz;No arguments. Uses hotel_id from the current guest session.NrB   r   r   r   rE   rE      s        EEDr   rE   c                   2    e Zd ZU  ed          Zeed<   dS )HotelAgentResponsea  A clear, friendly, direct reply to the guest based on retrieved hotel knowledge, hotel context, and conversation history. Do not invent hotel details. Do not mention documents, documentation, sources, knowledge base, or that you are seeing/checking/finding information. Speak as a hotel team member with the facts. Do not add soft offers to connect with staff or ask if they want confirmation after giving an informational answer.r'   r#   N)r   r   r   r   r#   r   r   r   r   r   rG   rG      sB         %4	 	 	FC 	 	 	 	 	r   rG   N)enumr   pydanticr   r   typingr   r   r   r	   r
   r   r   r"   r*   r.   r2   r<   r?   rA   rE   rG   r   r   r   <module>rK      sB         % % % % % % % % 5 5 5 5 5 5 5 5 5 5 5 5 5 5@ @ @ @ @) @ @ @    y       	       i   & & & & &9 & & &T T T T Ty T T Tl	 	 	 	 	Y 	 	 	    )   	 	 	 	 		 	 	 	
	 	 	 	 	Y 	 	 	

 
 
 
 
 
 
 
 
 
r   