Class BhashiniManager
The script for managing all interactions with the Bhashini ULCA API.
public class BhashiniManager : Singleton<BhashiniManager>
- Inheritance
-
objectBhashiniManager
Fields
AuthUlcaApiKeyHeader
Header for the API key in pipeline config requests.
private const string AuthUlcaApiKeyHeader = "ulcaApiKey"
Field Value
- string
AuthUserIdHeader
Header for the User ID in pipeline config requests.
private const string AuthUserIdHeader = "userId"
Field Value
- string
PipelineConfigurationEndpoint
The pipeline configuration API endpoint.
public string PipelineConfigurationEndpoint
Field Value
- string
PipelineProvider
The ID of the pipeline provider to use.
public string PipelineProvider
Field Value
- string
_ulcaApiKey
The ULCA API key.
private string _ulcaApiKey
Field Value
- string
_ulcaUserId
The ULCA account's user ID.
private string _ulcaUserId
Field Value
- string
Methods
ComputeOnPipeline(BhashiniPipelineInferenceEndpoint, BhashiniInputData, params BhashiniComputeTask[])
Runs the given computation tasks on a pipeline.
public Task<BhashiniComputeResponse> ComputeOnPipeline(BhashiniPipelineInferenceEndpoint inferenceEndpoint, BhashiniInputData input, params BhashiniComputeTask[] tasks)
Parameters
inferenceEndpoint
BhashiniPipelineInferenceEndpointThe pipeline's inference endpoint.
input
BhashiniInputDataInput data for the computation.
tasks
BhashiniComputeTask[]The tasks to run on the pipeline.
Returns
- Task<BhashiniComputeResponse>
The computed results.
Exceptions
- BhashiniRequestException
Thrown when the request fails or can't be processed.
- BhashiniAudioIOException
Thrown when an unsupported audio encoding is encountered.
ConfigurePipeline(params BhashiniPipelineRequestTask[])
Configures a pipeline for the given tasks.
public Task<BhashiniPipelineResponse> ConfigurePipeline(params BhashiniPipelineRequestTask[] tasks)
Parameters
tasks
BhashiniPipelineRequestTask[]The pipeline tasks.
Returns
- Task<BhashiniPipelineResponse>
The available pipeline configurations.
Exceptions
- BhashiniRequestException
Thrown when the request fails or can't be processed.
SetDetails(string, string)
Sets the user ID and API key.
public void SetDetails(string ulcaUserId, string ulcaApiKey)
Parameters
ulcaUserId
stringThe new user ID.
ulcaApiKey
stringThe new API key.