Spaces:
Running
Running
Actualiza `app.py` para implementar un nuevo estilo CSS que mejora la apariencia de la interfaz de usuario, forzando un tema oscuro similar al de ChatGPT. Se eliminan las definiciones de estilo anteriores y se reemplazan por una variable `style`, lo que simplifica la gestión del CSS en la aplicación. Además, se añade el decorador `@traceable` a la función `respond`, mejorando la trazabilidad de las respuestas del asistente.
Browse files
app.py
CHANGED
|
@@ -38,6 +38,29 @@ Comienza preguntando si ya tiene cuenta y acceso al portal adecuado:
|
|
| 38 |
- Para OneDrive: cuenta de Microsoft y acceso a Microsoft Entra ID (Azure AD) en Azure Portal.
|
| 39 |
"""
|
| 40 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
|
| 42 |
def _extract_text_and_files(message):
|
| 43 |
"""Extract user text and attached files from a multimodal message value."""
|
|
@@ -68,6 +91,7 @@ def _extract_text_and_files(message):
|
|
| 68 |
return text_combined, files
|
| 69 |
|
| 70 |
|
|
|
|
| 71 |
def respond(message, history: list[tuple[str, str]]):
|
| 72 |
"""Stream assistant reply via Gemini using OpenAI-compatible API.
|
| 73 |
|
|
@@ -177,28 +201,7 @@ chat = gr.ChatInterface(
|
|
| 177 |
"Guíame para obtener credenciales de OneDrive",
|
| 178 |
],
|
| 179 |
theme=gr.themes.Monochrome(),
|
| 180 |
-
css=
|
| 181 |
-
/* Force dark appearance similar to ChatGPT */
|
| 182 |
-
:root, .gradio-container { color-scheme: dark; }
|
| 183 |
-
body, .gradio-container { background: #0b0f16; }
|
| 184 |
-
.prose, .gr-text, .gr-form { color: #e5e7eb; }
|
| 185 |
-
/* Chat bubbles */
|
| 186 |
-
.message.user { background: #111827; border-radius: 10px; }
|
| 187 |
-
.message.assistant { background: #0f172a; border-radius: 10px; }
|
| 188 |
-
/* Input */
|
| 189 |
-
textarea, .gr-textbox textarea {
|
| 190 |
-
background: #0f172a !important;
|
| 191 |
-
color: #e5e7eb !important;
|
| 192 |
-
border-color: #1f2937 !important;
|
| 193 |
-
}
|
| 194 |
-
/* Buttons */
|
| 195 |
-
button {
|
| 196 |
-
background: #1f2937 !important;
|
| 197 |
-
color: #e5e7eb !important;
|
| 198 |
-
border: 1px solid #374151 !important;
|
| 199 |
-
}
|
| 200 |
-
button:hover { background: #374151 !important; }
|
| 201 |
-
""",
|
| 202 |
)
|
| 203 |
|
| 204 |
|
|
|
|
| 38 |
- Para OneDrive: cuenta de Microsoft y acceso a Microsoft Entra ID (Azure AD) en Azure Portal.
|
| 39 |
"""
|
| 40 |
|
| 41 |
+
style = """
|
| 42 |
+
/* Force dark appearance similar to ChatGPT */
|
| 43 |
+
:root, .gradio-container { color-scheme: dark; }
|
| 44 |
+
body, .gradio-container { background: #0b0f16; }
|
| 45 |
+
.prose, .gr-text, .gr-form { color: #e5e7eb; }
|
| 46 |
+
/* Chat bubbles */
|
| 47 |
+
.message.user { background: #111827; border-radius: 10px; }
|
| 48 |
+
.message.assistant { background: #0f172a; border-radius: 10px; }
|
| 49 |
+
/* Input */
|
| 50 |
+
textarea, .gr-textbox textarea {
|
| 51 |
+
background: #0f172a !important;
|
| 52 |
+
color: #e5e7eb !important;
|
| 53 |
+
border-color: #1f2937 !important;
|
| 54 |
+
}
|
| 55 |
+
/* Buttons */
|
| 56 |
+
button {
|
| 57 |
+
background: #1f2937 !important;
|
| 58 |
+
color: #e5e7eb !important;
|
| 59 |
+
border: 1px solid #374151 !important;
|
| 60 |
+
}
|
| 61 |
+
button:hover { background: #374151 !important; }
|
| 62 |
+
"""
|
| 63 |
+
|
| 64 |
|
| 65 |
def _extract_text_and_files(message):
|
| 66 |
"""Extract user text and attached files from a multimodal message value."""
|
|
|
|
| 91 |
return text_combined, files
|
| 92 |
|
| 93 |
|
| 94 |
+
@traceable
|
| 95 |
def respond(message, history: list[tuple[str, str]]):
|
| 96 |
"""Stream assistant reply via Gemini using OpenAI-compatible API.
|
| 97 |
|
|
|
|
| 201 |
"Guíame para obtener credenciales de OneDrive",
|
| 202 |
],
|
| 203 |
theme=gr.themes.Monochrome(),
|
| 204 |
+
css=style,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 205 |
)
|
| 206 |
|
| 207 |
|