Skip to content

FEAT: added the ability to pass the service area location into the prompts - #129

Closed
michelle-hadfield-nava wants to merge 4 commits into
mainfrom
mHadfield/1403_add_ability_to_support_multiple_service_areas
Closed

FEAT: added the ability to pass the service area location into the prompts#129
michelle-hadfield-nava wants to merge 4 commits into
mainfrom
mHadfield/1403_add_ability_to_support_multiple_service_areas

Conversation

@michelle-hadfield-nava

@michelle-hadfield-nava michelle-hadfield-nava commented Jan 8, 2026

Copy link
Copy Markdown
Collaborator

Ticket

https://navalabs.atlassian.net/browse/DST-1403

Changes

  • Added location as a parameter in the Action plan and referrals prompts
  • Added location as a parameter in the frontend query params
  • Added location as a parameter in the Action plan and referrals pipelines
  • Added a default location value for Central Texas

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 ♻️

@github-actions

github-actions Bot commented Jan 8, 2026

Copy link
Copy Markdown

Coverage report for frontend

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

@michelle-hadfield-nava
michelle-hadfield-nava marked this pull request as ready for review January 8, 2026 14:35
Copilot AI review requested due to automatic review settings January 8, 2026 14:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread app/src/pipelines/generate_referrals/pipeline_wrapper.py Outdated
Comment thread app/src/pipelines/generate_action_plan/pipeline_wrapper.py Outdated
Comment thread app/src/pipelines/generate_action_plan/pipeline_wrapper.py Outdated
michelle-hadfield-nava and others added 2 commits January 8, 2026 07:42
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pass in prompt_suffix instead of location, then lookup the prompt_template using f"generate_referrals_{prompt_suffix}" -- Slack

@michelle-hadfield-nava

Copy link
Copy Markdown
Collaborator Author

See #134
favoring separate prompt versions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants