Update app.py
Browse files
app.py
CHANGED
|
@@ -42,25 +42,6 @@ def build_interface() -> gr.Blocks:
|
|
| 42 |
* {
|
| 43 |
font-family: 'Nunito', sans-serif;
|
| 44 |
}
|
| 45 |
-
|
| 46 |
-
/* Set the background for the credentials and chat sections */
|
| 47 |
-
#credentials-box, #chat-box {
|
| 48 |
-
background-color: #36c4e4;
|
| 49 |
-
padding: 20px;
|
| 50 |
-
border-radius: 12px;
|
| 51 |
-
}
|
| 52 |
-
|
| 53 |
-
/* Make the button dark blue */
|
| 54 |
-
.gr-button-primary {
|
| 55 |
-
background-color: #0b65b3 !important;
|
| 56 |
-
color: white !important;
|
| 57 |
-
border: none !important;
|
| 58 |
-
border-radius: 6px;
|
| 59 |
-
}
|
| 60 |
-
|
| 61 |
-
.gr-button-primary:hover {
|
| 62 |
-
background-color: #094e91 !important;
|
| 63 |
-
}
|
| 64 |
"""
|
| 65 |
|
| 66 |
with gr.Blocks(title="WellBe+ Assistant", css=custom_css) as app:
|
|
@@ -79,39 +60,37 @@ def build_interface() -> gr.Blocks:
|
|
| 79 |
# Left column – credential inputs
|
| 80 |
# -----------------------------------------------------------------
|
| 81 |
with gr.Column(scale=1):
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 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 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 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/)"
|
|
|
|
| 42 |
* {
|
| 43 |
font-family: 'Nunito', sans-serif;
|
| 44 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
"""
|
| 46 |
|
| 47 |
with gr.Blocks(title="WellBe+ Assistant", css=custom_css) as app:
|
|
|
|
| 60 |
# Left column – credential inputs
|
| 61 |
# -----------------------------------------------------------------
|
| 62 |
with gr.Column(scale=1):
|
| 63 |
+
gr.Markdown("### Credentials")
|
| 64 |
+
openai_key_box = gr.Textbox(
|
| 65 |
+
label="OpenAI API Key",
|
| 66 |
+
type="password",
|
| 67 |
+
placeholder="sk‑…",
|
| 68 |
+
)
|
| 69 |
+
whoop_email_box = gr.Textbox(label="Whoop e‑mail", type="password")
|
| 70 |
+
whoop_pass_box = gr.Textbox(label="Whoop password", type="password")
|
|
|
|
| 71 |
|
| 72 |
# -----------------------------------------------------------------
|
| 73 |
# Right column – chat interface
|
| 74 |
# -----------------------------------------------------------------
|
| 75 |
with gr.Column(scale=2):
|
| 76 |
+
gr.Markdown("### Chat")
|
| 77 |
+
question_box = gr.Textbox(
|
| 78 |
+
label="Question",
|
| 79 |
+
lines=3,
|
| 80 |
+
placeholder="e.g. How has my sleep changed since starting Prozac last month?",
|
| 81 |
+
)
|
| 82 |
+
answer_box = gr.Textbox(label="Assistant", lines=8, interactive=False)
|
| 83 |
+
ask_btn = gr.Button("Explore Insights", variant="primary")
|
| 84 |
+
ask_btn.click(
|
| 85 |
+
fn=answer_sync,
|
| 86 |
+
inputs=[
|
| 87 |
+
question_box,
|
| 88 |
+
openai_key_box,
|
| 89 |
+
whoop_email_box,
|
| 90 |
+
whoop_pass_box,
|
| 91 |
+
],
|
| 92 |
+
outputs=answer_box,
|
| 93 |
+
)
|
|
|
|
| 94 |
|
| 95 |
gr.Markdown(
|
| 96 |
"---\nBuilt by [Natalia B.](https://www.linkedin.com/in/natalia-bobkova/), [Victoria L.](https://www.linkedin.com/in/victoria-latynina/)"
|