Spaces:
Build error
Build error
Ivan Roman
commited on
Commit
·
d7652fa
1
Parent(s):
a771de4
Update app.py
Browse files
app.py
CHANGED
@@ -5,8 +5,8 @@ openai.api_key = "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"
|
|
5 |
|
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",
|
@@ -18,17 +18,19 @@ def CustomChatGPT(user_input):
|
|
18 |
|
19 |
iface = gr.Interface(
|
20 |
fn=CustomChatGPT,
|
21 |
-
inputs=gr.inputs.Textbox(lines=5, placeholder='Type here...', label='Your Question'),
|
22 |
outputs=gr.outputs.Textbox(label='AI Response'),
|
23 |
title="CannaAssist AI Assistant",
|
24 |
description="Welcome to the CannaAssist AI Assistant. This tool is designed to provide expert guidance on BioTrack and cannabis regulations in New Mexico. DISCLAIMER: This is a proof of concept and not an official product.",
|
25 |
examples=[
|
26 |
-
["How to add wholesale flower into my inventory?"],
|
27 |
-
["
|
28 |
-
["
|
|
|
29 |
],
|
30 |
theme="huggingface"
|
31 |
)
|
32 |
|
33 |
iface.launch()
|
34 |
|
|
|
|
5 |
|
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(category, user_input):
|
9 |
+
user_input = f"In the context of BioTrack and cannabis regulations in New Mexico, and specifically about {category}, " + user_input
|
10 |
messages.append({"role": "user", "content": user_input})
|
11 |
response = openai.ChatCompletion.create(
|
12 |
model="gpt-3.5-turbo",
|
|
|
18 |
|
19 |
iface = gr.Interface(
|
20 |
fn=CustomChatGPT,
|
21 |
+
inputs=[gr.inputs.Dropdown(choices=['Biotrack', 'Regulations', 'Best Practices', 'General Question'], label='Category'), gr.inputs.Textbox(lines=5, placeholder='Type here...', label='Your Question')],
|
22 |
outputs=gr.outputs.Textbox(label='AI Response'),
|
23 |
title="CannaAssist AI Assistant",
|
24 |
description="Welcome to the CannaAssist AI Assistant. This tool is designed to provide expert guidance on BioTrack and cannabis regulations in New Mexico. DISCLAIMER: This is a proof of concept and not an official product.",
|
25 |
examples=[
|
26 |
+
["Biotrack", "How to add wholesale flower into my inventory?"],
|
27 |
+
["Regulations", "Tell me about cannabis regulations in New Mexico."],
|
28 |
+
["Best Practices", "What are the best practices for managing inventory?"],
|
29 |
+
["General Question", "What is BioTrack?"]
|
30 |
],
|
31 |
theme="huggingface"
|
32 |
)
|
33 |
|
34 |
iface.launch()
|
35 |
|
36 |
+
|