whspr 1.0.8 → 1.0.10
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/postprocess.js +7 -5
- package/dist/recorder.js +1 -1
- package/package.json +4 -4
package/dist/postprocess.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { generateText, Output } from "ai";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { withRetry } from "./utils/retry.js";
|
|
4
4
|
import { getProvider } from "./utils/providers.js";
|
|
@@ -6,12 +6,14 @@ const outputSchema = z.object({
|
|
|
6
6
|
fixed_transcription: z.string(),
|
|
7
7
|
});
|
|
8
8
|
export async function postprocess(rawTranscription, customPrompt, options) {
|
|
9
|
-
const { provider, modelName, systemPrompt, customPromptPrefix, transcriptionPrefix } = options;
|
|
9
|
+
const { provider, modelName, systemPrompt, customPromptPrefix, transcriptionPrefix, } = options;
|
|
10
10
|
const providerInstance = getProvider(provider);
|
|
11
11
|
const result = await withRetry(async () => {
|
|
12
|
-
const response = await
|
|
12
|
+
const response = await generateText({
|
|
13
13
|
model: providerInstance(modelName),
|
|
14
|
-
|
|
14
|
+
output: Output.object({
|
|
15
|
+
schema: outputSchema,
|
|
16
|
+
}),
|
|
15
17
|
messages: [
|
|
16
18
|
{
|
|
17
19
|
role: "system",
|
|
@@ -31,7 +33,7 @@ export async function postprocess(rawTranscription, customPrompt, options) {
|
|
|
31
33
|
},
|
|
32
34
|
],
|
|
33
35
|
});
|
|
34
|
-
return response.
|
|
36
|
+
return response.output;
|
|
35
37
|
}, 3, "postprocess");
|
|
36
38
|
return result.fixed_transcription;
|
|
37
39
|
}
|
package/dist/recorder.js
CHANGED
|
@@ -32,7 +32,7 @@ export async function record(verbose = false) {
|
|
|
32
32
|
return new Promise((resolve, reject) => {
|
|
33
33
|
// Initialize waveform buffer
|
|
34
34
|
let waveWidth = getWaveWidth();
|
|
35
|
-
const waveBuffer = new Array(waveWidth).fill(
|
|
35
|
+
const waveBuffer = new Array(waveWidth).fill(WAVE_CHARS[0]);
|
|
36
36
|
let currentDb = -60;
|
|
37
37
|
let cancelled = false;
|
|
38
38
|
// Spawn FFmpeg with ebur128 filter to get volume levels
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "whspr",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
4
4
|
"description": "CLI tool for audio transcription with Groq Whisper API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"prepublishOnly": "npm run build"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@ai-sdk/anthropic": "^
|
|
33
|
-
"@ai-sdk/groq": "^
|
|
34
|
-
"ai": "^
|
|
32
|
+
"@ai-sdk/anthropic": "^3.0.15",
|
|
33
|
+
"@ai-sdk/groq": "^3.0.11",
|
|
34
|
+
"ai": "^6.0.41",
|
|
35
35
|
"chalk": "^5.x",
|
|
36
36
|
"clipboardy": "^4.x",
|
|
37
37
|
"groq-sdk": "^0.x",
|