Val town script here (which you can import as a module if you want!)
Demo using the template Money Database
- Uses
instructorandopen ai(withgpt-4-turbo) to process any content into a notion database entry. - Use
addToNotionwith any database id and content.
await addToNotion(
"DB_ID_GOES_HERE",
"CONTENT_GOES HERE"//"for example: $43.28 ordered malai kofta and kadhi (doordash) [me and mom] jan 3 2024"
);Prompts are created based on your database name, database description, property name, property type, property description, and if applicable, property options (and their descriptions).
Supports: checkbox, date, multi_select, number, rich_text, select, status, title, url, email. Filters properties where either type is title or description starts with ✨.
- Uses
NOTION_API_KEY,OPENAI_API_KEYstored in env variables and uses Valtown blob storage to store information about the database. - Use
get_notion_db_infoto use the stored blob if exists or create one, useget_and_save_notion_db_infoto create a new blob (and replace an existing one if exists).
![[Image version] And the outcome of the demo video above. Shows 3 entries, 2 of type debit, 1 of credit, across various inferred categories etc.](/_astro/Untitled.DG0K9Q9G_Z11vR9n.webp)