@@ -41,7 +41,8 @@ def _set_default_token(self) -> None:
4141 self .token = self .access_token .token
4242
4343 def refresh_token (self ) -> str :
44- """Refresh the access token if it is expired.
44+ """
45+ Refresh the access token if it is expired.
4546
4647 Returns:
4748 A token
@@ -79,7 +80,8 @@ def get_access_token_from_azure_cli(*, scope: str, tenant_id: str = ""):
7980
8081
8182def get_access_token_from_azure_msi (* , client_id : str , scope : str ):
82- """Connect to an AOAI endpoint via managed identity credential attached to an Azure resource.
83+ """
84+ Connect to an AOAI endpoint via managed identity credential attached to an Azure resource.
8385 For proper setup and configuration of MSI
8486 https://learn.microsoft.com/en-us/entra/identity/managed-identities-azure-resources/overview.
8587
@@ -100,7 +102,8 @@ def get_access_token_from_azure_msi(*, client_id: str, scope: str):
100102
101103
102104def get_access_token_from_msa_public_client (* , client_id : str , scope : str ):
103- """Uses MSA account to connect to an AOAI endpoint via interactive login. A browser window
105+ """
106+ Uses MSA account to connect to an AOAI endpoint via interactive login. A browser window
104107 will open and ask for login credentials.
105108
106109 Args:
@@ -120,7 +123,8 @@ def get_access_token_from_msa_public_client(*, client_id: str, scope: str):
120123
121124
122125def get_access_token_from_interactive_login (scope : str ) -> str :
123- """Connects to an OpenAI endpoint with an interactive login from Azure. A browser window will
126+ """
127+ Connects to an OpenAI endpoint with an interactive login from Azure. A browser window will
124128 open and ask for login credentials. The token will be scoped for Azure Cognitive services.
125129
126130 Returns:
@@ -135,7 +139,8 @@ def get_access_token_from_interactive_login(scope: str) -> str:
135139
136140
137141def get_token_provider_from_default_azure_credential (scope : str ) -> Callable [[], str ]:
138- """Connect to an AOAI endpoint via default Azure credential.
142+ """
143+ Connect to an AOAI endpoint via default Azure credential.
139144
140145 Returns:
141146 Authentication token provider
@@ -149,7 +154,8 @@ def get_token_provider_from_default_azure_credential(scope: str) -> Callable[[],
149154
150155
151156def get_default_scope (endpoint : str ) -> str :
152- """Get the default scope for the given endpoint.
157+ """
158+ Get the default scope for the given endpoint.
153159
154160 Args:
155161 endpoint (str): The endpoint to get the scope for.
@@ -170,12 +176,13 @@ def get_default_scope(endpoint: str) -> str:
170176def get_speech_config (resource_id : Union [str , None ], key : Union [str , None ], region : str ):
171177 """
172178 Get the speech config using key/region pair (for key auth scenarios) or resource_id/region pair
173- (for Entra auth scenarios)
179+ (for Entra auth scenarios).
174180
175181 Args:
176182 resource_id (Union[str, None]): The resource ID to get the token for.
177183 key (Union[str, None]): The Azure Speech key
178184 region (str): The region to get the token for.
185+
179186 Returns:
180187 The speech config based on passed in args
181188
@@ -207,7 +214,8 @@ def get_speech_config(resource_id: Union[str, None], key: Union[str, None], regi
207214
208215
209216def get_speech_config_from_default_azure_credential (resource_id : str , region : str ):
210- """Get the speech config for the given resource ID and region.
217+ """
218+ Get the speech config for the given resource ID and region.
211219
212220 Args:
213221 resource_id (str): The resource ID to get the token for.
0 commit comments