Update router.py
Browse files
router.py
CHANGED
@@ -5,16 +5,16 @@ import json, csv
|
|
5 |
def routing_agent(query, key, chat_history):
|
6 |
|
7 |
system_prompt = """
|
8 |
-
You are
|
9 |
-
You will
|
10 |
-
|
11 |
"""
|
12 |
|
13 |
response = openai.ChatCompletion.create(
|
14 |
model="gpt-3.5-turbo",
|
15 |
messages=[
|
16 |
{"role": "system", "content": system_prompt},
|
17 |
-
{"role": "user", "content": query},
|
18 |
{"role": "assistant", "content": "Here is the chat history: " + chat_history}
|
19 |
]
|
20 |
)
|
|
|
5 |
def routing_agent(query, key, chat_history):
|
6 |
|
7 |
system_prompt = """
|
8 |
+
You are an AI assistant, solely made to output a "1" or a "0".
|
9 |
+
You will output a "1" when, based on the most recent query and the recent chat history, you determine that the user is looking for additional classes not already included in the chat history.
|
10 |
+
In the scenario where it seems the user is asking a question not related to the classes they could take, please output a "0".
|
11 |
"""
|
12 |
|
13 |
response = openai.ChatCompletion.create(
|
14 |
model="gpt-3.5-turbo",
|
15 |
messages=[
|
16 |
{"role": "system", "content": system_prompt},
|
17 |
+
{"role": "user", "content": "Query:" + query},
|
18 |
{"role": "assistant", "content": "Here is the chat history: " + chat_history}
|
19 |
]
|
20 |
)
|