whio-api-sdk 1.0.218-beta-staging → 1.0.220-beta-staging

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.
@@ -29,4 +29,7 @@ export declare class AudioModule extends BaseClient {
29
29
  queueSessionBase64AudioForTranscription(sessionId: string): Promise<{
30
30
  success: boolean;
31
31
  }>;
32
+ transcribeAudioFileDirect(file: File | Blob, fileName?: string, useFineTuned?: boolean, onProgress?: (percentage: number) => void): Promise<{
33
+ transcription?: string;
34
+ }>;
32
35
  }
@@ -141,4 +141,17 @@ export class AudioModule extends BaseClient {
141
141
  return this.request(`${urls.audioFiles}/session/${sessionId}/transcribe`, 'POST');
142
142
  });
143
143
  }
144
+ // ======================
145
+ // DIRECT TRANSCRIPTION METHODS
146
+ // ======================
147
+ transcribeAudioFileDirect(file, fileName, useFineTuned, onProgress) {
148
+ return __awaiter(this, void 0, void 0, function* () {
149
+ const formData = new FormData();
150
+ formData.append('file', file, fileName);
151
+ if (useFineTuned !== undefined) {
152
+ formData.append('useFineTuned', useFineTuned.toString());
153
+ }
154
+ return this.fileUploadRequest(`${urls.audioFiles}/transcribe`, formData, {}, onProgress);
155
+ });
156
+ }
144
157
  }
@@ -157,6 +157,9 @@ export declare class ApiSDK extends BaseClient {
157
157
  queueSessionBase64AudioForTranscription(...args: Parameters<AudioModule['queueSessionBase64AudioForTranscription']>): Promise<{
158
158
  success: boolean;
159
159
  }>;
160
+ transcribeAudioFileDirect(...args: Parameters<AudioModule['transcribeAudioFileDirect']>): Promise<{
161
+ transcription?: string | undefined;
162
+ }>;
160
163
  createWorkflow(...args: Parameters<WorkflowModule['createWorkflow']>): Promise<import("./types").Workflow>;
161
164
  getWorkflows(...args: Parameters<WorkflowModule['getWorkflows']>): Promise<import("./types").Workflow[]>;
162
165
  getWorkflow(...args: Parameters<WorkflowModule['getWorkflow']>): Promise<import("./types").Workflow>;
@@ -618,6 +618,11 @@ export class ApiSDK extends BaseClient {
618
618
  return this.audio.queueSessionBase64AudioForTranscription(...args);
619
619
  });
620
620
  }
621
+ transcribeAudioFileDirect(...args) {
622
+ return __awaiter(this, void 0, void 0, function* () {
623
+ return this.audio.transcribeAudioFileDirect(...args);
624
+ });
625
+ }
621
626
  // Workflow methods
622
627
  createWorkflow(...args) {
623
628
  return __awaiter(this, void 0, void 0, function* () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "whio-api-sdk",
3
- "version": "1.0.218-beta-staging",
3
+ "version": "1.0.220-beta-staging",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
@@ -124,4 +124,17 @@ export class AudioModule extends BaseClient {
124
124
  public async queueSessionBase64AudioForTranscription(sessionId: string): Promise<{ success: boolean }> {
125
125
  return this.request<{ success: boolean }>(`${urls.audioFiles}/session/${sessionId}/transcribe`, 'POST');
126
126
  }
127
+
128
+ // ======================
129
+ // DIRECT TRANSCRIPTION METHODS
130
+ // ======================
131
+
132
+ public async transcribeAudioFileDirect(file: File | Blob, fileName?: string, useFineTuned?: boolean, onProgress?: (percentage: number) => void): Promise<{ transcription?: string }> {
133
+ const formData = new FormData();
134
+ formData.append('file', file, fileName);
135
+ if (useFineTuned !== undefined) {
136
+ formData.append('useFineTuned', useFineTuned.toString());
137
+ }
138
+ return this.fileUploadRequest<{ transcription?: string }>(`${urls.audioFiles}/transcribe`, formData, {}, onProgress);
139
+ }
127
140
  }
package/src/sdk/sdk.ts CHANGED
@@ -519,6 +519,10 @@ export class ApiSDK extends BaseClient {
519
519
  return this.audio.queueSessionBase64AudioForTranscription(...args);
520
520
  }
521
521
 
522
+ public async transcribeAudioFileDirect(...args: Parameters<AudioModule['transcribeAudioFileDirect']>) {
523
+ return this.audio.transcribeAudioFileDirect(...args);
524
+ }
525
+
522
526
  // Workflow methods
523
527
  public async createWorkflow(...args: Parameters<WorkflowModule['createWorkflow']>) {
524
528
  return this.workflows.createWorkflow(...args);