Update results.py
Browse files- results.py +6 -4
results.py
CHANGED
|
@@ -2,12 +2,13 @@ import os
|
|
| 2 |
import openai
|
| 3 |
import json, csv
|
| 4 |
|
| 5 |
-
def results_agent(query,
|
| 6 |
|
| 7 |
system_prompt = """
|
| 8 |
-
You are an academic advisor helping students find classes for the next semester.
|
| 9 |
Relay information in a succinct way that fully answers their questions.
|
| 10 |
-
|
|
|
|
| 11 |
Please add new lines, bolding/italicizing, formatting like "##" for headers to make it a pretty output as well.
|
| 12 |
"""
|
| 13 |
|
|
@@ -15,7 +16,8 @@ def results_agent(query, key):
|
|
| 15 |
model="gpt-3.5-turbo",
|
| 16 |
messages=[
|
| 17 |
{"role": "system", "content": system_prompt},
|
| 18 |
-
{"role": "user", "content": query}
|
|
|
|
| 19 |
]
|
| 20 |
)
|
| 21 |
|
|
|
|
| 2 |
import openai
|
| 3 |
import json, csv
|
| 4 |
|
| 5 |
+
def results_agent(query, context):
|
| 6 |
|
| 7 |
system_prompt = """
|
| 8 |
+
You are an academic advisor helping students (user role) find classes for the next semester.
|
| 9 |
Relay information in a succinct way that fully answers their questions.
|
| 10 |
+
You will be given a user's query, as well as the chat history and finally, the rag responses in context.
|
| 11 |
+
Please use your own discretion to determine form the rag responses (which have scores to help you, higher is better) the best way to respond to the user's query
|
| 12 |
Please add new lines, bolding/italicizing, formatting like "##" for headers to make it a pretty output as well.
|
| 13 |
"""
|
| 14 |
|
|
|
|
| 16 |
model="gpt-3.5-turbo",
|
| 17 |
messages=[
|
| 18 |
{"role": "system", "content": system_prompt},
|
| 19 |
+
{"role": "user", "content": query},
|
| 20 |
+
{"role": "assistant", "Additional Context": context}
|
| 21 |
]
|
| 22 |
)
|
| 23 |
|