Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def __init__(
self,
*,
endpoint: str,
api_version: str = "2024-07-31-preview",
api_version: str | None = None,
credential: AzureKeyCredential | TokenCredential | None = None,
file_types: List[DocumentIntelligenceFileType] = [
DocumentIntelligenceFileType.DOCX,
Expand All @@ -152,7 +152,9 @@ def __init__(

Args:
endpoint (str): The endpoint for the Document Intelligence service.
api_version (str): The API version to use. Defaults to "2024-07-31-preview".
api_version (str | None): The API version to use. When None (the default),
the Document Intelligence SDK uses its own built-in default version.
Set this explicitly only if you need a specific API version.
credential (AzureKeyCredential | TokenCredential | None): The credential to use for authentication.
file_types (List[DocumentIntelligenceFileType]): The file types to accept. Defaults to all supported file types.
"""
Expand Down Expand Up @@ -180,11 +182,15 @@ def __init__(

self.endpoint = endpoint
self.api_version = api_version
self.doc_intel_client = DocumentIntelligenceClient(
endpoint=self.endpoint,
api_version=self.api_version,
credential=credential,
)

client_kwargs: dict[str, Any] = {
"endpoint": self.endpoint,
"credential": credential,
}
if self.api_version is not None:
client_kwargs["api_version"] = self.api_version

self.doc_intel_client = DocumentIntelligenceClient(**client_kwargs)

def accepts(
self,
Expand Down