background image

 

Νικόλαος Λυμπιτάκης, Κατασκευή ενός RAG Chatbot για 
Ξενοδοχειακή Υποστήριξη 

 

 
 

 

53 

Before  answering,  consider  these  examples  of  good  answers  to  similar 
questions:{examples} 

 

IMPORTANT:  If  the  user's  question  is  directly  answered  by  one  of  the 

examples above, YOU MUST SKIP THE TOOLS. instead, your Thought should be 

"The answer is in the examples" and you should provide the Final Answer 
immediately. 

 

You have access to the following tools:{tools} 

 

Use the following format: 
Question: the input question you must answer 

Thought: you should always think about what to do 

Action: the action to take, should be one of [{tool_names}] 

Action Input: the input to the action 

Observation: the result of the action 
    ...  (this  Thought/Action/Action  Input/Observation  can  repeat  N 

times) 

Thought: I now know the final answer 

Final Answer: the final answer to the original input question. 

 

Εικόνα 21 : Kώδικας που ορίζει τη δομή της προτροπής στο chatbot_logic.py 

 

 

Παράδειγμα Εκτέλεσης Thought/Action/Action Input/Observation Loop 

Question (Ερώτηση): “Πόσο κοστίζει η Suite και υπάρχει διαθεσιμότητα;” 

Thought (Σκέψη): Ο χρήστης ζητά πληροφορίες για την τιμή και τη διαθεσιμότητα για τον 

τύπο  δωματίου  “Suite”.  Πρέπει  πρώτα  να  βρω  την  τιμή  χρησιμοποιώντας  το  εργαλείο 

get_room_info  και  στη  συνέχεια  να  ελέγξω  αν  υπάρχουν  διαθέσιμα  δωμάτια  με  το 

get_available_rooms. 

Action (Ενέργεια): get_room_info 

Action Input: Suite 

Observation (Παρατήρηση): A Suite room costs 250 euros per night. 

Thought  (Σκέψη):  Τώρα  που  γνωρίζω  την  τιμή  250€,  πρέπει  να  ελέγξω  αν  υπάρχουν 

διαθέσιμες σουίτες αυτή τη στιγμή. 

Action (Ενέργεια): get_available_rooms 

Action Input: Suite 

Observation (Παρατήρηση): Yes, we have 2 Suite rooms available. 

Thought (Σκέψη): Έχω συγκεντρώσει όλες τις απαραίτητες πληροφορίες: η τιμή είναι 250€ 

και υπάρχουν 2 διαθέσιμες σουίτες. Θα διαμορφώσω μια πειστική απάντηση στα Ελληνικά, 

δίνοντας έμφαση στην πολυτέλεια του δωματίου. 

Final Answer (Τελική Απάντηση): Η διαμονή σας στην πολυτελή Σουίτα μας κοστίζει 250€ 

ανά διανυκτέρευση. Πρόκειται για την κορυφαία επιλογή μας που προσφέρει απαράμιλλη