@@ -28,7 +28,7 @@ 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
31+ ~azure.core.credentials.TokenCredential
3232 :keyword api_version: The API version to use for this operation. Default value is
3333 "2024-05-01-preview". Note that overriding this default value may result in unsupported
3434 behavior.
@@ -54,8 +54,6 @@ def __init__(self, endpoint: str, credential: Union[AzureKeyCredential, "TokenCr
5454 def _infer_policy (self , ** kwargs ):
5555 if isinstance (self .credential , AzureKeyCredential ):
5656 return policies .AzureKeyCredentialPolicy (self .credential , "Authorization" , prefix = "Bearer" , ** kwargs )
57- if isinstance (self .credential , AzureKeyCredential ):
58- return policies .AzureKeyCredentialPolicy (self .credential , "api-key" , ** kwargs )
5957 if hasattr (self .credential , "get_token" ):
6058 return policies .BearerTokenCredentialPolicy (self .credential , * self .credential_scopes , ** kwargs )
6159 raise TypeError (f"Unsupported credential: { self .credential } " )
@@ -85,7 +83,7 @@ class EmbeddingsClientConfiguration: # pylint: disable=too-many-instance-attrib
8583 :param credential: Credential used to authenticate requests to the service. Is either a key
8684 credential type or a token credential type. Required.
8785 :type credential: ~azure.core.credentials.AzureKeyCredential or
88- ~azure.core.credentials.AzureKeyCredential or ~azure.core.credentials. TokenCredential
86+ ~azure.core.credentials.TokenCredential
8987 :keyword api_version: The API version to use for this operation. Default value is
9088 "2024-05-01-preview". Note that overriding this default value may result in unsupported
9189 behavior.
@@ -111,8 +109,6 @@ def __init__(self, endpoint: str, credential: Union[AzureKeyCredential, "TokenCr
111109 def _infer_policy (self , ** kwargs ):
112110 if isinstance (self .credential , AzureKeyCredential ):
113111 return policies .AzureKeyCredentialPolicy (self .credential , "Authorization" , prefix = "Bearer" , ** kwargs )
114- if isinstance (self .credential , AzureKeyCredential ):
115- return policies .AzureKeyCredentialPolicy (self .credential , "api-key" , ** kwargs )
116112 if hasattr (self .credential , "get_token" ):
117113 return policies .BearerTokenCredentialPolicy (self .credential , * self .credential_scopes , ** kwargs )
118114 raise TypeError (f"Unsupported credential: { self .credential } " )
@@ -142,7 +138,7 @@ class ImageEmbeddingsClientConfiguration: # pylint: disable=too-many-instance-a
142138 :param credential: Credential used to authenticate requests to the service. Is either a key
143139 credential type or a token credential type. Required.
144140 :type credential: ~azure.core.credentials.AzureKeyCredential or
145- ~azure.core.credentials.AzureKeyCredential or ~azure.core.credentials. TokenCredential
141+ ~azure.core.credentials.TokenCredential
146142 :keyword api_version: The API version to use for this operation. Default value is
147143 "2024-05-01-preview". Note that overriding this default value may result in unsupported
148144 behavior.
@@ -168,8 +164,6 @@ def __init__(self, endpoint: str, credential: Union[AzureKeyCredential, "TokenCr
168164 def _infer_policy (self , ** kwargs ):
169165 if isinstance (self .credential , AzureKeyCredential ):
170166 return policies .AzureKeyCredentialPolicy (self .credential , "Authorization" , prefix = "Bearer" , ** kwargs )
171- if isinstance (self .credential , AzureKeyCredential ):
172- return policies .AzureKeyCredentialPolicy (self .credential , "api-key" , ** kwargs )
173167 if hasattr (self .credential , "get_token" ):
174168 return policies .BearerTokenCredentialPolicy (self .credential , * self .credential_scopes , ** kwargs )
175169 raise TypeError (f"Unsupported credential: { self .credential } " )
0 commit comments