@copilotkit/voice 1.54.1 → 1.55.0-next.8
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/CHANGELOG.md +58 -46
- package/README.md +2 -2
- package/dist/index.umd.js +5 -5
- package/dist/index.umd.js.map +1 -1
- package/dist/transcription/transcription-service-openai.cjs +2 -2
- package/dist/transcription/transcription-service-openai.cjs.map +1 -1
- package/dist/transcription/transcription-service-openai.d.cts +1 -1
- package/dist/transcription/transcription-service-openai.d.mts +1 -1
- package/dist/transcription/transcription-service-openai.mjs +1 -1
- package/dist/transcription/transcription-service-openai.mjs.map +1 -1
- package/eslint.config.mjs +1 -1
- package/package.json +4 -4
- package/src/transcription/transcription-service-openai.ts +1 -1
- package/tsconfig.json +1 -1
- package/tsdown.config.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,22 @@
|
|
|
1
1
|
# @copilotkit/voice
|
|
2
2
|
|
|
3
|
-
## 1.
|
|
3
|
+
## 1.55.0-next.8
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
-
-
|
|
7
|
+
- Updated dependencies [8aafcbe]
|
|
8
|
+
- @copilotkit/runtime@1.55.0-next.8
|
|
9
|
+
|
|
10
|
+
## 1.55.0-next.7
|
|
11
|
+
|
|
12
|
+
### Minor Changes
|
|
13
|
+
|
|
14
|
+
- 1ceb963: refactor: consolidate V1/V2 packages into flat @copilotkit/\* structure
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- Updated dependencies [1ceb963]
|
|
19
|
+
- @copilotkit/runtime@1.55.0-next.7
|
|
8
20
|
|
|
9
21
|
## 1.54.1-next.6
|
|
10
22
|
|
|
@@ -102,209 +114,209 @@
|
|
|
102
114
|
|
|
103
115
|
### Patch Changes
|
|
104
116
|
|
|
105
|
-
- @
|
|
117
|
+
- @copilotkit/runtime@1.53.1-next.2
|
|
106
118
|
|
|
107
119
|
## 1.53.1-next.1
|
|
108
120
|
|
|
109
121
|
### Patch Changes
|
|
110
122
|
|
|
111
|
-
- @
|
|
123
|
+
- @copilotkit/runtime@1.53.1-next.1
|
|
112
124
|
|
|
113
125
|
## 1.53.1-next.0
|
|
114
126
|
|
|
115
127
|
### Patch Changes
|
|
116
128
|
|
|
117
|
-
- @
|
|
129
|
+
- @copilotkit/runtime@1.53.1-next.0
|
|
118
130
|
|
|
119
131
|
## 1.53.0
|
|
120
132
|
|
|
121
133
|
### Patch Changes
|
|
122
134
|
|
|
123
135
|
- Updated dependencies [1510f64]
|
|
124
|
-
- @
|
|
136
|
+
- @copilotkit/runtime@1.53.0
|
|
125
137
|
|
|
126
138
|
## 1.53.0-next.6
|
|
127
139
|
|
|
128
140
|
### Patch Changes
|
|
129
141
|
|
|
130
|
-
- @
|
|
142
|
+
- @copilotkit/runtime@1.53.0-next.6
|
|
131
143
|
|
|
132
144
|
## 1.53.0-next.5
|
|
133
145
|
|
|
134
146
|
### Patch Changes
|
|
135
147
|
|
|
136
|
-
- @
|
|
148
|
+
- @copilotkit/runtime@1.53.0-next.5
|
|
137
149
|
|
|
138
150
|
## 1.52.2-next.4
|
|
139
151
|
|
|
140
152
|
### Patch Changes
|
|
141
153
|
|
|
142
|
-
- @
|
|
154
|
+
- @copilotkit/runtime@1.52.2-next.4
|
|
143
155
|
|
|
144
156
|
## 1.52.2-next.3
|
|
145
157
|
|
|
146
158
|
### Patch Changes
|
|
147
159
|
|
|
148
160
|
- Updated dependencies [1510f64]
|
|
149
|
-
- @
|
|
161
|
+
- @copilotkit/runtime@1.52.2-next.3
|
|
150
162
|
|
|
151
163
|
## 1.52.2-next.2
|
|
152
164
|
|
|
153
165
|
### Patch Changes
|
|
154
166
|
|
|
155
|
-
- @
|
|
167
|
+
- @copilotkit/runtime@1.52.2-next.2
|
|
156
168
|
|
|
157
169
|
## 1.52.2-next.1
|
|
158
170
|
|
|
159
171
|
### Patch Changes
|
|
160
172
|
|
|
161
|
-
- @
|
|
173
|
+
- @copilotkit/runtime@1.52.2-next.1
|
|
162
174
|
|
|
163
175
|
## 1.52.2-next.0
|
|
164
176
|
|
|
165
177
|
### Patch Changes
|
|
166
178
|
|
|
167
|
-
- @
|
|
179
|
+
- @copilotkit/runtime@1.52.2-next.0
|
|
168
180
|
|
|
169
181
|
## 1.52.1
|
|
170
182
|
|
|
171
183
|
### Patch Changes
|
|
172
184
|
|
|
173
|
-
- @
|
|
185
|
+
- @copilotkit/runtime@1.52.1
|
|
174
186
|
|
|
175
187
|
## 1.52.1-next.1
|
|
176
188
|
|
|
177
189
|
### Patch Changes
|
|
178
190
|
|
|
179
|
-
- @
|
|
191
|
+
- @copilotkit/runtime@1.52.1-next.1
|
|
180
192
|
|
|
181
193
|
## 1.52.1-next.0
|
|
182
194
|
|
|
183
195
|
### Patch Changes
|
|
184
196
|
|
|
185
|
-
- @
|
|
197
|
+
- @copilotkit/runtime@1.52.1-next.0
|
|
186
198
|
|
|
187
199
|
## 1.52.0
|
|
188
200
|
|
|
189
201
|
### Patch Changes
|
|
190
202
|
|
|
191
203
|
- Updated dependencies [ef0f539]
|
|
192
|
-
- @
|
|
204
|
+
- @copilotkit/runtime@1.52.0
|
|
193
205
|
|
|
194
206
|
## 1.52.0-next.8
|
|
195
207
|
|
|
196
208
|
### Patch Changes
|
|
197
209
|
|
|
198
|
-
- @
|
|
210
|
+
- @copilotkit/runtime@1.52.0-next.8
|
|
199
211
|
|
|
200
212
|
## 1.52.0-next.7
|
|
201
213
|
|
|
202
214
|
### Patch Changes
|
|
203
215
|
|
|
204
|
-
- @
|
|
216
|
+
- @copilotkit/runtime@1.52.0-next.7
|
|
205
217
|
|
|
206
218
|
## 1.52.0-next.6
|
|
207
219
|
|
|
208
220
|
### Patch Changes
|
|
209
221
|
|
|
210
|
-
- @
|
|
222
|
+
- @copilotkit/runtime@1.52.0-next.6
|
|
211
223
|
|
|
212
224
|
## 1.52.0-next.5
|
|
213
225
|
|
|
214
226
|
### Patch Changes
|
|
215
227
|
|
|
216
|
-
- @
|
|
228
|
+
- @copilotkit/runtime@1.52.0-next.5
|
|
217
229
|
|
|
218
230
|
## 1.51.5-next.4
|
|
219
231
|
|
|
220
232
|
### Patch Changes
|
|
221
233
|
|
|
222
|
-
- @
|
|
234
|
+
- @copilotkit/runtime@1.51.5-next.4
|
|
223
235
|
|
|
224
236
|
## 1.51.5-next.3
|
|
225
237
|
|
|
226
238
|
### Patch Changes
|
|
227
239
|
|
|
228
|
-
- @
|
|
240
|
+
- @copilotkit/runtime@1.51.5-next.3
|
|
229
241
|
|
|
230
242
|
## 1.51.5-next.2
|
|
231
243
|
|
|
232
244
|
### Patch Changes
|
|
233
245
|
|
|
234
|
-
- @
|
|
246
|
+
- @copilotkit/runtime@1.51.5-next.2
|
|
235
247
|
|
|
236
248
|
## 1.51.5-next.1
|
|
237
249
|
|
|
238
250
|
### Patch Changes
|
|
239
251
|
|
|
240
|
-
- @
|
|
252
|
+
- @copilotkit/runtime@1.51.5-next.1
|
|
241
253
|
|
|
242
254
|
## 1.51.5-next.0
|
|
243
255
|
|
|
244
256
|
### Patch Changes
|
|
245
257
|
|
|
246
258
|
- Updated dependencies [ef0f539]
|
|
247
|
-
- @
|
|
259
|
+
- @copilotkit/runtime@1.51.5-next.0
|
|
248
260
|
|
|
249
261
|
## 1.51.4
|
|
250
262
|
|
|
251
263
|
### Patch Changes
|
|
252
264
|
|
|
253
|
-
- @
|
|
265
|
+
- @copilotkit/runtime@1.51.4
|
|
254
266
|
|
|
255
267
|
## 1.51.4-next.8
|
|
256
268
|
|
|
257
269
|
### Patch Changes
|
|
258
270
|
|
|
259
|
-
- @
|
|
271
|
+
- @copilotkit/runtime@1.51.4-next.8
|
|
260
272
|
|
|
261
273
|
## 1.51.4-next.7
|
|
262
274
|
|
|
263
275
|
### Patch Changes
|
|
264
276
|
|
|
265
|
-
- @
|
|
277
|
+
- @copilotkit/runtime@1.51.4-next.7
|
|
266
278
|
|
|
267
279
|
## 1.51.4-next.6
|
|
268
280
|
|
|
269
281
|
### Patch Changes
|
|
270
282
|
|
|
271
|
-
- @
|
|
283
|
+
- @copilotkit/runtime@1.51.4-next.6
|
|
272
284
|
|
|
273
285
|
## 1.51.4-next.5
|
|
274
286
|
|
|
275
287
|
### Patch Changes
|
|
276
288
|
|
|
277
|
-
- @
|
|
289
|
+
- @copilotkit/runtime@1.51.4-next.5
|
|
278
290
|
|
|
279
291
|
## 1.51.4-next.4
|
|
280
292
|
|
|
281
293
|
### Patch Changes
|
|
282
294
|
|
|
283
|
-
- @
|
|
295
|
+
- @copilotkit/runtime@1.51.4-next.4
|
|
284
296
|
|
|
285
297
|
## 1.51.4-next.3
|
|
286
298
|
|
|
287
299
|
### Patch Changes
|
|
288
300
|
|
|
289
|
-
- @
|
|
301
|
+
- @copilotkit/runtime@1.51.4-next.3
|
|
290
302
|
|
|
291
303
|
## 1.51.4-next.2
|
|
292
304
|
|
|
293
305
|
### Patch Changes
|
|
294
306
|
|
|
295
|
-
- @
|
|
307
|
+
- @copilotkit/runtime@1.51.4-next.2
|
|
296
308
|
|
|
297
309
|
## 1.51.4-next.1
|
|
298
310
|
|
|
299
311
|
### Patch Changes
|
|
300
312
|
|
|
301
|
-
- @
|
|
313
|
+
- @copilotkit/runtime@1.51.4-next.1
|
|
302
314
|
|
|
303
315
|
## 1.51.4-next.0
|
|
304
316
|
|
|
305
317
|
### Patch Changes
|
|
306
318
|
|
|
307
|
-
- @
|
|
319
|
+
- @copilotkit/runtime@1.51.4-next.0
|
|
308
320
|
|
|
309
321
|
## 1.51.3
|
|
310
322
|
|
|
@@ -312,7 +324,7 @@
|
|
|
312
324
|
|
|
313
325
|
- d36fc1e: Add UMD export
|
|
314
326
|
- Updated dependencies [d36fc1e]
|
|
315
|
-
- @
|
|
327
|
+
- @copilotkit/runtime@1.51.3
|
|
316
328
|
|
|
317
329
|
## 1.51.3-next.8
|
|
318
330
|
|
|
@@ -320,52 +332,52 @@
|
|
|
320
332
|
|
|
321
333
|
- d36fc1e: Add UMD export
|
|
322
334
|
- Updated dependencies [d36fc1e]
|
|
323
|
-
- @
|
|
335
|
+
- @copilotkit/runtime@1.51.3-next.8
|
|
324
336
|
|
|
325
337
|
## 1.51.3-next.7
|
|
326
338
|
|
|
327
339
|
### Patch Changes
|
|
328
340
|
|
|
329
|
-
- @
|
|
341
|
+
- @copilotkit/runtime@1.51.3-next.7
|
|
330
342
|
|
|
331
343
|
## 1.51.3-next.6
|
|
332
344
|
|
|
333
345
|
### Patch Changes
|
|
334
346
|
|
|
335
|
-
- @
|
|
347
|
+
- @copilotkit/runtime@1.51.3-next.6
|
|
336
348
|
|
|
337
349
|
## 1.51.3-next.5
|
|
338
350
|
|
|
339
351
|
### Patch Changes
|
|
340
352
|
|
|
341
|
-
- @
|
|
353
|
+
- @copilotkit/runtime@1.51.3-next.5
|
|
342
354
|
|
|
343
355
|
## 1.51.3-next.4
|
|
344
356
|
|
|
345
357
|
### Patch Changes
|
|
346
358
|
|
|
347
|
-
- @
|
|
359
|
+
- @copilotkit/runtime@1.51.3-next.4
|
|
348
360
|
|
|
349
361
|
## 1.51.3-next.3
|
|
350
362
|
|
|
351
363
|
### Patch Changes
|
|
352
364
|
|
|
353
|
-
- @
|
|
365
|
+
- @copilotkit/runtime@1.51.3-next.3
|
|
354
366
|
|
|
355
367
|
## 1.51.3-next.2
|
|
356
368
|
|
|
357
369
|
### Patch Changes
|
|
358
370
|
|
|
359
|
-
- @
|
|
371
|
+
- @copilotkit/runtime@1.51.3-next.2
|
|
360
372
|
|
|
361
373
|
## 1.51.3-next.1
|
|
362
374
|
|
|
363
375
|
### Patch Changes
|
|
364
376
|
|
|
365
|
-
- @
|
|
377
|
+
- @copilotkit/runtime@1.51.3-next.1
|
|
366
378
|
|
|
367
379
|
## 1.51.3-next.0
|
|
368
380
|
|
|
369
381
|
### Patch Changes
|
|
370
382
|
|
|
371
|
-
- @
|
|
383
|
+
- @copilotkit/runtime@1.51.3-next.0
|
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ pnpm add @copilotkit/voice openai
|
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
```typescript
|
|
12
|
-
import { CopilotRuntime, createCopilotEndpoint } from "@
|
|
12
|
+
import { CopilotRuntime, createCopilotEndpoint } from "@copilotkit/runtime";
|
|
13
13
|
import { TranscriptionServiceOpenAI } from "@copilotkit/voice";
|
|
14
14
|
import OpenAI from "openai";
|
|
15
15
|
|
|
@@ -45,7 +45,7 @@ Extend `TranscriptionService` from runtime:
|
|
|
45
45
|
import {
|
|
46
46
|
TranscriptionService,
|
|
47
47
|
TranscribeFileOptions,
|
|
48
|
-
} from "@
|
|
48
|
+
} from "@copilotkit/runtime";
|
|
49
49
|
|
|
50
50
|
class MyTranscriptionService extends TranscriptionService {
|
|
51
51
|
async transcribeFile(options: TranscribeFileOptions): Promise<string> {
|
package/dist/index.umd.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function(global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', '@
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.CopilotKitVoice = {}), global.
|
|
5
|
-
})(this, function(exports,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@copilotkit/runtime/v2'), require('openai')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', '@copilotkit/runtime/v2', 'openai'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.CopilotKitVoice = {}), global._copilotkit_runtime_v2,global.openai));
|
|
5
|
+
})(this, function(exports, _copilotkit_runtime_v2, openai) {
|
|
6
6
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
7
7
|
//#region \0rolldown/runtime.js
|
|
8
8
|
var __create = Object.create;
|
|
@@ -76,7 +76,7 @@ openai = __toESM(openai);
|
|
|
76
76
|
|
|
77
77
|
//#endregion
|
|
78
78
|
//#region src/transcription/transcription-service-openai.ts
|
|
79
|
-
var TranscriptionServiceOpenAI = class extends
|
|
79
|
+
var TranscriptionServiceOpenAI = class extends _copilotkit_runtime_v2.TranscriptionService {
|
|
80
80
|
constructor(config) {
|
|
81
81
|
var _config$openai, _config$model;
|
|
82
82
|
super();
|
package/dist/index.umd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.umd.js","names":["TranscriptionService","OpenAI"],"sources":["../src/transcription/transcription-service-openai.ts"],"sourcesContent":["import {\n TranscribeFileOptions,\n TranscriptionService,\n} from \"@
|
|
1
|
+
{"version":3,"file":"index.umd.js","names":["TranscriptionService","OpenAI"],"sources":["../src/transcription/transcription-service-openai.ts"],"sourcesContent":["import {\n TranscribeFileOptions,\n TranscriptionService,\n} from \"@copilotkit/runtime/v2\";\nimport OpenAI from \"openai\";\n\n/**\n * Configuration options for the OpenAI transcription service.\n */\nexport interface TranscriptionServiceOpenAIConfig {\n /** OpenAI client instance. */\n openai: OpenAI;\n /** Whisper model to use. Defaults to \"whisper-1\". */\n model?: string;\n /**\n * Language of the audio in ISO-639-1 format (e.g., \"en\", \"de\", \"fr\").\n * Providing the language improves accuracy and latency.\n */\n language?: string;\n /**\n * Optional text to guide the model's style or continue a previous segment.\n * Should match the audio language.\n */\n prompt?: string;\n /**\n * Sampling temperature between 0 and 1.\n * Lower values are more deterministic, higher values more creative.\n */\n temperature?: number;\n}\n\nexport class TranscriptionServiceOpenAI extends TranscriptionService {\n private openai: OpenAI;\n private model: string;\n private language?: string;\n private prompt?: string;\n private temperature?: number;\n\n constructor(config: TranscriptionServiceOpenAIConfig) {\n super();\n this.openai = config.openai ?? new OpenAI();\n this.model = config.model ?? \"whisper-1\";\n this.language = config.language;\n this.prompt = config.prompt;\n this.temperature = config.temperature;\n }\n\n async transcribeFile(options: TranscribeFileOptions): Promise<string> {\n const response = await this.openai.audio.transcriptions.create({\n file: options.audioFile,\n model: this.model,\n ...(this.language && { language: this.language }),\n ...(this.prompt && { prompt: this.prompt }),\n ...(this.temperature !== undefined && { temperature: this.temperature }),\n });\n return response.text;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+BA,IAAa,6BAAb,cAAgDA,4CAAqB;EAOnE,YAAY,QAA0C;;AACpD,UAAO;yBAPD;yBACA;yBACA;yBACA;yBACA;AAIN,QAAK,2BAAS,OAAO,iEAAU,IAAIC,gBAAQ;AAC3C,QAAK,yBAAQ,OAAO,8DAAS;AAC7B,QAAK,WAAW,OAAO;AACvB,QAAK,SAAS,OAAO;AACrB,QAAK,cAAc,OAAO;;EAG5B,MAAM,eAAe,SAAiD;AAQpE,WAPiB,MAAM,KAAK,OAAO,MAAM,eAAe,OAAO;IAC7D,MAAM,QAAQ;IACd,OAAO,KAAK;IACZ,GAAI,KAAK,YAAY,EAAE,UAAU,KAAK,UAAU;IAChD,GAAI,KAAK,UAAU,EAAE,QAAQ,KAAK,QAAQ;IAC1C,GAAI,KAAK,gBAAgB,UAAa,EAAE,aAAa,KAAK,aAAa;IACxE,CAAC,EACc"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
2
|
-
let
|
|
2
|
+
let _copilotkit_runtime_v2 = require("@copilotkit/runtime/v2");
|
|
3
3
|
let openai = require("openai");
|
|
4
4
|
openai = require_runtime.__toESM(openai);
|
|
5
5
|
|
|
6
6
|
//#region src/transcription/transcription-service-openai.ts
|
|
7
|
-
var TranscriptionServiceOpenAI = class extends
|
|
7
|
+
var TranscriptionServiceOpenAI = class extends _copilotkit_runtime_v2.TranscriptionService {
|
|
8
8
|
openai;
|
|
9
9
|
model;
|
|
10
10
|
language;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transcription-service-openai.cjs","names":["TranscriptionService","OpenAI"],"sources":["../../src/transcription/transcription-service-openai.ts"],"sourcesContent":["import {\n TranscribeFileOptions,\n TranscriptionService,\n} from \"@
|
|
1
|
+
{"version":3,"file":"transcription-service-openai.cjs","names":["TranscriptionService","OpenAI"],"sources":["../../src/transcription/transcription-service-openai.ts"],"sourcesContent":["import {\n TranscribeFileOptions,\n TranscriptionService,\n} from \"@copilotkit/runtime/v2\";\nimport OpenAI from \"openai\";\n\n/**\n * Configuration options for the OpenAI transcription service.\n */\nexport interface TranscriptionServiceOpenAIConfig {\n /** OpenAI client instance. */\n openai: OpenAI;\n /** Whisper model to use. Defaults to \"whisper-1\". */\n model?: string;\n /**\n * Language of the audio in ISO-639-1 format (e.g., \"en\", \"de\", \"fr\").\n * Providing the language improves accuracy and latency.\n */\n language?: string;\n /**\n * Optional text to guide the model's style or continue a previous segment.\n * Should match the audio language.\n */\n prompt?: string;\n /**\n * Sampling temperature between 0 and 1.\n * Lower values are more deterministic, higher values more creative.\n */\n temperature?: number;\n}\n\nexport class TranscriptionServiceOpenAI extends TranscriptionService {\n private openai: OpenAI;\n private model: string;\n private language?: string;\n private prompt?: string;\n private temperature?: number;\n\n constructor(config: TranscriptionServiceOpenAIConfig) {\n super();\n this.openai = config.openai ?? new OpenAI();\n this.model = config.model ?? \"whisper-1\";\n this.language = config.language;\n this.prompt = config.prompt;\n this.temperature = config.temperature;\n }\n\n async transcribeFile(options: TranscribeFileOptions): Promise<string> {\n const response = await this.openai.audio.transcriptions.create({\n file: options.audioFile,\n model: this.model,\n ...(this.language && { language: this.language }),\n ...(this.prompt && { prompt: this.prompt }),\n ...(this.temperature !== undefined && { temperature: this.temperature }),\n });\n return response.text;\n }\n}\n"],"mappings":";;;;;;AA+BA,IAAa,6BAAb,cAAgDA,4CAAqB;CACnE,AAAQ;CACR,AAAQ;CACR,AAAQ;CACR,AAAQ;CACR,AAAQ;CAER,YAAY,QAA0C;AACpD,SAAO;AACP,OAAK,SAAS,OAAO,UAAU,IAAIC,gBAAQ;AAC3C,OAAK,QAAQ,OAAO,SAAS;AAC7B,OAAK,WAAW,OAAO;AACvB,OAAK,SAAS,OAAO;AACrB,OAAK,cAAc,OAAO;;CAG5B,MAAM,eAAe,SAAiD;AAQpE,UAPiB,MAAM,KAAK,OAAO,MAAM,eAAe,OAAO;GAC7D,MAAM,QAAQ;GACd,OAAO,KAAK;GACZ,GAAI,KAAK,YAAY,EAAE,UAAU,KAAK,UAAU;GAChD,GAAI,KAAK,UAAU,EAAE,QAAQ,KAAK,QAAQ;GAC1C,GAAI,KAAK,gBAAgB,UAAa,EAAE,aAAa,KAAK,aAAa;GACxE,CAAC,EACc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transcription-service-openai.mjs","names":[],"sources":["../../src/transcription/transcription-service-openai.ts"],"sourcesContent":["import {\n TranscribeFileOptions,\n TranscriptionService,\n} from \"@
|
|
1
|
+
{"version":3,"file":"transcription-service-openai.mjs","names":[],"sources":["../../src/transcription/transcription-service-openai.ts"],"sourcesContent":["import {\n TranscribeFileOptions,\n TranscriptionService,\n} from \"@copilotkit/runtime/v2\";\nimport OpenAI from \"openai\";\n\n/**\n * Configuration options for the OpenAI transcription service.\n */\nexport interface TranscriptionServiceOpenAIConfig {\n /** OpenAI client instance. */\n openai: OpenAI;\n /** Whisper model to use. Defaults to \"whisper-1\". */\n model?: string;\n /**\n * Language of the audio in ISO-639-1 format (e.g., \"en\", \"de\", \"fr\").\n * Providing the language improves accuracy and latency.\n */\n language?: string;\n /**\n * Optional text to guide the model's style or continue a previous segment.\n * Should match the audio language.\n */\n prompt?: string;\n /**\n * Sampling temperature between 0 and 1.\n * Lower values are more deterministic, higher values more creative.\n */\n temperature?: number;\n}\n\nexport class TranscriptionServiceOpenAI extends TranscriptionService {\n private openai: OpenAI;\n private model: string;\n private language?: string;\n private prompt?: string;\n private temperature?: number;\n\n constructor(config: TranscriptionServiceOpenAIConfig) {\n super();\n this.openai = config.openai ?? new OpenAI();\n this.model = config.model ?? \"whisper-1\";\n this.language = config.language;\n this.prompt = config.prompt;\n this.temperature = config.temperature;\n }\n\n async transcribeFile(options: TranscribeFileOptions): Promise<string> {\n const response = await this.openai.audio.transcriptions.create({\n file: options.audioFile,\n model: this.model,\n ...(this.language && { language: this.language }),\n ...(this.prompt && { prompt: this.prompt }),\n ...(this.temperature !== undefined && { temperature: this.temperature }),\n });\n return response.text;\n }\n}\n"],"mappings":";;;;AA+BA,IAAa,6BAAb,cAAgD,qBAAqB;CACnE,AAAQ;CACR,AAAQ;CACR,AAAQ;CACR,AAAQ;CACR,AAAQ;CAER,YAAY,QAA0C;AACpD,SAAO;AACP,OAAK,SAAS,OAAO,UAAU,IAAI,QAAQ;AAC3C,OAAK,QAAQ,OAAO,SAAS;AAC7B,OAAK,WAAW,OAAO;AACvB,OAAK,SAAS,OAAO;AACrB,OAAK,cAAc,OAAO;;CAG5B,MAAM,eAAe,SAAiD;AAQpE,UAPiB,MAAM,KAAK,OAAO,MAAM,eAAe,OAAO;GAC7D,MAAM,QAAQ;GACd,OAAO,KAAK;GACZ,GAAI,KAAK,YAAY,EAAE,UAAU,KAAK,UAAU;GAChD,GAAI,KAAK,UAAU,EAAE,QAAQ,KAAK,QAAQ;GAC1C,GAAI,KAAK,gBAAgB,UAAa,EAAE,aAAa,KAAK,aAAa;GACxE,CAAC,EACc"}
|
package/eslint.config.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@copilotkit/voice",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.55.0-next.8",
|
|
4
4
|
"description": "Voice services for CopilotKit (transcription, text-to-speech, etc.)",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"types": "./dist/index.d.cts",
|
|
@@ -23,12 +23,12 @@
|
|
|
23
23
|
"tsdown": "^0.20.3",
|
|
24
24
|
"typescript": "5.8.2",
|
|
25
25
|
"vitest": "^3.0.5",
|
|
26
|
-
"@
|
|
27
|
-
"@
|
|
26
|
+
"@copilotkit/eslint-config": "1.55.0-next.8",
|
|
27
|
+
"@copilotkit/typescript-config": "1.55.0-next.8"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"openai": "^5.9.0",
|
|
31
|
-
"@
|
|
31
|
+
"@copilotkit/runtime": "1.55.0-next.8"
|
|
32
32
|
},
|
|
33
33
|
"engines": {
|
|
34
34
|
"node": ">=18"
|
package/tsconfig.json
CHANGED
package/tsdown.config.ts
CHANGED
|
@@ -26,7 +26,7 @@ export default defineConfig([
|
|
|
26
26
|
outputOptions(options) {
|
|
27
27
|
options.entryFileNames = "[name].umd.js";
|
|
28
28
|
options.globals = {
|
|
29
|
-
"@
|
|
29
|
+
"@copilotkit/runtime": "CopilotKitRuntime",
|
|
30
30
|
openai: "openai",
|
|
31
31
|
};
|
|
32
32
|
return options;
|