@openclaw/inworld-speech 2026.9.8 → 2026.10.1-beta.1
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/speech-provider.js +32 -44
- package/package.json +4 -4
package/dist/speech-provider.js
CHANGED
|
@@ -33,64 +33,52 @@ function readInworldProviderConfig(config) {
|
|
|
33
33
|
function resolveInworldApiKey(primary, fallback) {
|
|
34
34
|
return resolveSpeechProviderApiKey(primary, fallback, process.env.INWORLD_API_KEY);
|
|
35
35
|
}
|
|
36
|
-
function readInworldOverrides(overrides) {
|
|
37
|
-
return {
|
|
38
|
-
voiceId: normalizeOptionalString(overrides?.voiceId ?? overrides?.voice),
|
|
39
|
-
modelId: normalizeOptionalString(overrides?.modelId ?? overrides?.model),
|
|
40
|
-
temperature: normalizeInworldTemperature(overrides?.temperature)
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
36
|
async function synthesizeInworld(req) {
|
|
44
37
|
const config = readInworldProviderConfig(req.providerConfig);
|
|
45
|
-
const overrides =
|
|
38
|
+
const overrides = req.providerOverrides;
|
|
46
39
|
const apiKey = resolveInworldApiKey(config.apiKey);
|
|
47
40
|
if (!apiKey) throw new Error("Inworld API key missing");
|
|
48
41
|
return inworldTTS({
|
|
49
42
|
text: req.text,
|
|
50
43
|
apiKey,
|
|
51
44
|
baseUrl: config.baseUrl,
|
|
52
|
-
voiceId: overrides
|
|
53
|
-
modelId: overrides
|
|
45
|
+
voiceId: normalizeOptionalString(overrides?.voiceId ?? overrides?.voice) ?? config.voiceId,
|
|
46
|
+
modelId: normalizeOptionalString(overrides?.modelId ?? overrides?.model) ?? config.modelId,
|
|
54
47
|
audioEncoding: req.audioEncoding,
|
|
55
48
|
...req.sampleRateHertz === void 0 ? {} : { sampleRateHertz: req.sampleRateHertz },
|
|
56
|
-
temperature: overrides
|
|
49
|
+
temperature: normalizeInworldTemperature(overrides?.temperature) ?? config.temperature,
|
|
57
50
|
timeoutMs: req.timeoutMs
|
|
58
51
|
});
|
|
59
52
|
}
|
|
60
53
|
function parseDirectiveToken(ctx) {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
},
|
|
90
|
-
warning: (value) => `invalid Inworld temperature "${value}"`
|
|
91
|
-
});
|
|
92
|
-
default: return { handled: false };
|
|
93
|
-
}
|
|
54
|
+
if (ctx.key === "temperature") return parseSpeechDirectiveNumberOverride({
|
|
55
|
+
ctx,
|
|
56
|
+
overrideKey: "temperature",
|
|
57
|
+
range: {
|
|
58
|
+
min: 0,
|
|
59
|
+
minExclusive: true,
|
|
60
|
+
max: 2
|
|
61
|
+
},
|
|
62
|
+
warning: (value) => `invalid Inworld temperature "${value}"`
|
|
63
|
+
});
|
|
64
|
+
const key = [
|
|
65
|
+
"voice",
|
|
66
|
+
"voiceid",
|
|
67
|
+
"voice_id",
|
|
68
|
+
"inworld_voice",
|
|
69
|
+
"inworldvoice"
|
|
70
|
+
].includes(ctx.key) ? "voiceId" : [
|
|
71
|
+
"model",
|
|
72
|
+
"modelid",
|
|
73
|
+
"model_id",
|
|
74
|
+
"inworld_model",
|
|
75
|
+
"inworldmodel"
|
|
76
|
+
].includes(ctx.key) ? "modelId" : void 0;
|
|
77
|
+
if (!key) return { handled: false };
|
|
78
|
+
return (key === "voiceId" ? ctx.policy.allowVoice : ctx.policy.allowModelId) ? {
|
|
79
|
+
handled: true,
|
|
80
|
+
overrides: { [key]: ctx.value }
|
|
81
|
+
} : { handled: true };
|
|
94
82
|
}
|
|
95
83
|
function buildInworldSpeechProvider() {
|
|
96
84
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/inworld-speech",
|
|
3
|
-
"version": "2026.
|
|
3
|
+
"version": "2026.10.1-beta.1",
|
|
4
4
|
"description": "OpenClaw Inworld speech plugin.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
"minHostVersion": ">=2026.6.8"
|
|
19
19
|
},
|
|
20
20
|
"compat": {
|
|
21
|
-
"pluginApi": ">=2026.
|
|
21
|
+
"pluginApi": ">=2026.10.1-beta.1"
|
|
22
22
|
},
|
|
23
23
|
"build": {
|
|
24
|
-
"openclawVersion": "2026.
|
|
24
|
+
"openclawVersion": "2026.10.1-beta.1",
|
|
25
25
|
"bundledDist": false
|
|
26
26
|
},
|
|
27
27
|
"release": {
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"assets/activity.svg"
|
|
41
41
|
],
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"openclaw": ">=2026.
|
|
43
|
+
"openclaw": ">=2026.10.1-beta.1"
|
|
44
44
|
},
|
|
45
45
|
"peerDependenciesMeta": {
|
|
46
46
|
"openclaw": {
|