Spaces:
Sleeping
Sleeping
Commit ·
45694be
1
Parent(s): d071708
reverts changes to tab visibility
Browse files
app.py
CHANGED
|
@@ -294,32 +294,20 @@ with gr.Blocks(theme='aliabid94/new-theme') as demo:
|
|
| 294 |
openai_api_key = gr.Textbox(label = 'Please provide your OpenAI API Key:', type = 'password', placeholder = 'Note: To use the OpenAI API, you need a paid account')
|
| 295 |
api_key_output = gr.Textbox(label = 'Result')
|
| 296 |
load_button = gr.Button('Load TLS Protect Cloud Data')
|
| 297 |
-
with gr.
|
| 298 |
-
|
| 299 |
-
|
| 300 |
-
|
| 301 |
-
|
| 302 |
-
|
| 303 |
-
|
| 304 |
-
|
| 305 |
-
|
| 306 |
-
chart_button = gr.Button("Submit")
|
| 307 |
-
|
| 308 |
-
def load_data_submit(tlspc_api_key, open_api_key):
|
| 309 |
-
data_return = getData(tlspc_api_key,openai_api_key)
|
| 310 |
-
if "Error" in data_return:
|
| 311 |
-
return {api_key_output: data_return}
|
| 312 |
-
else:
|
| 313 |
-
return {
|
| 314 |
-
api_key_output: data_return,
|
| 315 |
-
hidden_tabs: gr.update(visible=True),
|
| 316 |
-
}
|
| 317 |
|
| 318 |
|
| 319 |
|
| 320 |
text_button.click(prompt_analyze_questions, inputs=prompt_questions, outputs=text_output)
|
| 321 |
chart_button.click(prompt_analyze_reporting, inputs=prompt_reporting, outputs=chart_output)
|
| 322 |
-
load_button.click(
|
| 323 |
-
outputs = [api_key_output, hidden_tabs])
|
| 324 |
|
| 325 |
demo.launch()
|
|
|
|
| 294 |
openai_api_key = gr.Textbox(label = 'Please provide your OpenAI API Key:', type = 'password', placeholder = 'Note: To use the OpenAI API, you need a paid account')
|
| 295 |
api_key_output = gr.Textbox(label = 'Result')
|
| 296 |
load_button = gr.Button('Load TLS Protect Cloud Data')
|
| 297 |
+
with gr.Tab("Answer Questions"):
|
| 298 |
+
#prompt_tlspc_key = gr.Textbox(label = 'Please provide your TLS Protect Cloud API Key:')
|
| 299 |
+
prompt_questions = gr.Textbox(label = 'Input prompt here:', placeholder = "Try something like 'What is the name of the issuing template that has been used to request the most certificates?'")
|
| 300 |
+
text_output = gr.Textbox(label = 'Response:')
|
| 301 |
+
text_button = gr.Button("Submit")
|
| 302 |
+
with gr.Tab("Create Graphs"):
|
| 303 |
+
prompt_reporting = gr.Textbox(label = 'Input prompt here:', placeholder = "Try something like 'Plot a line chart of certificate issuances over time'")
|
| 304 |
+
chart_output = gr.Plot(label = 'Output:')
|
| 305 |
+
chart_button = gr.Button("Submit")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 306 |
|
| 307 |
|
| 308 |
|
| 309 |
text_button.click(prompt_analyze_questions, inputs=prompt_questions, outputs=text_output)
|
| 310 |
chart_button.click(prompt_analyze_reporting, inputs=prompt_reporting, outputs=chart_output)
|
| 311 |
+
load_button.click(getData, inputs=[tlspc_api_key, openai_api_key], outputs=api_key_output)
|
|
|
|
| 312 |
|
| 313 |
demo.launch()
|