Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -40,12 +40,12 @@ with block:
|
|
40 |
gr.Markdown("""<h1><center>π€ ChatGPT-Assistant π</center></h1>
|
41 |
<p><center>ChatGPT-Assistant is a chatbot that uses the gpt-3.5-turbo model</center></p>
|
42 |
""")
|
43 |
-
api_key = gr.Textbox(type="password", label="Enter your OpenAI API key here")
|
44 |
-
system = gr.Textbox(label="System message", placeholder="
|
45 |
sub = gr.Button("Send")
|
46 |
sub.click(chatgpt.system_message, inputs=[system])
|
47 |
chatbot = gr.Chatbot()
|
48 |
-
message = gr.Textbox(label="Message")
|
49 |
state = gr.State()
|
50 |
submit = gr.Button("Send")
|
51 |
submit.click(chatgpt.answer_chatgpt, inputs=[api_key, message, state], outputs=[chatbot, state])
|
|
|
40 |
gr.Markdown("""<h1><center>π€ ChatGPT-Assistant π</center></h1>
|
41 |
<p><center>ChatGPT-Assistant is a chatbot that uses the gpt-3.5-turbo model</center></p>
|
42 |
""")
|
43 |
+
api_key = gr.Textbox(type="password", label="Enter your OpenAI API key here", placeholder="sk-...0VYO")
|
44 |
+
system = gr.Textbox(label="System message", placeholder="You are a helpful assistant.")
|
45 |
sub = gr.Button("Send")
|
46 |
sub.click(chatgpt.system_message, inputs=[system])
|
47 |
chatbot = gr.Chatbot()
|
48 |
+
message = gr.Textbox(label="Message", placeholder="Hi, how are things ?")
|
49 |
state = gr.State()
|
50 |
submit = gr.Button("Send")
|
51 |
submit.click(chatgpt.answer_chatgpt, inputs=[api_key, message, state], outputs=[chatbot, state])
|