S-MurilloG commited on
Commit
11201f0
1 Parent(s): 889c81b

Updating Application file

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -1,7 +1,6 @@
1
  import gradio as gr
2
  from openai import OpenAI
3
-
4
- client = OpenAI()
5
 
6
  conversation_history = []
7
  # Chat function using GPT-3.5-turbo
@@ -47,6 +46,9 @@ with gr.Blocks() as app:
47
  with gr.Row():
48
  api_key_input = gr.Textbox(label="OpenAI API Key", placeholder="Introduce tu clave API de OpenAI", type="password")
49
 
 
 
 
50
  # Chat History in the middle
51
  chat_history = gr.Textbox(label="Carse chat", value="", lines=10, interactive=False)
52
 
 
1
  import gradio as gr
2
  from openai import OpenAI
3
+ from content import OPENAI_API_KEY
 
4
 
5
  conversation_history = []
6
  # Chat function using GPT-3.5-turbo
 
46
  with gr.Row():
47
  api_key_input = gr.Textbox(label="OpenAI API Key", placeholder="Introduce tu clave API de OpenAI", type="password")
48
 
49
+ OPENAI_API_KEY = api_key_input
50
+ client = OpenAI(api_key=OPENAI_API_KEY)
51
+
52
  # Chat History in the middle
53
  chat_history = gr.Textbox(label="Carse chat", value="", lines=10, interactive=False)
54