mulmocast 2.6.8 → 2.6.9
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.
|
@@ -2,6 +2,10 @@ import { GraphAILogger } from "graphai";
|
|
|
2
2
|
import * as textToSpeech from "@google-cloud/text-to-speech";
|
|
3
3
|
import { agentGenerationError, audioAction, audioFileTarget } from "../utils/error_cause.js";
|
|
4
4
|
const client = new textToSpeech.TextToSpeechClient();
|
|
5
|
+
// Hard cap so a hung Google TTS RPC can't pin a beat indefinitely.
|
|
6
|
+
// Most synthesizeSpeech calls return in seconds; 60s leaves headroom
|
|
7
|
+
// for long inputs and slow regions while still failing loud.
|
|
8
|
+
const SYNTHESIZE_TIMEOUT_MS = 60_000;
|
|
5
9
|
const getPrompt = (text, instructions) => {
|
|
6
10
|
if (instructions) {
|
|
7
11
|
return `### DIRECTOR'S NOTES\n${instructions}\n\n#### TRANSCRIPT\n${text}`;
|
|
@@ -37,7 +41,7 @@ export const ttsGoogleAgent = async ({ namedInputs, params }) => {
|
|
|
37
41
|
};
|
|
38
42
|
try {
|
|
39
43
|
// Call the Text-to-Speech API
|
|
40
|
-
const [response] = await client.synthesizeSpeech(request);
|
|
44
|
+
const [response] = await client.synthesizeSpeech(request, { timeout: SYNTHESIZE_TIMEOUT_MS });
|
|
41
45
|
return { buffer: response.audioContent };
|
|
42
46
|
}
|
|
43
47
|
catch (e) {
|
|
@@ -47,11 +51,23 @@ export const ttsGoogleAgent = async ({ namedInputs, params }) => {
|
|
|
47
51
|
};
|
|
48
52
|
}
|
|
49
53
|
GraphAILogger.info(e);
|
|
50
|
-
|
|
54
|
+
// gRPC errors from @google-cloud/text-to-speech are ServiceError
|
|
55
|
+
// (extends Error with a `details` string). Surface that human-readable
|
|
56
|
+
// text so callers don't see only "TTS Google Error".
|
|
57
|
+
throw new Error(`TTS Google Error: ${grpcErrorDetail(e)}`, {
|
|
51
58
|
cause: agentGenerationError("ttsGoogleAgent", audioAction, audioFileTarget),
|
|
52
59
|
});
|
|
53
60
|
}
|
|
54
61
|
};
|
|
62
|
+
const grpcErrorDetail = (e) => {
|
|
63
|
+
if (e instanceof Error) {
|
|
64
|
+
const details = e.details;
|
|
65
|
+
if (typeof details === "string" && details)
|
|
66
|
+
return details;
|
|
67
|
+
return e.message;
|
|
68
|
+
}
|
|
69
|
+
return String(e);
|
|
70
|
+
};
|
|
55
71
|
const ttsGoogleAgentInfo = {
|
|
56
72
|
name: "ttsGoogleAgent",
|
|
57
73
|
agent: ttsGoogleAgent,
|
|
@@ -44,7 +44,7 @@ export const provider2TTSAgent = {
|
|
|
44
44
|
models: ["mock-model"],
|
|
45
45
|
},
|
|
46
46
|
};
|
|
47
|
-
export const gptImages = ["gpt-image-1.5", "gpt-image-1", "gpt-image-1-mini"];
|
|
47
|
+
export const gptImages = ["gpt-image-2", "gpt-image-1.5", "gpt-image-1", "gpt-image-1-mini"];
|
|
48
48
|
export const provider2ImageAgent = {
|
|
49
49
|
openai: {
|
|
50
50
|
agentName: "imageOpenaiAgent",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mulmocast",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.9",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.node.js",
|
|
@@ -109,11 +109,11 @@
|
|
|
109
109
|
"dotenv": "^17.4.2",
|
|
110
110
|
"fluent-ffmpeg": "^2.1.3",
|
|
111
111
|
"graphai": "^2.0.16",
|
|
112
|
-
"jsdom": "^29.0
|
|
112
|
+
"jsdom": "^29.1.0",
|
|
113
113
|
"marked": "^18.0.2",
|
|
114
114
|
"mulmocast-vision": "^1.0.9",
|
|
115
|
-
"ora": "^9.
|
|
116
|
-
"puppeteer": "^24.
|
|
115
|
+
"ora": "^9.4.0",
|
|
116
|
+
"puppeteer": "^24.42.0",
|
|
117
117
|
"replicate": "^1.4.0",
|
|
118
118
|
"yaml": "^2.8.3",
|
|
119
119
|
"yargs": "^18.0.0",
|
|
@@ -136,7 +136,7 @@
|
|
|
136
136
|
"prettier": "^3.8.3",
|
|
137
137
|
"tsx": "^4.21.0",
|
|
138
138
|
"typescript": "6.0.3",
|
|
139
|
-
"typescript-eslint": "^8.
|
|
139
|
+
"typescript-eslint": "^8.59.1"
|
|
140
140
|
},
|
|
141
141
|
"engines": {
|
|
142
142
|
"node": ">=22.0.0"
|
package/scripts/test/README.md
CHANGED
|
@@ -106,7 +106,7 @@ Language setting tests
|
|
|
106
106
|
Provider-specific feature tests
|
|
107
107
|
|
|
108
108
|
- [**test_hello_google.json**](./test_hello_google.json) - Google TTS専用テスト / Google TTS specific test
|
|
109
|
-
- [**
|
|
109
|
+
- [**test_gpt_image.json**](./test_gpt_image.json) - GPT image model test
|
|
110
110
|
- [**mulmo_story.json**](./mulmo_story.json) - ストーリー形式テスト / Story format test
|
|
111
111
|
- [**nano_banana.json**](./nano_banana.json) - カスタムサンプル / Custom sample
|
|
112
112
|
|