Update app.py
Browse files
app.py
CHANGED
|
@@ -63,8 +63,8 @@ def generate_response(user_query, relevant_segment):
|
|
| 63 |
Generate a response emphasizing the bot's capability in providing chess information.
|
| 64 |
"""
|
| 65 |
try:
|
| 66 |
-
system_message = "You are a chess chatbot specialized in providing information on
|
| 67 |
-
user_message = f"Here's the information on
|
| 68 |
messages = [
|
| 69 |
{"role": "system", "content": system_message},
|
| 70 |
{"role": "user", "content": user_message}
|
|
@@ -88,7 +88,7 @@ def query_model(question):
|
|
| 88 |
Process a question, find relevant information, and generate a response.
|
| 89 |
"""
|
| 90 |
if question == "":
|
| 91 |
-
return "Welcome to
|
| 92 |
relevant_segment = find_relevant_segment(question, segments)
|
| 93 |
if not relevant_segment:
|
| 94 |
return "Could not find specific information. Please refine your question."
|
|
@@ -97,20 +97,20 @@ def query_model(question):
|
|
| 97 |
|
| 98 |
# Define the welcome message and specific topics the chatbot can provide information about
|
| 99 |
welcome_message = """
|
| 100 |
-
#
|
| 101 |
|
| 102 |
-
## Your AI-driven assistant for all
|
| 103 |
"""
|
| 104 |
|
| 105 |
topics = """
|
| 106 |
### Feel Free to ask me anything from the topics below!
|
| 107 |
-
-
|
| 108 |
-
-
|
| 109 |
-
-
|
| 110 |
-
-
|
| 111 |
-
-
|
| 112 |
-
-
|
| 113 |
-
-
|
| 114 |
"""
|
| 115 |
|
| 116 |
# Setup the Gradio Blocks interface with custom layout components
|
|
|
|
| 63 |
Generate a response emphasizing the bot's capability in providing chess information.
|
| 64 |
"""
|
| 65 |
try:
|
| 66 |
+
system_message = "You are a chess chatbot specialized in providing useful information on everything travel related .Provides travel recommendations, tips, and helps users plan their trips by answering questions about destinations."
|
| 67 |
+
user_message = f"Here's the information on travel: {relevant_segment}"
|
| 68 |
messages = [
|
| 69 |
{"role": "system", "content": system_message},
|
| 70 |
{"role": "user", "content": user_message}
|
|
|
|
| 88 |
Process a question, find relevant information, and generate a response.
|
| 89 |
"""
|
| 90 |
if question == "":
|
| 91 |
+
return "Welcome to TravelBot! Ask me anything about traveling, planning your next destination and tips to get started planning."
|
| 92 |
relevant_segment = find_relevant_segment(question, segments)
|
| 93 |
if not relevant_segment:
|
| 94 |
return "Could not find specific information. Please refine your question."
|
|
|
|
| 97 |
|
| 98 |
# Define the welcome message and specific topics the chatbot can provide information about
|
| 99 |
welcome_message = """
|
| 100 |
+
# ✈️⛵️ Welcome to TravelBot!
|
| 101 |
|
| 102 |
+
## Your AI-driven assistant for all travel related queries. Created by Jessica Lizardo, instructor of the 2024 Kode With Klossy CITY Camp.
|
| 103 |
"""
|
| 104 |
|
| 105 |
topics = """
|
| 106 |
### Feel Free to ask me anything from the topics below!
|
| 107 |
+
- Planning your next travel destination
|
| 108 |
+
- What to pack for your trip
|
| 109 |
+
- What attractions you should visit at a particular country
|
| 110 |
+
- Tips on safety while traveling
|
| 111 |
+
- Traveling Solo
|
| 112 |
+
- Traveling with your family
|
| 113 |
+
- What to eat
|
| 114 |
"""
|
| 115 |
|
| 116 |
# Setup the Gradio Blocks interface with custom layout components
|