Skip to content

Fix AzureDIExtract.load_analyze_result #140

Merged
jnu merged 1 commit into
mainfrom
fix/analyze-result-from-dict
May 12, 2026
Merged

Fix AzureDIExtract.load_analyze_result #140
jnu merged 1 commit into
mainfrom
fix/analyze-result-from-dict

Conversation

@jnu
Copy link
Copy Markdown
Contributor

@jnu jnu commented May 12, 2026

The 1.0 release of azure-ai-documentintelligence dropped AnalyzeResult.from_dict; AnalyzeResult now inherits from the new _model_base.Model and is constructed directly from the REST payload dict (matching as_dict() round-trips). The sibling driver in bc2/core/ontology/openai.py already uses AnalyzeResult(content); this extraction driver was missed, so any pipeline that re-reads a cached application/x-analyze-result file blew up with:

AttributeError: type object 'AnalyzeResult' has no attribute 'from_dict'

…nce>=1.0

The 1.0 release of azure-ai-documentintelligence dropped
`AnalyzeResult.from_dict`; `AnalyzeResult` now inherits from the new
`_model_base.Model` and is constructed directly from the REST payload dict
(matching `as_dict()` round-trips). The sibling driver in
`bc2/core/ontology/openai.py` already uses `AnalyzeResult(content)`; this
extraction driver was missed, so any pipeline that re-reads a cached
`application/x-analyze-result` file blew up with:

    AttributeError: type object 'AnalyzeResult' has no attribute 'from_dict'

Co-authored-by: Cursor <cursoragent@cursor.com>
@jnu jnu merged commit 0b39bf8 into main May 12, 2026
5 checks passed
@jnu jnu deleted the fix/analyze-result-from-dict branch May 12, 2026 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant