image.png

Below is shown the code behind the data extraction, AI Reasoning, and Supabase feeder by using Python

Initialization

First, we initialize the variables and clients to connect with Gemini and Supabase API

Data Extraction from RSS

Next, the data extracted from RSS. Since the RSS is in XML format, we used the feedparser to make the XML into dictionary objects in Python. From there, we extract desired value that will be sent both to Supabase and Gemini.

New Data Checker

Since we only able to request to Gemini API up to 20 requests per day, we need to make sure only extracting the data that is not available on Supabase. And make sure that the data is new.

AI Reasoning with Gemini and Data Feeder to Supabase

If new data exist, the code will start the AI Reasoning. For more details, here is the behind the scene on how I made it two steps AI call instead of one,

Building the AI System

Here is the code for supabase and gemini reasoning:

Data Output sample