@copilotkit/voice 1.83.0 → 2.0.0-rc.0
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/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.cts.map +1 -1
- package/dist/transcription/transcription-service-openai.d.mts +1 -1
- package/dist/transcription/transcription-service-openai.d.mts.map +1 -1
- package/dist/transcription/transcription-service-openai.mjs +1 -1
- package/dist/transcription/transcription-service-openai.mjs.map +1 -1
- package/package.json +4 -4
- package/src/transcription/transcription-service-openai.ts +2 -4
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('@copilotkit/runtime
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', '@copilotkit/runtime
|
|
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'), require('openai')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', '@copilotkit/runtime', 'openai'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.CopilotKitVoice = {}), global.CopilotKitRuntime,global.openai));
|
|
5
|
+
})(this, function(exports, _copilotkit_runtime, 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.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 {\
|
|
1
|
+
{"version":3,"file":"index.umd.js","names":["TranscriptionService","OpenAI"],"sources":["../src/transcription/transcription-service-openai.ts"],"sourcesContent":["import type { TranscribeFileOptions } from \"@copilotkit/runtime\";\nimport { TranscriptionService } from \"@copilotkit/runtime\";\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BA,IAAa,6BAAb,cAAgDA,yCAAqB;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 = require("@copilotkit/runtime");
|
|
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.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 {\
|
|
1
|
+
{"version":3,"file":"transcription-service-openai.cjs","names":["TranscriptionService","OpenAI"],"sources":["../../src/transcription/transcription-service-openai.ts"],"sourcesContent":["import type { TranscribeFileOptions } from \"@copilotkit/runtime\";\nimport { TranscriptionService } from \"@copilotkit/runtime\";\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":";;;;;;AA6BA,IAAa,6BAAb,cAAgDA,yCAAqB;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.d.cts","names":[],"sources":["../../src/transcription/transcription-service-openai.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"transcription-service-openai.d.cts","names":[],"sources":["../../src/transcription/transcription-service-openai.ts"],"mappings":";;;;;AAOA;;UAAiB,gCAAA;EAED;EAAd,MAAA,EAAQ,MAAA;EAAA;EAER,KAAA;EAKA;;;;EAAA,QAAA;EAaW;;;;EARX,MAAA;EAwBsD;;;;EAnBtD,WAAA;AAAA;AAAA,cAGW,0BAAA,SAAmC,oBAAA;EAAA,QACtC,MAAA;EAAA,QACA,KAAA;EAAA,QACA,QAAA;EAAA,QACA,MAAA;EAAA,QACA,WAAA;cAEI,MAAA,EAAQ,gCAAA;EASd,cAAA,CAAe,OAAA,EAAS,qBAAA,GAAwB,OAAA;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transcription-service-openai.d.mts","names":[],"sources":["../../src/transcription/transcription-service-openai.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"transcription-service-openai.d.mts","names":[],"sources":["../../src/transcription/transcription-service-openai.ts"],"mappings":";;;;;AAOA;;UAAiB,gCAAA;EAED;EAAd,MAAA,EAAQ,MAAA;EAAA;EAER,KAAA;EAKA;;;;EAAA,QAAA;EAaW;;;;EARX,MAAA;EAwBsD;;;;EAnBtD,WAAA;AAAA;AAAA,cAGW,0BAAA,SAAmC,oBAAA;EAAA,QACtC,MAAA;EAAA,QACA,KAAA;EAAA,QACA,QAAA;EAAA,QACA,MAAA;EAAA,QACA,WAAA;cAEI,MAAA,EAAQ,gCAAA;EASd,cAAA,CAAe,OAAA,EAAS,qBAAA,GAAwB,OAAA;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transcription-service-openai.mjs","names":[],"sources":["../../src/transcription/transcription-service-openai.ts"],"sourcesContent":["import {\
|
|
1
|
+
{"version":3,"file":"transcription-service-openai.mjs","names":[],"sources":["../../src/transcription/transcription-service-openai.ts"],"sourcesContent":["import type { TranscribeFileOptions } from \"@copilotkit/runtime\";\nimport { TranscriptionService } from \"@copilotkit/runtime\";\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":";;;;AA6BA,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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@copilotkit/voice",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-rc.0",
|
|
4
4
|
"description": "Voice services for CopilotKit (transcription, text-to-speech, etc.)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -31,11 +31,11 @@
|
|
|
31
31
|
"tsdown": "^0.20.3",
|
|
32
32
|
"typescript": "5.8.2",
|
|
33
33
|
"vitest": "^3.0.5",
|
|
34
|
-
"@copilotkit/
|
|
35
|
-
"@copilotkit/
|
|
34
|
+
"@copilotkit/runtime": "2.0.0-rc.0",
|
|
35
|
+
"@copilotkit/typescript-config": "1.55.0-next.8"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
|
-
"@copilotkit/runtime": "
|
|
38
|
+
"@copilotkit/runtime": "2.0.0-rc.0"
|
|
39
39
|
},
|
|
40
40
|
"engines": {
|
|
41
41
|
"node": ">=20"
|