Commit
·
287b2b6
1
Parent(s):
d051b4e
Update app.py
Browse files
app.py
CHANGED
@@ -1,16 +1,19 @@
|
|
1 |
# import libraries
|
2 |
import os
|
3 |
import gradio as gr
|
|
|
4 |
import openai
|
5 |
|
6 |
-
|
7 |
-
|
|
|
|
|
8 |
|
9 |
def ai_response(q):
|
10 |
completion = openai.ChatCompletion.create(
|
11 |
model="gpt-3.5-turbo",
|
12 |
messages=[
|
13 |
-
{"role": "assistant", "content":
|
14 |
{"role": "user", "content": q}
|
15 |
],
|
16 |
stop=[" Human:", " AI:"]
|
|
|
1 |
# import libraries
|
2 |
import os
|
3 |
import gradio as gr
|
4 |
+
from dotenv import load_dotenv, dotenv_values
|
5 |
import openai
|
6 |
|
7 |
+
load_dotenv()
|
8 |
+
|
9 |
+
openai.organization = os.getenv("ORG_KEY")
|
10 |
+
openai.api_key = os.getenv("OPENAI_API_KEY")
|
11 |
|
12 |
def ai_response(q):
|
13 |
completion = openai.ChatCompletion.create(
|
14 |
model="gpt-3.5-turbo",
|
15 |
messages=[
|
16 |
+
{"role": "assistant", "content": os.getenv("Prompt_doctor")},
|
17 |
{"role": "user", "content": q}
|
18 |
],
|
19 |
stop=[" Human:", " AI:"]
|