bhulston commited on
Commit
36fde6a
1 Parent(s): 9dc0a1b

Update router.py

Browse files
Files changed (1) hide show
  1. router.py +4 -4
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 a routing agent, purely designed to determine if a user's query is a request for the use of a vector database for semantic search.
9
- You will determine this based on the chat message history. A vector database is only needed to search for new classes. A user might ask for additional filtering on classes, but this is not necessarily a request for a new search.
10
- Relay information in a way that is the bare minimum. You should only answer with a "1" when a vector db is needed or "0" otherwise and no other text at all.
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
  )