codeforboston/maple

Function Wrapper for LLM Features

Opened this issue · 1 comments

Problem

Our codebase is written in Javascript/Typescript, but the LLM team does their data analysis and LLM queries in Python. We want them to continue to be able to write code in their language of choice (without compromising our language of choice), but we need to be able to call their LLM-based summary and tag generating functions in order to populate our firestore database.

To that end, we need to set up a framework to enable us to deploy Python Cloud function/s that can wrap the LLM team's summary/tag generators.

Success Criteria

  • Python-based Google Cloud Function (in the codeforboston/maple repo)
    • Wraps the existing LLM team code for Bill Summary and Bill Tag generation
    • BillSummary function has a contract like (BillId, BillText, SectionText) -> (BillSummary)
    • BillTag function has a contract like (BillId, BillText) -> [BillTags]
  • Functions should be internally-accessible only (e.g. only accessible from our other backend services)

Omissions

  • Actually acquiring the section text for Bill Summaries is out-of-scope for this ticket
  • This ticket doesn't cover the entire backend flow for generating and storing bill summaries - just the deployment of the cloud wrapper functions for the LLM code. Future tickets will build on this to queue up summary/tag generation requests and store the results in Firestore.

Additional Links

To be clear, this ticket requires no Typescript experience - it's strictly about wrapping the existing ML python functions in a Cloud Function so we can call it from non-python code.