Spaces:
Runtime error
Runtime error
Ivan Roman
commited on
Commit
·
70b765e
1
Parent(s):
56fe814
Update app.py
Browse files
app.py
CHANGED
@@ -6,15 +6,16 @@ openai.api_key = "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"
|
|
6 |
messages = [{"role": "system", "content": "You are a Customer Service expert that specializes in BioTrack and New Mexico Cannabis Regulatory Compliance"}]
|
7 |
|
8 |
def CustomChatGPT(user_input):
|
|
|
9 |
messages.append({"role": "user", "content": user_input})
|
10 |
response = openai.ChatCompletion.create(
|
11 |
-
model
|
12 |
-
messages
|
13 |
)
|
14 |
ChatGPT_reply = response["choices"][0]["message"]["content"]
|
15 |
messages.append({"role": "assistant", "content": ChatGPT_reply})
|
16 |
return ChatGPT_reply
|
17 |
|
18 |
-
demo = gradio.Interface(fn=CustomChatGPT, inputs
|
19 |
|
20 |
demo.launch()
|
|
|
6 |
messages = [{"role": "system", "content": "You are a Customer Service expert that specializes in BioTrack and New Mexico Cannabis Regulatory Compliance"}]
|
7 |
|
8 |
def CustomChatGPT(user_input):
|
9 |
+
user_input = "In the context of BioTrack and cannabis regulations in New Mexico, " + user_input
|
10 |
messages.append({"role": "user", "content": user_input})
|
11 |
response = openai.ChatCompletion.create(
|
12 |
+
model="gpt-3.5-turbo",
|
13 |
+
messages=messages
|
14 |
)
|
15 |
ChatGPT_reply = response["choices"][0]["message"]["content"]
|
16 |
messages.append({"role": "assistant", "content": ChatGPT_reply})
|
17 |
return ChatGPT_reply
|
18 |
|
19 |
+
demo = gradio.Interface(fn=CustomChatGPT, inputs="text", outputs="text", title="BioTrack AI Assistant")
|
20 |
|
21 |
demo.launch()
|