@@ -134,7 +134,7 @@ def __init__(
134134 self ,
135135 * ,
136136 endpoint : str ,
137- api_version : str = "2024-07-31-preview" ,
137+ api_version : str | None = None ,
138138 credential : AzureKeyCredential | TokenCredential | None = None ,
139139 file_types : List [DocumentIntelligenceFileType ] = [
140140 DocumentIntelligenceFileType .DOCX ,
@@ -152,7 +152,7 @@ def __init__(
152152
153153 Args:
154154 endpoint (str): The endpoint for the Document Intelligence service.
155- api_version (str): The API version to use. Defaults to "2024-07-31-preview" .
155+ api_version (str | None ): The API version to use. Defaults to None .
156156 credential (AzureKeyCredential | TokenCredential | None): The credential to use for authentication.
157157 file_types (List[DocumentIntelligenceFileType]): The file types to accept. Defaults to all supported file types.
158158 """
@@ -180,11 +180,15 @@ def __init__(
180180
181181 self .endpoint = endpoint
182182 self .api_version = api_version
183- self .doc_intel_client = DocumentIntelligenceClient (
184- endpoint = self .endpoint ,
185- api_version = self .api_version ,
186- credential = credential ,
187- )
183+
184+ client_kwargs : dict [str , Any ] = {
185+ "endpoint" : self .endpoint ,
186+ "credential" : credential ,
187+ }
188+ if self .api_version is not None :
189+ client_kwargs ["api_version" ] = self .api_version
190+
191+ self .doc_intel_client = DocumentIntelligenceClient (** client_kwargs )
188192
189193 def accepts (
190194 self ,
0 commit comments