feat(api): Interactive Voice Feedback Loop for Missing Incident Data (#106)#200
Open
Gopisokk wants to merge 1 commit intofireform-core:mainfrom
Open
feat(api): Interactive Voice Feedback Loop for Missing Incident Data (#106)#200Gopisokk wants to merge 1 commit intofireform-core:mainfrom
Gopisokk wants to merge 1 commit intofireform-core:mainfrom
Conversation
…ireform-core#106) Implemented stateful forms to support iterative data collection: - FormSubmission now stores status, extracted_data, and missing_fields - Decoupled LLM.main_loop() extraction from Filler.fill_form() to allow partial states - POST /forms/fill now checks for missing fields. Returns status: missing_data and pauses execution if data is incomplete. - Added POST /forms/{id}/feedback endpoint to accept follow-up user input, targeting only the previously missing_fields. - Generates the final PDF only when all fields are successfully extracted and status: completed. - Added mock-driven integration tests for the feedback loop flow.
7 tasks
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.
Summary
Resolves #[Paste Issue 106 number here] by implementing a stateful, multi-turn feedback loop for form submissions. If the LLM extraction identifies missing required data, the pipeline pauses, saves the partial JSON state, and exposes the missing fields to the frontend so it can prompt the user.
Architecture Changes
FormSubmissionwithstatus: str,extracted_data: JSON, andmissing_fields: JSONto persist partial states.LLM.main_loop()fromFiller.fill_form()insrc/file_manipulator.pyto allow execution to pause without generating a PDF. Wait states are now supported.POST /forms/{id}/feedback. This receives subsequent user input targeting only the missing fields, merging the newly extracted data with the previous session. The final PDF is generated only when all fields are successfully mapped.Testing
tests/test_forms.pycovering the end-to-end multi-turn feedback behavior, LLM mocking, and model DB interactions.Note: Since the DB schema for
FormSubmissionwas altered (SQLModel), maintainers need to recreate thefireform.dbSQLite file locally or the application will throw a missing column exception on startup.