@speechall/sdk 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/api.js ADDED
@@ -0,0 +1,592 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.TranscribeTimestampGranularityEnum = exports.SpeechToTextApi = exports.SpeechToTextApiFactory = exports.SpeechToTextApiFp = exports.SpeechToTextApiAxiosParamCreator = exports.ReplacementRulesApi = exports.ReplacementRulesApiFactory = exports.ReplacementRulesApiFp = exports.ReplacementRulesApiAxiosParamCreator = exports.OpenaiCompatibleCreateTranscriptionTimestampGranularitiesEnum = exports.OpenAICompatibleSpeechToTextApi = exports.OpenAICompatibleSpeechToTextApiFactory = exports.OpenAICompatibleSpeechToTextApiFp = exports.OpenAICompatibleSpeechToTextApiAxiosParamCreator = exports.TranscriptionProvider = exports.TranscriptionOptionsTimestampGranularityEnum = exports.TranscriptionModelIdentifier = exports.TranscriptOutputFormat = exports.TranscriptLanguageCode = exports.SpeechToTextModelAccuracyTierEnum = exports.SpeechToTextModelModelTypeEnum = exports.RegexRuleFlagsEnum = exports.RegexRuleKindEnum = exports.RegexGroupRuleFlagsEnum = exports.RegexGroupRuleKindEnum = exports.OpenAIAudioResponseFormat = exports.ExactRuleKindEnum = void 0;
7
+ const axios_1 = __importDefault(require("axios"));
8
+ const common_1 = require("./common");
9
+ const base_1 = require("./base");
10
+ exports.ExactRuleKindEnum = {
11
+ Exact: 'exact'
12
+ };
13
+ exports.OpenAIAudioResponseFormat = {
14
+ Json: 'json',
15
+ Text: 'text',
16
+ Srt: 'srt',
17
+ VerboseJson: 'verbose_json',
18
+ Vtt: 'vtt'
19
+ };
20
+ exports.RegexGroupRuleKindEnum = {
21
+ RegexGroup: 'regex_group'
22
+ };
23
+ exports.RegexGroupRuleFlagsEnum = {
24
+ I: 'i',
25
+ M: 'm',
26
+ S: 's',
27
+ X: 'x',
28
+ U: 'u'
29
+ };
30
+ exports.RegexRuleKindEnum = {
31
+ Regex: 'regex'
32
+ };
33
+ exports.RegexRuleFlagsEnum = {
34
+ I: 'i',
35
+ M: 'm',
36
+ S: 's',
37
+ X: 'x',
38
+ U: 'u'
39
+ };
40
+ exports.SpeechToTextModelModelTypeEnum = {
41
+ General: 'general',
42
+ PhoneCall: 'phone_call',
43
+ Video: 'video',
44
+ CommandAndSearch: 'command_and_search',
45
+ Medical: 'medical',
46
+ Legal: 'legal',
47
+ Voicemail: 'voicemail',
48
+ Meeting: 'meeting'
49
+ };
50
+ exports.SpeechToTextModelAccuracyTierEnum = {
51
+ Basic: 'basic',
52
+ Standard: 'standard',
53
+ Enhanced: 'enhanced',
54
+ Premium: 'premium'
55
+ };
56
+ exports.TranscriptLanguageCode = {
57
+ Auto: 'auto',
58
+ En: 'en',
59
+ EnAu: 'en_au',
60
+ EnUk: 'en_uk',
61
+ EnUs: 'en_us',
62
+ Af: 'af',
63
+ Am: 'am',
64
+ Ar: 'ar',
65
+ As: 'as',
66
+ Az: 'az',
67
+ Ba: 'ba',
68
+ Be: 'be',
69
+ Bg: 'bg',
70
+ Bn: 'bn',
71
+ Bo: 'bo',
72
+ Br: 'br',
73
+ Bs: 'bs',
74
+ Ca: 'ca',
75
+ Cs: 'cs',
76
+ Cy: 'cy',
77
+ Da: 'da',
78
+ De: 'de',
79
+ El: 'el',
80
+ Es: 'es',
81
+ Et: 'et',
82
+ Eu: 'eu',
83
+ Fa: 'fa',
84
+ Fi: 'fi',
85
+ Fo: 'fo',
86
+ Fr: 'fr',
87
+ Gl: 'gl',
88
+ Gu: 'gu',
89
+ Ha: 'ha',
90
+ Haw: 'haw',
91
+ He: 'he',
92
+ Hi: 'hi',
93
+ Hr: 'hr',
94
+ Ht: 'ht',
95
+ Hu: 'hu',
96
+ Hy: 'hy',
97
+ Id: 'id',
98
+ Is: 'is',
99
+ It: 'it',
100
+ Ja: 'ja',
101
+ Jw: 'jw',
102
+ Ka: 'ka',
103
+ Kk: 'kk',
104
+ Km: 'km',
105
+ Kn: 'kn',
106
+ Ko: 'ko',
107
+ La: 'la',
108
+ Lb: 'lb',
109
+ Ln: 'ln',
110
+ Lo: 'lo',
111
+ Lt: 'lt',
112
+ Lv: 'lv',
113
+ Mg: 'mg',
114
+ Mi: 'mi',
115
+ Mk: 'mk',
116
+ Ml: 'ml',
117
+ Mn: 'mn',
118
+ Mr: 'mr',
119
+ Ms: 'ms',
120
+ Mt: 'mt',
121
+ My: 'my',
122
+ Ne: 'ne',
123
+ Nl: 'nl',
124
+ Nn: 'nn',
125
+ False: 'false',
126
+ Oc: 'oc',
127
+ Pa: 'pa',
128
+ Pl: 'pl',
129
+ Ps: 'ps',
130
+ Pt: 'pt',
131
+ Ro: 'ro',
132
+ Ru: 'ru',
133
+ Sa: 'sa',
134
+ Sd: 'sd',
135
+ Si: 'si',
136
+ Sk: 'sk',
137
+ Sl: 'sl',
138
+ Sn: 'sn',
139
+ So: 'so',
140
+ Sq: 'sq',
141
+ Sr: 'sr',
142
+ Su: 'su',
143
+ Sv: 'sv',
144
+ Sw: 'sw',
145
+ Ta: 'ta',
146
+ Te: 'te',
147
+ Tg: 'tg',
148
+ Th: 'th',
149
+ Tk: 'tk',
150
+ Tl: 'tl',
151
+ Tr: 'tr',
152
+ Tt: 'tt',
153
+ Uk: 'uk',
154
+ Ur: 'ur',
155
+ Uz: 'uz',
156
+ Vi: 'vi',
157
+ Yi: 'yi',
158
+ Yo: 'yo',
159
+ Zh: 'zh'
160
+ };
161
+ exports.TranscriptOutputFormat = {
162
+ Text: 'text',
163
+ JsonText: 'json_text',
164
+ Json: 'json',
165
+ Srt: 'srt',
166
+ Vtt: 'vtt'
167
+ };
168
+ exports.TranscriptionModelIdentifier = {
169
+ AmazonTranscribe: 'amazon.transcribe',
170
+ AssemblyaiBest: 'assemblyai.best',
171
+ AssemblyaiNano: 'assemblyai.nano',
172
+ AzureStandard: 'azure.standard',
173
+ CloudflareWhisper: 'cloudflare.whisper',
174
+ DeepgramBase: 'deepgram.base',
175
+ DeepgramBaseConversationalai: 'deepgram.base-conversationalai',
176
+ DeepgramBaseFinance: 'deepgram.base-finance',
177
+ DeepgramBaseGeneral: 'deepgram.base-general',
178
+ DeepgramBaseMeeting: 'deepgram.base-meeting',
179
+ DeepgramBasePhonecall: 'deepgram.base-phonecall',
180
+ DeepgramBaseVideo: 'deepgram.base-video',
181
+ DeepgramBaseVoicemail: 'deepgram.base-voicemail',
182
+ DeepgramEnhanced: 'deepgram.enhanced',
183
+ DeepgramEnhancedFinance: 'deepgram.enhanced-finance',
184
+ DeepgramEnhancedGeneral: 'deepgram.enhanced-general',
185
+ DeepgramEnhancedMeeting: 'deepgram.enhanced-meeting',
186
+ DeepgramEnhancedPhonecall: 'deepgram.enhanced-phonecall',
187
+ DeepgramNova: 'deepgram.nova',
188
+ DeepgramNova2: 'deepgram.nova-2',
189
+ DeepgramNova2Atc: 'deepgram.nova-2-atc',
190
+ DeepgramNova2Automotive: 'deepgram.nova-2-automotive',
191
+ DeepgramNova2Conversationalai: 'deepgram.nova-2-conversationalai',
192
+ DeepgramNova2Drivethru: 'deepgram.nova-2-drivethru',
193
+ DeepgramNova2Finance: 'deepgram.nova-2-finance',
194
+ DeepgramNova2General: 'deepgram.nova-2-general',
195
+ DeepgramNova2Medical: 'deepgram.nova-2-medical',
196
+ DeepgramNova2Meeting: 'deepgram.nova-2-meeting',
197
+ DeepgramNova2Phonecall: 'deepgram.nova-2-phonecall',
198
+ DeepgramNova2Video: 'deepgram.nova-2-video',
199
+ DeepgramNova2Voicemail: 'deepgram.nova-2-voicemail',
200
+ DeepgramNova3: 'deepgram.nova-3',
201
+ DeepgramNovaGeneral: 'deepgram.nova-general',
202
+ DeepgramNovaPhonecall: 'deepgram.nova-phonecall',
203
+ DeepgramWhisper: 'deepgram.whisper',
204
+ DeepgramWhisperBase: 'deepgram.whisper-base',
205
+ DeepgramWhisperLarge: 'deepgram.whisper-large',
206
+ DeepgramWhisperMedium: 'deepgram.whisper-medium',
207
+ DeepgramWhisperSmall: 'deepgram.whisper-small',
208
+ DeepgramWhisperTiny: 'deepgram.whisper-tiny',
209
+ FalaiWhisper: 'falai.whisper',
210
+ FalaiWizper: 'falai.wizper',
211
+ FireworksaiWhisperV3: 'fireworksai.whisper-v3',
212
+ FireworksaiWhisperV3Turbo: 'fireworksai.whisper-v3-turbo',
213
+ GladiaStandard: 'gladia.standard',
214
+ GoogleEnhanced: 'google.enhanced',
215
+ GoogleStandard: 'google.standard',
216
+ GroqDistilWhisperLargeV3En: 'groq.distil-whisper-large-v3-en',
217
+ GroqWhisperLargeV3: 'groq.whisper-large-v3',
218
+ GroqWhisperLargeV3Turbo: 'groq.whisper-large-v3-turbo',
219
+ IbmStandard: 'ibm.standard',
220
+ OpenaiWhisper1: 'openai.whisper-1',
221
+ OpenaiGpt4oTranscribe: 'openai.gpt-4o-transcribe',
222
+ OpenaiGpt4oMiniTranscribe: 'openai.gpt-4o-mini-transcribe',
223
+ RevaiMachine: 'revai.machine',
224
+ SpeechmaticsEnhanced: 'speechmatics.enhanced',
225
+ SpeechmaticsStandard: 'speechmatics.standard'
226
+ };
227
+ exports.TranscriptionOptionsTimestampGranularityEnum = {
228
+ Word: 'word',
229
+ Segment: 'segment'
230
+ };
231
+ exports.TranscriptionProvider = {
232
+ Amazon: 'amazon',
233
+ Assemblyai: 'assemblyai',
234
+ Azure: 'azure',
235
+ Cloudflare: 'cloudflare',
236
+ Deepgram: 'deepgram',
237
+ Falai: 'falai',
238
+ Fireworksai: 'fireworksai',
239
+ Gladia: 'gladia',
240
+ Google: 'google',
241
+ Groq: 'groq',
242
+ Ibm: 'ibm',
243
+ Openai: 'openai',
244
+ Revai: 'revai',
245
+ Speechmatics: 'speechmatics'
246
+ };
247
+ const OpenAICompatibleSpeechToTextApiAxiosParamCreator = function (configuration) {
248
+ return {
249
+ openaiCompatibleCreateTranscription: async (file, model, language, prompt, responseFormat, temperature, timestampGranularities, options = {}) => {
250
+ (0, common_1.assertParamExists)('openaiCompatibleCreateTranscription', 'file', file);
251
+ (0, common_1.assertParamExists)('openaiCompatibleCreateTranscription', 'model', model);
252
+ const localVarPath = `/openai-compatible/audio/transcriptions`;
253
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
254
+ let baseOptions;
255
+ if (configuration) {
256
+ baseOptions = configuration.baseOptions;
257
+ }
258
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
259
+ const localVarHeaderParameter = {};
260
+ const localVarQueryParameter = {};
261
+ const localVarFormParams = new ((configuration && configuration.formDataCtor) || FormData)();
262
+ await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
263
+ if (file !== undefined) {
264
+ localVarFormParams.append('file', file);
265
+ }
266
+ if (model !== undefined) {
267
+ localVarFormParams.append('model', model);
268
+ }
269
+ if (language !== undefined) {
270
+ localVarFormParams.append('language', language);
271
+ }
272
+ if (prompt !== undefined) {
273
+ localVarFormParams.append('prompt', prompt);
274
+ }
275
+ if (responseFormat !== undefined) {
276
+ localVarFormParams.append('response_format', responseFormat);
277
+ }
278
+ if (temperature !== undefined) {
279
+ localVarFormParams.append('temperature', temperature);
280
+ }
281
+ if (timestampGranularities) {
282
+ localVarFormParams.append('timestamp_granularities[]', timestampGranularities.join(base_1.COLLECTION_FORMATS.csv));
283
+ }
284
+ localVarHeaderParameter['Content-Type'] = 'multipart/form-data';
285
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
286
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
287
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
288
+ localVarRequestOptions.data = localVarFormParams;
289
+ return {
290
+ url: (0, common_1.toPathString)(localVarUrlObj),
291
+ options: localVarRequestOptions,
292
+ };
293
+ },
294
+ openaiCompatibleCreateTranslation: async (file, model, prompt, responseFormat, temperature, options = {}) => {
295
+ (0, common_1.assertParamExists)('openaiCompatibleCreateTranslation', 'file', file);
296
+ (0, common_1.assertParamExists)('openaiCompatibleCreateTranslation', 'model', model);
297
+ const localVarPath = `/openai-compatible/audio/translations`;
298
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
299
+ let baseOptions;
300
+ if (configuration) {
301
+ baseOptions = configuration.baseOptions;
302
+ }
303
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
304
+ const localVarHeaderParameter = {};
305
+ const localVarQueryParameter = {};
306
+ const localVarFormParams = new ((configuration && configuration.formDataCtor) || FormData)();
307
+ await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
308
+ if (file !== undefined) {
309
+ localVarFormParams.append('file', file);
310
+ }
311
+ if (model !== undefined) {
312
+ localVarFormParams.append('model', new Blob([JSON.stringify(model)], { type: "application/json", }));
313
+ }
314
+ if (prompt !== undefined) {
315
+ localVarFormParams.append('prompt', prompt);
316
+ }
317
+ if (responseFormat !== undefined) {
318
+ localVarFormParams.append('response_format', responseFormat);
319
+ }
320
+ if (temperature !== undefined) {
321
+ localVarFormParams.append('temperature', temperature);
322
+ }
323
+ localVarHeaderParameter['Content-Type'] = 'multipart/form-data';
324
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
325
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
326
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
327
+ localVarRequestOptions.data = localVarFormParams;
328
+ return {
329
+ url: (0, common_1.toPathString)(localVarUrlObj),
330
+ options: localVarRequestOptions,
331
+ };
332
+ },
333
+ };
334
+ };
335
+ exports.OpenAICompatibleSpeechToTextApiAxiosParamCreator = OpenAICompatibleSpeechToTextApiAxiosParamCreator;
336
+ const OpenAICompatibleSpeechToTextApiFp = function (configuration) {
337
+ const localVarAxiosParamCreator = (0, exports.OpenAICompatibleSpeechToTextApiAxiosParamCreator)(configuration);
338
+ return {
339
+ async openaiCompatibleCreateTranscription(file, model, language, prompt, responseFormat, temperature, timestampGranularities, options) {
340
+ const localVarAxiosArgs = await localVarAxiosParamCreator.openaiCompatibleCreateTranscription(file, model, language, prompt, responseFormat, temperature, timestampGranularities, options);
341
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
342
+ const localVarOperationServerBasePath = base_1.operationServerMap['OpenAICompatibleSpeechToTextApi.openaiCompatibleCreateTranscription']?.[localVarOperationServerIndex]?.url;
343
+ return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
344
+ },
345
+ async openaiCompatibleCreateTranslation(file, model, prompt, responseFormat, temperature, options) {
346
+ const localVarAxiosArgs = await localVarAxiosParamCreator.openaiCompatibleCreateTranslation(file, model, prompt, responseFormat, temperature, options);
347
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
348
+ const localVarOperationServerBasePath = base_1.operationServerMap['OpenAICompatibleSpeechToTextApi.openaiCompatibleCreateTranslation']?.[localVarOperationServerIndex]?.url;
349
+ return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
350
+ },
351
+ };
352
+ };
353
+ exports.OpenAICompatibleSpeechToTextApiFp = OpenAICompatibleSpeechToTextApiFp;
354
+ const OpenAICompatibleSpeechToTextApiFactory = function (configuration, basePath, axios) {
355
+ const localVarFp = (0, exports.OpenAICompatibleSpeechToTextApiFp)(configuration);
356
+ return {
357
+ openaiCompatibleCreateTranscription(file, model, language, prompt, responseFormat, temperature, timestampGranularities, options) {
358
+ return localVarFp.openaiCompatibleCreateTranscription(file, model, language, prompt, responseFormat, temperature, timestampGranularities, options).then((request) => request(axios, basePath));
359
+ },
360
+ openaiCompatibleCreateTranslation(file, model, prompt, responseFormat, temperature, options) {
361
+ return localVarFp.openaiCompatibleCreateTranslation(file, model, prompt, responseFormat, temperature, options).then((request) => request(axios, basePath));
362
+ },
363
+ };
364
+ };
365
+ exports.OpenAICompatibleSpeechToTextApiFactory = OpenAICompatibleSpeechToTextApiFactory;
366
+ class OpenAICompatibleSpeechToTextApi extends base_1.BaseAPI {
367
+ openaiCompatibleCreateTranscription(file, model, language, prompt, responseFormat, temperature, timestampGranularities, options) {
368
+ return (0, exports.OpenAICompatibleSpeechToTextApiFp)(this.configuration).openaiCompatibleCreateTranscription(file, model, language, prompt, responseFormat, temperature, timestampGranularities, options).then((request) => request(this.axios, this.basePath));
369
+ }
370
+ openaiCompatibleCreateTranslation(file, model, prompt, responseFormat, temperature, options) {
371
+ return (0, exports.OpenAICompatibleSpeechToTextApiFp)(this.configuration).openaiCompatibleCreateTranslation(file, model, prompt, responseFormat, temperature, options).then((request) => request(this.axios, this.basePath));
372
+ }
373
+ }
374
+ exports.OpenAICompatibleSpeechToTextApi = OpenAICompatibleSpeechToTextApi;
375
+ exports.OpenaiCompatibleCreateTranscriptionTimestampGranularitiesEnum = {
376
+ Word: 'word',
377
+ Segment: 'segment'
378
+ };
379
+ const ReplacementRulesApiAxiosParamCreator = function (configuration) {
380
+ return {
381
+ createReplacementRuleset: async (createReplacementRulesetRequest, options = {}) => {
382
+ (0, common_1.assertParamExists)('createReplacementRuleset', 'createReplacementRulesetRequest', createReplacementRulesetRequest);
383
+ const localVarPath = `/replacement-rulesets`;
384
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
385
+ let baseOptions;
386
+ if (configuration) {
387
+ baseOptions = configuration.baseOptions;
388
+ }
389
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
390
+ const localVarHeaderParameter = {};
391
+ const localVarQueryParameter = {};
392
+ await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
393
+ localVarHeaderParameter['Content-Type'] = 'application/json';
394
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
395
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
396
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
397
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(createReplacementRulesetRequest, localVarRequestOptions, configuration);
398
+ return {
399
+ url: (0, common_1.toPathString)(localVarUrlObj),
400
+ options: localVarRequestOptions,
401
+ };
402
+ },
403
+ };
404
+ };
405
+ exports.ReplacementRulesApiAxiosParamCreator = ReplacementRulesApiAxiosParamCreator;
406
+ const ReplacementRulesApiFp = function (configuration) {
407
+ const localVarAxiosParamCreator = (0, exports.ReplacementRulesApiAxiosParamCreator)(configuration);
408
+ return {
409
+ async createReplacementRuleset(createReplacementRulesetRequest, options) {
410
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createReplacementRuleset(createReplacementRulesetRequest, options);
411
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
412
+ const localVarOperationServerBasePath = base_1.operationServerMap['ReplacementRulesApi.createReplacementRuleset']?.[localVarOperationServerIndex]?.url;
413
+ return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
414
+ },
415
+ };
416
+ };
417
+ exports.ReplacementRulesApiFp = ReplacementRulesApiFp;
418
+ const ReplacementRulesApiFactory = function (configuration, basePath, axios) {
419
+ const localVarFp = (0, exports.ReplacementRulesApiFp)(configuration);
420
+ return {
421
+ createReplacementRuleset(createReplacementRulesetRequest, options) {
422
+ return localVarFp.createReplacementRuleset(createReplacementRulesetRequest, options).then((request) => request(axios, basePath));
423
+ },
424
+ };
425
+ };
426
+ exports.ReplacementRulesApiFactory = ReplacementRulesApiFactory;
427
+ class ReplacementRulesApi extends base_1.BaseAPI {
428
+ createReplacementRuleset(createReplacementRulesetRequest, options) {
429
+ return (0, exports.ReplacementRulesApiFp)(this.configuration).createReplacementRuleset(createReplacementRulesetRequest, options).then((request) => request(this.axios, this.basePath));
430
+ }
431
+ }
432
+ exports.ReplacementRulesApi = ReplacementRulesApi;
433
+ const SpeechToTextApiAxiosParamCreator = function (configuration) {
434
+ return {
435
+ listSpeechToTextModels: async (options = {}) => {
436
+ const localVarPath = `/speech-to-text-models`;
437
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
438
+ let baseOptions;
439
+ if (configuration) {
440
+ baseOptions = configuration.baseOptions;
441
+ }
442
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
443
+ const localVarHeaderParameter = {};
444
+ const localVarQueryParameter = {};
445
+ await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
446
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
447
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
448
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
449
+ return {
450
+ url: (0, common_1.toPathString)(localVarUrlObj),
451
+ options: localVarRequestOptions,
452
+ };
453
+ },
454
+ transcribe: async (model, body, language, outputFormat, rulesetId, punctuation, timestampGranularity, diarization, initialPrompt, temperature, smartFormat, speakersExpected, customVocabulary, options = {}) => {
455
+ (0, common_1.assertParamExists)('transcribe', 'model', model);
456
+ (0, common_1.assertParamExists)('transcribe', 'body', body);
457
+ const localVarPath = `/transcribe`;
458
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
459
+ let baseOptions;
460
+ if (configuration) {
461
+ baseOptions = configuration.baseOptions;
462
+ }
463
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
464
+ const localVarHeaderParameter = {};
465
+ const localVarQueryParameter = {};
466
+ await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
467
+ if (model !== undefined) {
468
+ localVarQueryParameter['model'] = model;
469
+ }
470
+ if (language !== undefined) {
471
+ localVarQueryParameter['language'] = language;
472
+ }
473
+ if (outputFormat !== undefined) {
474
+ localVarQueryParameter['output_format'] = outputFormat;
475
+ }
476
+ if (rulesetId !== undefined) {
477
+ localVarQueryParameter['ruleset_id'] = rulesetId;
478
+ }
479
+ if (punctuation !== undefined) {
480
+ localVarQueryParameter['punctuation'] = punctuation;
481
+ }
482
+ if (timestampGranularity !== undefined) {
483
+ localVarQueryParameter['timestamp_granularity'] = timestampGranularity;
484
+ }
485
+ if (diarization !== undefined) {
486
+ localVarQueryParameter['diarization'] = diarization;
487
+ }
488
+ if (initialPrompt !== undefined) {
489
+ localVarQueryParameter['initial_prompt'] = initialPrompt;
490
+ }
491
+ if (temperature !== undefined) {
492
+ localVarQueryParameter['temperature'] = temperature;
493
+ }
494
+ if (smartFormat !== undefined) {
495
+ localVarQueryParameter['smart_format'] = smartFormat;
496
+ }
497
+ if (speakersExpected !== undefined) {
498
+ localVarQueryParameter['speakers_expected'] = speakersExpected;
499
+ }
500
+ if (customVocabulary) {
501
+ localVarQueryParameter['custom_vocabulary'] = customVocabulary;
502
+ }
503
+ localVarHeaderParameter['Content-Type'] = 'audio/*';
504
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
505
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
506
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
507
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(body, localVarRequestOptions, configuration);
508
+ return {
509
+ url: (0, common_1.toPathString)(localVarUrlObj),
510
+ options: localVarRequestOptions,
511
+ };
512
+ },
513
+ transcribeRemote: async (transcriptionOptions, options = {}) => {
514
+ (0, common_1.assertParamExists)('transcribeRemote', 'transcriptionOptions', transcriptionOptions);
515
+ const localVarPath = `/transcribe-remote`;
516
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
517
+ let baseOptions;
518
+ if (configuration) {
519
+ baseOptions = configuration.baseOptions;
520
+ }
521
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
522
+ const localVarHeaderParameter = {};
523
+ const localVarQueryParameter = {};
524
+ await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
525
+ localVarHeaderParameter['Content-Type'] = 'application/json';
526
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
527
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
528
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
529
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(transcriptionOptions, localVarRequestOptions, configuration);
530
+ return {
531
+ url: (0, common_1.toPathString)(localVarUrlObj),
532
+ options: localVarRequestOptions,
533
+ };
534
+ },
535
+ };
536
+ };
537
+ exports.SpeechToTextApiAxiosParamCreator = SpeechToTextApiAxiosParamCreator;
538
+ const SpeechToTextApiFp = function (configuration) {
539
+ const localVarAxiosParamCreator = (0, exports.SpeechToTextApiAxiosParamCreator)(configuration);
540
+ return {
541
+ async listSpeechToTextModels(options) {
542
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listSpeechToTextModels(options);
543
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
544
+ const localVarOperationServerBasePath = base_1.operationServerMap['SpeechToTextApi.listSpeechToTextModels']?.[localVarOperationServerIndex]?.url;
545
+ return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
546
+ },
547
+ async transcribe(model, body, language, outputFormat, rulesetId, punctuation, timestampGranularity, diarization, initialPrompt, temperature, smartFormat, speakersExpected, customVocabulary, options) {
548
+ const localVarAxiosArgs = await localVarAxiosParamCreator.transcribe(model, body, language, outputFormat, rulesetId, punctuation, timestampGranularity, diarization, initialPrompt, temperature, smartFormat, speakersExpected, customVocabulary, options);
549
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
550
+ const localVarOperationServerBasePath = base_1.operationServerMap['SpeechToTextApi.transcribe']?.[localVarOperationServerIndex]?.url;
551
+ return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
552
+ },
553
+ async transcribeRemote(transcriptionOptions, options) {
554
+ const localVarAxiosArgs = await localVarAxiosParamCreator.transcribeRemote(transcriptionOptions, options);
555
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
556
+ const localVarOperationServerBasePath = base_1.operationServerMap['SpeechToTextApi.transcribeRemote']?.[localVarOperationServerIndex]?.url;
557
+ return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
558
+ },
559
+ };
560
+ };
561
+ exports.SpeechToTextApiFp = SpeechToTextApiFp;
562
+ const SpeechToTextApiFactory = function (configuration, basePath, axios) {
563
+ const localVarFp = (0, exports.SpeechToTextApiFp)(configuration);
564
+ return {
565
+ listSpeechToTextModels(options) {
566
+ return localVarFp.listSpeechToTextModels(options).then((request) => request(axios, basePath));
567
+ },
568
+ transcribe(model, body, language, outputFormat, rulesetId, punctuation, timestampGranularity, diarization, initialPrompt, temperature, smartFormat, speakersExpected, customVocabulary, options) {
569
+ return localVarFp.transcribe(model, body, language, outputFormat, rulesetId, punctuation, timestampGranularity, diarization, initialPrompt, temperature, smartFormat, speakersExpected, customVocabulary, options).then((request) => request(axios, basePath));
570
+ },
571
+ transcribeRemote(transcriptionOptions, options) {
572
+ return localVarFp.transcribeRemote(transcriptionOptions, options).then((request) => request(axios, basePath));
573
+ },
574
+ };
575
+ };
576
+ exports.SpeechToTextApiFactory = SpeechToTextApiFactory;
577
+ class SpeechToTextApi extends base_1.BaseAPI {
578
+ listSpeechToTextModels(options) {
579
+ return (0, exports.SpeechToTextApiFp)(this.configuration).listSpeechToTextModels(options).then((request) => request(this.axios, this.basePath));
580
+ }
581
+ transcribe(model, body, language, outputFormat, rulesetId, punctuation, timestampGranularity, diarization, initialPrompt, temperature, smartFormat, speakersExpected, customVocabulary, options) {
582
+ return (0, exports.SpeechToTextApiFp)(this.configuration).transcribe(model, body, language, outputFormat, rulesetId, punctuation, timestampGranularity, diarization, initialPrompt, temperature, smartFormat, speakersExpected, customVocabulary, options).then((request) => request(this.axios, this.basePath));
583
+ }
584
+ transcribeRemote(transcriptionOptions, options) {
585
+ return (0, exports.SpeechToTextApiFp)(this.configuration).transcribeRemote(transcriptionOptions, options).then((request) => request(this.axios, this.basePath));
586
+ }
587
+ }
588
+ exports.SpeechToTextApi = SpeechToTextApi;
589
+ exports.TranscribeTimestampGranularityEnum = {
590
+ Word: 'word',
591
+ Segment: 'segment'
592
+ };
package/dist/base.d.ts ADDED
@@ -0,0 +1,32 @@
1
+ import type { Configuration } from './configuration';
2
+ import type { AxiosInstance, RawAxiosRequestConfig } from 'axios';
3
+ export declare const BASE_PATH: string;
4
+ export declare const COLLECTION_FORMATS: {
5
+ csv: string;
6
+ ssv: string;
7
+ tsv: string;
8
+ pipes: string;
9
+ };
10
+ export interface RequestArgs {
11
+ url: string;
12
+ options: RawAxiosRequestConfig;
13
+ }
14
+ export declare class BaseAPI {
15
+ protected basePath: string;
16
+ protected axios: AxiosInstance;
17
+ protected configuration: Configuration | undefined;
18
+ constructor(configuration?: Configuration, basePath?: string, axios?: AxiosInstance);
19
+ }
20
+ export declare class RequiredError extends Error {
21
+ field: string;
22
+ constructor(field: string, msg?: string);
23
+ }
24
+ interface ServerMap {
25
+ [key: string]: {
26
+ url: string;
27
+ description: string;
28
+ }[];
29
+ }
30
+ export declare const operationServerMap: ServerMap;
31
+ export {};
32
+ //# sourceMappingURL=base.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../base.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGrD,OAAO,KAAK,EAAgB,aAAa,EAAE,qBAAqB,EAAE,MAAM,OAAO,CAAC;AAGhF,eAAO,MAAM,SAAS,QAAqD,CAAC;AAM5E,eAAO,MAAM,kBAAkB;;;;;CAK9B,CAAC;AAOF,MAAM,WAAW,WAAW;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,qBAAqB,CAAC;CAClC;AAOD,qBAAa,OAAO;IAG2B,SAAS,CAAC,QAAQ,EAAE,MAAM;IAAc,SAAS,CAAC,KAAK,EAAE,aAAa;IAFjH,SAAS,CAAC,aAAa,EAAE,aAAa,GAAG,SAAS,CAAC;gBAEvC,aAAa,CAAC,EAAE,aAAa,EAAY,QAAQ,GAAE,MAAkB,EAAY,KAAK,GAAE,aAA2B;CAMlI;AAQD,qBAAa,aAAc,SAAQ,KAAK;IACjB,KAAK,EAAE,MAAM;gBAAb,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM;CAIjD;AAED,UAAU,SAAS;IACf,CAAC,GAAG,EAAE,MAAM,GAAG;QACX,GAAG,EAAE,MAAM,CAAC;QACZ,WAAW,EAAE,MAAM,CAAC;KACvB,EAAE,CAAC;CACP;AAMD,eAAO,MAAM,kBAAkB,EAAE,SAChC,CAAA"}
package/dist/base.js ADDED
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.operationServerMap = exports.RequiredError = exports.BaseAPI = exports.COLLECTION_FORMATS = exports.BASE_PATH = void 0;
7
+ const axios_1 = __importDefault(require("axios"));
8
+ exports.BASE_PATH = "https://api.speechall.com/v1".replace(/\/+$/, "");
9
+ exports.COLLECTION_FORMATS = {
10
+ csv: ",",
11
+ ssv: " ",
12
+ tsv: "\t",
13
+ pipes: "|",
14
+ };
15
+ class BaseAPI {
16
+ constructor(configuration, basePath = exports.BASE_PATH, axios = axios_1.default) {
17
+ this.basePath = basePath;
18
+ this.axios = axios;
19
+ if (configuration) {
20
+ this.configuration = configuration;
21
+ this.basePath = configuration.basePath ?? basePath;
22
+ }
23
+ }
24
+ }
25
+ exports.BaseAPI = BaseAPI;
26
+ ;
27
+ class RequiredError extends Error {
28
+ constructor(field, msg) {
29
+ super(msg);
30
+ this.field = field;
31
+ this.name = "RequiredError";
32
+ }
33
+ }
34
+ exports.RequiredError = RequiredError;
35
+ exports.operationServerMap = {};