Skip to content

[Pipeline B] Wire the fill flow to accept input_id and use the stored transcript #638

Description

@abhishek-8081

Today the fill endpoints take the raw narrative directly in the request body
(FormFill{template_id, input_text, model} on POST /forms/fill, and
AsyncFormFill{template_ids, input_text, model} on POST /forms/jobs). That duplicates the
narrative and ignores the stored transcript.

Approach B's model is "transcript stored once, reused at fill time." So the fill flow
should take an input_id, look up the stored Input.transcript, and use that as the narrative
passed to the LLM.

Changes

  • POST /forms/fill and POST /forms/jobs accept input_id instead of input_text.
  • The service layer fetches the Input by input_id and uses Input.transcript as the
    narrative.
  • Error handling: 404 if the input doesn't exist; 409 if the input isn't ready (still
    transcribing / failed).
  • The template's fields dict continues to drive the per-field LLM extraction (unchanged).

Acceptance criteria

  • Fill endpoints take input_id and resolve the transcript from the stored Input.
  • 404 / 409 handled for missing / not-ready inputs.
  • Existing fill behavior (per-field LLM loop, PDF fill) otherwise unchanged.
  • Tests updated to pass input_id and cover the 404 / 409 cases.

Part of the Pipeline B tracker (#636 ).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    Week X Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions