Remove hardcoded query string in collect function for improved flexibility
Browse files- app/controllers/mail.py +2 -2
app/controllers/mail.py
CHANGED
@@ -198,7 +198,7 @@ def list_emails(service, messages):
|
|
198 |
vectorstore.add_documents(documents=documents, ids=ids)
|
199 |
|
200 |
|
201 |
-
def collect(service, query=(datetime.today() - timedelta(days=
|
202 |
"""
|
203 |
Main function to search and list emails from Gmail.
|
204 |
|
@@ -209,7 +209,7 @@ def collect(service, query=(datetime.today() - timedelta(days=21)).strftime("aft
|
|
209 |
Returns:
|
210 |
None
|
211 |
"""
|
212 |
-
query = "subject:Re: Smartcareers algorithm debug and improvement'"
|
213 |
emails = search_emails(service, query)
|
214 |
if emails:
|
215 |
print("Found %d emails:\n", len(emails))
|
|
|
198 |
vectorstore.add_documents(documents=documents, ids=ids)
|
199 |
|
200 |
|
201 |
+
def collect(service, query=(datetime.today() - timedelta(days=10)).strftime("after:%Y/%m/%d")):
|
202 |
"""
|
203 |
Main function to search and list emails from Gmail.
|
204 |
|
|
|
209 |
Returns:
|
210 |
None
|
211 |
"""
|
212 |
+
# query = "subject:Re: Smartcareers algorithm debug and improvement'"
|
213 |
emails = search_emails(service, query)
|
214 |
if emails:
|
215 |
print("Found %d emails:\n", len(emails))
|