Upload 29 files
Browse files
app.py
CHANGED
|
@@ -53,8 +53,15 @@ body, html {
|
|
| 53 |
padding-top: 2rem !important;
|
| 54 |
}
|
| 55 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
#chat-canvas {
|
| 57 |
-
height: calc(100vh -
|
|
|
|
| 58 |
overflow-y: auto;
|
| 59 |
border: none !important;
|
| 60 |
box-shadow: none !important;
|
|
@@ -101,6 +108,9 @@ body, html {
|
|
| 101 |
border-top: 1px solid var(--border-light);
|
| 102 |
background: var(--bg-light);
|
| 103 |
padding: 1.5rem 0;
|
|
|
|
|
|
|
|
|
|
| 104 |
}
|
| 105 |
|
| 106 |
@media (prefers-color-scheme: dark) {
|
|
@@ -119,6 +129,14 @@ body, html {
|
|
| 119 |
padding: 16px !important;
|
| 120 |
}
|
| 121 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 122 |
@media (prefers-color-scheme: dark) {
|
| 123 |
#prompt-input {
|
| 124 |
background-color: var(--input-bg-dark) !important;
|
|
@@ -158,7 +176,7 @@ body, html {
|
|
| 158 |
display: flex;
|
| 159 |
flex-direction: column;
|
| 160 |
justify-content: center;
|
| 161 |
-
|
| 162 |
}
|
| 163 |
#welcome-message h2 { font-size: 2.2rem; font-weight: 700; }
|
| 164 |
#welcome-message p { font-size: 1.1rem; opacity: 0.7; }
|
|
@@ -188,25 +206,37 @@ def build_ui() -> gr.Blocks:
|
|
| 188 |
)
|
| 189 |
|
| 190 |
# Welcome message or chat
|
| 191 |
-
gr.
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
<
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 210 |
# Hidden components for logic
|
| 211 |
files_in = gr.File(
|
| 212 |
label="Attach files",
|
|
@@ -215,18 +245,6 @@ def build_ui() -> gr.Blocks:
|
|
| 215 |
elem_id="file-input",
|
| 216 |
)
|
| 217 |
|
| 218 |
-
# Prompt bar at the bottom
|
| 219 |
-
with gr.Row(elem_id="prompt-bar"):
|
| 220 |
-
attach_btn = gr.Button("馃搸", elem_id="attach-btn", size="sm")
|
| 221 |
-
user_in = gr.Textbox(
|
| 222 |
-
placeholder="Escribe tu mensaje...",
|
| 223 |
-
lines=1,
|
| 224 |
-
elem_id="prompt-input",
|
| 225 |
-
show_label=False,
|
| 226 |
-
container=False,
|
| 227 |
-
)
|
| 228 |
-
send_btn = gr.Button("Enviar", elem_id="send-btn", variant="primary", size="sm")
|
| 229 |
-
|
| 230 |
# --- Event Handlers ---
|
| 231 |
|
| 232 |
chat_inputs = [
|
|
|
|
| 53 |
padding-top: 2rem !important;
|
| 54 |
}
|
| 55 |
|
| 56 |
+
#chat-area {
|
| 57 |
+
display: flex;
|
| 58 |
+
flex-direction: column;
|
| 59 |
+
gap: 1.5rem;
|
| 60 |
+
}
|
| 61 |
+
|
| 62 |
#chat-canvas {
|
| 63 |
+
height: min(520px, calc(100vh - 260px)) !important;
|
| 64 |
+
min-height: 320px !important;
|
| 65 |
overflow-y: auto;
|
| 66 |
border: none !important;
|
| 67 |
box-shadow: none !important;
|
|
|
|
| 108 |
border-top: 1px solid var(--border-light);
|
| 109 |
background: var(--bg-light);
|
| 110 |
padding: 1.5rem 0;
|
| 111 |
+
display: flex;
|
| 112 |
+
gap: 0.75rem;
|
| 113 |
+
align-items: flex-end;
|
| 114 |
}
|
| 115 |
|
| 116 |
@media (prefers-color-scheme: dark) {
|
|
|
|
| 129 |
padding: 16px !important;
|
| 130 |
}
|
| 131 |
|
| 132 |
+
#prompt-bar .gr-textbox {
|
| 133 |
+
flex: 1;
|
| 134 |
+
}
|
| 135 |
+
|
| 136 |
+
#prompt-bar .gr-button {
|
| 137 |
+
min-width: 110px !important;
|
| 138 |
+
}
|
| 139 |
+
|
| 140 |
@media (prefers-color-scheme: dark) {
|
| 141 |
#prompt-input {
|
| 142 |
background-color: var(--input-bg-dark) !important;
|
|
|
|
| 176 |
display: flex;
|
| 177 |
flex-direction: column;
|
| 178 |
justify-content: center;
|
| 179 |
+
gap: 0.5rem;
|
| 180 |
}
|
| 181 |
#welcome-message h2 { font-size: 2.2rem; font-weight: 700; }
|
| 182 |
#welcome-message p { font-size: 1.1rem; opacity: 0.7; }
|
|
|
|
| 206 |
)
|
| 207 |
|
| 208 |
# Welcome message or chat
|
| 209 |
+
with gr.Column(elem_id="chat-area"):
|
| 210 |
+
gr.HTML(
|
| 211 |
+
"""
|
| 212 |
+
<section class="welcome-card" id="welcome-card">
|
| 213 |
+
<h2>Tu Asistente de IA Personal</h2>
|
| 214 |
+
<p>Comienza una conversaci贸n para obtener ayuda con c贸digo, ideas y m谩s.</p>
|
| 215 |
+
</section>
|
| 216 |
+
""",
|
| 217 |
+
elem_id="welcome-message",
|
| 218 |
+
)
|
| 219 |
+
|
| 220 |
+
chat_box = gr.Chatbot(
|
| 221 |
+
label="",
|
| 222 |
+
height=None,
|
| 223 |
+
elem_id="chat-canvas",
|
| 224 |
+
show_label=False,
|
| 225 |
+
container=False,
|
| 226 |
+
visible=True
|
| 227 |
+
)
|
| 228 |
+
|
| 229 |
+
with gr.Row(elem_id="prompt-bar"):
|
| 230 |
+
attach_btn = gr.Button("馃搸", elem_id="attach-btn", size="sm")
|
| 231 |
+
user_in = gr.Textbox(
|
| 232 |
+
placeholder="Escribe tu mensaje...",
|
| 233 |
+
lines=1,
|
| 234 |
+
elem_id="prompt-input",
|
| 235 |
+
show_label=False,
|
| 236 |
+
container=False,
|
| 237 |
+
)
|
| 238 |
+
send_btn = gr.Button("Enviar", elem_id="send-btn", variant="primary", size="sm")
|
| 239 |
+
|
| 240 |
# Hidden components for logic
|
| 241 |
files_in = gr.File(
|
| 242 |
label="Attach files",
|
|
|
|
| 245 |
elem_id="file-input",
|
| 246 |
)
|
| 247 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 248 |
# --- Event Handlers ---
|
| 249 |
|
| 250 |
chat_inputs = [
|