Update app.py
Browse files
app.py
CHANGED
|
@@ -79,37 +79,39 @@ def build_interface() -> gr.Blocks:
|
|
| 79 |
# Left column – credential inputs
|
| 80 |
# -----------------------------------------------------------------
|
| 81 |
with gr.Column(scale=1):
|
| 82 |
-
gr.
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
|
|
|
| 90 |
|
| 91 |
# -----------------------------------------------------------------
|
| 92 |
# Right column – chat interface
|
| 93 |
# -----------------------------------------------------------------
|
| 94 |
with gr.Column(scale=2):
|
| 95 |
-
gr.
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
|
|
|
| 113 |
|
| 114 |
gr.Markdown(
|
| 115 |
"---\nBuilt by [Natalia B.](https://www.linkedin.com/in/natalia-bobkova/), [Victoria L.](https://www.linkedin.com/in/victoria-latynina/)"
|
|
|
|
| 79 |
# Left column – credential inputs
|
| 80 |
# -----------------------------------------------------------------
|
| 81 |
with gr.Column(scale=1):
|
| 82 |
+
with gr.Group(elem_id="credentials-box"):
|
| 83 |
+
gr.Markdown("### Credentials")
|
| 84 |
+
openai_key_box = gr.Textbox(
|
| 85 |
+
label="OpenAI API Key",
|
| 86 |
+
type="password",
|
| 87 |
+
placeholder="sk‑…",
|
| 88 |
+
)
|
| 89 |
+
whoop_email_box = gr.Textbox(label="Whoop e‑mail", type="password")
|
| 90 |
+
whoop_pass_box = gr.Textbox(label="Whoop password", type="password")
|
| 91 |
|
| 92 |
# -----------------------------------------------------------------
|
| 93 |
# Right column – chat interface
|
| 94 |
# -----------------------------------------------------------------
|
| 95 |
with gr.Column(scale=2):
|
| 96 |
+
with gr.Group(elem_id="chat-box"):
|
| 97 |
+
gr.Markdown("### Chat")
|
| 98 |
+
question_box = gr.Textbox(
|
| 99 |
+
label="Question",
|
| 100 |
+
lines=3,
|
| 101 |
+
placeholder="e.g. How has my sleep changed since starting Prozac last month?",
|
| 102 |
+
)
|
| 103 |
+
answer_box = gr.Textbox(label="Assistant", lines=8, interactive=False)
|
| 104 |
+
ask_btn = gr.Button("Explore Insights", variant="primary")
|
| 105 |
+
ask_btn.click(
|
| 106 |
+
fn=answer_sync,
|
| 107 |
+
inputs=[
|
| 108 |
+
question_box,
|
| 109 |
+
openai_key_box,
|
| 110 |
+
whoop_email_box,
|
| 111 |
+
whoop_pass_box,
|
| 112 |
+
],
|
| 113 |
+
outputs=answer_box,
|
| 114 |
+
)
|
| 115 |
|
| 116 |
gr.Markdown(
|
| 117 |
"---\nBuilt by [Natalia B.](https://www.linkedin.com/in/natalia-bobkova/), [Victoria L.](https://www.linkedin.com/in/victoria-latynina/)"
|