A repository for JavaScript software development kit (SDK) of Farsava API.
FarsavaJsClient - JavaScript client for Farsava API
Farsava API: Speech Recognition and Text to Speech by applying powerful deep neural network models.
This SDK is generated by the OpenAPI Generator project:
- API version: 1.0.5
- Package version: 1.0.5
- Build package: org.openapitools.codegen.languages.JavascriptClientCodegen
For Node.js
To publish the library as a npm, please follow the procedure in "Publishing npm packages".
Then install it via:
npm install farsava-js-client --save
If the library is hosted at a git repository, e.g.https://github.com/GIT_USER_ID/GIT_REPO_ID then install it via:
npm install GIT_USER_ID/GIT_REPO_ID --save
The library also works in the browser environment via npm and browserify. After following
the above steps with Node.js and installing browserify with npm install -g browserify
,
perform the following (assuming main.js is your entry file):
browserify main.js > bundle.js
Then include bundle.js in the HTML pages.
Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:
module: {
rules: [
{
parser: {
amd: false
}
}
]
}
Please follow the installation instruction and execute the following JS code:
var FarsavaJsClient = require('farsava-js-client');
var defaultClient = FarsavaJsClient.ApiClient.instance;
// Configure Bearer (JWT) access token for authorization: bearerAuth
var bearerAuth = defaultClient.authentications['bearerAuth'];
bearerAuth.accessToken = "YOUR ACCESS TOKEN"
var api = new FarsavaJsClient.LanguageModelApi()
var languageModelId = "languageModelId_example"; // {String} Id of the language model.
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.getLanguageModelById(languageModelId, callback);
All URIs are relative to https://api.farsava.ir/v1
You can also visit our documentation.
Class | Method | HTTP request | Description |
---|---|---|---|
FarsavaJsClient.LanguageModelApi | getLanguageModelById | GET /speech/languagemodels/{languageModelId} | GET /speech/languagemodels/{languageModelId} |
FarsavaJsClient.LanguageModelApi | getLanguageModelList | GET /speech/languagemodels | GET /speech/languagemodels |
FarsavaJsClient.LanguageModelApi | trainLanguageModel | POST /speech/languagemodels | POST /speech/languagemodels |
FarsavaJsClient.SpeechApi | deleteTranscription | DELETE /speech/transcriptions/{transcriptionId} | DELETE /speech/transcriptions/{transcriptionId} |
FarsavaJsClient.SpeechApi | getTranscription | GET /speech/transcriptions/{transcriptionId} | GET /speech/transcriptions/{transcriptionId} |
FarsavaJsClient.SpeechApi | recognize | POST /speech/asr | POST /speech/asr |
FarsavaJsClient.SpeechApi | recognizeLive | GET /speech/asrlive | GET /speech/asrlive |
FarsavaJsClient.SpeechApi | recognizeLongRunning | POST /speech/asrlongrunning | POST /speech/asrlongrunning |
FarsavaJsClient.SpeechApi | speechHealthCheck | GET /speech/healthcheck | GET /speech/healthcheck |
FarsavaJsClient.VoiceApi | getVoicesList | GET /voice/speakers | GET /voice/speakers |
FarsavaJsClient.VoiceApi | synthesize | POST /voice/tts | POST /voice/tts |
FarsavaJsClient.VoiceApi | voiceHealthCheck | GET /voice/healthcheck | GET /voice/healthcheck |
- FarsavaJsClient.ASRRequestBodyData
- FarsavaJsClient.ASRRequestBodyURI
- FarsavaJsClient.ASRResponseBody
- FarsavaJsClient.ASRStatus
- FarsavaJsClient.AudioEncoding
- FarsavaJsClient.Error
- FarsavaJsClient.HealthCheckResponseBody
- FarsavaJsClient.LMStatus
- FarsavaJsClient.LanguageCode
- FarsavaJsClient.LanguageModelResult
- FarsavaJsClient.LanguageModelTrainRequestBody
- FarsavaJsClient.RecognitionAudioData
- FarsavaJsClient.RecognitionAudioURI
- FarsavaJsClient.RecognitionConfig
- FarsavaJsClient.SpeechRecognitionModel
- FarsavaJsClient.SpeechRecognitionResult
- FarsavaJsClient.SynthesisInput
- FarsavaJsClient.TTSAudioConfig
- FarsavaJsClient.TTSRequestBody
- FarsavaJsClient.TTSResponseBody
- FarsavaJsClient.TTSVoiceGender
- FarsavaJsClient.VoiceSelectionParams
- FarsavaJsClient.WordInfo
- Type: Bearer authentication (JWT)