@openclaw/gradium-speech 2026.7.2-beta.1 → 2026.7.2-beta.2

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,7 @@ import { GRADIUM_VOICES, normalizeGradiumBaseUrl } from "./shared.js";
2
2
  import { gradiumTTS } from "./tts.js";
3
3
  import { normalizeResolvedSecretInputString } from "openclaw/plugin-sdk/secret-input";
4
4
  import { asObject, trimToUndefined } from "openclaw/plugin-sdk/speech";
5
+ import { resolveSpeechProviderApiKey } from "openclaw/plugin-sdk/speech-core";
5
6
  //#region extensions/gradium/speech-provider.ts
6
7
  const DEFAULT_GENERATED_AUDIO_MAX_BYTES = 16 * 1024 * 1024;
7
8
  function normalizeGradiumProviderConfig(rawConfig) {
@@ -23,6 +24,18 @@ function readGradiumProviderConfig(config) {
23
24
  voiceId: trimToUndefined(config.voiceId) ?? defaults.voiceId
24
25
  };
25
26
  }
27
+ function resolveGradiumApiKey(configApiKey) {
28
+ return resolveSpeechProviderApiKey(trimToUndefined(configApiKey), process.env.GRADIUM_API_KEY);
29
+ }
30
+ function isGradiumProviderConfigured(config) {
31
+ if (!resolveGradiumApiKey(config.apiKey)) return false;
32
+ try {
33
+ normalizeGradiumBaseUrl(trimToUndefined(config.baseUrl));
34
+ return true;
35
+ } catch {
36
+ return false;
37
+ }
38
+ }
26
39
  function resolveGeneratedAudioMaxBytes(req) {
27
40
  const configured = req.cfg.agents?.defaults?.mediaMaxMb;
28
41
  if (typeof configured === "number" && Number.isFinite(configured) && configured > 0) return Math.floor(configured * 1024 * 1024);
@@ -58,11 +71,11 @@ function buildGradiumSpeechProvider() {
58
71
  id: v.id,
59
72
  name: v.name
60
73
  })),
61
- isConfigured: ({ providerConfig }) => Boolean(readGradiumProviderConfig(providerConfig).apiKey || process.env.GRADIUM_API_KEY),
74
+ isConfigured: ({ providerConfig }) => isGradiumProviderConfigured(providerConfig),
62
75
  synthesize: async (req) => {
63
76
  const config = readGradiumProviderConfig(req.providerConfig);
64
77
  const overrides = req.providerOverrides ?? {};
65
- const apiKey = config.apiKey || process.env.GRADIUM_API_KEY;
78
+ const apiKey = resolveGradiumApiKey(config.apiKey);
66
79
  if (!apiKey) throw new Error("Gradium API key missing");
67
80
  const wantsVoiceNote = req.target === "voice-note";
68
81
  const outputFormat = wantsVoiceNote ? "opus" : "wav";
@@ -84,7 +97,7 @@ function buildGradiumSpeechProvider() {
84
97
  synthesizeTelephony: async (req) => {
85
98
  const config = readGradiumProviderConfig(req.providerConfig);
86
99
  const overrides = req.providerOverrides ?? {};
87
- const apiKey = config.apiKey || process.env.GRADIUM_API_KEY;
100
+ const apiKey = resolveGradiumApiKey(config.apiKey);
88
101
  if (!apiKey) throw new Error("Gradium API key missing");
89
102
  const outputFormat = "ulaw_8000";
90
103
  return {
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@openclaw/gradium-speech",
3
- "version": "2026.7.2-beta.1",
3
+ "version": "2026.7.2-beta.2",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@openclaw/gradium-speech",
9
- "version": "2026.7.2-beta.1"
9
+ "version": "2026.7.2-beta.2"
10
10
  }
11
11
  }
12
12
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/gradium-speech",
3
- "version": "2026.7.2-beta.1",
3
+ "version": "2026.7.2-beta.2",
4
4
  "description": "OpenClaw Gradium 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.7.2-beta.1"
21
+ "pluginApi": ">=2026.7.2-beta.2"
22
22
  },
23
23
  "build": {
24
- "openclawVersion": "2026.7.2-beta.1",
24
+ "openclawVersion": "2026.7.2-beta.2",
25
25
  "bundledDist": false
26
26
  },
27
27
  "release": {
@@ -39,7 +39,7 @@
39
39
  "README.md"
40
40
  ],
41
41
  "peerDependencies": {
42
- "openclaw": ">=2026.7.2-beta.1"
42
+ "openclaw": ">=2026.7.2-beta.2"
43
43
  },
44
44
  "peerDependenciesMeta": {
45
45
  "openclaw": {