CognitiveServiceRestClient Class
REST client to access Cognitive Service Language REST endpoints. Authentication tokens are not required.
Experimental: This class is experimental and may change in future versions.
Constructor
CognitiveServiceRestClient(token_provider: TokenProvider | None = None, retry_config: Dict | None = None, credential: TokenCredential | None = None)
Parameters
| Name | Description |
|---|---|
|
token_provider
|
<xref:sempy.fabric.TokenProvider>
DEPRECATED The 'token_provider' parameter is deprecated and will be removed in a future version. Please use 'credential' parameter with azure.core.credentials.TokenCredential implementations instead. Default value: None
|
|
retry_config
|
Configuration for the retry strategy. The following keys are filled with default values if not provided:
Default value: None
|
|
credential
|
<xref:sempy.fabric.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, defaults to fabric.analytics.environment.credentials.FabricAnalyticsTokenCredentials. Default value: None
|
Methods
| request |
Request to the Cognitive Service REST API. |
request
Request to the Cognitive Service REST API.
request(method: str, path_or_url: str, auth_required: bool = True, *args, **kwargs)
Parameters
| Name | Description |
|---|---|
|
method
Required
|
HTTP method. |
|
path_or_url
Required
|
The path or the url to the resource. |
|
auth_required
|
If True, authentication is required. Default value: True
|
|
*args
Required
|
Arguments passed to the request method. |
|
**kwargs
Required
|
Arguments passed to the request method. |
Returns
| Type | Description |
|---|---|
|
The response from the REST API. |