@openclaw/venice-provider 2026.7.2-beta.7 → 2026.7.34

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.
@@ -0,0 +1,536 @@
1
+ import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
2
+ import { LiveModelCatalogHttpError, getCachedLiveProviderModelRows } from "openclaw/plugin-sdk/provider-catalog-live-runtime";
3
+ import { buildManifestModelProviderConfig } from "openclaw/plugin-sdk/provider-catalog-shared";
4
+ import { createSubsystemLogger, retryAsync } from "openclaw/plugin-sdk/runtime-env";
5
+ //#region extensions/venice/openclaw.plugin.json
6
+ var modelCatalog = {
7
+ "providers": { "venice": {
8
+ "baseUrl": "https://api.venice.ai/api/v1",
9
+ "api": "openai-completions",
10
+ "models": [
11
+ {
12
+ "id": "llama-3.3-70b",
13
+ "name": "Llama 3.3 70B",
14
+ "reasoning": false,
15
+ "input": ["text"],
16
+ "contextWindow": 128e3,
17
+ "maxTokens": 4096,
18
+ "compat": { "supportsUsageInStreaming": false }
19
+ },
20
+ {
21
+ "id": "llama-3.2-3b",
22
+ "name": "Llama 3.2 3B",
23
+ "reasoning": false,
24
+ "input": ["text"],
25
+ "contextWindow": 128e3,
26
+ "maxTokens": 4096,
27
+ "compat": { "supportsUsageInStreaming": false }
28
+ },
29
+ {
30
+ "id": "hermes-3-llama-3.1-405b",
31
+ "name": "Hermes 3 Llama 3.1 405B",
32
+ "reasoning": false,
33
+ "input": ["text"],
34
+ "contextWindow": 128e3,
35
+ "maxTokens": 16384,
36
+ "compat": {
37
+ "supportsUsageInStreaming": false,
38
+ "supportsTools": false
39
+ }
40
+ },
41
+ {
42
+ "id": "qwen3-235b-a22b-thinking-2507",
43
+ "name": "Qwen3 235B Thinking",
44
+ "reasoning": true,
45
+ "input": ["text"],
46
+ "contextWindow": 128e3,
47
+ "maxTokens": 16384,
48
+ "compat": { "supportsUsageInStreaming": false }
49
+ },
50
+ {
51
+ "id": "qwen3-235b-a22b-instruct-2507",
52
+ "name": "Qwen3 235B Instruct",
53
+ "reasoning": false,
54
+ "input": ["text"],
55
+ "contextWindow": 128e3,
56
+ "maxTokens": 16384,
57
+ "compat": { "supportsUsageInStreaming": false }
58
+ },
59
+ {
60
+ "id": "qwen3-coder-480b-a35b-instruct",
61
+ "name": "Qwen3 Coder 480B",
62
+ "reasoning": false,
63
+ "input": ["text"],
64
+ "contextWindow": 256e3,
65
+ "maxTokens": 65536,
66
+ "compat": { "supportsUsageInStreaming": false }
67
+ },
68
+ {
69
+ "id": "qwen3-coder-480b-a35b-instruct-turbo",
70
+ "name": "Qwen3 Coder 480B Turbo",
71
+ "reasoning": false,
72
+ "input": ["text"],
73
+ "contextWindow": 256e3,
74
+ "maxTokens": 65536,
75
+ "compat": { "supportsUsageInStreaming": false }
76
+ },
77
+ {
78
+ "id": "qwen3-5-35b-a3b",
79
+ "name": "Qwen3.5 35B A3B",
80
+ "reasoning": true,
81
+ "input": ["text", "image"],
82
+ "contextWindow": 256e3,
83
+ "maxTokens": 65536,
84
+ "compat": { "supportsUsageInStreaming": false }
85
+ },
86
+ {
87
+ "id": "qwen3-next-80b",
88
+ "name": "Qwen3 Next 80B",
89
+ "reasoning": false,
90
+ "input": ["text"],
91
+ "contextWindow": 256e3,
92
+ "maxTokens": 16384,
93
+ "compat": { "supportsUsageInStreaming": false }
94
+ },
95
+ {
96
+ "id": "qwen3-vl-235b-a22b",
97
+ "name": "Qwen3 VL 235B (Vision)",
98
+ "reasoning": false,
99
+ "input": ["text", "image"],
100
+ "contextWindow": 256e3,
101
+ "maxTokens": 16384,
102
+ "compat": { "supportsUsageInStreaming": false }
103
+ },
104
+ {
105
+ "id": "qwen3-4b",
106
+ "name": "Venice Small (Qwen3 4B)",
107
+ "reasoning": true,
108
+ "input": ["text"],
109
+ "contextWindow": 32e3,
110
+ "maxTokens": 4096,
111
+ "compat": { "supportsUsageInStreaming": false }
112
+ },
113
+ {
114
+ "id": "deepseek-v3.2",
115
+ "name": "DeepSeek V3.2",
116
+ "reasoning": true,
117
+ "input": ["text"],
118
+ "contextWindow": 16e4,
119
+ "maxTokens": 32768,
120
+ "compat": {
121
+ "supportsUsageInStreaming": false,
122
+ "supportsTools": false
123
+ }
124
+ },
125
+ {
126
+ "id": "venice-uncensored",
127
+ "name": "Venice Uncensored (Dolphin-Mistral)",
128
+ "reasoning": false,
129
+ "input": ["text"],
130
+ "contextWindow": 32e3,
131
+ "maxTokens": 4096,
132
+ "compat": {
133
+ "supportsUsageInStreaming": false,
134
+ "supportsTools": false
135
+ }
136
+ },
137
+ {
138
+ "id": "mistral-31-24b",
139
+ "name": "Venice Medium (Mistral)",
140
+ "reasoning": false,
141
+ "input": ["text", "image"],
142
+ "contextWindow": 128e3,
143
+ "maxTokens": 4096,
144
+ "compat": { "supportsUsageInStreaming": false }
145
+ },
146
+ {
147
+ "id": "google-gemma-3-27b-it",
148
+ "name": "Google Gemma 3 27B Instruct",
149
+ "reasoning": false,
150
+ "input": ["text", "image"],
151
+ "contextWindow": 198e3,
152
+ "maxTokens": 16384,
153
+ "compat": { "supportsUsageInStreaming": false }
154
+ },
155
+ {
156
+ "id": "openai-gpt-oss-120b",
157
+ "name": "OpenAI GPT OSS 120B",
158
+ "reasoning": false,
159
+ "input": ["text"],
160
+ "contextWindow": 128e3,
161
+ "maxTokens": 16384,
162
+ "compat": { "supportsUsageInStreaming": false }
163
+ },
164
+ {
165
+ "id": "nvidia-nemotron-3-nano-30b-a3b",
166
+ "name": "NVIDIA Nemotron 3 Nano 30B",
167
+ "reasoning": false,
168
+ "input": ["text"],
169
+ "contextWindow": 128e3,
170
+ "maxTokens": 16384,
171
+ "compat": { "supportsUsageInStreaming": false }
172
+ },
173
+ {
174
+ "id": "olafangensan-glm-4.7-flash-heretic",
175
+ "name": "GLM 4.7 Flash Heretic",
176
+ "reasoning": true,
177
+ "input": ["text"],
178
+ "contextWindow": 128e3,
179
+ "maxTokens": 24e3,
180
+ "compat": { "supportsUsageInStreaming": false }
181
+ },
182
+ {
183
+ "id": "zai-org-glm-4.6",
184
+ "name": "GLM 4.6",
185
+ "reasoning": false,
186
+ "input": ["text"],
187
+ "contextWindow": 198e3,
188
+ "maxTokens": 16384,
189
+ "compat": { "supportsUsageInStreaming": false }
190
+ },
191
+ {
192
+ "id": "zai-org-glm-4.7",
193
+ "name": "GLM 4.7",
194
+ "reasoning": true,
195
+ "input": ["text"],
196
+ "contextWindow": 198e3,
197
+ "maxTokens": 16384,
198
+ "compat": { "supportsUsageInStreaming": false }
199
+ },
200
+ {
201
+ "id": "zai-org-glm-4.7-flash",
202
+ "name": "GLM 4.7 Flash",
203
+ "reasoning": true,
204
+ "input": ["text"],
205
+ "contextWindow": 128e3,
206
+ "maxTokens": 16384,
207
+ "compat": { "supportsUsageInStreaming": false }
208
+ },
209
+ {
210
+ "id": "zai-org-glm-5",
211
+ "name": "GLM 5",
212
+ "reasoning": true,
213
+ "input": ["text"],
214
+ "contextWindow": 198e3,
215
+ "maxTokens": 32e3,
216
+ "compat": { "supportsUsageInStreaming": false }
217
+ },
218
+ {
219
+ "id": "kimi-k2-5",
220
+ "name": "Kimi K2.5",
221
+ "reasoning": true,
222
+ "input": ["text", "image"],
223
+ "contextWindow": 256e3,
224
+ "maxTokens": 65536,
225
+ "compat": { "supportsUsageInStreaming": false }
226
+ },
227
+ {
228
+ "id": "kimi-k2-thinking",
229
+ "name": "Kimi K2 Thinking",
230
+ "reasoning": true,
231
+ "input": ["text"],
232
+ "contextWindow": 256e3,
233
+ "maxTokens": 65536,
234
+ "compat": { "supportsUsageInStreaming": false }
235
+ },
236
+ {
237
+ "id": "minimax-m21",
238
+ "name": "MiniMax M2.1",
239
+ "reasoning": true,
240
+ "input": ["text"],
241
+ "contextWindow": 198e3,
242
+ "maxTokens": 32768,
243
+ "compat": { "supportsUsageInStreaming": false }
244
+ },
245
+ {
246
+ "id": "minimax-m25",
247
+ "name": "MiniMax M2.5",
248
+ "reasoning": true,
249
+ "input": ["text"],
250
+ "contextWindow": 198e3,
251
+ "maxTokens": 32768,
252
+ "compat": { "supportsUsageInStreaming": false }
253
+ },
254
+ {
255
+ "id": "claude-opus-4-6",
256
+ "name": "Claude Opus 4.6 (via Venice)",
257
+ "reasoning": true,
258
+ "input": ["text", "image"],
259
+ "contextWindow": 1e6,
260
+ "maxTokens": 128e3,
261
+ "compat": { "supportsUsageInStreaming": false }
262
+ },
263
+ {
264
+ "id": "claude-sonnet-4-6",
265
+ "name": "Claude Sonnet 4.6 (via Venice)",
266
+ "reasoning": true,
267
+ "input": ["text", "image"],
268
+ "contextWindow": 1e6,
269
+ "maxTokens": 64e3,
270
+ "compat": { "supportsUsageInStreaming": false }
271
+ },
272
+ {
273
+ "id": "openai-gpt-52",
274
+ "name": "GPT-5.2 (via Venice)",
275
+ "reasoning": true,
276
+ "input": ["text"],
277
+ "contextWindow": 256e3,
278
+ "maxTokens": 65536,
279
+ "compat": { "supportsUsageInStreaming": false }
280
+ },
281
+ {
282
+ "id": "openai-gpt-52-codex",
283
+ "name": "GPT-5.2 Codex (via Venice)",
284
+ "reasoning": true,
285
+ "input": ["text", "image"],
286
+ "contextWindow": 256e3,
287
+ "maxTokens": 65536,
288
+ "compat": { "supportsUsageInStreaming": false }
289
+ },
290
+ {
291
+ "id": "openai-gpt-53-codex",
292
+ "name": "GPT-5.3 Codex (via Venice)",
293
+ "reasoning": true,
294
+ "input": ["text", "image"],
295
+ "contextWindow": 4e5,
296
+ "maxTokens": 128e3,
297
+ "compat": { "supportsUsageInStreaming": false }
298
+ },
299
+ {
300
+ "id": "openai-gpt-54",
301
+ "name": "GPT-5.4 (via Venice)",
302
+ "reasoning": true,
303
+ "input": ["text", "image"],
304
+ "contextWindow": 1e6,
305
+ "maxTokens": 131072,
306
+ "compat": { "supportsUsageInStreaming": false }
307
+ },
308
+ {
309
+ "id": "openai-gpt-4o-2024-11-20",
310
+ "name": "GPT-4o (via Venice)",
311
+ "reasoning": false,
312
+ "input": ["text", "image"],
313
+ "contextWindow": 128e3,
314
+ "maxTokens": 16384,
315
+ "compat": { "supportsUsageInStreaming": false }
316
+ },
317
+ {
318
+ "id": "openai-gpt-4o-mini-2024-07-18",
319
+ "name": "GPT-4o Mini (via Venice)",
320
+ "reasoning": false,
321
+ "input": ["text", "image"],
322
+ "contextWindow": 128e3,
323
+ "maxTokens": 16384,
324
+ "compat": { "supportsUsageInStreaming": false }
325
+ },
326
+ {
327
+ "id": "gemini-3-pro-preview",
328
+ "name": "Gemini 3 Pro (via Venice)",
329
+ "reasoning": true,
330
+ "input": ["text", "image"],
331
+ "contextWindow": 198e3,
332
+ "maxTokens": 32768,
333
+ "compat": { "supportsUsageInStreaming": false }
334
+ },
335
+ {
336
+ "id": "gemini-3-1-pro-preview",
337
+ "name": "Gemini 3.1 Pro (via Venice)",
338
+ "reasoning": true,
339
+ "input": ["text", "image"],
340
+ "contextWindow": 1e6,
341
+ "maxTokens": 32768,
342
+ "compat": { "supportsUsageInStreaming": false }
343
+ },
344
+ {
345
+ "id": "gemini-3-flash-preview",
346
+ "name": "Gemini 3 Flash (via Venice)",
347
+ "reasoning": true,
348
+ "input": ["text", "image"],
349
+ "contextWindow": 256e3,
350
+ "maxTokens": 65536,
351
+ "compat": { "supportsUsageInStreaming": false }
352
+ },
353
+ {
354
+ "id": "grok-41-fast",
355
+ "name": "Grok 4.1 Fast (via Venice)",
356
+ "reasoning": true,
357
+ "input": ["text", "image"],
358
+ "contextWindow": 1e6,
359
+ "maxTokens": 3e4,
360
+ "compat": { "supportsUsageInStreaming": false }
361
+ }
362
+ ]
363
+ } },
364
+ "discovery": { "venice": "refreshable" }
365
+ };
366
+ //#endregion
367
+ //#region extensions/venice/models.ts
368
+ const log = createSubsystemLogger("venice-models");
369
+ const VENICE_MANIFEST_PROVIDER = buildManifestModelProviderConfig({
370
+ providerId: "venice",
371
+ catalog: modelCatalog.providers.venice
372
+ });
373
+ const VENICE_BASE_URL = VENICE_MANIFEST_PROVIDER.baseUrl;
374
+ const VENICE_DEFAULT_MODEL_REF = `venice/kimi-k2-5`;
375
+ const VENICE_ALLOWED_HOSTNAMES = ["api.venice.ai"];
376
+ const VENICE_DEFAULT_COST = {
377
+ input: 0,
378
+ output: 0,
379
+ cacheRead: 0,
380
+ cacheWrite: 0
381
+ };
382
+ const VENICE_DEFAULT_CONTEXT_WINDOW = 128e3;
383
+ const VENICE_DEFAULT_MAX_TOKENS = 4096;
384
+ const VENICE_DISCOVERY_HARD_MAX_TOKENS = 131072;
385
+ const VENICE_DISCOVERY_TIMEOUT_MS = 1e4;
386
+ const VENICE_DISCOVERY_CACHE_TTL_MS = 6e4;
387
+ const VENICE_DISCOVERY_RETRYABLE_HTTP_STATUS = /* @__PURE__ */ new Set([
388
+ 408,
389
+ 425,
390
+ 429,
391
+ 500,
392
+ 502,
393
+ 503,
394
+ 504
395
+ ]);
396
+ const VENICE_DISCOVERY_RETRYABLE_NETWORK_CODES = /* @__PURE__ */ new Set([
397
+ "ECONNABORTED",
398
+ "ECONNREFUSED",
399
+ "ECONNRESET",
400
+ "EAI_AGAIN",
401
+ "ENETDOWN",
402
+ "ENETUNREACH",
403
+ "ENOTFOUND",
404
+ "ETIMEDOUT",
405
+ "UND_ERR_BODY_TIMEOUT",
406
+ "UND_ERR_CONNECT_TIMEOUT",
407
+ "UND_ERR_CONNECT_ERROR",
408
+ "UND_ERR_HEADERS_TIMEOUT",
409
+ "UND_ERR_SOCKET"
410
+ ]);
411
+ const VENICE_MODEL_CATALOG = VENICE_MANIFEST_PROVIDER.models;
412
+ function buildVeniceModelDefinition(entry) {
413
+ return {
414
+ id: entry.id,
415
+ name: entry.name,
416
+ reasoning: entry.reasoning,
417
+ input: [...entry.input],
418
+ cost: VENICE_DEFAULT_COST,
419
+ contextWindow: entry.contextWindow,
420
+ maxTokens: entry.maxTokens,
421
+ compat: {
422
+ supportsUsageInStreaming: false,
423
+ ...entry.compat
424
+ }
425
+ };
426
+ }
427
+ function staticVeniceModelDefinitions() {
428
+ return VENICE_MODEL_CATALOG.map(buildVeniceModelDefinition);
429
+ }
430
+ function hasRetryableNetworkCode(err) {
431
+ const queue = [err];
432
+ const seen = /* @__PURE__ */ new Set();
433
+ while (queue.length > 0) {
434
+ const current = queue.shift();
435
+ if (!current || typeof current !== "object" || seen.has(current)) continue;
436
+ seen.add(current);
437
+ const candidate = current;
438
+ const code = typeof candidate.code === "string" ? candidate.code : typeof candidate.errno === "string" ? candidate.errno : void 0;
439
+ if (code && VENICE_DISCOVERY_RETRYABLE_NETWORK_CODES.has(code)) return true;
440
+ if (candidate.cause) queue.push(candidate.cause);
441
+ if (Array.isArray(candidate.errors)) queue.push(...candidate.errors);
442
+ }
443
+ return false;
444
+ }
445
+ function isRetryableVeniceDiscoveryError(err) {
446
+ if (err instanceof LiveModelCatalogHttpError) return VENICE_DISCOVERY_RETRYABLE_HTTP_STATUS.has(err.status);
447
+ if (err instanceof Error && err.name === "AbortError") return true;
448
+ if (err instanceof TypeError && normalizeLowercaseStringOrEmpty(err.message) === "fetch failed") return true;
449
+ return hasRetryableNetworkCode(err);
450
+ }
451
+ function normalizePositiveInt(value) {
452
+ if (typeof value !== "number" || !Number.isFinite(value) || value <= 0) return;
453
+ return Math.floor(value);
454
+ }
455
+ function resolveApiMaxCompletionTokens(params) {
456
+ const raw = normalizePositiveInt(params.apiModel.model_spec?.maxCompletionTokens);
457
+ if (!raw) return;
458
+ const contextWindow = normalizePositiveInt(params.apiModel.model_spec?.availableContextTokens);
459
+ const knownMaxTokens = typeof params.knownMaxTokens === "number" && Number.isFinite(params.knownMaxTokens) ? Math.floor(params.knownMaxTokens) : void 0;
460
+ return Math.min(raw, contextWindow ?? knownMaxTokens ?? VENICE_DEFAULT_CONTEXT_WINDOW, knownMaxTokens ?? VENICE_DISCOVERY_HARD_MAX_TOKENS);
461
+ }
462
+ function resolveApiSupportsTools(apiModel) {
463
+ const supportsFunctionCalling = apiModel.model_spec?.capabilities?.supportsFunctionCalling;
464
+ return typeof supportsFunctionCalling === "boolean" ? supportsFunctionCalling : void 0;
465
+ }
466
+ async function discoverVeniceModels(options = {}) {
467
+ if (process.env.VITEST) return staticVeniceModelDefinitions();
468
+ try {
469
+ const data = await retryAsync(async () => await getCachedLiveProviderModelRows({
470
+ providerId: "venice",
471
+ endpoint: `${VENICE_BASE_URL}/models`,
472
+ timeoutMs: VENICE_DISCOVERY_TIMEOUT_MS,
473
+ ttlMs: VENICE_DISCOVERY_CACHE_TTL_MS,
474
+ policy: { allowedHostnames: VENICE_ALLOWED_HOSTNAMES },
475
+ auditContext: "venice-model-discovery"
476
+ }), {
477
+ attempts: 3,
478
+ minDelayMs: options.retryDelayMs ?? 300,
479
+ maxDelayMs: options.retryDelayMs ?? 2e3,
480
+ jitter: options.retryDelayMs === void 0 ? .2 : 0,
481
+ label: "venice-model-discovery",
482
+ shouldRetry: isRetryableVeniceDiscoveryError
483
+ });
484
+ if (data.length === 0) {
485
+ log.warn("No models found from API, using static catalog");
486
+ return staticVeniceModelDefinitions();
487
+ }
488
+ const catalogById = new Map(VENICE_MODEL_CATALOG.map((m) => [m.id, m]));
489
+ const models = [];
490
+ for (const apiModel of data) {
491
+ const catalogEntry = catalogById.get(apiModel.id);
492
+ const apiMaxTokens = resolveApiMaxCompletionTokens({
493
+ apiModel,
494
+ knownMaxTokens: catalogEntry?.maxTokens
495
+ });
496
+ const apiSupportsTools = resolveApiSupportsTools(apiModel);
497
+ if (catalogEntry) {
498
+ const definition = buildVeniceModelDefinition(catalogEntry);
499
+ if (apiMaxTokens !== void 0) definition.maxTokens = apiMaxTokens;
500
+ if (apiSupportsTools === false) definition.compat = {
501
+ ...definition.compat,
502
+ supportsTools: false
503
+ };
504
+ models.push(definition);
505
+ } else {
506
+ const apiSpec = apiModel.model_spec;
507
+ const lowerModelId = normalizeLowercaseStringOrEmpty(apiModel.id);
508
+ const isReasoning = apiSpec?.capabilities?.supportsReasoning || lowerModelId.includes("thinking") || lowerModelId.includes("reason") || lowerModelId.includes("r1");
509
+ const hasVision = apiSpec?.capabilities?.supportsVision === true;
510
+ models.push({
511
+ id: apiModel.id,
512
+ name: apiSpec?.name || apiModel.id,
513
+ reasoning: isReasoning,
514
+ input: hasVision ? ["text", "image"] : ["text"],
515
+ cost: VENICE_DEFAULT_COST,
516
+ contextWindow: normalizePositiveInt(apiSpec?.availableContextTokens) ?? VENICE_DEFAULT_CONTEXT_WINDOW,
517
+ maxTokens: apiMaxTokens ?? VENICE_DEFAULT_MAX_TOKENS,
518
+ compat: {
519
+ supportsUsageInStreaming: false,
520
+ ...apiSupportsTools === false ? { supportsTools: false } : {}
521
+ }
522
+ });
523
+ }
524
+ }
525
+ return models.length > 0 ? models : staticVeniceModelDefinitions();
526
+ } catch (error) {
527
+ if (error instanceof LiveModelCatalogHttpError) {
528
+ log.warn(`Failed to discover models: HTTP ${error.status}, using static catalog`);
529
+ return staticVeniceModelDefinitions();
530
+ }
531
+ log.warn(`Discovery failed: ${String(error)}, using static catalog`);
532
+ return staticVeniceModelDefinitions();
533
+ }
534
+ }
535
+ //#endregion
536
+ export { discoverVeniceModels as a, buildVeniceModelDefinition as i, VENICE_DEFAULT_MODEL_REF as n, VENICE_MODEL_CATALOG as r, VENICE_BASE_URL as t };
package/dist/api.js CHANGED
@@ -1,2 +1,3 @@
1
- import { n as VENICE_DEFAULT_MODEL_REF, r as VENICE_MODEL_CATALOG, t as VENICE_BASE_URL } from "./models-B-tcQZD0.js";
2
- export { VENICE_BASE_URL, VENICE_DEFAULT_MODEL_REF, VENICE_MODEL_CATALOG };
1
+ import { a as discoverVeniceModels, i as buildVeniceModelDefinition, n as VENICE_DEFAULT_MODEL_REF, r as VENICE_MODEL_CATALOG, t as VENICE_BASE_URL } from "./.setup/models-C5WznQTA.mjs";
2
+ import { buildVeniceProvider } from "./provider-catalog.js";
3
+ export { VENICE_BASE_URL, VENICE_DEFAULT_MODEL_REF, VENICE_MODEL_CATALOG, buildVeniceModelDefinition, buildVeniceProvider, discoverVeniceModels };
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import { a as openclaw_plugin_default, i as VENICE_MODEL_DISCOVERY_OPTIONS } from "./models-B-tcQZD0.js";
1
+ import { n as VENICE_DEFAULT_MODEL_REF } from "./.setup/models-C5WznQTA.mjs";
2
+ import { buildVeniceProvider } from "./provider-catalog.js";
2
3
  import { applyVeniceConfig } from "./onboard.js";
3
- import { buildStaticVeniceProvider } from "./provider-catalog.js";
4
4
  import { createVeniceDeepSeekV4Wrapper } from "./stream.js";
5
5
  import { fetchVeniceUsage } from "./usage.js";
6
6
  import { defineSingleProviderPluginEntry } from "openclaw/plugin-sdk/provider-entry";
@@ -20,6 +20,7 @@ function applyXaiModelCompat(model) {
20
20
  return applyModelCompatPatch(model, {
21
21
  toolSchemaProfile: "xai",
22
22
  unsupportedToolSchemaKeywords: [...XAI_UNSUPPORTED_SCHEMA_KEYWORDS],
23
+ nativeWebSearchTool: true,
23
24
  toolCallArgumentsEncoding: "html-entities"
24
25
  });
25
26
  }
@@ -30,23 +31,28 @@ var venice_default = defineSingleProviderPluginEntry({
30
31
  id: PROVIDER_ID,
31
32
  name: "Venice Provider",
32
33
  description: "Bundled Venice provider plugin",
33
- manifest: openclaw_plugin_default,
34
34
  provider: {
35
35
  label: "Venice",
36
36
  docsPath: "/providers/venice",
37
- manifestAuth: {
38
- applyConfig: applyVeniceConfig,
37
+ auth: [{
38
+ methodId: "api-key",
39
+ label: "Venice AI API key",
40
+ hint: "Privacy-focused (uncensored models)",
41
+ optionKey: "veniceApiKey",
42
+ flagName: "--venice-api-key",
43
+ envVar: "VENICE_API_KEY",
44
+ promptMessage: "Enter Venice AI API key",
45
+ defaultModel: VENICE_DEFAULT_MODEL_REF,
46
+ applyConfig: (cfg) => applyVeniceConfig(cfg),
39
47
  noteMessage: [
40
48
  "Venice AI provides privacy-focused inference with uncensored models.",
41
49
  "Get your API key at: https://venice.ai/settings/api",
42
50
  "Supports 'private' (fully private) and 'anonymized' (proxy) modes."
43
51
  ].join("\n"),
44
- noteTitle: "Venice AI"
45
- },
46
- catalog: {
47
- buildProvider: buildStaticVeniceProvider,
48
- liveModelDiscovery: VENICE_MODEL_DISCOVERY_OPTIONS
49
- },
52
+ noteTitle: "Venice AI",
53
+ wizard: { groupLabel: "Venice AI" }
54
+ }],
55
+ catalog: { buildProvider: buildVeniceProvider },
50
56
  normalizeResolvedModel: ({ modelId, model }) => isXaiBackedVeniceModel(modelId) ? applyXaiModelCompat(model) : void 0,
51
57
  wrapStreamFn: (ctx) => createVeniceDeepSeekV4Wrapper(ctx.streamFn, ctx.thinkingLevel),
52
58
  resolveUsageAuth: async (ctx) => {
package/dist/models.js CHANGED
@@ -1,2 +1,2 @@
1
- import { i as VENICE_MODEL_DISCOVERY_OPTIONS, n as VENICE_DEFAULT_MODEL_REF, r as VENICE_MODEL_CATALOG, t as VENICE_BASE_URL } from "./models-B-tcQZD0.js";
2
- export { VENICE_BASE_URL, VENICE_DEFAULT_MODEL_REF, VENICE_MODEL_CATALOG, VENICE_MODEL_DISCOVERY_OPTIONS };
1
+ import { a as discoverVeniceModels, i as buildVeniceModelDefinition, n as VENICE_DEFAULT_MODEL_REF, r as VENICE_MODEL_CATALOG, t as VENICE_BASE_URL } from "./.setup/models-C5WznQTA.mjs";
2
+ export { VENICE_BASE_URL, VENICE_DEFAULT_MODEL_REF, VENICE_MODEL_CATALOG, buildVeniceModelDefinition, discoverVeniceModels };
package/dist/onboard.js CHANGED
@@ -1,19 +1,22 @@
1
- import { n as VENICE_DEFAULT_MODEL_REF, r as VENICE_MODEL_CATALOG, t as VENICE_BASE_URL } from "./models-B-tcQZD0.js";
1
+ import { i as buildVeniceModelDefinition, n as VENICE_DEFAULT_MODEL_REF, r as VENICE_MODEL_CATALOG, t as VENICE_BASE_URL } from "./.setup/models-C5WznQTA.mjs";
2
2
  import "./api.js";
3
3
  import { createModelCatalogPresetAppliers } from "openclaw/plugin-sdk/provider-onboard";
4
4
  //#region extensions/venice/onboard.ts
5
- const { applyConfig: applyVeniceConfig } = createModelCatalogPresetAppliers({
5
+ const venicePresetAppliers = createModelCatalogPresetAppliers({
6
6
  primaryModelRef: VENICE_DEFAULT_MODEL_REF,
7
- resolveParams: () => ({
7
+ resolveParams: (_cfg) => ({
8
8
  providerId: "venice",
9
9
  api: "openai-completions",
10
10
  baseUrl: VENICE_BASE_URL,
11
- catalogModels: structuredClone(VENICE_MODEL_CATALOG),
11
+ catalogModels: VENICE_MODEL_CATALOG.map(buildVeniceModelDefinition),
12
12
  aliases: [{
13
13
  modelRef: VENICE_DEFAULT_MODEL_REF,
14
- alias: "GLM 4.7"
14
+ alias: "Kimi K2.5"
15
15
  }]
16
16
  })
17
17
  });
18
+ function applyVeniceConfig(cfg) {
19
+ return venicePresetAppliers.applyConfig(cfg);
20
+ }
18
21
  //#endregion
19
- export { applyVeniceConfig };
22
+ export { VENICE_DEFAULT_MODEL_REF, applyVeniceConfig };
@@ -1,11 +1,12 @@
1
- import { r as VENICE_MODEL_CATALOG, t as VENICE_BASE_URL } from "./models-B-tcQZD0.js";
1
+ import { a as discoverVeniceModels, t as VENICE_BASE_URL } from "./.setup/models-C5WznQTA.mjs";
2
2
  //#region extensions/venice/provider-catalog.ts
3
- function buildStaticVeniceProvider() {
3
+ async function buildVeniceProvider() {
4
+ const models = await discoverVeniceModels();
4
5
  return {
5
6
  baseUrl: VENICE_BASE_URL,
6
7
  api: "openai-completions",
7
- models: structuredClone(VENICE_MODEL_CATALOG)
8
+ models
8
9
  };
9
10
  }
10
11
  //#endregion
11
- export { buildStaticVeniceProvider };
12
+ export { buildVeniceProvider };
package/dist/stream.js CHANGED
@@ -1,19 +1,22 @@
1
- import { createPayloadPatchStreamWrapper, normalizeOpenAICompatibleReasoningReplay } from "openclaw/plugin-sdk/provider-stream-shared";
1
+ import { createPayloadPatchStreamWrapper } from "openclaw/plugin-sdk/provider-stream-shared";
2
2
  //#region extensions/venice/stream.ts
3
3
  function isVeniceDeepSeekV4ModelId(modelId) {
4
4
  return modelId === "deepseek-v4-flash" || modelId === "deepseek-v4-pro";
5
5
  }
6
+ function ensureVeniceDeepSeekV4Replay(payload) {
7
+ delete payload.thinking;
8
+ delete payload.reasoning;
9
+ delete payload.reasoning_effort;
10
+ if (!Array.isArray(payload.messages)) return;
11
+ for (const message of payload.messages) {
12
+ if (!message || typeof message !== "object") continue;
13
+ const record = message;
14
+ if (record.role === "assistant") record.reasoning_content ??= "";
15
+ }
16
+ }
6
17
  function createVeniceDeepSeekV4Wrapper(baseStreamFn, thinkingLevel) {
7
18
  return createPayloadPatchStreamWrapper(baseStreamFn, ({ payload, model }) => {
8
- if (model.provider === "venice" && isVeniceDeepSeekV4ModelId(model.id)) {
9
- delete payload.thinking;
10
- delete payload.reasoning;
11
- delete payload.reasoning_effort;
12
- normalizeOpenAICompatibleReasoningReplay(payload, {
13
- thinkingEnabled: true,
14
- replaceNullReasoningContent: true
15
- });
16
- }
19
+ if (model.provider === "venice" && isVeniceDeepSeekV4ModelId(model.id)) ensureVeniceDeepSeekV4Replay(payload);
17
20
  });
18
21
  }
19
22
  //#endregion