@opencode/ai 0.0.0-dev-20336 → 0.0.0-dev-20344
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.
|
@@ -111,8 +111,8 @@ const adapter = {
|
|
|
111
111
|
name: NAME,
|
|
112
112
|
restoreHostedToolItem: (item) => (Schema.is(OpenAIResponsesHostedToolItem)(item) ? item : undefined),
|
|
113
113
|
};
|
|
114
|
-
// GPT-6
|
|
115
|
-
//
|
|
114
|
+
// GPT-6 and later default to `configuration_update` support, except in `reasoning.mode: "pro"`
|
|
115
|
+
// or alongside automatic `context_management` compaction.
|
|
116
116
|
const supportsEffortUpdates = (request) => {
|
|
117
117
|
if (request.providerOptions?.contextManagement !== undefined)
|
|
118
118
|
return false;
|
|
@@ -121,7 +121,8 @@ const supportsEffortUpdates = (request) => {
|
|
|
121
121
|
const override = request.model.compatibility?.supportsEffortUpdates;
|
|
122
122
|
if (override !== undefined)
|
|
123
123
|
return override;
|
|
124
|
-
|
|
124
|
+
const match = /(?:^|\/)gpt-(\d+)(?:\.\d+)?(?:-|$)/i.exec(request.model.id);
|
|
125
|
+
return match !== null && Number(match[1]) >= 6;
|
|
125
126
|
};
|
|
126
127
|
const nativeImageToolInput = (tool) => {
|
|
127
128
|
const native = tool.native?.openai;
|
|
@@ -19,15 +19,18 @@ const Body = Schema.Struct({
|
|
|
19
19
|
request_id: Options.fields.requestID,
|
|
20
20
|
user_id: Options.fields.userID,
|
|
21
21
|
});
|
|
22
|
+
// Tool streaming was introduced in GLM-4.6; later versions inherit support.
|
|
23
|
+
const supportsToolStreaming = (modelID) => {
|
|
24
|
+
const match = /(?:^|\/)glm-(\d+)(?:\.(\d+))?(?:-|$)/i.exec(modelID);
|
|
25
|
+
return match !== null && (Number(match[1]) > 4 || (Number(match[1]) === 4 && Number(match[2] ?? 0) >= 6));
|
|
26
|
+
};
|
|
22
27
|
const fromRequest = Effect.fn("ZAIChat.fromRequest")(function* (request) {
|
|
23
28
|
const options = yield* ProviderShared.validateWith(Schema.decodeUnknownEffect(Options))(request.providerOptions ?? {});
|
|
24
29
|
const body = yield* OpenAIChat.protocol.body.from(request);
|
|
25
30
|
return {
|
|
26
31
|
...body,
|
|
27
32
|
thinking: options.thinking,
|
|
28
|
-
|
|
29
|
-
tool_stream: options.toolStream ??
|
|
30
|
-
(body.tools?.length && /^glm-(?:4\.[67]|5(?:[.-]|$))/i.test(request.model.id) ? true : undefined),
|
|
33
|
+
tool_stream: options.toolStream ?? (body.tools?.length && supportsToolStreaming(request.model.id) ? true : undefined),
|
|
31
34
|
do_sample: options.doSample,
|
|
32
35
|
response_format: options.responseFormat,
|
|
33
36
|
request_id: options.requestID,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-20344",
|
|
4
4
|
"name": "@opencode/ai",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@clack/prompts": "1.0.0-alpha.1",
|
|
36
36
|
"@effect/platform-node": "4.0.0-rc.112",
|
|
37
|
-
"@opencode/http-recorder": "0.0.0-dev-
|
|
37
|
+
"@opencode/http-recorder": "0.0.0-dev-20344",
|
|
38
38
|
"@tsconfig/bun": "1.0.9",
|
|
39
39
|
"@types/bun": "1.4.0",
|
|
40
40
|
"@typescript/native-preview": "7.0.0-dev.20251207.1",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@aws-sdk/credential-providers": "3.1057.0",
|
|
45
45
|
"@smithy/eventstream-codec": "4.2.14",
|
|
46
46
|
"@smithy/util-utf8": "4.2.2",
|
|
47
|
-
"@opencode/schema": "0.0.0-dev-
|
|
47
|
+
"@opencode/schema": "0.0.0-dev-20344",
|
|
48
48
|
"aws4fetch": "1.0.20",
|
|
49
49
|
"effect": "4.0.0-rc.112",
|
|
50
50
|
"google-auth-library": "10.5.0"
|