@opencode-ai/ai 0.0.0-next-15788 → 0.0.0-next-15796
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/protocols/openai-chat.d.ts +15 -0
- package/dist/protocols/openai-chat.js +40 -6
- package/dist/protocols/openai-compatible-chat.d.ts +2 -0
- package/dist/providers/azure.d.ts +2 -0
- package/dist/providers/cloudflare.d.ts +6 -0
- package/dist/providers/github-copilot.d.ts +2 -0
- package/dist/providers/google-vertex-chat.d.ts +2 -0
- package/dist/providers/openai-compatible.d.ts +2 -0
- package/dist/providers/openai.d.ts +2 -0
- package/dist/providers/openrouter.d.ts +10 -0
- package/dist/providers/xai.d.ts +2 -0
- package/package.json +3 -3
|
@@ -35,6 +35,8 @@ export declare const bodyFields: {
|
|
|
35
35
|
}>;
|
|
36
36
|
}>>>;
|
|
37
37
|
readonly reasoning_content: Schema.optional<Schema.String>;
|
|
38
|
+
readonly reasoning: Schema.optional<Schema.String>;
|
|
39
|
+
readonly reasoning_text: Schema.optional<Schema.String>;
|
|
38
40
|
}>, Schema.Struct<{
|
|
39
41
|
readonly role: Schema.Literal<"tool">;
|
|
40
42
|
readonly tool_call_id: Schema.String;
|
|
@@ -96,6 +98,8 @@ declare const OpenAIChatBody: Schema.Struct<{
|
|
|
96
98
|
}>;
|
|
97
99
|
}>>>;
|
|
98
100
|
readonly reasoning_content: Schema.optional<Schema.String>;
|
|
101
|
+
readonly reasoning: Schema.optional<Schema.String>;
|
|
102
|
+
readonly reasoning_text: Schema.optional<Schema.String>;
|
|
99
103
|
}>, Schema.Struct<{
|
|
100
104
|
readonly role: Schema.Literal<"tool">;
|
|
101
105
|
readonly tool_call_id: Schema.String;
|
|
@@ -135,6 +139,8 @@ export declare const OpenAIChatEvent: Schema.Struct<{
|
|
|
135
139
|
readonly delta: Schema.optional<Schema.NullOr<Schema.Struct<{
|
|
136
140
|
readonly content: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
137
141
|
readonly reasoning_content: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
142
|
+
readonly reasoning: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
143
|
+
readonly reasoning_text: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
138
144
|
readonly tool_calls: Schema.optional<Schema.NullOr<Schema.$Array<Schema.Struct<{
|
|
139
145
|
readonly index: Schema.Number;
|
|
140
146
|
readonly id: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
@@ -165,6 +171,7 @@ export interface ParserState {
|
|
|
165
171
|
readonly usage?: Usage;
|
|
166
172
|
readonly finishReason?: FinishReason;
|
|
167
173
|
readonly lifecycle: Lifecycle.State;
|
|
174
|
+
readonly reasoningField?: "reasoning" | "reasoning_content" | "reasoning_text";
|
|
168
175
|
}
|
|
169
176
|
/**
|
|
170
177
|
* The OpenAI Chat protocol — request body construction, body schema, and the
|
|
@@ -190,6 +197,7 @@ export declare const protocol: Protocol<{
|
|
|
190
197
|
}, "Type"> | {
|
|
191
198
|
readonly content: string | null;
|
|
192
199
|
readonly role: "assistant";
|
|
200
|
+
readonly reasoning?: string | undefined;
|
|
193
201
|
readonly tool_calls?: readonly Schema.Struct.ReadonlySide<{
|
|
194
202
|
readonly id: Schema.String;
|
|
195
203
|
readonly type: Schema.tag<"function">;
|
|
@@ -199,6 +207,7 @@ export declare const protocol: Protocol<{
|
|
|
199
207
|
}>;
|
|
200
208
|
}, "Type">[] | undefined;
|
|
201
209
|
readonly reasoning_content?: string | undefined;
|
|
210
|
+
readonly reasoning_text?: string | undefined;
|
|
202
211
|
} | Schema.Struct.ReadonlySide<{
|
|
203
212
|
readonly role: Schema.Literal<"tool">;
|
|
204
213
|
readonly tool_call_id: Schema.String;
|
|
@@ -236,6 +245,7 @@ export declare const protocol: Protocol<{
|
|
|
236
245
|
readonly choices: readonly {
|
|
237
246
|
readonly delta?: {
|
|
238
247
|
readonly content?: string | null | undefined;
|
|
248
|
+
readonly reasoning?: string | null | undefined;
|
|
239
249
|
readonly tool_calls?: readonly {
|
|
240
250
|
readonly index: number;
|
|
241
251
|
readonly function?: {
|
|
@@ -245,6 +255,7 @@ export declare const protocol: Protocol<{
|
|
|
245
255
|
readonly id?: string | null | undefined;
|
|
246
256
|
}[] | null | undefined;
|
|
247
257
|
readonly reasoning_content?: string | null | undefined;
|
|
258
|
+
readonly reasoning_text?: string | null | undefined;
|
|
248
259
|
} | null | undefined;
|
|
249
260
|
readonly finish_reason?: string | null | undefined;
|
|
250
261
|
}[];
|
|
@@ -278,6 +289,7 @@ export declare const httpTransport: HttpTransport.HttpJsonTransport<{
|
|
|
278
289
|
}, "Type"> | {
|
|
279
290
|
readonly content: string | null;
|
|
280
291
|
readonly role: "assistant";
|
|
292
|
+
readonly reasoning?: string | undefined;
|
|
281
293
|
readonly tool_calls?: readonly Schema.Struct.ReadonlySide<{
|
|
282
294
|
readonly id: Schema.String;
|
|
283
295
|
readonly type: Schema.tag<"function">;
|
|
@@ -287,6 +299,7 @@ export declare const httpTransport: HttpTransport.HttpJsonTransport<{
|
|
|
287
299
|
}>;
|
|
288
300
|
}, "Type">[] | undefined;
|
|
289
301
|
readonly reasoning_content?: string | undefined;
|
|
302
|
+
readonly reasoning_text?: string | undefined;
|
|
290
303
|
} | Schema.Struct.ReadonlySide<{
|
|
291
304
|
readonly role: Schema.Literal<"tool">;
|
|
292
305
|
readonly tool_call_id: Schema.String;
|
|
@@ -339,6 +352,7 @@ export declare const route: Route<{
|
|
|
339
352
|
}, "Type"> | {
|
|
340
353
|
readonly content: string | null;
|
|
341
354
|
readonly role: "assistant";
|
|
355
|
+
readonly reasoning?: string | undefined;
|
|
342
356
|
readonly tool_calls?: readonly Schema.Struct.ReadonlySide<{
|
|
343
357
|
readonly id: Schema.String;
|
|
344
358
|
readonly type: Schema.tag<"function">;
|
|
@@ -348,6 +362,7 @@ export declare const route: Route<{
|
|
|
348
362
|
}>;
|
|
349
363
|
}, "Type">[] | undefined;
|
|
350
364
|
readonly reasoning_content?: string | undefined;
|
|
365
|
+
readonly reasoning_text?: string | undefined;
|
|
351
366
|
} | Schema.Struct.ReadonlySide<{
|
|
352
367
|
readonly role: Schema.Literal<"tool">;
|
|
353
368
|
readonly tool_call_id: Schema.String;
|
|
@@ -55,6 +55,8 @@ const OpenAIChatMessage = Schema.Union([
|
|
|
55
55
|
content: Schema.NullOr(Schema.String),
|
|
56
56
|
tool_calls: optionalArray(OpenAIChatAssistantToolCall),
|
|
57
57
|
reasoning_content: Schema.optional(Schema.String),
|
|
58
|
+
reasoning: Schema.optional(Schema.String),
|
|
59
|
+
reasoning_text: Schema.optional(Schema.String),
|
|
58
60
|
}),
|
|
59
61
|
Schema.Struct({ role: Schema.Literal("tool"), tool_call_id: Schema.String, content: Schema.String }),
|
|
60
62
|
]).pipe(Schema.toTaggedUnion("role"));
|
|
@@ -112,6 +114,8 @@ const OpenAIChatToolCallDelta = Schema.Struct({
|
|
|
112
114
|
const OpenAIChatDelta = Schema.Struct({
|
|
113
115
|
content: optionalNull(Schema.String),
|
|
114
116
|
reasoning_content: optionalNull(Schema.String),
|
|
117
|
+
reasoning: optionalNull(Schema.String),
|
|
118
|
+
reasoning_text: optionalNull(Schema.String),
|
|
115
119
|
tool_calls: optionalNull(Schema.Array(OpenAIChatToolCallDelta)),
|
|
116
120
|
});
|
|
117
121
|
const OpenAIChatChoice = Schema.Struct({
|
|
@@ -155,6 +159,12 @@ const lowerMedia = Effect.fn("OpenAIChat.lowerMedia")(function* (part) {
|
|
|
155
159
|
return { type: "image_url", image_url: { url: media.dataUrl } };
|
|
156
160
|
});
|
|
157
161
|
const openAICompatibleReasoningContent = (native) => isRecord(native) && typeof native.reasoning_content === "string" ? native.reasoning_content : undefined;
|
|
162
|
+
const reasoningField = (part) => {
|
|
163
|
+
const field = part.providerMetadata?.openai?.reasoningField;
|
|
164
|
+
if (field === "reasoning" || field === "reasoning_content" || field === "reasoning_text")
|
|
165
|
+
return field;
|
|
166
|
+
return "reasoning_content";
|
|
167
|
+
};
|
|
158
168
|
const lowerUserMessage = Effect.fn("OpenAIChat.lowerUserMessage")(function* (message) {
|
|
159
169
|
const content = [];
|
|
160
170
|
for (const part of message.content) {
|
|
@@ -192,13 +202,19 @@ const lowerAssistantMessage = Effect.fn("OpenAIChat.lowerAssistantMessage")(func
|
|
|
192
202
|
continue;
|
|
193
203
|
}
|
|
194
204
|
}
|
|
205
|
+
const text = reasoning.map((part) => part.text).join("");
|
|
206
|
+
const field = reasoning[0] ? reasoningField(reasoning[0]) : "reasoning_content";
|
|
195
207
|
return {
|
|
196
208
|
role: "assistant",
|
|
197
209
|
content: content.length === 0 ? null : ProviderShared.joinText(content),
|
|
198
210
|
tool_calls: toolCalls.length === 0 ? undefined : toolCalls,
|
|
199
|
-
reasoning_content: reasoning.length
|
|
200
|
-
?
|
|
201
|
-
:
|
|
211
|
+
reasoning_content: reasoning.length === 0
|
|
212
|
+
? openAICompatibleReasoningContent(message.native?.openaiCompatible)
|
|
213
|
+
: field === "reasoning_content"
|
|
214
|
+
? text
|
|
215
|
+
: undefined,
|
|
216
|
+
reasoning: reasoning.length > 0 && field === "reasoning" ? text : undefined,
|
|
217
|
+
reasoning_text: reasoning.length > 0 && field === "reasoning_text" ? text : undefined,
|
|
202
218
|
};
|
|
203
219
|
});
|
|
204
220
|
const lowerToolMessages = Effect.fn("OpenAIChat.lowerToolMessages")(function* (message) {
|
|
@@ -336,6 +352,14 @@ const mapUsage = (usage) => {
|
|
|
336
352
|
providerMetadata: { openai: usage },
|
|
337
353
|
});
|
|
338
354
|
};
|
|
355
|
+
const reasoningDelta = (delta) => {
|
|
356
|
+
if (delta?.reasoning_content)
|
|
357
|
+
return { field: "reasoning_content", text: delta.reasoning_content };
|
|
358
|
+
if (delta?.reasoning)
|
|
359
|
+
return { field: "reasoning", text: delta.reasoning };
|
|
360
|
+
if (delta?.reasoning_text)
|
|
361
|
+
return { field: "reasoning_text", text: delta.reasoning_text };
|
|
362
|
+
};
|
|
339
363
|
const step = (state, event) => Effect.gen(function* () {
|
|
340
364
|
const events = [];
|
|
341
365
|
const usage = mapUsage(event.usage) ?? state.usage;
|
|
@@ -345,8 +369,12 @@ const step = (state, event) => Effect.gen(function* () {
|
|
|
345
369
|
const toolDeltas = delta?.tool_calls ?? [];
|
|
346
370
|
let tools = state.tools;
|
|
347
371
|
let lifecycle = state.lifecycle;
|
|
348
|
-
|
|
349
|
-
|
|
372
|
+
const reasoning = reasoningDelta(delta);
|
|
373
|
+
const reasoningField = state.reasoningField ?? reasoning?.field;
|
|
374
|
+
if (reasoning)
|
|
375
|
+
lifecycle = Lifecycle.reasoningDelta(lifecycle, events, "reasoning-0", reasoning.text, {
|
|
376
|
+
openai: { reasoningField: reasoningField ?? reasoning.field },
|
|
377
|
+
});
|
|
350
378
|
if (delta?.content) {
|
|
351
379
|
lifecycle = Lifecycle.reasoningEnd(lifecycle, events, "reasoning-0");
|
|
352
380
|
lifecycle = Lifecycle.textDelta(lifecycle, events, "text-0", delta.content);
|
|
@@ -374,6 +402,7 @@ const step = (state, event) => Effect.gen(function* () {
|
|
|
374
402
|
usage,
|
|
375
403
|
finishReason,
|
|
376
404
|
lifecycle,
|
|
405
|
+
reasoningField,
|
|
377
406
|
},
|
|
378
407
|
events,
|
|
379
408
|
];
|
|
@@ -405,7 +434,12 @@ export const protocol = Protocol.make({
|
|
|
405
434
|
},
|
|
406
435
|
stream: {
|
|
407
436
|
event: Protocol.jsonEvent(OpenAIChatEvent),
|
|
408
|
-
initial: () => ({
|
|
437
|
+
initial: () => ({
|
|
438
|
+
tools: ToolStream.empty(),
|
|
439
|
+
toolCallEvents: [],
|
|
440
|
+
lifecycle: Lifecycle.initial(),
|
|
441
|
+
reasoningField: undefined,
|
|
442
|
+
}),
|
|
409
443
|
step,
|
|
410
444
|
onHalt: finishEvents,
|
|
411
445
|
},
|
|
@@ -25,6 +25,7 @@ export declare const route: Route<{
|
|
|
25
25
|
}, "Type"> | {
|
|
26
26
|
readonly content: string | null;
|
|
27
27
|
readonly role: "assistant";
|
|
28
|
+
readonly reasoning?: string | undefined;
|
|
28
29
|
readonly tool_calls?: readonly import("effect/Schema").Struct.ReadonlySide<{
|
|
29
30
|
readonly id: import("effect/Schema").String;
|
|
30
31
|
readonly type: import("effect/Schema").tag<"function">;
|
|
@@ -34,6 +35,7 @@ export declare const route: Route<{
|
|
|
34
35
|
}>;
|
|
35
36
|
}, "Type">[] | undefined;
|
|
36
37
|
readonly reasoning_content?: string | undefined;
|
|
38
|
+
readonly reasoning_text?: string | undefined;
|
|
37
39
|
} | import("effect/Schema").Struct.ReadonlySide<{
|
|
38
40
|
readonly role: import("effect/Schema").Literal<"tool">;
|
|
39
41
|
readonly tool_call_id: import("effect/Schema").String;
|
|
@@ -39,6 +39,7 @@ export declare const routes: (RouteDef<{
|
|
|
39
39
|
}, "Type"> | {
|
|
40
40
|
readonly content: string | null;
|
|
41
41
|
readonly role: "assistant";
|
|
42
|
+
readonly reasoning?: string | undefined;
|
|
42
43
|
readonly tool_calls?: readonly import("effect/Schema").Struct.ReadonlySide<{
|
|
43
44
|
readonly id: import("effect/Schema").String;
|
|
44
45
|
readonly type: import("effect/Schema").tag<"function">;
|
|
@@ -48,6 +49,7 @@ export declare const routes: (RouteDef<{
|
|
|
48
49
|
}>;
|
|
49
50
|
}, "Type">[] | undefined;
|
|
50
51
|
readonly reasoning_content?: string | undefined;
|
|
52
|
+
readonly reasoning_text?: string | undefined;
|
|
51
53
|
} | import("effect/Schema").Struct.ReadonlySide<{
|
|
52
54
|
readonly role: import("effect/Schema").Literal<"tool">;
|
|
53
55
|
readonly tool_call_id: import("effect/Schema").String;
|
|
@@ -42,6 +42,7 @@ export declare const aiGatewayRoute: import("../route").Route<{
|
|
|
42
42
|
}, "Type"> | {
|
|
43
43
|
readonly content: string | null;
|
|
44
44
|
readonly role: "assistant";
|
|
45
|
+
readonly reasoning?: string | undefined;
|
|
45
46
|
readonly tool_calls?: readonly import("effect/Schema").Struct.ReadonlySide<{
|
|
46
47
|
readonly id: import("effect/Schema").String;
|
|
47
48
|
readonly type: import("effect/Schema").tag<"function">;
|
|
@@ -51,6 +52,7 @@ export declare const aiGatewayRoute: import("../route").Route<{
|
|
|
51
52
|
}>;
|
|
52
53
|
}, "Type">[] | undefined;
|
|
53
54
|
readonly reasoning_content?: string | undefined;
|
|
55
|
+
readonly reasoning_text?: string | undefined;
|
|
54
56
|
} | import("effect/Schema").Struct.ReadonlySide<{
|
|
55
57
|
readonly role: import("effect/Schema").Literal<"tool">;
|
|
56
58
|
readonly tool_call_id: import("effect/Schema").String;
|
|
@@ -103,6 +105,7 @@ export declare const workersAIRoute: import("../route").Route<{
|
|
|
103
105
|
}, "Type"> | {
|
|
104
106
|
readonly content: string | null;
|
|
105
107
|
readonly role: "assistant";
|
|
108
|
+
readonly reasoning?: string | undefined;
|
|
106
109
|
readonly tool_calls?: readonly import("effect/Schema").Struct.ReadonlySide<{
|
|
107
110
|
readonly id: import("effect/Schema").String;
|
|
108
111
|
readonly type: import("effect/Schema").tag<"function">;
|
|
@@ -112,6 +115,7 @@ export declare const workersAIRoute: import("../route").Route<{
|
|
|
112
115
|
}>;
|
|
113
116
|
}, "Type">[] | undefined;
|
|
114
117
|
readonly reasoning_content?: string | undefined;
|
|
118
|
+
readonly reasoning_text?: string | undefined;
|
|
115
119
|
} | import("effect/Schema").Struct.ReadonlySide<{
|
|
116
120
|
readonly role: import("effect/Schema").Literal<"tool">;
|
|
117
121
|
readonly tool_call_id: import("effect/Schema").String;
|
|
@@ -164,6 +168,7 @@ export declare const routes: import("../route").Route<{
|
|
|
164
168
|
}, "Type"> | {
|
|
165
169
|
readonly content: string | null;
|
|
166
170
|
readonly role: "assistant";
|
|
171
|
+
readonly reasoning?: string | undefined;
|
|
167
172
|
readonly tool_calls?: readonly import("effect/Schema").Struct.ReadonlySide<{
|
|
168
173
|
readonly id: import("effect/Schema").String;
|
|
169
174
|
readonly type: import("effect/Schema").tag<"function">;
|
|
@@ -173,6 +178,7 @@ export declare const routes: import("../route").Route<{
|
|
|
173
178
|
}>;
|
|
174
179
|
}, "Type">[] | undefined;
|
|
175
180
|
readonly reasoning_content?: string | undefined;
|
|
181
|
+
readonly reasoning_text?: string | undefined;
|
|
176
182
|
} | import("effect/Schema").Struct.ReadonlySide<{
|
|
177
183
|
readonly role: import("effect/Schema").Literal<"tool">;
|
|
178
184
|
readonly tool_call_id: import("effect/Schema").String;
|
|
@@ -27,6 +27,7 @@ export declare const routes: (import("../route").Route<{
|
|
|
27
27
|
}, "Type"> | {
|
|
28
28
|
readonly content: string | null;
|
|
29
29
|
readonly role: "assistant";
|
|
30
|
+
readonly reasoning?: string | undefined;
|
|
30
31
|
readonly tool_calls?: readonly import("effect/Schema").Struct.ReadonlySide<{
|
|
31
32
|
readonly id: import("effect/Schema").String;
|
|
32
33
|
readonly type: import("effect/Schema").tag<"function">;
|
|
@@ -36,6 +37,7 @@ export declare const routes: (import("../route").Route<{
|
|
|
36
37
|
}>;
|
|
37
38
|
}, "Type">[] | undefined;
|
|
38
39
|
readonly reasoning_content?: string | undefined;
|
|
40
|
+
readonly reasoning_text?: string | undefined;
|
|
39
41
|
} | import("effect/Schema").Struct.ReadonlySide<{
|
|
40
42
|
readonly role: import("effect/Schema").Literal<"tool">;
|
|
41
43
|
readonly tool_call_id: import("effect/Schema").String;
|
|
@@ -34,6 +34,7 @@ export declare const routes: import("../route").Route<{
|
|
|
34
34
|
}, "Type"> | {
|
|
35
35
|
readonly content: string | null;
|
|
36
36
|
readonly role: "assistant";
|
|
37
|
+
readonly reasoning?: string | undefined;
|
|
37
38
|
readonly tool_calls?: readonly import("effect/Schema").Struct.ReadonlySide<{
|
|
38
39
|
readonly id: import("effect/Schema").String;
|
|
39
40
|
readonly type: import("effect/Schema").tag<"function">;
|
|
@@ -43,6 +44,7 @@ export declare const routes: import("../route").Route<{
|
|
|
43
44
|
}>;
|
|
44
45
|
}, "Type">[] | undefined;
|
|
45
46
|
readonly reasoning_content?: string | undefined;
|
|
47
|
+
readonly reasoning_text?: string | undefined;
|
|
46
48
|
} | import("effect/Schema").Struct.ReadonlySide<{
|
|
47
49
|
readonly role: import("effect/Schema").Literal<"tool">;
|
|
48
50
|
readonly tool_call_id: import("effect/Schema").String;
|
|
@@ -33,6 +33,7 @@ export declare const routes: import("../route").Route<{
|
|
|
33
33
|
}, "Type"> | {
|
|
34
34
|
readonly content: string | null;
|
|
35
35
|
readonly role: "assistant";
|
|
36
|
+
readonly reasoning?: string | undefined;
|
|
36
37
|
readonly tool_calls?: readonly import("effect/Schema").Struct.ReadonlySide<{
|
|
37
38
|
readonly id: import("effect/Schema").String;
|
|
38
39
|
readonly type: import("effect/Schema").tag<"function">;
|
|
@@ -42,6 +43,7 @@ export declare const routes: import("../route").Route<{
|
|
|
42
43
|
}>;
|
|
43
44
|
}, "Type">[] | undefined;
|
|
44
45
|
readonly reasoning_content?: string | undefined;
|
|
46
|
+
readonly reasoning_text?: string | undefined;
|
|
45
47
|
} | import("effect/Schema").Struct.ReadonlySide<{
|
|
46
48
|
readonly role: import("effect/Schema").Literal<"tool">;
|
|
47
49
|
readonly tool_call_id: import("effect/Schema").String;
|
|
@@ -23,6 +23,7 @@ export declare const routes: (Route<{
|
|
|
23
23
|
}, "Type"> | {
|
|
24
24
|
readonly content: string | null;
|
|
25
25
|
readonly role: "assistant";
|
|
26
|
+
readonly reasoning?: string | undefined;
|
|
26
27
|
readonly tool_calls?: readonly import("effect/Schema").Struct.ReadonlySide<{
|
|
27
28
|
readonly id: import("effect/Schema").String;
|
|
28
29
|
readonly type: import("effect/Schema").tag<"function">;
|
|
@@ -32,6 +33,7 @@ export declare const routes: (Route<{
|
|
|
32
33
|
}>;
|
|
33
34
|
}, "Type">[] | undefined;
|
|
34
35
|
readonly reasoning_content?: string | undefined;
|
|
36
|
+
readonly reasoning_text?: string | undefined;
|
|
35
37
|
} | import("effect/Schema").Struct.ReadonlySide<{
|
|
36
38
|
readonly role: import("effect/Schema").Literal<"tool">;
|
|
37
39
|
readonly tool_call_id: import("effect/Schema").String;
|
|
@@ -50,6 +50,8 @@ declare const OpenRouterBody: Schema.StructWithRest<Schema.Struct<{
|
|
|
50
50
|
}>;
|
|
51
51
|
}>>>;
|
|
52
52
|
readonly reasoning_content: Schema.optional<Schema.String>;
|
|
53
|
+
readonly reasoning: Schema.optional<Schema.String>;
|
|
54
|
+
readonly reasoning_text: Schema.optional<Schema.String>;
|
|
53
55
|
}>, Schema.Struct<{
|
|
54
56
|
readonly role: Schema.Literal<"tool">;
|
|
55
57
|
readonly tool_call_id: Schema.String;
|
|
@@ -103,6 +105,7 @@ export declare const protocol: Protocol<{
|
|
|
103
105
|
}, "Type"> | {
|
|
104
106
|
readonly content: string | null;
|
|
105
107
|
readonly role: "assistant";
|
|
108
|
+
readonly reasoning?: string | undefined;
|
|
106
109
|
readonly tool_calls?: readonly Schema.Struct.ReadonlySide<{
|
|
107
110
|
readonly id: Schema.String;
|
|
108
111
|
readonly type: Schema.tag<"function">;
|
|
@@ -112,6 +115,7 @@ export declare const protocol: Protocol<{
|
|
|
112
115
|
}>;
|
|
113
116
|
}, "Type">[] | undefined;
|
|
114
117
|
readonly reasoning_content?: string | undefined;
|
|
118
|
+
readonly reasoning_text?: string | undefined;
|
|
115
119
|
} | Schema.Struct.ReadonlySide<{
|
|
116
120
|
readonly role: Schema.Literal<"tool">;
|
|
117
121
|
readonly tool_call_id: Schema.String;
|
|
@@ -149,6 +153,7 @@ export declare const protocol: Protocol<{
|
|
|
149
153
|
readonly choices: readonly {
|
|
150
154
|
readonly delta?: {
|
|
151
155
|
readonly content?: string | null | undefined;
|
|
156
|
+
readonly reasoning?: string | null | undefined;
|
|
152
157
|
readonly tool_calls?: readonly {
|
|
153
158
|
readonly index: number;
|
|
154
159
|
readonly function?: {
|
|
@@ -158,6 +163,7 @@ export declare const protocol: Protocol<{
|
|
|
158
163
|
readonly id?: string | null | undefined;
|
|
159
164
|
}[] | null | undefined;
|
|
160
165
|
readonly reasoning_content?: string | null | undefined;
|
|
166
|
+
readonly reasoning_text?: string | null | undefined;
|
|
161
167
|
} | null | undefined;
|
|
162
168
|
readonly finish_reason?: string | null | undefined;
|
|
163
169
|
}[];
|
|
@@ -192,6 +198,7 @@ export declare const route: Route<{
|
|
|
192
198
|
}, "Type"> | {
|
|
193
199
|
readonly content: string | null;
|
|
194
200
|
readonly role: "assistant";
|
|
201
|
+
readonly reasoning?: string | undefined;
|
|
195
202
|
readonly tool_calls?: readonly Schema.Struct.ReadonlySide<{
|
|
196
203
|
readonly id: Schema.String;
|
|
197
204
|
readonly type: Schema.tag<"function">;
|
|
@@ -201,6 +208,7 @@ export declare const route: Route<{
|
|
|
201
208
|
}>;
|
|
202
209
|
}, "Type">[] | undefined;
|
|
203
210
|
readonly reasoning_content?: string | undefined;
|
|
211
|
+
readonly reasoning_text?: string | undefined;
|
|
204
212
|
} | Schema.Struct.ReadonlySide<{
|
|
205
213
|
readonly role: Schema.Literal<"tool">;
|
|
206
214
|
readonly tool_call_id: Schema.String;
|
|
@@ -254,6 +262,7 @@ export declare const routes: Route<{
|
|
|
254
262
|
}, "Type"> | {
|
|
255
263
|
readonly content: string | null;
|
|
256
264
|
readonly role: "assistant";
|
|
265
|
+
readonly reasoning?: string | undefined;
|
|
257
266
|
readonly tool_calls?: readonly Schema.Struct.ReadonlySide<{
|
|
258
267
|
readonly id: Schema.String;
|
|
259
268
|
readonly type: Schema.tag<"function">;
|
|
@@ -263,6 +272,7 @@ export declare const routes: Route<{
|
|
|
263
272
|
}>;
|
|
264
273
|
}, "Type">[] | undefined;
|
|
265
274
|
readonly reasoning_content?: string | undefined;
|
|
275
|
+
readonly reasoning_text?: string | undefined;
|
|
266
276
|
} | Schema.Struct.ReadonlySide<{
|
|
267
277
|
readonly role: Schema.Literal<"tool">;
|
|
268
278
|
readonly tool_call_id: Schema.String;
|
package/dist/providers/xai.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ export declare const routes: (import("../route").Route<{
|
|
|
23
23
|
}, "Type"> | {
|
|
24
24
|
readonly content: string | null;
|
|
25
25
|
readonly role: "assistant";
|
|
26
|
+
readonly reasoning?: string | undefined;
|
|
26
27
|
readonly tool_calls?: readonly import("effect/Schema").Struct.ReadonlySide<{
|
|
27
28
|
readonly id: import("effect/Schema").String;
|
|
28
29
|
readonly type: import("effect/Schema").tag<"function">;
|
|
@@ -32,6 +33,7 @@ export declare const routes: (import("../route").Route<{
|
|
|
32
33
|
}>;
|
|
33
34
|
}, "Type">[] | undefined;
|
|
34
35
|
readonly reasoning_content?: string | undefined;
|
|
36
|
+
readonly reasoning_text?: string | undefined;
|
|
35
37
|
} | import("effect/Schema").Struct.ReadonlySide<{
|
|
36
38
|
readonly role: import("effect/Schema").Literal<"tool">;
|
|
37
39
|
readonly tool_call_id: import("effect/Schema").String;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
|
-
"version": "0.0.0-next-
|
|
3
|
+
"version": "0.0.0-next-15796",
|
|
4
4
|
"name": "@opencode-ai/ai",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@clack/prompts": "1.0.0-alpha.1",
|
|
28
28
|
"@effect/platform-node": "4.0.0-beta.98",
|
|
29
|
-
"@opencode-ai/http-recorder": "0.0.0-next-
|
|
29
|
+
"@opencode-ai/http-recorder": "0.0.0-next-15796",
|
|
30
30
|
"@tsconfig/bun": "1.0.9",
|
|
31
31
|
"@types/bun": "1.3.13",
|
|
32
32
|
"@typescript/native-preview": "7.0.0-dev.20251207.1",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@smithy/eventstream-codec": "4.2.14",
|
|
37
37
|
"@smithy/util-utf8": "4.2.2",
|
|
38
|
-
"@opencode-ai/schema": "0.0.0-next-
|
|
38
|
+
"@opencode-ai/schema": "0.0.0-next-15796",
|
|
39
39
|
"aws4fetch": "1.0.20",
|
|
40
40
|
"effect": "4.0.0-beta.98",
|
|
41
41
|
"google-auth-library": "10.5.0"
|