mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
fix: update tool installation checks and refactor stdout JSON parsing in AI modules
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { readFile, writeFile } from "node:fs/promises";
|
||||
import { join } from "node:path";
|
||||
import { type ProgressCallback, runPythonWithProgress } from "./bridge.js";
|
||||
import { type ProgressCallback, parseStdoutJson, runPythonWithProgress } from "./bridge.js";
|
||||
|
||||
export interface NoiseRemovalOptions {
|
||||
tier?: string;
|
||||
@@ -35,7 +35,7 @@ export async function noiseRemoval(
|
||||
{ onProgress },
|
||||
);
|
||||
|
||||
const result = JSON.parse(stdout);
|
||||
const result = parseStdoutJson(stdout);
|
||||
if (!result.success) {
|
||||
throw new Error(result.error || "Noise removal failed");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user