Update app.py
Browse files
app.py
CHANGED
|
@@ -124,7 +124,6 @@ def ra(user_question):
|
|
| 124 |
def get_system_prompt(message):
|
| 125 |
"""Generate a system message based on the user's input."""
|
| 126 |
context = ra(message) # Call external function to get context dynamically
|
| 127 |
-
print(context)
|
| 128 |
return f"""
|
| 129 |
You are an expert in League of Legends (LoL) lore. You will only answer questions related to the champions and their stories within the game.
|
| 130 |
|
|
@@ -142,8 +141,14 @@ def respond(
|
|
| 142 |
):
|
| 143 |
res = ra(message)
|
| 144 |
# Initialize a list to store messages.
|
| 145 |
-
system_message =
|
| 146 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 147 |
messages = [{"role": "system", "content": system_message}]
|
| 148 |
|
| 149 |
# Process conversation history to append user and assistant messages
|
|
|
|
| 124 |
def get_system_prompt(message):
|
| 125 |
"""Generate a system message based on the user's input."""
|
| 126 |
context = ra(message) # Call external function to get context dynamically
|
|
|
|
| 127 |
return f"""
|
| 128 |
You are an expert in League of Legends (LoL) lore. You will only answer questions related to the champions and their stories within the game.
|
| 129 |
|
|
|
|
| 141 |
):
|
| 142 |
res = ra(message)
|
| 143 |
# Initialize a list to store messages.
|
| 144 |
+
system_message = f"""
|
| 145 |
+
You are an expert in League of Legends (LoL) lore. You will only answer questions related to the champions and their stories within the game.
|
| 146 |
+
|
| 147 |
+
Instructions:
|
| 148 |
+
1. **Only use the context provided below** to answer the question. Reference the context directly for accuracy.
|
| 149 |
+
2. If the question is outside the scope of League of Legends lore, respond: *"Please ask something related to League of Legends lore."*
|
| 150 |
+
3. If the provided context does not provide a clear answer, respond: *"I'm unsure based on the provided context."*
|
| 151 |
+
"""
|
| 152 |
messages = [{"role": "system", "content": system_message}]
|
| 153 |
|
| 154 |
# Process conversation history to append user and assistant messages
|