Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -53,13 +53,15 @@ def function(Textbox,Textbox2,Textbox3):
|
|
53 |
# model = os.environ.get("model")
|
54 |
# hrc = os.environ.get("hrc")
|
55 |
if Textbox3 == target:
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
if Textbox2:
|
60 |
-
|
|
|
|
|
61 |
chat = openai.ChatCompletion.create(
|
62 |
-
model="gpt-3.5-turbo", messages=
|
63 |
)
|
64 |
reply = chat.choices[0].message.content
|
65 |
messages.append({"role": "assistant", "content": reply})
|
|
|
53 |
# model = os.environ.get("model")
|
54 |
# hrc = os.environ.get("hrc")
|
55 |
if Textbox3 == target:
|
56 |
+
messages = [
|
57 |
+
{"role": "system", "content": content},
|
58 |
+
]
|
59 |
if Textbox2:
|
60 |
+
messages.append(
|
61 |
+
{"role": "user", "content": Textbox},
|
62 |
+
)
|
63 |
chat = openai.ChatCompletion.create(
|
64 |
+
model="gpt-3.5-turbo", messages=messages
|
65 |
)
|
66 |
reply = chat.choices[0].message.content
|
67 |
messages.append({"role": "assistant", "content": reply})
|