FEAT: added the ability to pass the service area location into the prompts - #129
Conversation
… Location can be set in the query params
Coverage report for
|
St.❔ |
Category | Percentage | Covered / Total |
|---|---|---|---|
| 🔴 | Statements | 53.35% (-0.64% 🔻) |
366/686 |
| 🔴 | Branches | 48.36% (-0.17% 🔻) |
118/244 |
| 🔴 | Functions | 58.88% | 63/107 |
| 🔴 | Lines | 53.08% (-0.67% 🔻) |
345/650 |
Show files with reduced coverage 🔻
St.❔ |
File | Statements | Branches | Functions | Lines |
|---|---|---|---|---|---|
| 🟡 | ... / page.tsx |
75.27% (-0.27% 🔻) |
78.69% (-2.01% 🔻) |
75.68% | 76% (-0.3% 🔻) |
| 🔴 | ... / fetchResources.ts |
8.57% (-1.43% 🔻) |
0% | 0% | 8.82% (-1.52% 🔻) |
| 🔴 | ... / fetchActionPlan.ts |
3.7% (-0.22% 🔻) |
0% | 0% | 3.85% (-0.24% 🔻) |
Test suite run success
78 tests passing in 7 suites.
Report generated by 🧪jest coverage report action from a42afc1
There was a problem hiding this comment.
Pull request overview
This PR adds location support to the referral generation and action plan pipelines, enabling location-specific resource recommendations. The location parameter is passed from the frontend through the API to the LLM prompts.
- Added location as an optional parameter throughout the frontend and backend stack
- Updated prompt versions to support location-based queries
- Set "Austin - Central Texas" as the default location when none is provided
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/util/fetchResources.ts | Added location parameter to API request body, conditionally included when provided |
| frontend/src/util/fetchActionPlan.ts | Added location parameter to action plan API request, conditionally included when provided |
| frontend/src/app/[locale]/generate-referrals/page.tsx | Extracts location from URL query params and passes to both resource fetch and action plan generation |
| app/src/pipelines/generate_referrals_rag/pipeline_wrapper.py | Added location variable to ChatPromptBuilder and updated method signatures to pass location through pipeline |
| app/src/pipelines/generate_referrals/pipeline_wrapper.py | Added location variable to ChatPromptBuilder, updated signatures, and implemented default location fallback |
| app/src/pipelines/generate_action_plan/pipeline_wrapper.py | Added location parameter to API methods and passes location to prompt builder with default fallback |
| app/src/app_config.py | Added default_location configuration value and updated prompt version IDs |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| def _run(self, query: str, user_email: str, prompt_version_id: str = "") -> dict: | ||
| def _run( | ||
| self, query: str, user_email: str, prompt_version_id: str = "", location: str = "" | ||
| ) -> dict: |
There was a problem hiding this comment.
Pass in prompt_suffix instead of location, then lookup the prompt_template using f"generate_referrals_{prompt_suffix}" -- Slack
|
See #134 |
Ticket
https://navalabs.atlassian.net/browse/DST-1403
Changes
Context for reviewers
https://phoenix.referral-pilot-dev.navateam.com:6006/prompts/
Generate Referrals Prompt Version - UHJvbXB0VmVyc2lvbjo2MA==
Generate Action Plan Prompt Version - UHJvbXB0VmVyc2lvbjo1OQ==
Testing
You will need to test this locally for end to end testing. Preview frontend environments refer to DEV
visit `generate-referrals?location=Harrisburg%2C%20PA
Confirm generated resources are location-specific
Preview environment for frontend
♻️ Environment destroyed ♻️
Preview environment for app
♻️ Environment destroyed ♻️