Delete router.py
Browse files
router.py
DELETED
|
@@ -1,24 +0,0 @@
|
|
| 1 |
-
import os
|
| 2 |
-
import openai
|
| 3 |
-
import json, csv
|
| 4 |
-
|
| 5 |
-
def routing_agent(query, 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 Query from the User role, you determine that the user is looking for additional classes not already included in the chat history.
|
| 10 |
-
Chat history is also included to aid you in this, but please make your decision primarily based on the user's query, not the chat history.
|
| 11 |
-
A good example of where you should output "1", would be if the Query is: "What programming classes relating to video games could I take?"
|
| 12 |
-
"""
|
| 13 |
-
|
| 14 |
-
response = openai.ChatCompletion.create(
|
| 15 |
-
model="gpt-3.5-turbo",
|
| 16 |
-
messages=[
|
| 17 |
-
{"role": "system", "content": system_prompt},
|
| 18 |
-
{"role": "user", "content": "Query:" + query},
|
| 19 |
-
{"role": "assistant", "content": "Here is the chat history: " + chat_history}
|
| 20 |
-
]
|
| 21 |
-
)
|
| 22 |
-
|
| 23 |
-
return response["choices"][0]["message"]["content"]
|
| 24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|