Repository navigation
Add include_profile_context option to form fills (#770) - #771
Open
vikash7485 wants to merge 1 commit into
Open
vikash7485 wants to merge 1 commit into
vikash7485 wants to merge 1 commit into
Conversation
Add include_profile_context (default false) to POST /forms/fill and POST /forms/jobs. When it is true, the current profile is passed to the filler, which already adds it to the model input. For /forms/jobs the profile is read once when the request is submitted, so every job in the batch uses the same values. Part of fireform-core#770.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Part of #770.
filler.fill()can already add a profile to the model input, butFormServicenever passed one, so the saved profile never reached the model.This adds
include_profile_context(defaultfalse) toPOST /api/v1/forms/fillandPOST /api/v1/forms/jobs. When it istrue, the current profile (the oneGET /api/v1/profiles/returns) is passed to the filler. If no profile is saved, the fill runs without one. For/forms/jobsthe profile is read once when the request is submitted, so all jobs in the batch use the same values.Known problem: this only passes the profile through. With qwen2.5:3b the current profile block often ends up in the wrong fields, for example the contacts table instead of "Prepared by" (details and screenshots on #770). I kept the default off and left the model input change out until we agree on it there.
Type of change
How Has This Been Tested?
tests/test_profile_context.py(9 tests): on, off, default, no saved profile, async jobs and the Celery task. 3 of them fail ondevelopmentwithout this change.apply_asyncassertions intests/test_jobs.pyfor the new argument.pytest tests/: 481 passed.test_desktop_migration_failure_restores_databaseandtest_uploaded_audio_is_decoded_and_transcribedfail on my machine, the same way they do ondevelopment.ruff check app/andalembic checkare clean.Test Configuration:
Checklist: