From 71c8f4cf9736b608a2a9035d792b481562d78e42 Mon Sep 17 00:00:00 2001 From: Tyler Hill Date: Thu, 4 Jun 2026 19:28:14 -0500 Subject: [PATCH 1/2] Copy static-data folder over --- Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dockerfile b/Dockerfile index 8c7e2d1..36c6386 100644 --- a/Dockerfile +++ b/Dockerfile @@ -34,6 +34,9 @@ COPY runners /app/runners RUN chmod +x /app/runners/setup.sh ENTRYPOINT ["/app/runners/setup.sh"] +# Copy static-data folder for budgets and grades +COPY static-data /app/static-data + # Optional .env copy for development FROM base AS local COPY .env /app/.env From fcf7743418df0499e6e148e3566e788f77a49e07 Mon Sep 17 00:00:00 2001 From: Tyler Hill Date: Thu, 4 Jun 2026 19:35:51 -0500 Subject: [PATCH 2/2] Change to caching by year --- parser/budgetsParser.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/parser/budgetsParser.go b/parser/budgetsParser.go index 025a42f..77fc50f 100644 --- a/parser/budgetsParser.go +++ b/parser/budgetsParser.go @@ -9,8 +9,6 @@ package parser import ( "context" - "crypto/sha256" - "encoding/hex" "encoding/json" "errors" "fmt" @@ -29,7 +27,8 @@ import ( ) // What gets sent to Gemini, with the PDF content added -// WARNING: Changes to this prompt will invalidate all cached AI responses, only change if necessary +// WARNING: Changes to this prompt WILL NOT invalidate cached AI responses. Caching is made only based off of year +// FOR CHANGES TO THIS PROMPT TO TAKE EFFECT THE GCP CACHE FILE MUST BE DELETED MANUALLY. The API project lead can do this for a PR var budgetPrompt = `Parse the content of these PDFs and generate the following JSON schema. { @@ -414,9 +413,8 @@ func parseBudgetPdfs(paths []string) (schema.Budget, error) { promptFilled := fmt.Sprintf(budgetPrompt, year, year, content) // Check cache - hashByte := sha256.Sum256([]byte(promptFilled)) - hash := hex.EncodeToString(hashByte[:]) + ".json" - result, err := utils.CheckCache(hash, apiBucket) + cacheName := year + ".json" + result, err := utils.CheckCache(cacheName, apiBucket) if err != nil { return schema.Budget{}, err } @@ -452,7 +450,7 @@ func parseBudgetPdfs(paths []string) (schema.Budget, error) { result = response.Candidates[0].Content.Parts[0].Text // Set cache for next time - err = utils.SetCache(hash, result, apiBucket) + err = utils.SetCache(cacheName, result, apiBucket) if err != nil { return schema.Budget{}, err }