@@ -28,15 +28,14 @@ class ChatCompletionsClientConfiguration: # pylint: disable=too-many-instance-a
2828 :param credential: Credential used to authenticate requests to the service. Is either a key
2929 credential type or a token credential type. Required.
3030 :type credential: ~azure.core.credentials.AzureKeyCredential or
31- ~azure.core.credentials.AzureKeyCredential or ~azure.core.credentials.TokenCredential
32- :keyword api_version: The API version to use for this operation. Default value is
33- "2024-05-01-preview". Note that overriding this default value may result in unsupported
34- behavior.
31+ ~azure.core.credentials.TokenCredential
32+ :keyword api_version: The API version to use for this operation. Default value is "2025-04-01".
33+ Note that overriding this default value may result in unsupported behavior.
3534 :paramtype api_version: str
3635 """
3736
3837 def __init__ (self , endpoint : str , credential : Union [AzureKeyCredential , "TokenCredential" ], ** kwargs : Any ) -> None :
39- api_version : str = kwargs .pop ("api_version" , "2024-05 -01-preview " )
38+ api_version : str = kwargs .pop ("api_version" , "2025-04 -01" )
4039
4140 if endpoint is None :
4241 raise ValueError ("Parameter 'endpoint' must not be None." )
@@ -46,16 +45,14 @@ def __init__(self, endpoint: str, credential: Union[AzureKeyCredential, "TokenCr
4645 self .endpoint = endpoint
4746 self .credential = credential
4847 self .api_version = api_version
49- self .credential_scopes = kwargs .pop ("credential_scopes" , ["https://ml .azure.com/.default" ])
48+ self .credential_scopes = kwargs .pop ("credential_scopes" , ["https://cognitiveservices .azure.com/.default" ])
5049 kwargs .setdefault ("sdk_moniker" , "ai-inference/{}" .format (VERSION ))
5150 self .polling_interval = kwargs .get ("polling_interval" , 30 )
5251 self ._configure (** kwargs )
5352
5453 def _infer_policy (self , ** kwargs ):
5554 if isinstance (self .credential , AzureKeyCredential ):
5655 return policies .AzureKeyCredentialPolicy (self .credential , "Authorization" , prefix = "Bearer" , ** kwargs )
57- if isinstance (self .credential , AzureKeyCredential ):
58- return policies .AzureKeyCredentialPolicy (self .credential , "api-key" , ** kwargs )
5956 if hasattr (self .credential , "get_token" ):
6057 return policies .BearerTokenCredentialPolicy (self .credential , * self .credential_scopes , ** kwargs )
6158 raise TypeError (f"Unsupported credential: { self .credential } " )
@@ -85,15 +82,14 @@ class EmbeddingsClientConfiguration: # pylint: disable=too-many-instance-attrib
8582 :param credential: Credential used to authenticate requests to the service. Is either a key
8683 credential type or a token credential type. Required.
8784 :type credential: ~azure.core.credentials.AzureKeyCredential or
88- ~azure.core.credentials.AzureKeyCredential or ~azure.core.credentials.TokenCredential
89- :keyword api_version: The API version to use for this operation. Default value is
90- "2024-05-01-preview". Note that overriding this default value may result in unsupported
91- behavior.
85+ ~azure.core.credentials.TokenCredential
86+ :keyword api_version: The API version to use for this operation. Default value is "2025-04-01".
87+ Note that overriding this default value may result in unsupported behavior.
9288 :paramtype api_version: str
9389 """
9490
9591 def __init__ (self , endpoint : str , credential : Union [AzureKeyCredential , "TokenCredential" ], ** kwargs : Any ) -> None :
96- api_version : str = kwargs .pop ("api_version" , "2024-05 -01-preview " )
92+ api_version : str = kwargs .pop ("api_version" , "2025-04 -01" )
9793
9894 if endpoint is None :
9995 raise ValueError ("Parameter 'endpoint' must not be None." )
@@ -103,16 +99,14 @@ def __init__(self, endpoint: str, credential: Union[AzureKeyCredential, "TokenCr
10399 self .endpoint = endpoint
104100 self .credential = credential
105101 self .api_version = api_version
106- self .credential_scopes = kwargs .pop ("credential_scopes" , ["https://ml .azure.com/.default" ])
102+ self .credential_scopes = kwargs .pop ("credential_scopes" , ["https://cognitiveservices .azure.com/.default" ])
107103 kwargs .setdefault ("sdk_moniker" , "ai-inference/{}" .format (VERSION ))
108104 self .polling_interval = kwargs .get ("polling_interval" , 30 )
109105 self ._configure (** kwargs )
110106
111107 def _infer_policy (self , ** kwargs ):
112108 if isinstance (self .credential , AzureKeyCredential ):
113109 return policies .AzureKeyCredentialPolicy (self .credential , "Authorization" , prefix = "Bearer" , ** kwargs )
114- if isinstance (self .credential , AzureKeyCredential ):
115- return policies .AzureKeyCredentialPolicy (self .credential , "api-key" , ** kwargs )
116110 if hasattr (self .credential , "get_token" ):
117111 return policies .BearerTokenCredentialPolicy (self .credential , * self .credential_scopes , ** kwargs )
118112 raise TypeError (f"Unsupported credential: { self .credential } " )
@@ -142,15 +136,14 @@ class ImageEmbeddingsClientConfiguration: # pylint: disable=too-many-instance-a
142136 :param credential: Credential used to authenticate requests to the service. Is either a key
143137 credential type or a token credential type. Required.
144138 :type credential: ~azure.core.credentials.AzureKeyCredential or
145- ~azure.core.credentials.AzureKeyCredential or ~azure.core.credentials.TokenCredential
146- :keyword api_version: The API version to use for this operation. Default value is
147- "2024-05-01-preview". Note that overriding this default value may result in unsupported
148- behavior.
139+ ~azure.core.credentials.TokenCredential
140+ :keyword api_version: The API version to use for this operation. Default value is "2025-04-01".
141+ Note that overriding this default value may result in unsupported behavior.
149142 :paramtype api_version: str
150143 """
151144
152145 def __init__ (self , endpoint : str , credential : Union [AzureKeyCredential , "TokenCredential" ], ** kwargs : Any ) -> None :
153- api_version : str = kwargs .pop ("api_version" , "2024-05 -01-preview " )
146+ api_version : str = kwargs .pop ("api_version" , "2025-04 -01" )
154147
155148 if endpoint is None :
156149 raise ValueError ("Parameter 'endpoint' must not be None." )
@@ -160,16 +153,14 @@ def __init__(self, endpoint: str, credential: Union[AzureKeyCredential, "TokenCr
160153 self .endpoint = endpoint
161154 self .credential = credential
162155 self .api_version = api_version
163- self .credential_scopes = kwargs .pop ("credential_scopes" , ["https://ml .azure.com/.default" ])
156+ self .credential_scopes = kwargs .pop ("credential_scopes" , ["https://cognitiveservices .azure.com/.default" ])
164157 kwargs .setdefault ("sdk_moniker" , "ai-inference/{}" .format (VERSION ))
165158 self .polling_interval = kwargs .get ("polling_interval" , 30 )
166159 self ._configure (** kwargs )
167160
168161 def _infer_policy (self , ** kwargs ):
169162 if isinstance (self .credential , AzureKeyCredential ):
170163 return policies .AzureKeyCredentialPolicy (self .credential , "Authorization" , prefix = "Bearer" , ** kwargs )
171- if isinstance (self .credential , AzureKeyCredential ):
172- return policies .AzureKeyCredentialPolicy (self .credential , "api-key" , ** kwargs )
173164 if hasattr (self .credential , "get_token" ):
174165 return policies .BearerTokenCredentialPolicy (self .credential , * self .credential_scopes , ** kwargs )
175166 raise TypeError (f"Unsupported credential: { self .credential } " )
0 commit comments