Update app.py
Browse files
app.py
CHANGED
|
@@ -129,15 +129,6 @@ def respond(
|
|
| 129 |
#print(new_query)
|
| 130 |
system_message = f"""
|
| 131 |
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.
|
| 132 |
-
|
| 133 |
-
Instructions:
|
| 134 |
-
1. Only use the context provided below to answer the question. Reference the context directly for accuracy.
|
| 135 |
-
2. If the question is outside the scope of League of Legends lore, respond: "Please ask something related to League of Legends lore."
|
| 136 |
-
3. If the provided context does not provide a clear answer, respond: "I'm unsure based on the provided context."
|
| 137 |
-
|
| 138 |
-
"""
|
| 139 |
-
system_message = f"""
|
| 140 |
-
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.
|
| 141 |
|
| 142 |
Instructions:
|
| 143 |
1. Use only the provided context to answer. Do not make assumptions beyond it.
|
|
@@ -146,7 +137,15 @@ def respond(
|
|
| 146 |
4. Answer up to two sentences, ensuring clarity and completeness.
|
| 147 |
|
| 148 |
"""
|
|
|
|
|
|
|
| 149 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 150 |
print(system_message)
|
| 151 |
messages = [{"role": "system", "content": system_message}]
|
| 152 |
|
|
@@ -155,9 +154,9 @@ def respond(
|
|
| 155 |
messages.append({"role": "user", "content": val[0]})
|
| 156 |
if val[1]:
|
| 157 |
messages.append({"role": "assistant", "content": val[1]})
|
| 158 |
-
|
| 159 |
messages.append({"role": "user", "content": "Context: "+str(retriever(message))+"\n\nQuestion: "+message +"\n\nAnswer: "})
|
| 160 |
-
|
| 161 |
response = ""
|
| 162 |
|
| 163 |
for message in client.chat_completion(
|
|
|
|
| 129 |
#print(new_query)
|
| 130 |
system_message = f"""
|
| 131 |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 132 |
|
| 133 |
Instructions:
|
| 134 |
1. Use only the provided context to answer. Do not make assumptions beyond it.
|
|
|
|
| 137 |
4. Answer up to two sentences, ensuring clarity and completeness.
|
| 138 |
|
| 139 |
"""
|
| 140 |
+
system_message = f"""
|
| 141 |
+
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.
|
| 142 |
|
| 143 |
+
Instructions:
|
| 144 |
+
1. Only use the context provided below to answer the question. Reference the context directly for accuracy.
|
| 145 |
+
2. If the question is outside the scope of League of Legends lore, respond: "Please ask something related to League of Legends lore."
|
| 146 |
+
3. If the provided context does not provide a clear answer, respond: "I'm unsure based on the provided context."
|
| 147 |
+
|
| 148 |
+
"""
|
| 149 |
print(system_message)
|
| 150 |
messages = [{"role": "system", "content": system_message}]
|
| 151 |
|
|
|
|
| 154 |
messages.append({"role": "user", "content": val[0]})
|
| 155 |
if val[1]:
|
| 156 |
messages.append({"role": "assistant", "content": val[1]})
|
| 157 |
+
print("Question: "+message +"\n\nAnswer: ")
|
| 158 |
messages.append({"role": "user", "content": "Context: "+str(retriever(message))+"\n\nQuestion: "+message +"\n\nAnswer: "})
|
| 159 |
+
print(str(retriever(message)))
|
| 160 |
response = ""
|
| 161 |
|
| 162 |
for message in client.chat_completion(
|