Repository navigation
fix(form-filler): treat a null table in the LLM answer as empty - #764
vikash7485 wants to merge 1 commit into
Conversation
Providers without structured output (e.g. Anthropic) can return null for a table array. expand_output used dict.get with a [] default, which only applies when the key is missing, so enumerate(None) raised TypeError and the whole fill failed. Fall back to an empty list for null as well.
|
Hi @vikash7485, Nice to have new people here. Maybe it'd be interesting to you to hop in our Discord channel to could update of what's going on in the project and hop on weekly meetings. This PR description reads as AI-generated and includes inaccurate claims. Notably, the statement that "Providers without structured output (e.g. Anthropic) can return null this way" is completely false—Anthropic supports structured outputs, and that isn't why null would be returned here. M |
|
Thanks @marcvergees , you're right. Anthropic does support structured outputs. I misread FireForm's own config (structured_output=False in specs.py) as a limitation of the provider, and I hadn't actually seen a model return null for a table. Sorry about that. Thanks for the invite too. I'll join the Discord and the weekly meeting, and I'll check there before opening any more PRs. |
Description
expand_output()usedllm_output.get(name, []). The default only applies when the key is missing, so a table returned asnullcrashed the fill withTypeError: 'NoneType' object is not iterable. Providers without structured output (e.g. Anthropic) can returnnullthis way. The fix usesllm_output.get(name) or [].Type of change
How Has This Been Tested?
test_expand_output_treats_null_table_as_empty(fails before the fix, passes after)pytest tests/→ 458 passed,ruff check app/→ cleanTest Configuration:
Checklist: