No, the script just runs a Gmail search and iterates over the results. The workflow is as follows:
1. Send statement items to GPT to generate search queries for Gmail. (basically company names like “Adobe”)
2. Search Gmail using these queries and some search modifiers that are likely to winnow down the messages to those likely to contain invoices.
3. Send a snippet of the message to GPT and ask it whether the message seems like it might contain an invoice.
4. If so, parse the message and save any attachments or render the HTML body as a PDF and save that. Also grok the message for currency amounts so I can put the likely invoice total in the file name (this helps the accountants).
That’s the flow. GPT helped me write it all, of course.
1. Send statement items to GPT to generate search queries for Gmail. (basically company names like “Adobe”)
2. Search Gmail using these queries and some search modifiers that are likely to winnow down the messages to those likely to contain invoices.
3. Send a snippet of the message to GPT and ask it whether the message seems like it might contain an invoice.
4. If so, parse the message and save any attachments or render the HTML body as a PDF and save that. Also grok the message for currency amounts so I can put the likely invoice total in the file name (this helps the accountants).
That’s the flow. GPT helped me write it all, of course.