@copilotkit/voice 1.54.1 → 1.55.0-next.7
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 +51 -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,15 @@
|
|
|
1
1
|
# @copilotkit/voice
|
|
2
2
|
|
|
3
|
-
## 1.
|
|
3
|
+
## 1.55.0-next.7
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 1ceb963: refactor: consolidate V1/V2 packages into flat @copilotkit/\* structure
|
|
4
8
|
|
|
5
9
|
### Patch Changes
|
|
6
10
|
|
|
7
|
-
-
|
|
11
|
+
- Updated dependencies [1ceb963]
|
|
12
|
+
- @copilotkit/runtime@1.55.0-next.7
|
|
8
13
|
|
|
9
14
|
## 1.54.1-next.6
|
|
10
15
|
|
|
@@ -102,209 +107,209 @@
|
|
|
102
107
|
|
|
103
108
|
### Patch Changes
|
|
104
109
|
|
|
105
|
-
- @
|
|
110
|
+
- @copilotkit/runtime@1.53.1-next.2
|
|
106
111
|
|
|
107
112
|
## 1.53.1-next.1
|
|
108
113
|
|
|
109
114
|
### Patch Changes
|
|
110
115
|
|
|
111
|
-
- @
|
|
116
|
+
- @copilotkit/runtime@1.53.1-next.1
|
|
112
117
|
|
|
113
118
|
## 1.53.1-next.0
|
|
114
119
|
|
|
115
120
|
### Patch Changes
|
|
116
121
|
|
|
117
|
-
- @
|
|
122
|
+
- @copilotkit/runtime@1.53.1-next.0
|
|
118
123
|
|
|
119
124
|
## 1.53.0
|
|
120
125
|
|
|
121
126
|
### Patch Changes
|
|
122
127
|
|
|
123
128
|
- Updated dependencies [1510f64]
|
|
124
|
-
- @
|
|
129
|
+
- @copilotkit/runtime@1.53.0
|
|
125
130
|
|
|
126
131
|
## 1.53.0-next.6
|
|
127
132
|
|
|
128
133
|
### Patch Changes
|
|
129
134
|
|
|
130
|
-
- @
|
|
135
|
+
- @copilotkit/runtime@1.53.0-next.6
|
|
131
136
|
|
|
132
137
|
## 1.53.0-next.5
|
|
133
138
|
|
|
134
139
|
### Patch Changes
|
|
135
140
|
|
|
136
|
-
- @
|
|
141
|
+
- @copilotkit/runtime@1.53.0-next.5
|
|
137
142
|
|
|
138
143
|
## 1.52.2-next.4
|
|
139
144
|
|
|
140
145
|
### Patch Changes
|
|
141
146
|
|
|
142
|
-
- @
|
|
147
|
+
- @copilotkit/runtime@1.52.2-next.4
|
|
143
148
|
|
|
144
149
|
## 1.52.2-next.3
|
|
145
150
|
|
|
146
151
|
### Patch Changes
|
|
147
152
|
|
|
148
153
|
- Updated dependencies [1510f64]
|
|
149
|
-
- @
|
|
154
|
+
- @copilotkit/runtime@1.52.2-next.3
|
|
150
155
|
|
|
151
156
|
## 1.52.2-next.2
|
|
152
157
|
|
|
153
158
|
### Patch Changes
|
|
154
159
|
|
|
155
|
-
- @
|
|
160
|
+
- @copilotkit/runtime@1.52.2-next.2
|
|
156
161
|
|
|
157
162
|
## 1.52.2-next.1
|
|
158
163
|
|
|
159
164
|
### Patch Changes
|
|
160
165
|
|
|
161
|
-
- @
|
|
166
|
+
- @copilotkit/runtime@1.52.2-next.1
|
|
162
167
|
|
|
163
168
|
## 1.52.2-next.0
|
|
164
169
|
|
|
165
170
|
### Patch Changes
|
|
166
171
|
|
|
167
|
-
- @
|
|
172
|
+
- @copilotkit/runtime@1.52.2-next.0
|
|
168
173
|
|
|
169
174
|
## 1.52.1
|
|
170
175
|
|
|
171
176
|
### Patch Changes
|
|
172
177
|
|
|
173
|
-
- @
|
|
178
|
+
- @copilotkit/runtime@1.52.1
|
|
174
179
|
|
|
175
180
|
## 1.52.1-next.1
|
|
176
181
|
|
|
177
182
|
### Patch Changes
|
|
178
183
|
|
|
179
|
-
- @
|
|
184
|
+
- @copilotkit/runtime@1.52.1-next.1
|
|
180
185
|
|
|
181
186
|
## 1.52.1-next.0
|
|
182
187
|
|
|
183
188
|
### Patch Changes
|
|
184
189
|
|
|
185
|
-
- @
|
|
190
|
+
- @copilotkit/runtime@1.52.1-next.0
|
|
186
191
|
|
|
187
192
|
## 1.52.0
|
|
188
193
|
|
|
189
194
|
### Patch Changes
|
|
190
195
|
|
|
191
196
|
- Updated dependencies [ef0f539]
|
|
192
|
-
- @
|
|
197
|
+
- @copilotkit/runtime@1.52.0
|
|
193
198
|
|
|
194
199
|
## 1.52.0-next.8
|
|
195
200
|
|
|
196
201
|
### Patch Changes
|
|
197
202
|
|
|
198
|
-
- @
|
|
203
|
+
- @copilotkit/runtime@1.52.0-next.8
|
|
199
204
|
|
|
200
205
|
## 1.52.0-next.7
|
|
201
206
|
|
|
202
207
|
### Patch Changes
|
|
203
208
|
|
|
204
|
-
- @
|
|
209
|
+
- @copilotkit/runtime@1.52.0-next.7
|
|
205
210
|
|
|
206
211
|
## 1.52.0-next.6
|
|
207
212
|
|
|
208
213
|
### Patch Changes
|
|
209
214
|
|
|
210
|
-
- @
|
|
215
|
+
- @copilotkit/runtime@1.52.0-next.6
|
|
211
216
|
|
|
212
217
|
## 1.52.0-next.5
|
|
213
218
|
|
|
214
219
|
### Patch Changes
|
|
215
220
|
|
|
216
|
-
- @
|
|
221
|
+
- @copilotkit/runtime@1.52.0-next.5
|
|
217
222
|
|
|
218
223
|
## 1.51.5-next.4
|
|
219
224
|
|
|
220
225
|
### Patch Changes
|
|
221
226
|
|
|
222
|
-
- @
|
|
227
|
+
- @copilotkit/runtime@1.51.5-next.4
|
|
223
228
|
|
|
224
229
|
## 1.51.5-next.3
|
|
225
230
|
|
|
226
231
|
### Patch Changes
|
|
227
232
|
|
|
228
|
-
- @
|
|
233
|
+
- @copilotkit/runtime@1.51.5-next.3
|
|
229
234
|
|
|
230
235
|
## 1.51.5-next.2
|
|
231
236
|
|
|
232
237
|
### Patch Changes
|
|
233
238
|
|
|
234
|
-
- @
|
|
239
|
+
- @copilotkit/runtime@1.51.5-next.2
|
|
235
240
|
|
|
236
241
|
## 1.51.5-next.1
|
|
237
242
|
|
|
238
243
|
### Patch Changes
|
|
239
244
|
|
|
240
|
-
- @
|
|
245
|
+
- @copilotkit/runtime@1.51.5-next.1
|
|
241
246
|
|
|
242
247
|
## 1.51.5-next.0
|
|
243
248
|
|
|
244
249
|
### Patch Changes
|
|
245
250
|
|
|
246
251
|
- Updated dependencies [ef0f539]
|
|
247
|
-
- @
|
|
252
|
+
- @copilotkit/runtime@1.51.5-next.0
|
|
248
253
|
|
|
249
254
|
## 1.51.4
|
|
250
255
|
|
|
251
256
|
### Patch Changes
|
|
252
257
|
|
|
253
|
-
- @
|
|
258
|
+
- @copilotkit/runtime@1.51.4
|
|
254
259
|
|
|
255
260
|
## 1.51.4-next.8
|
|
256
261
|
|
|
257
262
|
### Patch Changes
|
|
258
263
|
|
|
259
|
-
- @
|
|
264
|
+
- @copilotkit/runtime@1.51.4-next.8
|
|
260
265
|
|
|
261
266
|
## 1.51.4-next.7
|
|
262
267
|
|
|
263
268
|
### Patch Changes
|
|
264
269
|
|
|
265
|
-
- @
|
|
270
|
+
- @copilotkit/runtime@1.51.4-next.7
|
|
266
271
|
|
|
267
272
|
## 1.51.4-next.6
|
|
268
273
|
|
|
269
274
|
### Patch Changes
|
|
270
275
|
|
|
271
|
-
- @
|
|
276
|
+
- @copilotkit/runtime@1.51.4-next.6
|
|
272
277
|
|
|
273
278
|
## 1.51.4-next.5
|
|
274
279
|
|
|
275
280
|
### Patch Changes
|
|
276
281
|
|
|
277
|
-
- @
|
|
282
|
+
- @copilotkit/runtime@1.51.4-next.5
|
|
278
283
|
|
|
279
284
|
## 1.51.4-next.4
|
|
280
285
|
|
|
281
286
|
### Patch Changes
|
|
282
287
|
|
|
283
|
-
- @
|
|
288
|
+
- @copilotkit/runtime@1.51.4-next.4
|
|
284
289
|
|
|
285
290
|
## 1.51.4-next.3
|
|
286
291
|
|
|
287
292
|
### Patch Changes
|
|
288
293
|
|
|
289
|
-
- @
|
|
294
|
+
- @copilotkit/runtime@1.51.4-next.3
|
|
290
295
|
|
|
291
296
|
## 1.51.4-next.2
|
|
292
297
|
|
|
293
298
|
### Patch Changes
|
|
294
299
|
|
|
295
|
-
- @
|
|
300
|
+
- @copilotkit/runtime@1.51.4-next.2
|
|
296
301
|
|
|
297
302
|
## 1.51.4-next.1
|
|
298
303
|
|
|
299
304
|
### Patch Changes
|
|
300
305
|
|
|
301
|
-
- @
|
|
306
|
+
- @copilotkit/runtime@1.51.4-next.1
|
|
302
307
|
|
|
303
308
|
## 1.51.4-next.0
|
|
304
309
|
|
|
305
310
|
### Patch Changes
|
|
306
311
|
|
|
307
|
-
- @
|
|
312
|
+
- @copilotkit/runtime@1.51.4-next.0
|
|
308
313
|
|
|
309
314
|
## 1.51.3
|
|
310
315
|
|
|
@@ -312,7 +317,7 @@
|
|
|
312
317
|
|
|
313
318
|
- d36fc1e: Add UMD export
|
|
314
319
|
- Updated dependencies [d36fc1e]
|
|
315
|
-
- @
|
|
320
|
+
- @copilotkit/runtime@1.51.3
|
|
316
321
|
|
|
317
322
|
## 1.51.3-next.8
|
|
318
323
|
|
|
@@ -320,52 +325,52 @@
|
|
|
320
325
|
|
|
321
326
|
- d36fc1e: Add UMD export
|
|
322
327
|
- Updated dependencies [d36fc1e]
|
|
323
|
-
- @
|
|
328
|
+
- @copilotkit/runtime@1.51.3-next.8
|
|
324
329
|
|
|
325
330
|
## 1.51.3-next.7
|
|
326
331
|
|
|
327
332
|
### Patch Changes
|
|
328
333
|
|
|
329
|
-
- @
|
|
334
|
+
- @copilotkit/runtime@1.51.3-next.7
|
|
330
335
|
|
|
331
336
|
## 1.51.3-next.6
|
|
332
337
|
|
|
333
338
|
### Patch Changes
|
|
334
339
|
|
|
335
|
-
- @
|
|
340
|
+
- @copilotkit/runtime@1.51.3-next.6
|
|
336
341
|
|
|
337
342
|
## 1.51.3-next.5
|
|
338
343
|
|
|
339
344
|
### Patch Changes
|
|
340
345
|
|
|
341
|
-
- @
|
|
346
|
+
- @copilotkit/runtime@1.51.3-next.5
|
|
342
347
|
|
|
343
348
|
## 1.51.3-next.4
|
|
344
349
|
|
|
345
350
|
### Patch Changes
|
|
346
351
|
|
|
347
|
-
- @
|
|
352
|
+
- @copilotkit/runtime@1.51.3-next.4
|
|
348
353
|
|
|
349
354
|
## 1.51.3-next.3
|
|
350
355
|
|
|
351
356
|
### Patch Changes
|
|
352
357
|
|
|
353
|
-
- @
|
|
358
|
+
- @copilotkit/runtime@1.51.3-next.3
|
|
354
359
|
|
|
355
360
|
## 1.51.3-next.2
|
|
356
361
|
|
|
357
362
|
### Patch Changes
|
|
358
363
|
|
|
359
|
-
- @
|
|
364
|
+
- @copilotkit/runtime@1.51.3-next.2
|
|
360
365
|
|
|
361
366
|
## 1.51.3-next.1
|
|
362
367
|
|
|
363
368
|
### Patch Changes
|
|
364
369
|
|
|
365
|
-
- @
|
|
370
|
+
- @copilotkit/runtime@1.51.3-next.1
|
|
366
371
|
|
|
367
372
|
## 1.51.3-next.0
|
|
368
373
|
|
|
369
374
|
### Patch Changes
|
|
370
375
|
|
|
371
|
-
- @
|
|
376
|
+
- @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.7",
|
|
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.7",
|
|
27
|
+
"@copilotkit/typescript-config": "1.55.0-next.7"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"openai": "^5.9.0",
|
|
31
|
-
"@
|
|
31
|
+
"@copilotkit/runtime": "1.55.0-next.7"
|
|
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;
|