Spaces:
Sleeping
Sleeping
S-MurilloG
commited on
Commit
•
e58fe8c
1
Parent(s):
86ca265
Updating application file
Browse files
app.py
CHANGED
@@ -1,6 +1,5 @@
|
|
1 |
import gradio as gr
|
2 |
import openai
|
3 |
-
import os
|
4 |
|
5 |
conversation_history = []
|
6 |
# Chat function using GPT-3.5-turbo
|
@@ -49,8 +48,8 @@ with gr.Blocks() as app:
|
|
49 |
gr.Markdown("# CARSE")
|
50 |
|
51 |
# API Key and User Name Inputs at the top
|
52 |
-
|
53 |
-
|
54 |
|
55 |
# Chat History in the middle
|
56 |
chat_history = gr.Textbox(label="Carse chat", value="", lines=10, interactive=False)
|
@@ -69,7 +68,7 @@ with gr.Blocks() as app:
|
|
69 |
|
70 |
submit_button.click(
|
71 |
fn=update_chat,
|
72 |
-
inputs=[message_input],
|
73 |
outputs=[chat_history, message_input]
|
74 |
)
|
75 |
# Run the app
|
|
|
1 |
import gradio as gr
|
2 |
import openai
|
|
|
3 |
|
4 |
conversation_history = []
|
5 |
# Chat function using GPT-3.5-turbo
|
|
|
48 |
gr.Markdown("# CARSE")
|
49 |
|
50 |
# API Key and User Name Inputs at the top
|
51 |
+
with gr.Row():
|
52 |
+
api_key_input = gr.Textbox(label="OpenAI API Key", placeholder="Introduce tu clave API de OpenAI", type="password")
|
53 |
|
54 |
# Chat History in the middle
|
55 |
chat_history = gr.Textbox(label="Carse chat", value="", lines=10, interactive=False)
|
|
|
68 |
|
69 |
submit_button.click(
|
70 |
fn=update_chat,
|
71 |
+
inputs=[api_key_input, message_input],
|
72 |
outputs=[chat_history, message_input]
|
73 |
)
|
74 |
# Run the app
|