Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -10,7 +10,7 @@ system_prompt = [
|
|
10 |
}
|
11 |
]
|
12 |
|
13 |
-
|
14 |
|
15 |
def respond(message, chat_history):
|
16 |
re_messages = system_prompt
|
@@ -30,6 +30,7 @@ def respond(message, chat_history):
|
|
30 |
|
31 |
with gr.Blocks() as demo:
|
32 |
open_ai_key = gr.Textbox(label='OpenAI API Key', placeholder='输入你的OpenAI API Key')
|
|
|
33 |
chatbot = gr.Chatbot(label='历史会话')
|
34 |
msg = gr.Textbox(label='回车输入')
|
35 |
msg.submit(respond, [msg, chatbot], [msg, chatbot])
|
|
|
10 |
}
|
11 |
]
|
12 |
|
13 |
+
|
14 |
|
15 |
def respond(message, chat_history):
|
16 |
re_messages = system_prompt
|
|
|
30 |
|
31 |
with gr.Blocks() as demo:
|
32 |
open_ai_key = gr.Textbox(label='OpenAI API Key', placeholder='输入你的OpenAI API Key')
|
33 |
+
openai.api_key = open_ai_key
|
34 |
chatbot = gr.Chatbot(label='历史会话')
|
35 |
msg = gr.Textbox(label='回车输入')
|
36 |
msg.submit(respond, [msg, chatbot], [msg, chatbot])
|