Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update parameter name in AzureAIDocumentIntelligenceLoader #593

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hide212131
Copy link

Description

This is a fix for the error that occurs when using Azure Document Intelligence.

Using reader AzureAIDocumentIntelligenceLoader(cache_dir=/Users/hide/Git..., client_=<azure.ai.docum..., credential=, endpoint=, figure_friendly_filetypes=['.pdf', '.jpeg..., model=prebuilt-layout, output_content_format=markdown, vlm_endpoint=/openai/deploym...)
DocumentIntelligenceClientOperationsMixin.begin_analyze_document() missing 1 required positional argument: 'body'
Traceback (most recent call last):
  File "/Users/hide/Github/kotaemon/libs/ktem/ktem/index/file/pipelines.py", line 808, in stream
    file_id, docs = yield from pipeline.stream(
  File "/Users/hide/Github/kotaemon/libs/ktem/ktem/index/file/pipelines.py", line 646, in stream
    docs = self.loader.load_data(file_path, extra_info=extra_info)
  File "/Users/hide/Github/kotaemon/libs/kotaemon/kotaemon/loaders/azureai_document_intelligence_loader.py", line 134, in load_data
    poller = self.client_.begin_analyze_document(
  File "/Users/hide/Github/kotaemon/venv/lib/python3.10/site-packages/azure/core/tracing/decorator.py", line 105, in wrapper_use_tracer
    return func(*args, **kwargs)
TypeError: DocumentIntelligenceClientOperationsMixin.begin_analyze_document() missing 1 required positional argument: 'body'

The API of azure-ai-documentintelligence has changed in version 1.0.0.

Type of change

  • New features (non-breaking change).
  • Bug fix (non-breaking change).
  • Breaking change (fix or feature that would cause existing functionality not to work as expected).

Checklist

  • I have performed a self-review of my code.
  • I have added thorough tests if it is a core feature.
  • There is a reference to the original bug report and related work.
  • I have commented on my code, particularly in hard-to-understand areas.
  • The feature is well documented.

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