Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -81,6 +81,7 @@
|
|
81 |
import gradio as gr
|
82 |
import requests
|
83 |
import openai
|
|
|
84 |
import os
|
85 |
|
86 |
def function(Textbox,Textbox2,Textbox3):
|
@@ -91,11 +92,12 @@ def function(Textbox,Textbox2,Textbox3):
|
|
91 |
# model = os.environ.get("model")
|
92 |
# hrc = os.environ.get("hrc")
|
93 |
if Textbox3 == target:
|
|
|
94 |
messages = [
|
95 |
{"role": "system", "content": content},
|
96 |
]
|
97 |
messages.append(
|
98 |
-
|
99 |
)
|
100 |
chat = openai.ChatCompletion.create(
|
101 |
model="gpt-3.5-turbo", messages=messages
|
|
|
81 |
import gradio as gr
|
82 |
import requests
|
83 |
import openai
|
84 |
+
import json
|
85 |
import os
|
86 |
|
87 |
def function(Textbox,Textbox2,Textbox3):
|
|
|
92 |
# model = os.environ.get("model")
|
93 |
# hrc = os.environ.get("hrc")
|
94 |
if Textbox3 == target:
|
95 |
+
history = json.loads(Textbox2)
|
96 |
messages = [
|
97 |
{"role": "system", "content": content},
|
98 |
]
|
99 |
messages.append(
|
100 |
+
history
|
101 |
)
|
102 |
chat = openai.ChatCompletion.create(
|
103 |
model="gpt-3.5-turbo", messages=messages
|