@livekit/agents-plugin-livekit 0.1.1 → 0.1.2
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.cjs +3 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/turn_detector.d.cts +22 -0
- package/package.json +10 -6
- package/src/index.ts +1 -1
package/dist/index.cjs
CHANGED
|
@@ -31,12 +31,13 @@ __export(src_exports, {
|
|
|
31
31
|
turnDetector: () => turnDetector
|
|
32
32
|
});
|
|
33
33
|
module.exports = __toCommonJS(src_exports);
|
|
34
|
+
var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
|
|
35
|
+
var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
34
36
|
var import_agents = require("@livekit/agents");
|
|
35
37
|
var turnDetector = __toESM(require("./turn_detector.cjs"), 1);
|
|
36
|
-
const import_meta = {};
|
|
37
38
|
import_agents.InferenceRunner.registerRunner(
|
|
38
39
|
turnDetector.EOURunner.INFERENCE_METHOD,
|
|
39
|
-
|
|
40
|
+
new URL("./turn_detector.js", importMetaUrl).toString()
|
|
40
41
|
);
|
|
41
42
|
// Annotate the CommonJS export names for ESM import in node:
|
|
42
43
|
0 && (module.exports = {
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2024 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\nimport { InferenceRunner } from '@livekit/agents';\nimport * as turnDetector from './turn_detector.js';\n\nInferenceRunner.registerRunner(\n turnDetector.EOURunner.INFERENCE_METHOD,\n
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../../../node_modules/.pnpm/tsup@8.3.5_@microsoft+api-extractor@7.43.7_@types+node@22.5.5__postcss@8.4.38_tsx@4.19.2_typescript@5.4.5/node_modules/tsup/assets/cjs_shims.js"],"sourcesContent":["// SPDX-FileCopyrightText: 2024 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\nimport { InferenceRunner } from '@livekit/agents';\nimport * as turnDetector from './turn_detector.js';\n\nInferenceRunner.registerRunner(\n turnDetector.EOURunner.INFERENCE_METHOD,\n new URL('./turn_detector.js', import.meta.url).toString(),\n);\nexport { turnDetector };\n","// Shim globals in cjs bundle\n// There's a weird bug that esbuild will always inject importMetaUrl\n// if we export it as `const importMetaUrl = ... __filename ...`\n// But using a function will not cause this issue\n\nconst getImportMetaUrl = () =>\n typeof document === 'undefined'\n ? new URL(`file:${__filename}`).href\n : (document.currentScript && document.currentScript.src) ||\n new URL('main.js', document.baseURI).href\n\nexport const importMetaUrl = /* @__PURE__ */ getImportMetaUrl()\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACKA,IAAM,mBAAmB,MACvB,OAAO,aAAa,cAChB,IAAI,IAAI,QAAQ,UAAU,EAAE,EAAE,OAC7B,SAAS,iBAAiB,SAAS,cAAc,OAClD,IAAI,IAAI,WAAW,SAAS,OAAO,EAAE;AAEpC,IAAM,gBAAgC,iCAAiB;ADR9D,oBAAgC;AAChC,mBAA8B;AAE9B,8BAAgB;AAAA,EACd,aAAa,UAAU;AAAA,EACvB,IAAI,IAAI,sBAAsB,aAAe,EAAE,SAAS;AAC1D;","names":[]}
|
package/dist/index.d.cts
ADDED
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { InferenceRunner } from "@livekit/agents";
|
|
|
2
2
|
import * as turnDetector from "./turn_detector.js";
|
|
3
3
|
InferenceRunner.registerRunner(
|
|
4
4
|
turnDetector.EOURunner.INFERENCE_METHOD,
|
|
5
|
-
|
|
5
|
+
new URL("./turn_detector.js", import.meta.url).toString()
|
|
6
6
|
);
|
|
7
7
|
export {
|
|
8
8
|
turnDetector
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2024 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\nimport { InferenceRunner } from '@livekit/agents';\nimport * as turnDetector from './turn_detector.js';\n\nInferenceRunner.registerRunner(\n turnDetector.EOURunner.INFERENCE_METHOD,\n
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2024 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\nimport { InferenceRunner } from '@livekit/agents';\nimport * as turnDetector from './turn_detector.js';\n\nInferenceRunner.registerRunner(\n turnDetector.EOURunner.INFERENCE_METHOD,\n new URL('./turn_detector.js', import.meta.url).toString(),\n);\nexport { turnDetector };\n"],"mappings":"AAGA,SAAS,uBAAuB;AAChC,YAAY,kBAAkB;AAE9B,gBAAgB;AAAA,EACd,aAAa,UAAU;AAAA,EACvB,IAAI,IAAI,sBAAsB,YAAY,GAAG,EAAE,SAAS;AAC1D;","names":[]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { InferenceRunner, llm } from '@livekit/agents';
|
|
2
|
+
type RawChatContext = {
|
|
3
|
+
role: string;
|
|
4
|
+
content: string;
|
|
5
|
+
}[];
|
|
6
|
+
export declare class EOURunner extends InferenceRunner {
|
|
7
|
+
#private;
|
|
8
|
+
static INFERENCE_METHOD: string;
|
|
9
|
+
constructor();
|
|
10
|
+
initialize(): Promise<void>;
|
|
11
|
+
run(data: RawChatContext): Promise<number | undefined>;
|
|
12
|
+
close(): Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
export declare class EOUModel {
|
|
15
|
+
#private;
|
|
16
|
+
readonly unlikelyThreshold: number;
|
|
17
|
+
constructor(unlikelyThreshold?: number);
|
|
18
|
+
supportsLanguage(language?: string): boolean;
|
|
19
|
+
predictEndOfTurn(chatCtx: llm.ChatContext): Promise<number>;
|
|
20
|
+
}
|
|
21
|
+
export default EOURunner;
|
|
22
|
+
//# sourceMappingURL=turn_detector.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@livekit/agents-plugin-livekit",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Additional utilities for LiveKit Node Agents",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"require": "dist/index.cjs",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"exports": {
|
|
9
|
-
"
|
|
9
|
+
"import": {
|
|
10
10
|
"types": "./dist/index.d.ts",
|
|
11
|
-
"
|
|
12
|
-
|
|
11
|
+
"default": "./dist/index.js"
|
|
12
|
+
},
|
|
13
|
+
"require": {
|
|
14
|
+
"types": "./dist/index.d.cts",
|
|
15
|
+
"default": "./dist/index.cjs"
|
|
13
16
|
}
|
|
14
17
|
},
|
|
15
18
|
"author": "LiveKit",
|
|
@@ -29,14 +32,15 @@
|
|
|
29
32
|
"typescript": "^5.0.0"
|
|
30
33
|
},
|
|
31
34
|
"peerDependencies": {
|
|
32
|
-
"@livekit/agents": "^0.7.
|
|
35
|
+
"@livekit/agents": "^0.7.7x"
|
|
33
36
|
},
|
|
34
37
|
"dependencies": {
|
|
35
38
|
"@huggingface/transformers": "^3.2.1",
|
|
36
39
|
"onnxruntime-node": "^1.19.2"
|
|
37
40
|
},
|
|
38
41
|
"scripts": {
|
|
39
|
-
"build": "tsup --onSuccess \"
|
|
42
|
+
"build": "tsup --onSuccess \"pnpm build:types\" && cp src/turn_detector.onnx dist/",
|
|
43
|
+
"build:types": "tsc --declaration --emitDeclarationOnly && node ../../scripts/copyDeclarationOutput.js",
|
|
40
44
|
"clean": "rm -rf dist",
|
|
41
45
|
"clean:build": "pnpm clean && pnpm build",
|
|
42
46
|
"lint": "eslint -f unix \"src/**/*.{ts,js}\"",
|
package/src/index.ts
CHANGED
|
@@ -6,6 +6,6 @@ import * as turnDetector from './turn_detector.js';
|
|
|
6
6
|
|
|
7
7
|
InferenceRunner.registerRunner(
|
|
8
8
|
turnDetector.EOURunner.INFERENCE_METHOD,
|
|
9
|
-
|
|
9
|
+
new URL('./turn_detector.js', import.meta.url).toString(),
|
|
10
10
|
);
|
|
11
11
|
export { turnDetector };
|