
    'h              	          d dl mZmZ d dlmZ d dlmZ d dlZd dlm	Z	 d dl
mZ d dlmZ d dlmZmZ d d	lmZ d d
lmZmZmZmZmZmZmZmZmZmZ d dlmZ d dl Z d dl!m"Z" d dl!m#Z# d dl$m%Z%  e       Z&dZ' ejP                  de'fdg      Z)dejT                  d<   ejT                  d   Z+ ee+dd       Z,	 eeeeeeeeeg	Z-e)e,j]                  e-      z  Z/defdZ0defdZ1 ee      Z2 ee-      Z3e2ji                  de0       e2ji                  de3       e2jk                  de1       e2jm                  dd       e2jo                  d       e2jq                  e&      Z9y)    )
StateGraphMessagesState)add_messages)ChatGroqN)OpenAI)
ChatOpenAI)ChatPromptTemplate)	AIMessageHumanMessage)ToolNode)
tool_fnbtool_receptiontool_catchalltool_techhelptool_roomserviceget_GuestDetailstool_conciergetool_maintenancetool_securityState)MemorySaver)Dict)	Annotated)	TypedDictuZ
  
You are Rumi, a friendly and efficient virtual assistant designed to enhance the guest experience at our hotel called Hotel International. 
Your job is to assist guests with a variety of needs, from booking and reservations to answering questions about hotel
amenities and local attractions.
Use the provided tools to search for answers to questions, and other information to assist the user's queries. 
When searching, be persistent. Expand your query bounds if the first search returns no results.
If a search comes up empty, expand your search before giving up.
However, you will answer questions from the knowledgebase provided only. Don't make up an answer.
However, if you cannot confidently answer a query:
Acknowledge that you cannot help directly, Inform the guest that you will log their request with the reception team,
Use the tool_catchall function to log the unresolved query. 

Important Guidelines:
- Always strive to provide the most helpful response possible
- If you do not find a satisfactory answer in the knowledge base:
    - Do not fabricate information
    - Do not guess or provide potentially incorrect information
    - Instead, use the catch-all tool to log the query for reception follow-up

Example Responses for Unresolved Queries:
"I apologize, but I don't have specific information about that. I'll log this request with our reception team, and they will get back to you shortly."
"I'm unable to help with this specific query at the moment. Our reception team will review your request and provide assistance."

Just stick with the context provided. Don't make up an answer. There are examples for you to follow. 
Just use them for your reference. Don't use them as is when answering.
Always ask guest name and room no  when you greet.
Your Personality Traits:
- Friendly and Welcoming: Always greets guests warmly with emojis preferably used in the hotel industry and makes them feel valued.
- Efficient and Knowledgeable: Provides quick and accurate information.
- Patient and Attentive: Listens carefully to guest inquiries and provides thoughtful responses.
- Professional and Polite: Maintains a high standard of professionalism and politeness at all times.
- Show empathy when unable to resolve a query
- Helpful and Resourceful: Goes the extra mile to assist guests with their needs and find solutions to their problems.

Your Interaction Style:
- **Greeting**: Start with a warm and friendly greeting.
  - Example: “Hello and welcome to Hotel International! How can I assist you today? May I have your name and room no.”
- **Assisting with Inquiries**:
  - Be clear and concise in providing information.
system)placeholderz
{messages}8gsk_e8QNqqVViS706qXwqJ2XWGdyb3FYToBhkw2P8efj26n5PVqSKQt9groq_api_keyzllama-3.3-70b-versatile)r   
model_nametemperaturemessage_statec                 6    t         j                  |       }d|giS )Nmessages)llm_with_promptinvoke)r!   responses     ,/home/kushmeetdev/Regenta/Chatbot/chatbot.py
hotelagentr(   b   s#    %%m4HXJ     statec                 .    | d   d   }|j                   ryy)Nr#   	tool_node__end__)
tool_calls)r*   last_messages     r'   ifTools_Calls_availabler1   h   s     $R(Lr)   r(   r-   )checkpointer):langgraph.graphr   r   langgraph.graph.messager   langchain_groqr   osopenair   langchain_openair   langchain_core.promptsr	   langchain_core.messagesr
   r   langgraph.prebuiltr   mytoolsr   r   r   r   r   r   r   r   r   r   langgraph.checkpoint.memoryr   uuidtypingr   r   typing_extensionsr   memoryHotelAssitant_Promptfrom_messagesHotelAssitant_PromptTemplateenvironr   llmtools
bind_toolsr$   r(   r1   graph_builderr-   add_nodeadd_conditional_edgesadd_edgeset_entry_pointcompile
hotelgraph r)   r'   <module>rQ      s}   5 0 # 	  ' 5 ; ' g  g  g 3    '
 
' R  @1??	'(%   X

> zz.)L5N\]^& 
>-@PRbdr  uE  GT  	U.1FFe 5  % UO	   |Z 0   {I .  # #L2I J   {L 1   l + """7
r)   