@voquill/voice-ai 0.2.5 → 0.3.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/LICENCE +1 -1
- package/dist/elevenlabs.utils.d.ts.map +1 -1
- package/dist/elevenlabs.utils.js +10 -9
- package/dist/groq.utils.d.ts.map +1 -1
- package/dist/groq.utils.js +19 -8
- package/package.json +4 -4
package/LICENCE
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"elevenlabs.utils.d.ts","sourceRoot":"","sources":["../src/elevenlabs.utils.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,6BAA6B,GAAG;IAC1C,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,yBAAyB,GAAU,aAE7C,6BAA6B,KAAG,OAAO,CAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"elevenlabs.utils.d.ts","sourceRoot":"","sources":["../src/elevenlabs.utils.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,6BAA6B,GAAG;IAC1C,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,yBAAyB,GAAU,aAE7C,6BAA6B,KAAG,OAAO,CAAC,OAAO,CAcjD,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,WAAW,GAAG,MAAM,CAAC;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,+BAA+B,GAAG;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,yBAAyB,GAAU,kCAK7C,2BAA2B,KAAG,OAAO,CAAC,+BAA+B,CA4CvE,CAAC;AAEF,eAAO,MAAM,2BAA2B,GACtC,cAAc,YAAY,GAAG,MAAM,EAAE,KACpC,MAmBF,CAAC"}
|
package/dist/elevenlabs.utils.js
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { retry, countWords } from "@voquill/utilities";
|
|
2
2
|
export const elevenlabsTestIntegration = async ({ apiKey, }) => {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
const response = await fetch("https://api.elevenlabs.io/v1/user", {
|
|
4
|
+
method: "GET",
|
|
5
|
+
headers: { "xi-api-key": apiKey },
|
|
6
|
+
});
|
|
7
|
+
if (!response.ok) {
|
|
8
|
+
const detail = await response.text().catch(() => "");
|
|
9
|
+
throw new Error(detail
|
|
10
|
+
? `ElevenLabs responded ${response.status}: ${detail}`
|
|
11
|
+
: `ElevenLabs responded with status ${response.status}`);
|
|
12
12
|
}
|
|
13
|
+
return true;
|
|
13
14
|
};
|
|
14
15
|
export const elevenlabsTranscribeAudio = async ({ apiKey, blob, ext, language, }) => {
|
|
15
16
|
return retry({
|
package/dist/groq.utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"groq.utils.d.ts","sourceRoot":"","sources":["../src/groq.utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,YAAY,EACZ,cAAc,EACf,MAAM,gBAAgB,CAAC;AAUxB,eAAO,MAAM,oBAAoB,yIAKvB,CAAC;AACX,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"groq.utils.d.ts","sourceRoot":"","sources":["../src/groq.utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,YAAY,EACZ,cAAc,EACf,MAAM,gBAAgB,CAAC;AAUxB,eAAO,MAAM,oBAAoB,yIAKvB,CAAC;AACX,MAAM,MAAM,iBAAiB,GAAG,C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C3C,CAAC;AAMF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,YAAY,CAAC;CACrB,CAAC;AAEF,wBAAuB,cAAc,CAAC,EACpC,MAAM,EACN,KAAK,EACL,KAAK,GACN,EAAE,kBAAkB,GAAG,cAAc,CAAC,cAAc,CAAC,CAOrD"}
|
package/dist/groq.utils.js
CHANGED
|
@@ -8,6 +8,15 @@ export const GENERATE_TEXT_MODELS = [
|
|
|
8
8
|
"openai/gpt-oss-20b",
|
|
9
9
|
"openai/gpt-oss-120b",
|
|
10
10
|
];
|
|
11
|
+
// Models that support `response_format: { type: "json_schema" }`.
|
|
12
|
+
// See https://console.groq.com/docs/structured-outputs
|
|
13
|
+
const JSON_SCHEMA_SUPPORTED_MODELS = new Set([
|
|
14
|
+
"moonshotai/kimi-k2-instruct-0905",
|
|
15
|
+
"openai/gpt-oss-20b",
|
|
16
|
+
"openai/gpt-oss-120b",
|
|
17
|
+
"meta-llama/llama-4-scout-17b-16e-instruct",
|
|
18
|
+
"meta-llama/llama-4-maverick-17b-128e-instruct",
|
|
19
|
+
]);
|
|
11
20
|
export const TRANSCRIPTION_MODELS = ["whisper-large-v3-turbo"];
|
|
12
21
|
const contentToString = (content) => {
|
|
13
22
|
if (!content) {
|
|
@@ -74,14 +83,16 @@ export const groqGenerateTextResponse = async ({ apiKey, model = "meta-llama/lla
|
|
|
74
83
|
model,
|
|
75
84
|
max_completion_tokens: 8192,
|
|
76
85
|
response_format: jsonResponse
|
|
77
|
-
?
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
86
|
+
? JSON_SCHEMA_SUPPORTED_MODELS.has(model)
|
|
87
|
+
? {
|
|
88
|
+
type: "json_schema",
|
|
89
|
+
json_schema: {
|
|
90
|
+
name: jsonResponse.name,
|
|
91
|
+
description: jsonResponse.description,
|
|
92
|
+
schema: jsonResponse.schema,
|
|
93
|
+
},
|
|
94
|
+
}
|
|
95
|
+
: { type: "json_object" }
|
|
85
96
|
: undefined,
|
|
86
97
|
});
|
|
87
98
|
console.log("groq llm usage:", response.usage);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voquill/voice-ai",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Shared Groq voice transcription helpers",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -22,12 +22,12 @@
|
|
|
22
22
|
"wavefile": "^11.0.0",
|
|
23
23
|
"zod": "^3.25.76",
|
|
24
24
|
"zod-to-json-schema": "^3.25.2",
|
|
25
|
-
"@voquill/utilities": "0.
|
|
26
|
-
"@voquill/types": "0.
|
|
25
|
+
"@voquill/utilities": "0.3.0",
|
|
26
|
+
"@voquill/types": "0.3.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"typescript": "5.9.2",
|
|
30
|
-
"@voquill/typescript-config": "0.
|
|
30
|
+
"@voquill/typescript-config": "0.3.0"
|
|
31
31
|
},
|
|
32
32
|
"publishConfig": {
|
|
33
33
|
"access": "public"
|