Bug 1: company_name is prepended to filename before the date
When using the Anthropic provider, the extracted company_name field is prepended to the filename before the date, producing output like:
Melchers 2024_Melchers_Corrosion-Steel_Paper.pdf
Department of Transport 2015_TMR_Crevice-Corrosion_Guide.pdf
This is a problem for users renaming engineering or academic documents where the counterparty concept does not apply. The company_name field is always extracted and inserted even when the prompt_extension explicitly instructs the model not to include names before the year.
The company_name field in DocumentMetadata and the corresponding extraction logic in build_system_prompt appear to be hardcoded for invoice workflows with no way to suppress them via config.
Suggested fix: Add a config option such as extract_company: false under the pdf: section that sets company_name to empty string and skips the company extraction prompt entirely.
Bug 2: temperature parameter causes 400 error on claude-sonnet-5
Setting temperature: 0.0 in config (or leaving it at the default) causes a 400 error when using claude-sonnet-5:
Error code: 400 - {'type': 'error', 'error': {'type': 'invalid_request_error',
'message': '`temperature` is deprecated for this model.'}}
Anthropic deprecated the temperature parameter for Claude Sonnet 5. The parameter is currently passed unconditionally in extract_metadata_from_text, extract_metadata_from_images, and extract_metadata_from_text_and_images.
Suggested fix: Conditionally exclude temperature from kwargs when the model is claude-sonnet-5, for example:
if not (provider == "anthropic" and "sonnet-5" in config["ai"].get("model", "")):
kwargs["temperature"] = config["ai"].get("temperature", 0.0)
Environment:
- Provider: Anthropic
- Models tested: claude-sonnet-4-6, claude-sonnet-5
- OS: Windows 11
- Use case: Engineering document library (research papers, standards, guides, manuals)
Bug 1: company_name is prepended to filename before the date
When using the Anthropic provider, the extracted
company_namefield is prepended to the filename before the date, producing output like:This is a problem for users renaming engineering or academic documents where the counterparty concept does not apply. The
company_namefield is always extracted and inserted even when theprompt_extensionexplicitly instructs the model not to include names before the year.The
company_namefield inDocumentMetadataand the corresponding extraction logic inbuild_system_promptappear to be hardcoded for invoice workflows with no way to suppress them via config.Suggested fix: Add a config option such as
extract_company: falseunder thepdf:section that setscompany_nameto empty string and skips the company extraction prompt entirely.Bug 2: temperature parameter causes 400 error on claude-sonnet-5
Setting
temperature: 0.0in config (or leaving it at the default) causes a 400 error when usingclaude-sonnet-5:Anthropic deprecated the
temperatureparameter for Claude Sonnet 5. The parameter is currently passed unconditionally inextract_metadata_from_text,extract_metadata_from_images, andextract_metadata_from_text_and_images.Suggested fix: Conditionally exclude
temperaturefrom kwargs when the model isclaude-sonnet-5, for example:Environment: