Spaces:
Sleeping
Sleeping
updated app.py
Browse files
app.py
CHANGED
@@ -188,12 +188,16 @@ def fetch_emails(days_back, auth_code="", include_job=True, include_personal=Tru
|
|
188 |
except Exception as e:
|
189 |
return f"Error: {str(e)}"
|
190 |
|
191 |
-
# Create Gradio interface
|
192 |
def create_interface():
|
193 |
with gr.Blocks(title="Email Filter") as demo:
|
194 |
gr.Markdown("# 📧 Smart Email Filter")
|
195 |
gr.Markdown("Connect to your Gmail account to filter important emails")
|
196 |
|
|
|
|
|
|
|
|
|
|
|
197 |
with gr.Row():
|
198 |
days_back = gr.Slider(
|
199 |
minimum=1,
|
@@ -220,11 +224,11 @@ def create_interface():
|
|
220 |
|
221 |
fetch_button.click(
|
222 |
fn=fetch_emails,
|
223 |
-
inputs=[days_back, include_job, include_personal],
|
224 |
outputs=output
|
225 |
)
|
226 |
|
227 |
return demo
|
228 |
-
|
229 |
demo = create_interface()
|
230 |
demo.launch()
|
|
|
188 |
except Exception as e:
|
189 |
return f"Error: {str(e)}"
|
190 |
|
|
|
191 |
def create_interface():
|
192 |
with gr.Blocks(title="Email Filter") as demo:
|
193 |
gr.Markdown("# 📧 Smart Email Filter")
|
194 |
gr.Markdown("Connect to your Gmail account to filter important emails")
|
195 |
|
196 |
+
auth_code = gr.Textbox(
|
197 |
+
label="Authorization Code (if required)",
|
198 |
+
placeholder="Enter the authorization code here after visiting the auth URL"
|
199 |
+
)
|
200 |
+
|
201 |
with gr.Row():
|
202 |
days_back = gr.Slider(
|
203 |
minimum=1,
|
|
|
224 |
|
225 |
fetch_button.click(
|
226 |
fn=fetch_emails,
|
227 |
+
inputs=[days_back, auth_code, include_job, include_personal],
|
228 |
outputs=output
|
229 |
)
|
230 |
|
231 |
return demo
|
232 |
+
|
233 |
demo = create_interface()
|
234 |
demo.launch()
|