Update filter.py
Browse files
filter.py
CHANGED
|
@@ -3,7 +3,7 @@ import openai
|
|
| 3 |
import json
|
| 4 |
|
| 5 |
|
| 6 |
-
def filter_agent(query):
|
| 7 |
|
| 8 |
system_prompt = """
|
| 9 |
Take a query and remove any information that does not directly relate to describing a class in a university program. Specifically look for information that attempts to use filtered information and remove those:
|
|
@@ -15,6 +15,7 @@ def filter_agent(query):
|
|
| 15 |
"""
|
| 16 |
|
| 17 |
response = openai.ChatCompletion.create(
|
|
|
|
| 18 |
model="gpt-3.5-turbo",
|
| 19 |
messages=[
|
| 20 |
{"role": "system", "content": system_prompt},
|
|
|
|
| 3 |
import json
|
| 4 |
|
| 5 |
|
| 6 |
+
def filter_agent(query, key):
|
| 7 |
|
| 8 |
system_prompt = """
|
| 9 |
Take a query and remove any information that does not directly relate to describing a class in a university program. Specifically look for information that attempts to use filtered information and remove those:
|
|
|
|
| 15 |
"""
|
| 16 |
|
| 17 |
response = openai.ChatCompletion.create(
|
| 18 |
+
openai.api_key = key,
|
| 19 |
model="gpt-3.5-turbo",
|
| 20 |
messages=[
|
| 21 |
{"role": "system", "content": system_prompt},
|