Skip to content

Update to prompts - #357

Merged
ppinchuk merged 1 commit into
mainfrom
pp/adjust_prompts
Dec 4, 2025
Merged

Update to prompts#357
ppinchuk merged 1 commit into
mainfrom
pp/adjust_prompts

Conversation

@ppinchuk

@ppinchuk ppinchuk commented Dec 1, 2025

Copy link
Copy Markdown
Collaborator

Add YES_NO_PROMPT to template to reduce code repetition and make it easier to adjust instructions across all prompts.

@ppinchuk ppinchuk self-assigned this Dec 1, 2025
Copilot AI review requested due to automatic review settings December 1, 2025 20:45
@ppinchuk
ppinchuk requested a review from castelao as a code owner December 1, 2025 20:45
@ppinchuk ppinchuk added enhancement Update to logic or general code improvements p-medium Priority: medium topic-python-llm Issues/pull requests related to LLMs labels Dec 1, 2025
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 43.33%. Comparing base (1b6b4ae) to head (9160d76).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #357      +/-   ##
==========================================
+ Coverage   43.32%   43.33%   +0.01%     
==========================================
  Files          45       45              
  Lines        4240     4241       +1     
  Branches      380      380              
==========================================
+ Hits         1837     1838       +1     
  Misses       2378     2378              
  Partials       25       25              
Flag Coverage Δ
unittests 43.33% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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 refactors repeated prompt instruction text by introducing a YES_NO_PROMPT template variable to reduce code duplication and simplify future prompt adjustments across all graph-based extraction and validation modules.

Key Changes:

  • Added _YES_NO_PROMPT constant in compass/common/base.py containing "Please start your response with either 'Yes' or 'No' and briefly explain your answer."
  • Registered YES_NO_PROMPT as a graph-level template variable in setup_graph_no_nodes()
  • Replaced 50+ occurrences of the repeated yes/no instruction text with {YES_NO_PROMPT} across validation and extraction modules

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
compass/common/base.py Added _YES_NO_PROMPT constant definition and registered it in the graph setup function; replaced 20+ occurrences in base graph setup functions with the template variable
compass/validation/graphs.py Replaced 20+ occurrences of the repeated yes/no prompt instruction with {YES_NO_PROMPT} across document type and jurisdiction validation prompts
compass/extraction/wind/graphs.py Replaced 10+ occurrences in wind energy system type classification and setback extraction prompts with the template variable
compass/extraction/solar/graphs.py Replaced 6+ occurrences in solar energy farm type classification and setback extraction prompts with the template variable
compass/extraction/small_wind/graphs.py Replaced 10+ occurrences in small wind system type classification and setback extraction prompts with the template variable

Comment thread compass/validation/graphs.py
Comment thread compass/common/base.py
@ppinchuk
ppinchuk merged commit b611a2d into main Dec 4, 2025
20 checks passed
@ppinchuk
ppinchuk deleted the pp/adjust_prompts branch December 4, 2025 01:10
rajeee pushed a commit that referenced this pull request May 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Update to logic or general code improvements p-medium Priority: medium topic-python-llm Issues/pull requests related to LLMs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants