Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -3,7 +3,7 @@ import gradio as gr
|
|
3 |
import os
|
4 |
|
5 |
# Set your OpenAI API key
|
6 |
-
client = OpenAI(api_key="
|
7 |
|
8 |
greetings = ["hello", "hi", "hey", "greetings", "good morning", "good afternoon", "good evening"]
|
9 |
|
@@ -18,7 +18,7 @@ def chatbot(input, conversation_history=[]):
|
|
18 |
|
19 |
# Define the structured interview messages
|
20 |
messages = [
|
21 |
-
{"role": "system", "content": "Your role is to answer the questions from the users friendly. If they ask weird questions or input things you do not understand, just say: 'Sorry, this question is beyond my understanding. Please try another one!"},
|
22 |
]
|
23 |
|
24 |
# Extend the conversation history with the user's messages
|
@@ -46,4 +46,4 @@ outputs = [gr.components.Textbox(label="Reply"), gr.components.State()]
|
|
46 |
|
47 |
gr.Interface(fn=chatbot, inputs=inputs, outputs=outputs, title="AI Chatbot",
|
48 |
description="Ask anything you want",
|
49 |
-
theme="Default").launch(
|
|
|
3 |
import os
|
4 |
|
5 |
# Set your OpenAI API key
|
6 |
+
client = OpenAI(api_key=os.environ["APITOKEN"])
|
7 |
|
8 |
greetings = ["hello", "hi", "hey", "greetings", "good morning", "good afternoon", "good evening"]
|
9 |
|
|
|
18 |
|
19 |
# Define the structured interview messages
|
20 |
messages = [
|
21 |
+
{"role": "system", "content": "Your role is to answer the questions from the users friendly. If they ask weird questions or input things you do not understand, just say: 'Sorry, this question is beyond my understanding. Please try another one!"},
|
22 |
]
|
23 |
|
24 |
# Extend the conversation history with the user's messages
|
|
|
46 |
|
47 |
gr.Interface(fn=chatbot, inputs=inputs, outputs=outputs, title="AI Chatbot",
|
48 |
description="Ask anything you want",
|
49 |
+
theme="Default").launch()
|