umangchaudhry commited on
Commit
0d12e40
·
1 Parent(s): 809d8e1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -11,11 +11,11 @@ from langchain.llms import OpenAI
11
 
12
  def set_api_key(key):
13
  os.environ["OPENAI_API_KEY"] = key
14
- return f"Your API Key has been set to {key}"
15
 
16
  def reset_api_key():
17
  os.environ["OPENAI_API_KEY"] = ""
18
- return {api_key_status: gr.update(placeholder="Your API Key has been reset")}
19
 
20
  def get_api_key():
21
  api_key = os.getenv("OPENAI_API_KEY")
@@ -49,7 +49,7 @@ with gr.Blocks() as demo:
49
  api_input = gr.Textbox(label = "API Key - Your key will be active for 10 minutes. The bar below shows the time left.",
50
  placeholder = "Please provide your OpenAI API key here.")
51
  api_key_status = gr.Textbox(label = "API Key Status",
52
- placeholder = "Your API Key has been reset or has not be set yet. Please enter your key.",
53
  interactive = False)
54
  api_submit_button = gr.Button("Submit")
55
  api_reset_button = gr.Button("Clear API Key from session")
 
11
 
12
  def set_api_key(key):
13
  os.environ["OPENAI_API_KEY"] = key
14
+ return f"Your API Key has been set to: {key}"
15
 
16
  def reset_api_key():
17
  os.environ["OPENAI_API_KEY"] = ""
18
+ return "Your API Key has been reset"
19
 
20
  def get_api_key():
21
  api_key = os.getenv("OPENAI_API_KEY")
 
49
  api_input = gr.Textbox(label = "API Key - Your key will be active for 10 minutes. The bar below shows the time left.",
50
  placeholder = "Please provide your OpenAI API key here.")
51
  api_key_status = gr.Textbox(label = "API Key Status",
52
+ placeholder = "Your API Key has not be set yet. Please enter your key.",
53
  interactive = False)
54
  api_submit_button = gr.Button("Submit")
55
  api_reset_button = gr.Button("Clear API Key from session")