Description
Currently, FireForm only supports filling one agency's form per API call via
POST /forms/fill. A responder dealing with a multi-agency incident must make
separate API calls for each form passing the same incident description repeatedly
and triggering a full LLM extraction for every single call. This directly contradicts
the "report once, file everywhere" goal that FireForm is built around.
Proposed Solution
Introduce a new batch endpoint POST /forms/fill-batch that accepts a list of
template IDs and a single incident description, runs LLM extraction exactly once,
and returns all filled PDFs in a single response.
Suggested Implementation
New endpoint: POST /forms/fill-batch
@router.post("/forms/fill-batch")
async def fill_batch(request: BatchFormFillRequest):
"""
Accepts multiple template IDs and a single input text.
Runs LLM extraction once and reuses the result across all templates.
"""
results = []
for template_id in request.template_ids:
result = await controller.fill_form(
user_input=request.input_text,
template_id=template_id
)
results.append(result)
return results
New request schema
class BatchFormFillRequest(BaseModel):
template_ids: list[int]
input_text: str
Benefits
- Performance — LLM inference runs once regardless of how many templates are
requested, making batch fills as fast as a single fill at the extraction stage
- Consistency — all agency forms are guaranteed to contain identical extracted
values since they share a single extraction result
- "File everywhere" goal — a responder can submit to every required agency in
one API call, eliminating repeated data entry entirely
Files Affected
api/routes/forms.py — new POST /forms/fill-batch endpoint
api/schemas/forms.py — new BatchFormFillRequest schema
tests/test_forms.py — new tests verifying single extraction call and
one result per template ID
Description
Currently, FireForm only supports filling one agency's form per API call via
POST /forms/fill. A responder dealing with a multi-agency incident must makeseparate API calls for each form passing the same incident description repeatedly
and triggering a full LLM extraction for every single call. This directly contradicts
the "report once, file everywhere" goal that FireForm is built around.
Proposed Solution
Introduce a new batch endpoint
POST /forms/fill-batchthat accepts a list oftemplate IDs and a single incident description, runs LLM extraction exactly once,
and returns all filled PDFs in a single response.
Suggested Implementation
New endpoint:
POST /forms/fill-batchNew request schema
Benefits
requested, making batch fills as fast as a single fill at the extraction stage
values since they share a single extraction result
one API call, eliminating repeated data entry entirely
Files Affected
api/routes/forms.py— newPOST /forms/fill-batchendpointapi/schemas/forms.py— newBatchFormFillRequestschematests/test_forms.py— new tests verifying single extraction call andone result per template ID