1414from ._version import VERSION
1515
1616if TYPE_CHECKING :
17- # pylint: disable=unused-import,ungrouped-imports
1817 from azure .core .credentials import TokenCredential
1918
2019
21- class ChatCompletionsClientConfiguration : # pylint: disable=too-many-instance-attributes,name-too-long
20+ class ChatCompletionsClientConfiguration : # pylint: disable=too-many-instance-attributes
2221 """Configuration for ChatCompletionsClient.
2322
2423 Note that all parameters used to create this instance are saved as instance
2524 attributes.
2625
2726 :param endpoint: Service host. Required.
2827 :type endpoint: str
29- :param credential: Credential used to authenticate requests to the service. Is one of the
30- following types: AzureKeyCredential, AzureKeyCredential, TokenCredential Required.
28+ :param credential: Credential used to authenticate requests to the service. Is either a
29+ AzureKeyCredential type or a TokenCredential type. Required.
3130 :type credential: ~azure.core.credentials.AzureKeyCredential or
32- ~azure.core.credentials.AzureKeyCredential or ~azure.core.credentials. TokenCredential
31+ ~azure.core.credentials.TokenCredential
3332 :keyword api_version: The API version to use for this operation. Default value is
3433 "2024-05-01-preview". Note that overriding this default value may result in unsupported
3534 behavior.
@@ -55,8 +54,6 @@ def __init__(self, endpoint: str, credential: Union[AzureKeyCredential, "TokenCr
5554 def _infer_policy (self , ** kwargs ):
5655 if isinstance (self .credential , AzureKeyCredential ):
5756 return policies .AzureKeyCredentialPolicy (self .credential , "Authorization" , prefix = "Bearer" , ** kwargs )
58- if isinstance (self .credential , AzureKeyCredential ):
59- return policies .AzureKeyCredentialPolicy (self .credential , "api-key" , ** kwargs )
6057 if hasattr (self .credential , "get_token" ):
6158 return policies .BearerTokenCredentialPolicy (self .credential , * self .credential_scopes , ** kwargs )
6259 raise TypeError (f"Unsupported credential: { self .credential } " )
@@ -75,18 +72,18 @@ def _configure(self, **kwargs: Any) -> None:
7572 self .authentication_policy = self ._infer_policy (** kwargs )
7673
7774
78- class EmbeddingsClientConfiguration : # pylint: disable=too-many-instance-attributes,name-too-long
75+ class EmbeddingsClientConfiguration : # pylint: disable=too-many-instance-attributes
7976 """Configuration for EmbeddingsClient.
8077
8178 Note that all parameters used to create this instance are saved as instance
8279 attributes.
8380
8481 :param endpoint: Service host. Required.
8582 :type endpoint: str
86- :param credential: Credential used to authenticate requests to the service. Is one of the
87- following types: AzureKeyCredential, AzureKeyCredential, TokenCredential Required.
83+ :param credential: Credential used to authenticate requests to the service. Is either a
84+ AzureKeyCredential type or a TokenCredential type. Required.
8885 :type credential: ~azure.core.credentials.AzureKeyCredential or
89- ~azure.core.credentials.AzureKeyCredential or ~azure.core.credentials. TokenCredential
86+ ~azure.core.credentials.TokenCredential
9087 :keyword api_version: The API version to use for this operation. Default value is
9188 "2024-05-01-preview". Note that overriding this default value may result in unsupported
9289 behavior.
@@ -112,8 +109,6 @@ def __init__(self, endpoint: str, credential: Union[AzureKeyCredential, "TokenCr
112109 def _infer_policy (self , ** kwargs ):
113110 if isinstance (self .credential , AzureKeyCredential ):
114111 return policies .AzureKeyCredentialPolicy (self .credential , "Authorization" , prefix = "Bearer" , ** kwargs )
115- if isinstance (self .credential , AzureKeyCredential ):
116- return policies .AzureKeyCredentialPolicy (self .credential , "api-key" , ** kwargs )
117112 if hasattr (self .credential , "get_token" ):
118113 return policies .BearerTokenCredentialPolicy (self .credential , * self .credential_scopes , ** kwargs )
119114 raise TypeError (f"Unsupported credential: { self .credential } " )
@@ -132,18 +127,18 @@ def _configure(self, **kwargs: Any) -> None:
132127 self .authentication_policy = self ._infer_policy (** kwargs )
133128
134129
135- class ImageEmbeddingsClientConfiguration : # pylint: disable=too-many-instance-attributes,name-too-long
130+ class ImageEmbeddingsClientConfiguration : # pylint: disable=too-many-instance-attributes
136131 """Configuration for ImageEmbeddingsClient.
137132
138133 Note that all parameters used to create this instance are saved as instance
139134 attributes.
140135
141136 :param endpoint: Service host. Required.
142137 :type endpoint: str
143- :param credential: Credential used to authenticate requests to the service. Is one of the
144- following types: AzureKeyCredential, AzureKeyCredential, TokenCredential Required.
138+ :param credential: Credential used to authenticate requests to the service. Is either a
139+ AzureKeyCredential type or a TokenCredential type. Required.
145140 :type credential: ~azure.core.credentials.AzureKeyCredential or
146- ~azure.core.credentials.AzureKeyCredential or ~azure.core.credentials. TokenCredential
141+ ~azure.core.credentials.TokenCredential
147142 :keyword api_version: The API version to use for this operation. Default value is
148143 "2024-05-01-preview". Note that overriding this default value may result in unsupported
149144 behavior.
@@ -169,8 +164,6 @@ def __init__(self, endpoint: str, credential: Union[AzureKeyCredential, "TokenCr
169164 def _infer_policy (self , ** kwargs ):
170165 if isinstance (self .credential , AzureKeyCredential ):
171166 return policies .AzureKeyCredentialPolicy (self .credential , "Authorization" , prefix = "Bearer" , ** kwargs )
172- if isinstance (self .credential , AzureKeyCredential ):
173- return policies .AzureKeyCredentialPolicy (self .credential , "api-key" , ** kwargs )
174167 if hasattr (self .credential , "get_token" ):
175168 return policies .BearerTokenCredentialPolicy (self .credential , * self .credential_scopes , ** kwargs )
176169 raise TypeError (f"Unsupported credential: { self .credential } " )
0 commit comments