@opencode/ai 0.0.0-dev-1302 → 0.0.0-dev-1304
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/cache-policy.js +4 -2
- package/dist/llm.d.ts +4 -1
- package/dist/llm.js +10 -1
- package/dist/protocols/alibaba-messages.d.ts +24 -2
- package/dist/protocols/alibaba-responses.d.ts +26 -0
- package/dist/protocols/anthropic-messages.d.ts +70 -6
- package/dist/protocols/anthropic-messages.js +74 -9
- package/dist/protocols/meta-messages.d.ts +24 -2
- package/dist/protocols/meta-responses.d.ts +52 -0
- package/dist/protocols/open-responses.d.ts +250 -24
- package/dist/protocols/open-responses.js +40 -24
- package/dist/protocols/openai-compatible-responses.d.ts +26 -0
- package/dist/protocols/openai-freeform.d.ts +1 -1
- package/dist/protocols/openai-freeform.js +9 -5
- package/dist/protocols/openai-responses.d.ts +153 -0
- package/dist/protocols/openai-responses.js +68 -7
- package/dist/protocols/utils/gateway-protocol.js +1 -0
- package/dist/protocols/utils/responses-compaction.js +7 -3
- package/dist/protocols/xai-responses.d.ts +26 -0
- package/dist/protocols/zai-messages.d.ts +24 -2
- package/dist/providers/alibaba.d.ts +50 -2
- package/dist/providers/amazon-bedrock-mantle.d.ts +50 -2
- package/dist/providers/anthropic-compatible.d.ts +24 -2
- package/dist/providers/anthropic.d.ts +24 -2
- package/dist/providers/azure.d.ts +76 -2
- package/dist/providers/cloudflare-ai-gateway.d.ts +100 -4
- package/dist/providers/digitalocean.d.ts +26 -0
- package/dist/providers/google-vertex-messages.d.ts +24 -2
- package/dist/providers/google-vertex-messages.js +1 -0
- package/dist/providers/google-vertex-responses.d.ts +26 -0
- package/dist/providers/meta.d.ts +50 -2
- package/dist/providers/minimax.d.ts +50 -2
- package/dist/providers/moonshot.d.ts +50 -2
- package/dist/providers/openai-compatible-responses.d.ts +26 -0
- package/dist/providers/openai.d.ts +26 -0
- package/dist/providers/openrouter.d.ts +26 -0
- package/dist/providers/venice.d.ts +26 -0
- package/dist/providers/zai-coding-plan.d.ts +50 -2
- package/dist/public.d.ts +2 -2
- package/dist/public.js +1 -1
- package/dist/route/client.d.ts +2 -0
- package/dist/route/client.js +5 -1
- package/dist/route/protocol.d.ts +3 -0
- package/dist/schema/events.d.ts +5 -0
- package/dist/schema/messages.d.ts +24 -1
- package/dist/schema/messages.js +26 -2
- package/dist/schema/options.d.ts +10 -2
- package/dist/tool-updates.d.ts +34 -0
- package/dist/tool-updates.js +93 -0
- package/dist/tool.d.ts +6 -1
- package/dist/tool.js +1 -1
- package/package.json +3 -3
|
@@ -26,6 +26,29 @@ declare const OpenAIResponsesBody: Schema.Struct<{
|
|
|
26
26
|
readonly reasoning: Schema.Struct<{
|
|
27
27
|
readonly effort: Schema.declare<OpenResponsesOptions.ReasoningEffort, OpenResponsesOptions.ReasoningEffort>;
|
|
28
28
|
}>;
|
|
29
|
+
}>, Schema.Struct<{
|
|
30
|
+
readonly type: Schema.Literal<"additional_tools">;
|
|
31
|
+
readonly role: Schema.Literal<"developer">;
|
|
32
|
+
readonly tools: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
33
|
+
readonly type: Schema.tag<"function">;
|
|
34
|
+
readonly name: Schema.String;
|
|
35
|
+
readonly description: Schema.String;
|
|
36
|
+
readonly parameters: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
37
|
+
readonly strict: Schema.optional<Schema.Boolean>;
|
|
38
|
+
}>, Schema.Struct<{
|
|
39
|
+
readonly type: Schema.tag<"custom">;
|
|
40
|
+
readonly name: Schema.String;
|
|
41
|
+
readonly description: Schema.String;
|
|
42
|
+
readonly format: Schema.Union<readonly [Schema.Struct<{
|
|
43
|
+
readonly type: Schema.tag<"text">;
|
|
44
|
+
}>, Schema.Struct<{
|
|
45
|
+
readonly type: Schema.tag<"grammar">;
|
|
46
|
+
readonly syntax: Schema.Literals<readonly ["lark", "regex"]>;
|
|
47
|
+
readonly definition: Schema.String;
|
|
48
|
+
}>]>;
|
|
49
|
+
}>, Schema.StructWithRest<Schema.Struct<{
|
|
50
|
+
readonly type: Schema.String;
|
|
51
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>]>>;
|
|
29
52
|
}>, Schema.Struct<{
|
|
30
53
|
readonly type: Schema.tag<"message">;
|
|
31
54
|
readonly role: Schema.tag<"system">;
|
|
@@ -240,6 +263,32 @@ export declare const protocol: Protocol<{
|
|
|
240
263
|
readonly reasoning: {
|
|
241
264
|
readonly effort: OpenResponsesOptions.ReasoningEffort;
|
|
242
265
|
};
|
|
266
|
+
} | {
|
|
267
|
+
readonly type: "additional_tools";
|
|
268
|
+
readonly role: "developer";
|
|
269
|
+
readonly tools: readonly ({
|
|
270
|
+
readonly type: "custom";
|
|
271
|
+
readonly name: string;
|
|
272
|
+
readonly description: string;
|
|
273
|
+
readonly format: {
|
|
274
|
+
readonly type: "text";
|
|
275
|
+
} | {
|
|
276
|
+
readonly type: "grammar";
|
|
277
|
+
readonly syntax: "lark" | "regex";
|
|
278
|
+
readonly definition: string;
|
|
279
|
+
};
|
|
280
|
+
} | {
|
|
281
|
+
readonly type: "function";
|
|
282
|
+
readonly name: string;
|
|
283
|
+
readonly description: string;
|
|
284
|
+
readonly parameters: {
|
|
285
|
+
readonly [x: string]: unknown;
|
|
286
|
+
};
|
|
287
|
+
readonly strict?: boolean | undefined;
|
|
288
|
+
} | {
|
|
289
|
+
readonly [x: string]: unknown;
|
|
290
|
+
readonly type: string;
|
|
291
|
+
})[];
|
|
243
292
|
} | {
|
|
244
293
|
readonly type: "message";
|
|
245
294
|
readonly role: "system";
|
|
@@ -528,6 +577,32 @@ export declare const httpTransport: HttpTransport.HttpJsonTransport<{
|
|
|
528
577
|
readonly reasoning: {
|
|
529
578
|
readonly effort: OpenResponsesOptions.ReasoningEffort;
|
|
530
579
|
};
|
|
580
|
+
} | {
|
|
581
|
+
readonly type: "additional_tools";
|
|
582
|
+
readonly role: "developer";
|
|
583
|
+
readonly tools: readonly ({
|
|
584
|
+
readonly type: "custom";
|
|
585
|
+
readonly name: string;
|
|
586
|
+
readonly description: string;
|
|
587
|
+
readonly format: {
|
|
588
|
+
readonly type: "text";
|
|
589
|
+
} | {
|
|
590
|
+
readonly type: "grammar";
|
|
591
|
+
readonly syntax: "lark" | "regex";
|
|
592
|
+
readonly definition: string;
|
|
593
|
+
};
|
|
594
|
+
} | {
|
|
595
|
+
readonly type: "function";
|
|
596
|
+
readonly name: string;
|
|
597
|
+
readonly description: string;
|
|
598
|
+
readonly parameters: {
|
|
599
|
+
readonly [x: string]: unknown;
|
|
600
|
+
};
|
|
601
|
+
readonly strict?: boolean | undefined;
|
|
602
|
+
} | {
|
|
603
|
+
readonly [x: string]: unknown;
|
|
604
|
+
readonly type: string;
|
|
605
|
+
})[];
|
|
531
606
|
} | {
|
|
532
607
|
readonly type: "message";
|
|
533
608
|
readonly role: "system";
|
|
@@ -758,6 +833,32 @@ export declare const channelTransport: (options: import("./open-responses-channe
|
|
|
758
833
|
readonly reasoning: {
|
|
759
834
|
readonly effort: OpenResponsesOptions.ReasoningEffort;
|
|
760
835
|
};
|
|
836
|
+
} | {
|
|
837
|
+
readonly type: "additional_tools";
|
|
838
|
+
readonly role: "developer";
|
|
839
|
+
readonly tools: readonly ({
|
|
840
|
+
readonly type: "custom";
|
|
841
|
+
readonly name: string;
|
|
842
|
+
readonly description: string;
|
|
843
|
+
readonly format: {
|
|
844
|
+
readonly type: "text";
|
|
845
|
+
} | {
|
|
846
|
+
readonly type: "grammar";
|
|
847
|
+
readonly syntax: "lark" | "regex";
|
|
848
|
+
readonly definition: string;
|
|
849
|
+
};
|
|
850
|
+
} | {
|
|
851
|
+
readonly type: "function";
|
|
852
|
+
readonly name: string;
|
|
853
|
+
readonly description: string;
|
|
854
|
+
readonly parameters: {
|
|
855
|
+
readonly [x: string]: unknown;
|
|
856
|
+
};
|
|
857
|
+
readonly strict?: boolean | undefined;
|
|
858
|
+
} | {
|
|
859
|
+
readonly [x: string]: unknown;
|
|
860
|
+
readonly type: string;
|
|
861
|
+
})[];
|
|
761
862
|
} | {
|
|
762
863
|
readonly type: "message";
|
|
763
864
|
readonly role: "system";
|
|
@@ -988,6 +1089,32 @@ export declare const transport: import("../route/transport/index.js").Transport<
|
|
|
988
1089
|
readonly reasoning: {
|
|
989
1090
|
readonly effort: OpenResponsesOptions.ReasoningEffort;
|
|
990
1091
|
};
|
|
1092
|
+
} | {
|
|
1093
|
+
readonly type: "additional_tools";
|
|
1094
|
+
readonly role: "developer";
|
|
1095
|
+
readonly tools: readonly ({
|
|
1096
|
+
readonly type: "custom";
|
|
1097
|
+
readonly name: string;
|
|
1098
|
+
readonly description: string;
|
|
1099
|
+
readonly format: {
|
|
1100
|
+
readonly type: "text";
|
|
1101
|
+
} | {
|
|
1102
|
+
readonly type: "grammar";
|
|
1103
|
+
readonly syntax: "lark" | "regex";
|
|
1104
|
+
readonly definition: string;
|
|
1105
|
+
};
|
|
1106
|
+
} | {
|
|
1107
|
+
readonly type: "function";
|
|
1108
|
+
readonly name: string;
|
|
1109
|
+
readonly description: string;
|
|
1110
|
+
readonly parameters: {
|
|
1111
|
+
readonly [x: string]: unknown;
|
|
1112
|
+
};
|
|
1113
|
+
readonly strict?: boolean | undefined;
|
|
1114
|
+
} | {
|
|
1115
|
+
readonly [x: string]: unknown;
|
|
1116
|
+
readonly type: string;
|
|
1117
|
+
})[];
|
|
991
1118
|
} | {
|
|
992
1119
|
readonly type: "message";
|
|
993
1120
|
readonly role: "system";
|
|
@@ -1218,6 +1345,32 @@ export declare const route: Route<{
|
|
|
1218
1345
|
readonly reasoning: {
|
|
1219
1346
|
readonly effort: OpenResponsesOptions.ReasoningEffort;
|
|
1220
1347
|
};
|
|
1348
|
+
} | {
|
|
1349
|
+
readonly type: "additional_tools";
|
|
1350
|
+
readonly role: "developer";
|
|
1351
|
+
readonly tools: readonly ({
|
|
1352
|
+
readonly type: "custom";
|
|
1353
|
+
readonly name: string;
|
|
1354
|
+
readonly description: string;
|
|
1355
|
+
readonly format: {
|
|
1356
|
+
readonly type: "text";
|
|
1357
|
+
} | {
|
|
1358
|
+
readonly type: "grammar";
|
|
1359
|
+
readonly syntax: "lark" | "regex";
|
|
1360
|
+
readonly definition: string;
|
|
1361
|
+
};
|
|
1362
|
+
} | {
|
|
1363
|
+
readonly type: "function";
|
|
1364
|
+
readonly name: string;
|
|
1365
|
+
readonly description: string;
|
|
1366
|
+
readonly parameters: {
|
|
1367
|
+
readonly [x: string]: unknown;
|
|
1368
|
+
};
|
|
1369
|
+
readonly strict?: boolean | undefined;
|
|
1370
|
+
} | {
|
|
1371
|
+
readonly [x: string]: unknown;
|
|
1372
|
+
readonly type: string;
|
|
1373
|
+
})[];
|
|
1221
1374
|
} | {
|
|
1222
1375
|
readonly type: "message";
|
|
1223
1376
|
readonly role: "system";
|
|
@@ -8,6 +8,7 @@ import { Protocol } from "../route/protocol.js";
|
|
|
8
8
|
import { HttpTransport } from "../route/transport/index.js";
|
|
9
9
|
import { requestTTL } from "../cache-policy.js";
|
|
10
10
|
import { resolveEffortUpdates } from "../effort-updates.js";
|
|
11
|
+
import { addsTools, toolUpdateKinds } from "../tool-updates.js";
|
|
11
12
|
import { OpenResponses } from "./open-responses.js";
|
|
12
13
|
import { OpenResponsesOptions } from "./utils/open-responses-options.js";
|
|
13
14
|
import { JsonObject, lenient, optionalArray, optionalNull, ProviderShared } from "./shared.js";
|
|
@@ -138,6 +139,19 @@ const supportsEffortUpdates = (request) => {
|
|
|
138
139
|
const match = /(?:^|\/)gpt-(\d+)(?:\.\d+)?(?:-|$)/i.exec(request.model.id);
|
|
139
140
|
return match !== null && Number(match[1]) >= 6;
|
|
140
141
|
};
|
|
142
|
+
// `additional_tools` adds tools, and redefines one by name only when that one was declared through `additional_tools`
|
|
143
|
+
// too. So a model whose `tools.updates` includes "add" gets every tool the request declares in a leading
|
|
144
|
+
// `additional_tools` item instead of top-level `tools`; without "add" nothing goes in place. Later additions and
|
|
145
|
+
// redefinitions ("replace") are later items. The API can't withdraw a tool, so a removal ("remove") is announced in
|
|
146
|
+
// a developer message and the tool stays declared. Hosted tools stay in `tools`, since the model doesn't use one
|
|
147
|
+
// declared in `additional_tools`, and changing one folds.
|
|
148
|
+
const toolUpdates = {
|
|
149
|
+
kinds: ["add", "remove", "replace"],
|
|
150
|
+
placeable: (request) => declaresInPlace(request),
|
|
151
|
+
declarable: (tool) => !isHostedTool(tool),
|
|
152
|
+
};
|
|
153
|
+
const isHostedTool = (tool) => tool.type === "tool" && tool.native !== undefined;
|
|
154
|
+
const declaresInPlace = (request) => toolUpdateKinds(request).includes("add");
|
|
141
155
|
const nativeImageToolInput = (tool) => {
|
|
142
156
|
const native = tool.native?.openai;
|
|
143
157
|
return ProviderShared.isRecord(native) && native.type === "image_generation" ? native : undefined;
|
|
@@ -172,10 +186,47 @@ const lowerToolEntry = Effect.fnUntraced(function* (tool, custom) {
|
|
|
172
186
|
tools: yield* Effect.forEach(ProviderShared.flattenTools(tool.tools), (leaf) => OpenResponses.lowerTool(NAME, leaf)),
|
|
173
187
|
};
|
|
174
188
|
});
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
189
|
+
// Lowers one request's tool updates, in message order. Every `additional_tools` item after the first is preceded by
|
|
190
|
+
// a hint that it adds to the tools declared before it, naming tools removed and not declared again since. Without
|
|
191
|
+
// it, models can read the latest item as the whole set.
|
|
192
|
+
const toolChangeLowering = (declaredInPlace, custom) => {
|
|
193
|
+
let declared = declaredInPlace;
|
|
194
|
+
const unavailable = new Set();
|
|
195
|
+
return Effect.fnUntraced(function* (changes) {
|
|
196
|
+
changes.add.forEach((tool) => unavailable.delete(tool.name));
|
|
197
|
+
const hint = declared && changes.add.length > 0 ? [developer(incrementalNotice([...unavailable]))] : [];
|
|
198
|
+
const additions = changes.add.length === 0
|
|
199
|
+
? []
|
|
200
|
+
: [
|
|
201
|
+
{
|
|
202
|
+
type: "additional_tools",
|
|
203
|
+
role: "developer",
|
|
204
|
+
tools: yield* Effect.forEach(changes.add, (tool) => lowerToolEntry(tool, custom)),
|
|
205
|
+
},
|
|
206
|
+
];
|
|
207
|
+
declared = declared || changes.add.length > 0;
|
|
208
|
+
changes.remove.forEach((name) => unavailable.add(name));
|
|
209
|
+
return [...hint, ...additions, ...(changes.remove.length === 0 ? [] : [developer(removalNotice(changes.remove))])];
|
|
210
|
+
});
|
|
178
211
|
};
|
|
212
|
+
const developer = (content) => ({ type: "message", role: "developer", content });
|
|
213
|
+
const incrementalNotice = (unavailable) => [
|
|
214
|
+
"Tool update: the tools below are added to the ones you already have. Earlier tools stay available unless marked unavailable, and a tool declared again replaces its earlier definition.",
|
|
215
|
+
...(unavailable.length === 0 ? [] : [`Still unavailable: ${unavailable.join(", ")}.`]),
|
|
216
|
+
].join("\n");
|
|
217
|
+
const removalNotice = (names) => `These tools are no longer available. Do not call them: ${names.join(", ")}.`;
|
|
218
|
+
// The leading declaration: top-level `tools`, or a leading `additional_tools` item on models that add tools in place.
|
|
219
|
+
const lowerToolLayout = Effect.fnUntraced(function* (request, custom) {
|
|
220
|
+
const lower = (tools) => Effect.forEach(tools, (tool) => lowerToolEntry(tool, custom));
|
|
221
|
+
const declared = declaresInPlace(request) ? request.tools.filter((tool) => !isHostedTool(tool)) : [];
|
|
222
|
+
const top = declared.length === 0 ? request.tools : request.tools.filter(isHostedTool);
|
|
223
|
+
return {
|
|
224
|
+
head: declared.length === 0
|
|
225
|
+
? []
|
|
226
|
+
: [{ type: "additional_tools", role: "developer", tools: yield* lower(declared) }],
|
|
227
|
+
tools: top.length === 0 ? undefined : yield* lower(top),
|
|
228
|
+
};
|
|
229
|
+
});
|
|
179
230
|
const lowerToolChoice = (toolChoice, tools, custom) => ProviderShared.matchToolChoice(NAME, toolChoice, {
|
|
180
231
|
auto: () => "auto",
|
|
181
232
|
none: () => "none",
|
|
@@ -191,8 +242,14 @@ const fromRequest = Effect.fn("OpenAIResponses.fromRequest")(function* (request)
|
|
|
191
242
|
const updates = resolveEffortUpdates(request, options.reasoningEffort);
|
|
192
243
|
const generation = OpenResponses.lowerGeneration(request, { ...options, reasoningEffort: updates.effort });
|
|
193
244
|
const custom = OpenAIFreeform.tools(request);
|
|
245
|
+
const layout = yield* lowerToolLayout(request, custom);
|
|
246
|
+
const conversation = yield* OpenResponses.lowerConversation(updates.request, {
|
|
247
|
+
...adapter,
|
|
248
|
+
lowerToolChanges: toolChangeLowering(layout.head.length > 0, custom),
|
|
249
|
+
});
|
|
194
250
|
return {
|
|
195
|
-
...
|
|
251
|
+
...conversation,
|
|
252
|
+
input: [...layout.head, ...conversation.input],
|
|
196
253
|
...generation,
|
|
197
254
|
...Cache.openAIRequestTTL(requestTTL(request)),
|
|
198
255
|
...(generation.reasoning || reasoning.reasoningMode || reasoning.reasoningContext
|
|
@@ -205,8 +262,8 @@ const fromRequest = Effect.fn("OpenAIResponses.fromRequest")(function* (request)
|
|
|
205
262
|
}
|
|
206
263
|
: {}),
|
|
207
264
|
context_management: management?.map((edit) => ({ type: edit.type, compact_threshold: edit.compactThreshold })),
|
|
208
|
-
tools:
|
|
209
|
-
tool_choice: request.tools.length === 0
|
|
265
|
+
tools: layout.tools,
|
|
266
|
+
tool_choice: request.tools.length === 0 && !addsTools(request)
|
|
210
267
|
? undefined
|
|
211
268
|
: (OpenResponses.allowedToolChoice(options, custom) ??
|
|
212
269
|
(request.toolChoice ? yield* lowerToolChoice(request.toolChoice, request.tools, custom) : undefined)),
|
|
@@ -268,6 +325,7 @@ export const protocol = Protocol.make({
|
|
|
268
325
|
: ProviderShared.eventError(ADAPTER, `${event.type} is missing item_id`);
|
|
269
326
|
}),
|
|
270
327
|
supportsEffortUpdates,
|
|
328
|
+
toolUpdates,
|
|
271
329
|
});
|
|
272
330
|
const endpoint = Endpoint.path(PATH, { baseURL: DEFAULT_BASE_URL });
|
|
273
331
|
const auth = Auth.none;
|
|
@@ -281,7 +339,10 @@ export const transport = channelTransport({
|
|
|
281
339
|
});
|
|
282
340
|
export const route = Route.make({
|
|
283
341
|
compact: {
|
|
284
|
-
endpoint: ResponsesCompaction.make(adapter,
|
|
342
|
+
endpoint: ResponsesCompaction.make(adapter, (request) => {
|
|
343
|
+
const custom = OpenAIFreeform.tools(request);
|
|
344
|
+
return Effect.forEach(request.tools, (tool) => lowerToolEntry(tool, custom));
|
|
345
|
+
}),
|
|
285
346
|
trigger: ResponsesCheckpoint.make(checkpointBody),
|
|
286
347
|
},
|
|
287
348
|
id: ADAPTER,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Effect, Schema, Stream } from "effect";
|
|
2
2
|
import { AIError, InvalidProviderOutputError, CompactionPart, CompactionResponse, Message, mergeJsonRecords, } from "../../schema/index.js";
|
|
3
3
|
import { stripEffortUpdates } from "../../effort-updates.js";
|
|
4
|
+
import { foldToolUpdates } from "../../tool-updates.js";
|
|
4
5
|
import { Endpoint } from "../../route/endpoint.js";
|
|
5
6
|
import { RequestExecutor } from "../../route/executor.js";
|
|
6
7
|
import { HttpTransport } from "../../route/transport/index.js";
|
|
@@ -62,10 +63,13 @@ const Response = Schema.Struct({
|
|
|
62
63
|
});
|
|
63
64
|
export const make = (adapter, lowerTools) => Effect.fn("ResponsesCompaction.execute")(function* (request, executor, options) {
|
|
64
65
|
const route = request.model.route;
|
|
65
|
-
// The standalone compaction endpoint rejects
|
|
66
|
-
|
|
66
|
+
// The standalone compaction endpoint rejects effort updates (`configuration_update`). Every tool goes in
|
|
67
|
+
// top-level `tools`: after compacting a history whose tools were only in `additional_tools`, small models lost
|
|
68
|
+
// track of them more often.
|
|
69
|
+
const folded = foldToolUpdates(stripEffortUpdates(request));
|
|
70
|
+
const native = yield* OpenResponses.lowerConversation(folded, adapter);
|
|
67
71
|
const generation = OpenResponses.lowerGeneration(request);
|
|
68
|
-
const tools =
|
|
72
|
+
const tools = folded.tools.length === 0 ? undefined : yield* lowerTools(folded);
|
|
69
73
|
const body = yield* ProviderShared.validateWith(Schema.decodeUnknownEffect(Body))(mergeJsonRecords({
|
|
70
74
|
...native,
|
|
71
75
|
service_tier: generation.service_tier,
|
|
@@ -12,6 +12,32 @@ export declare const protocol: Protocol<{
|
|
|
12
12
|
readonly reasoning: {
|
|
13
13
|
readonly effort: import("../schema/options.js").ReasoningEffort;
|
|
14
14
|
};
|
|
15
|
+
} | {
|
|
16
|
+
readonly type: "additional_tools";
|
|
17
|
+
readonly role: "developer";
|
|
18
|
+
readonly tools: readonly ({
|
|
19
|
+
readonly type: "custom";
|
|
20
|
+
readonly name: string;
|
|
21
|
+
readonly description: string;
|
|
22
|
+
readonly format: {
|
|
23
|
+
readonly type: "text";
|
|
24
|
+
} | {
|
|
25
|
+
readonly type: "grammar";
|
|
26
|
+
readonly syntax: "lark" | "regex";
|
|
27
|
+
readonly definition: string;
|
|
28
|
+
};
|
|
29
|
+
} | {
|
|
30
|
+
readonly type: "function";
|
|
31
|
+
readonly name: string;
|
|
32
|
+
readonly description: string;
|
|
33
|
+
readonly parameters: {
|
|
34
|
+
readonly [x: string]: unknown;
|
|
35
|
+
};
|
|
36
|
+
readonly strict?: boolean | undefined;
|
|
37
|
+
} | {
|
|
38
|
+
readonly [x: string]: unknown;
|
|
39
|
+
readonly type: string;
|
|
40
|
+
})[];
|
|
15
41
|
} | {
|
|
16
42
|
readonly type: "message";
|
|
17
43
|
readonly role: "system";
|
|
@@ -237,14 +237,36 @@ export declare const protocol: Protocol<{
|
|
|
237
237
|
})[];
|
|
238
238
|
} | {
|
|
239
239
|
readonly role: "system";
|
|
240
|
-
readonly content: readonly {
|
|
240
|
+
readonly content: readonly ({
|
|
241
|
+
readonly type: "tool_addition";
|
|
242
|
+
readonly tool: {
|
|
243
|
+
readonly type: "tool_definition";
|
|
244
|
+
readonly definition: {
|
|
245
|
+
readonly name: string;
|
|
246
|
+
readonly description: string;
|
|
247
|
+
readonly input_schema: {
|
|
248
|
+
readonly [x: string]: unknown;
|
|
249
|
+
};
|
|
250
|
+
readonly cache_control?: {
|
|
251
|
+
readonly type: "ephemeral";
|
|
252
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
253
|
+
} | undefined;
|
|
254
|
+
};
|
|
255
|
+
};
|
|
256
|
+
} | {
|
|
257
|
+
readonly type: "tool_removal";
|
|
258
|
+
readonly tool: {
|
|
259
|
+
readonly type: "tool_reference";
|
|
260
|
+
readonly name: string;
|
|
261
|
+
};
|
|
262
|
+
} | {
|
|
241
263
|
readonly type: "text";
|
|
242
264
|
readonly text: string;
|
|
243
265
|
readonly cache_control?: {
|
|
244
266
|
readonly type: "ephemeral";
|
|
245
267
|
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
246
268
|
} | undefined;
|
|
247
|
-
}[];
|
|
269
|
+
})[];
|
|
248
270
|
readonly output_config?: {
|
|
249
271
|
readonly effort: string;
|
|
250
272
|
} | undefined;
|
|
@@ -448,14 +448,36 @@ export declare const routes: (Route<{
|
|
|
448
448
|
})[];
|
|
449
449
|
} | {
|
|
450
450
|
readonly role: "system";
|
|
451
|
-
readonly content: readonly {
|
|
451
|
+
readonly content: readonly ({
|
|
452
|
+
readonly type: "tool_addition";
|
|
453
|
+
readonly tool: {
|
|
454
|
+
readonly type: "tool_definition";
|
|
455
|
+
readonly definition: {
|
|
456
|
+
readonly name: string;
|
|
457
|
+
readonly description: string;
|
|
458
|
+
readonly input_schema: {
|
|
459
|
+
readonly [x: string]: unknown;
|
|
460
|
+
};
|
|
461
|
+
readonly cache_control?: {
|
|
462
|
+
readonly type: "ephemeral";
|
|
463
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
464
|
+
} | undefined;
|
|
465
|
+
};
|
|
466
|
+
};
|
|
467
|
+
} | {
|
|
468
|
+
readonly type: "tool_removal";
|
|
469
|
+
readonly tool: {
|
|
470
|
+
readonly type: "tool_reference";
|
|
471
|
+
readonly name: string;
|
|
472
|
+
};
|
|
473
|
+
} | {
|
|
452
474
|
readonly type: "text";
|
|
453
475
|
readonly text: string;
|
|
454
476
|
readonly cache_control?: {
|
|
455
477
|
readonly type: "ephemeral";
|
|
456
478
|
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
457
479
|
} | undefined;
|
|
458
|
-
}[];
|
|
480
|
+
})[];
|
|
459
481
|
readonly output_config?: {
|
|
460
482
|
readonly effort: string;
|
|
461
483
|
} | undefined;
|
|
@@ -521,6 +543,32 @@ export declare const routes: (Route<{
|
|
|
521
543
|
readonly reasoning: {
|
|
522
544
|
readonly effort: import("../schema/options.js").ReasoningEffort;
|
|
523
545
|
};
|
|
546
|
+
} | {
|
|
547
|
+
readonly type: "additional_tools";
|
|
548
|
+
readonly role: "developer";
|
|
549
|
+
readonly tools: readonly ({
|
|
550
|
+
readonly type: "custom";
|
|
551
|
+
readonly name: string;
|
|
552
|
+
readonly description: string;
|
|
553
|
+
readonly format: {
|
|
554
|
+
readonly type: "text";
|
|
555
|
+
} | {
|
|
556
|
+
readonly type: "grammar";
|
|
557
|
+
readonly syntax: "lark" | "regex";
|
|
558
|
+
readonly definition: string;
|
|
559
|
+
};
|
|
560
|
+
} | {
|
|
561
|
+
readonly type: "function";
|
|
562
|
+
readonly name: string;
|
|
563
|
+
readonly description: string;
|
|
564
|
+
readonly parameters: {
|
|
565
|
+
readonly [x: string]: unknown;
|
|
566
|
+
};
|
|
567
|
+
readonly strict?: boolean | undefined;
|
|
568
|
+
} | {
|
|
569
|
+
readonly [x: string]: unknown;
|
|
570
|
+
readonly type: string;
|
|
571
|
+
})[];
|
|
524
572
|
} | {
|
|
525
573
|
readonly type: "message";
|
|
526
574
|
readonly role: "system";
|
|
@@ -266,14 +266,36 @@ export declare const routes: (Route<{
|
|
|
266
266
|
})[];
|
|
267
267
|
} | {
|
|
268
268
|
readonly role: "system";
|
|
269
|
-
readonly content: readonly {
|
|
269
|
+
readonly content: readonly ({
|
|
270
|
+
readonly type: "tool_addition";
|
|
271
|
+
readonly tool: {
|
|
272
|
+
readonly type: "tool_definition";
|
|
273
|
+
readonly definition: {
|
|
274
|
+
readonly name: string;
|
|
275
|
+
readonly description: string;
|
|
276
|
+
readonly input_schema: {
|
|
277
|
+
readonly [x: string]: unknown;
|
|
278
|
+
};
|
|
279
|
+
readonly cache_control?: {
|
|
280
|
+
readonly type: "ephemeral";
|
|
281
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
282
|
+
} | undefined;
|
|
283
|
+
};
|
|
284
|
+
};
|
|
285
|
+
} | {
|
|
286
|
+
readonly type: "tool_removal";
|
|
287
|
+
readonly tool: {
|
|
288
|
+
readonly type: "tool_reference";
|
|
289
|
+
readonly name: string;
|
|
290
|
+
};
|
|
291
|
+
} | {
|
|
270
292
|
readonly type: "text";
|
|
271
293
|
readonly text: string;
|
|
272
294
|
readonly cache_control?: {
|
|
273
295
|
readonly type: "ephemeral";
|
|
274
296
|
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
275
297
|
} | undefined;
|
|
276
|
-
}[];
|
|
298
|
+
})[];
|
|
277
299
|
readonly output_config?: {
|
|
278
300
|
readonly effort: string;
|
|
279
301
|
} | undefined;
|
|
@@ -351,6 +373,32 @@ export declare const routes: (Route<{
|
|
|
351
373
|
readonly reasoning: {
|
|
352
374
|
readonly effort: import("../schema/options.js").ReasoningEffort;
|
|
353
375
|
};
|
|
376
|
+
} | {
|
|
377
|
+
readonly type: "additional_tools";
|
|
378
|
+
readonly role: "developer";
|
|
379
|
+
readonly tools: readonly ({
|
|
380
|
+
readonly type: "custom";
|
|
381
|
+
readonly name: string;
|
|
382
|
+
readonly description: string;
|
|
383
|
+
readonly format: {
|
|
384
|
+
readonly type: "text";
|
|
385
|
+
} | {
|
|
386
|
+
readonly type: "grammar";
|
|
387
|
+
readonly syntax: "lark" | "regex";
|
|
388
|
+
readonly definition: string;
|
|
389
|
+
};
|
|
390
|
+
} | {
|
|
391
|
+
readonly type: "function";
|
|
392
|
+
readonly name: string;
|
|
393
|
+
readonly description: string;
|
|
394
|
+
readonly parameters: {
|
|
395
|
+
readonly [x: string]: unknown;
|
|
396
|
+
};
|
|
397
|
+
readonly strict?: boolean | undefined;
|
|
398
|
+
} | {
|
|
399
|
+
readonly [x: string]: unknown;
|
|
400
|
+
readonly type: string;
|
|
401
|
+
})[];
|
|
354
402
|
} | {
|
|
355
403
|
readonly type: "message";
|
|
356
404
|
readonly role: "system";
|
|
@@ -250,14 +250,36 @@ export declare const routes: import("../route.js").Route<{
|
|
|
250
250
|
})[];
|
|
251
251
|
} | {
|
|
252
252
|
readonly role: "system";
|
|
253
|
-
readonly content: readonly {
|
|
253
|
+
readonly content: readonly ({
|
|
254
|
+
readonly type: "tool_addition";
|
|
255
|
+
readonly tool: {
|
|
256
|
+
readonly type: "tool_definition";
|
|
257
|
+
readonly definition: {
|
|
258
|
+
readonly name: string;
|
|
259
|
+
readonly description: string;
|
|
260
|
+
readonly input_schema: {
|
|
261
|
+
readonly [x: string]: unknown;
|
|
262
|
+
};
|
|
263
|
+
readonly cache_control?: {
|
|
264
|
+
readonly type: "ephemeral";
|
|
265
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
266
|
+
} | undefined;
|
|
267
|
+
};
|
|
268
|
+
};
|
|
269
|
+
} | {
|
|
270
|
+
readonly type: "tool_removal";
|
|
271
|
+
readonly tool: {
|
|
272
|
+
readonly type: "tool_reference";
|
|
273
|
+
readonly name: string;
|
|
274
|
+
};
|
|
275
|
+
} | {
|
|
254
276
|
readonly type: "text";
|
|
255
277
|
readonly text: string;
|
|
256
278
|
readonly cache_control?: {
|
|
257
279
|
readonly type: "ephemeral";
|
|
258
280
|
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
259
281
|
} | undefined;
|
|
260
|
-
}[];
|
|
282
|
+
})[];
|
|
261
283
|
readonly output_config?: {
|
|
262
284
|
readonly effort: string;
|
|
263
285
|
} | undefined;
|
|
@@ -235,14 +235,36 @@ export declare const routes: import("../route.js").Route<{
|
|
|
235
235
|
})[];
|
|
236
236
|
} | {
|
|
237
237
|
readonly role: "system";
|
|
238
|
-
readonly content: readonly {
|
|
238
|
+
readonly content: readonly ({
|
|
239
|
+
readonly type: "tool_addition";
|
|
240
|
+
readonly tool: {
|
|
241
|
+
readonly type: "tool_definition";
|
|
242
|
+
readonly definition: {
|
|
243
|
+
readonly name: string;
|
|
244
|
+
readonly description: string;
|
|
245
|
+
readonly input_schema: {
|
|
246
|
+
readonly [x: string]: unknown;
|
|
247
|
+
};
|
|
248
|
+
readonly cache_control?: {
|
|
249
|
+
readonly type: "ephemeral";
|
|
250
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
251
|
+
} | undefined;
|
|
252
|
+
};
|
|
253
|
+
};
|
|
254
|
+
} | {
|
|
255
|
+
readonly type: "tool_removal";
|
|
256
|
+
readonly tool: {
|
|
257
|
+
readonly type: "tool_reference";
|
|
258
|
+
readonly name: string;
|
|
259
|
+
};
|
|
260
|
+
} | {
|
|
239
261
|
readonly type: "text";
|
|
240
262
|
readonly text: string;
|
|
241
263
|
readonly cache_control?: {
|
|
242
264
|
readonly type: "ephemeral";
|
|
243
265
|
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
244
266
|
} | undefined;
|
|
245
|
-
}[];
|
|
267
|
+
})[];
|
|
246
268
|
readonly output_config?: {
|
|
247
269
|
readonly effort: string;
|
|
248
270
|
} | undefined;
|