@openclaw/groq-provider 2026.10.5-beta.4 → 2026.10.10-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.
|
@@ -37,66 +37,6 @@ var openclaw_plugin_default = {
|
|
|
37
37
|
"api": "openai-completions",
|
|
38
38
|
"defaultModel": "openai/gpt-oss-120b",
|
|
39
39
|
"models": [
|
|
40
|
-
{
|
|
41
|
-
"id": "groq/compound",
|
|
42
|
-
"name": "Compound",
|
|
43
|
-
"reasoning": false,
|
|
44
|
-
"input": ["text"],
|
|
45
|
-
"contextWindow": 131072,
|
|
46
|
-
"maxTokens": 8192,
|
|
47
|
-
"cost": {
|
|
48
|
-
"input": 0,
|
|
49
|
-
"output": 0,
|
|
50
|
-
"cacheRead": 0,
|
|
51
|
-
"cacheWrite": 0
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
"id": "groq/compound-mini",
|
|
56
|
-
"name": "Compound Mini",
|
|
57
|
-
"reasoning": false,
|
|
58
|
-
"input": ["text"],
|
|
59
|
-
"contextWindow": 131072,
|
|
60
|
-
"maxTokens": 8192,
|
|
61
|
-
"cost": {
|
|
62
|
-
"input": 0,
|
|
63
|
-
"output": 0,
|
|
64
|
-
"cacheRead": 0,
|
|
65
|
-
"cacheWrite": 0
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
"id": "llama-3.1-8b-instant",
|
|
70
|
-
"name": "Llama 3.1 8B Instant",
|
|
71
|
-
"status": "deprecated",
|
|
72
|
-
"replacedBy": "openai/gpt-oss-20b",
|
|
73
|
-
"reasoning": false,
|
|
74
|
-
"input": ["text"],
|
|
75
|
-
"contextWindow": 131072,
|
|
76
|
-
"maxTokens": 131072,
|
|
77
|
-
"cost": {
|
|
78
|
-
"input": .05,
|
|
79
|
-
"output": .08,
|
|
80
|
-
"cacheRead": 0,
|
|
81
|
-
"cacheWrite": 0
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
"id": "llama-3.3-70b-versatile",
|
|
86
|
-
"name": "Llama 3.3 70B Versatile",
|
|
87
|
-
"status": "deprecated",
|
|
88
|
-
"replacedBy": "openai/gpt-oss-120b",
|
|
89
|
-
"reasoning": false,
|
|
90
|
-
"input": ["text"],
|
|
91
|
-
"contextWindow": 131072,
|
|
92
|
-
"maxTokens": 32768,
|
|
93
|
-
"cost": {
|
|
94
|
-
"input": .59,
|
|
95
|
-
"output": .79,
|
|
96
|
-
"cacheRead": 0,
|
|
97
|
-
"cacheWrite": 0
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
40
|
{
|
|
101
41
|
"id": "openai/gpt-oss-120b",
|
|
102
42
|
"name": "GPT OSS 120B",
|
|
@@ -143,7 +83,7 @@ var openclaw_plugin_default = {
|
|
|
143
83
|
"id": "qwen/qwen3.6-27b",
|
|
144
84
|
"name": "Qwen 3.6 27B",
|
|
145
85
|
"reasoning": true,
|
|
146
|
-
"input": ["text"
|
|
86
|
+
"input": ["text"],
|
|
147
87
|
"contextWindow": 131072,
|
|
148
88
|
"maxTokens": 16384,
|
|
149
89
|
"cost": {
|
|
@@ -151,6 +91,20 @@ var openclaw_plugin_default = {
|
|
|
151
91
|
"output": 3,
|
|
152
92
|
"cacheRead": 0,
|
|
153
93
|
"cacheWrite": 0
|
|
94
|
+
},
|
|
95
|
+
"compat": {
|
|
96
|
+
"supportedReasoningEfforts": ["none", "default"],
|
|
97
|
+
"reasoningEffortMap": {
|
|
98
|
+
"off": "none",
|
|
99
|
+
"none": "none",
|
|
100
|
+
"minimal": "default",
|
|
101
|
+
"low": "default",
|
|
102
|
+
"medium": "default",
|
|
103
|
+
"high": "default",
|
|
104
|
+
"xhigh": "default",
|
|
105
|
+
"adaptive": "default",
|
|
106
|
+
"max": "default"
|
|
107
|
+
}
|
|
154
108
|
}
|
|
155
109
|
}
|
|
156
110
|
]
|
package/dist/index.js
CHANGED
|
@@ -1,88 +1,12 @@
|
|
|
1
1
|
import { groqMediaUnderstandingProvider } from "./media-understanding-provider.js";
|
|
2
|
-
import { t as openclaw_plugin_default } from "./.setup/openclaw.plugin-
|
|
3
|
-
import { createAssistantMessageEventStream, streamSimple } from "openclaw/plugin-sdk/llm";
|
|
2
|
+
import { t as openclaw_plugin_default } from "./.setup/openclaw.plugin-B7n8WBLz.mjs";
|
|
4
3
|
import { defineSingleProviderPluginEntry } from "openclaw/plugin-sdk/provider-entry";
|
|
5
|
-
import {
|
|
4
|
+
import { createPayloadPatchStreamWrapper } from "openclaw/plugin-sdk/provider-stream-shared";
|
|
6
5
|
//#region extensions/groq/index.ts
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const record = value;
|
|
12
|
-
return record.max_completion_tokens !== void 0 || record.max_tokens !== void 0;
|
|
13
|
-
}
|
|
14
|
-
function hasExplicitMaxTokens(extraParams) {
|
|
15
|
-
return extraParams?.maxTokens !== void 0 || hasWireMaxTokens(extraParams) || hasWireMaxTokens(extraParams?.extra_body) || hasWireMaxTokens(extraParams?.extraBody);
|
|
16
|
-
}
|
|
17
|
-
function isGroqTpmRequestTooLargeEvent(event) {
|
|
18
|
-
if (event.type !== "error") return false;
|
|
19
|
-
const message = event.error.errorMessage?.toLowerCase() ?? "";
|
|
20
|
-
return message.includes("413 request too large for model") && message.includes("tokens per minute (tpm)") && message.includes("limit ") && message.includes("requested ");
|
|
21
|
-
}
|
|
22
|
-
function wrapGroqOversizedRequestRecovery(streamFn, enabled) {
|
|
23
|
-
const underlying = streamFn ?? streamSimple;
|
|
24
|
-
if (!enabled) return underlying;
|
|
25
|
-
const withoutTools = (model, context, options) => {
|
|
26
|
-
const originalOnPayload = options?.onPayload;
|
|
27
|
-
return underlying(model, context, {
|
|
28
|
-
...options,
|
|
29
|
-
async onPayload(payload, payloadModel) {
|
|
30
|
-
const replacement = await originalOnPayload?.(payload, payloadModel);
|
|
31
|
-
const finalPayload = replacement && typeof replacement === "object" ? replacement : payload;
|
|
32
|
-
const record = finalPayload;
|
|
33
|
-
delete record.tools;
|
|
34
|
-
delete record.tool_choice;
|
|
35
|
-
delete record.parallel_tool_calls;
|
|
36
|
-
delete record.parallelToolCalls;
|
|
37
|
-
delete record.max_tokens;
|
|
38
|
-
delete record.max_completion_tokens;
|
|
39
|
-
record.max_completion_tokens = GROQ_FALLBACK_MAX_TOKENS;
|
|
40
|
-
return finalPayload;
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
|
-
return (model, context, options) => {
|
|
45
|
-
if (options?.maxTokens !== void 0) return underlying(model, context, options);
|
|
46
|
-
const initial = underlying(model, context, options);
|
|
47
|
-
const output = createAssistantMessageEventStream();
|
|
48
|
-
(async () => {
|
|
49
|
-
try {
|
|
50
|
-
const resolvedInitial = await Promise.resolve(initial);
|
|
51
|
-
let forwarded = false;
|
|
52
|
-
let retryWithoutTools = false;
|
|
53
|
-
for await (const event of resolvedInitial) {
|
|
54
|
-
if (!forwarded && !options?.signal?.aborted && isGroqTpmRequestTooLargeEvent(event)) {
|
|
55
|
-
retryWithoutTools = true;
|
|
56
|
-
break;
|
|
57
|
-
}
|
|
58
|
-
output.push(event);
|
|
59
|
-
forwarded = true;
|
|
60
|
-
}
|
|
61
|
-
if (retryWithoutTools) {
|
|
62
|
-
const fallback = await Promise.resolve(withoutTools(model, context, options));
|
|
63
|
-
for await (const event of fallback) output.push(event);
|
|
64
|
-
}
|
|
65
|
-
} catch (error) {
|
|
66
|
-
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
67
|
-
output.push({
|
|
68
|
-
type: "error",
|
|
69
|
-
reason: "error",
|
|
70
|
-
error: {
|
|
71
|
-
...buildAssistantMessage({
|
|
72
|
-
model,
|
|
73
|
-
content: [],
|
|
74
|
-
usage: createEmptyTransportUsage(),
|
|
75
|
-
stopReason: "error"
|
|
76
|
-
}),
|
|
77
|
-
errorMessage
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
} finally {
|
|
81
|
-
output.end();
|
|
82
|
-
}
|
|
83
|
-
})();
|
|
84
|
-
return output;
|
|
85
|
-
};
|
|
6
|
+
function wrapGroqParsedReasoning(streamFn) {
|
|
7
|
+
return createPayloadPatchStreamWrapper(streamFn, ({ model, payload }) => {
|
|
8
|
+
if (model.id.startsWith("qwen/") && model.reasoning && payload.reasoning_effort !== "none") payload.reasoning_format = "parsed";
|
|
9
|
+
});
|
|
86
10
|
}
|
|
87
11
|
var groq_default = defineSingleProviderPluginEntry({
|
|
88
12
|
id: "groq",
|
|
@@ -96,7 +20,8 @@ var groq_default = defineSingleProviderPluginEntry({
|
|
|
96
20
|
liveModelDiscovery: true,
|
|
97
21
|
discoveryMode: "strict"
|
|
98
22
|
},
|
|
99
|
-
wrapStreamFn: (ctx) =>
|
|
23
|
+
wrapStreamFn: (ctx) => wrapGroqParsedReasoning(ctx.streamFn),
|
|
24
|
+
wrapSimpleCompletionStreamFn: (ctx) => wrapGroqParsedReasoning(ctx.streamFn)
|
|
100
25
|
},
|
|
101
26
|
register(api) {
|
|
102
27
|
api.registerMediaUnderstandingProvider(groqMediaUnderstandingProvider);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as openclaw_plugin_default } from "./.setup/openclaw.plugin-
|
|
1
|
+
import { t as openclaw_plugin_default } from "./.setup/openclaw.plugin-B7n8WBLz.mjs";
|
|
2
2
|
import { buildManifestModelProviderConfig } from "openclaw/plugin-sdk/provider-model-metadata";
|
|
3
3
|
//#region extensions/groq/provider-discovery.ts
|
|
4
4
|
const PROVIDER_ID = "groq";
|
package/openclaw.plugin.json
CHANGED
|
@@ -65,74 +65,6 @@
|
|
|
65
65
|
"api": "openai-completions",
|
|
66
66
|
"defaultModel": "openai/gpt-oss-120b",
|
|
67
67
|
"models": [
|
|
68
|
-
{
|
|
69
|
-
"id": "groq/compound",
|
|
70
|
-
"name": "Compound",
|
|
71
|
-
"reasoning": false,
|
|
72
|
-
"input": [
|
|
73
|
-
"text"
|
|
74
|
-
],
|
|
75
|
-
"contextWindow": 131072,
|
|
76
|
-
"maxTokens": 8192,
|
|
77
|
-
"cost": {
|
|
78
|
-
"input": 0,
|
|
79
|
-
"output": 0,
|
|
80
|
-
"cacheRead": 0,
|
|
81
|
-
"cacheWrite": 0
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
"id": "groq/compound-mini",
|
|
86
|
-
"name": "Compound Mini",
|
|
87
|
-
"reasoning": false,
|
|
88
|
-
"input": [
|
|
89
|
-
"text"
|
|
90
|
-
],
|
|
91
|
-
"contextWindow": 131072,
|
|
92
|
-
"maxTokens": 8192,
|
|
93
|
-
"cost": {
|
|
94
|
-
"input": 0,
|
|
95
|
-
"output": 0,
|
|
96
|
-
"cacheRead": 0,
|
|
97
|
-
"cacheWrite": 0
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
"id": "llama-3.1-8b-instant",
|
|
102
|
-
"name": "Llama 3.1 8B Instant",
|
|
103
|
-
"status": "deprecated",
|
|
104
|
-
"replacedBy": "openai/gpt-oss-20b",
|
|
105
|
-
"reasoning": false,
|
|
106
|
-
"input": [
|
|
107
|
-
"text"
|
|
108
|
-
],
|
|
109
|
-
"contextWindow": 131072,
|
|
110
|
-
"maxTokens": 131072,
|
|
111
|
-
"cost": {
|
|
112
|
-
"input": 0.05,
|
|
113
|
-
"output": 0.08,
|
|
114
|
-
"cacheRead": 0,
|
|
115
|
-
"cacheWrite": 0
|
|
116
|
-
}
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
"id": "llama-3.3-70b-versatile",
|
|
120
|
-
"name": "Llama 3.3 70B Versatile",
|
|
121
|
-
"status": "deprecated",
|
|
122
|
-
"replacedBy": "openai/gpt-oss-120b",
|
|
123
|
-
"reasoning": false,
|
|
124
|
-
"input": [
|
|
125
|
-
"text"
|
|
126
|
-
],
|
|
127
|
-
"contextWindow": 131072,
|
|
128
|
-
"maxTokens": 32768,
|
|
129
|
-
"cost": {
|
|
130
|
-
"input": 0.59,
|
|
131
|
-
"output": 0.79,
|
|
132
|
-
"cacheRead": 0,
|
|
133
|
-
"cacheWrite": 0
|
|
134
|
-
}
|
|
135
|
-
},
|
|
136
68
|
{
|
|
137
69
|
"id": "openai/gpt-oss-120b",
|
|
138
70
|
"name": "GPT OSS 120B",
|
|
@@ -186,8 +118,7 @@
|
|
|
186
118
|
"name": "Qwen 3.6 27B",
|
|
187
119
|
"reasoning": true,
|
|
188
120
|
"input": [
|
|
189
|
-
"text"
|
|
190
|
-
"image"
|
|
121
|
+
"text"
|
|
191
122
|
],
|
|
192
123
|
"contextWindow": 131072,
|
|
193
124
|
"maxTokens": 16384,
|
|
@@ -196,6 +127,23 @@
|
|
|
196
127
|
"output": 3,
|
|
197
128
|
"cacheRead": 0,
|
|
198
129
|
"cacheWrite": 0
|
|
130
|
+
},
|
|
131
|
+
"compat": {
|
|
132
|
+
"supportedReasoningEfforts": [
|
|
133
|
+
"none",
|
|
134
|
+
"default"
|
|
135
|
+
],
|
|
136
|
+
"reasoningEffortMap": {
|
|
137
|
+
"off": "none",
|
|
138
|
+
"none": "none",
|
|
139
|
+
"minimal": "default",
|
|
140
|
+
"low": "default",
|
|
141
|
+
"medium": "default",
|
|
142
|
+
"high": "default",
|
|
143
|
+
"xhigh": "default",
|
|
144
|
+
"adaptive": "default",
|
|
145
|
+
"max": "default"
|
|
146
|
+
}
|
|
199
147
|
}
|
|
200
148
|
}
|
|
201
149
|
]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/groq-provider",
|
|
3
|
-
"version": "2026.10.
|
|
3
|
+
"version": "2026.10.10-beta.2",
|
|
4
4
|
"description": "OpenClaw Groq media-understanding provider.",
|
|
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.10.
|
|
21
|
+
"pluginApi": ">=2026.10.10-beta.2"
|
|
22
22
|
},
|
|
23
23
|
"build": {
|
|
24
|
-
"openclawVersion": "2026.10.
|
|
24
|
+
"openclawVersion": "2026.10.10-beta.2",
|
|
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.10.
|
|
43
|
+
"openclaw": ">=2026.10.10-beta.2"
|
|
44
44
|
},
|
|
45
45
|
"peerDependenciesMeta": {
|
|
46
46
|
"openclaw": {
|