@opencode-ai/ai 0.0.0-dev-17643 → 0.0.0-dev-17653
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/open-responses.d.ts +68 -6
- package/dist/protocols/open-responses.js +21 -1
- package/dist/protocols/openai-compatible-responses.d.ts +10 -1
- package/dist/protocols/openai-responses.d.ts +50 -5
- package/dist/protocols/openai-responses.js +1 -1
- package/dist/protocols/utils/open-responses-options.d.ts +30 -13
- package/dist/protocols/utils/open-responses-options.js +27 -23
- package/dist/protocols/utils/openai-options.d.ts +1 -1
- package/dist/providers/amazon-bedrock-mantle.d.ts +10 -1
- package/dist/providers/azure.d.ts +10 -1
- package/dist/providers/google-vertex-responses.d.ts +10 -1
- package/dist/providers/open-responses-options.d.ts +4 -12
- package/dist/providers/openai-compatible-responses.d.ts +10 -1
- package/dist/providers/openai.d.ts +10 -1
- package/dist/providers/xai.d.ts +10 -1
- package/package.json +3 -3
|
@@ -3,6 +3,7 @@ import { HttpTransport } from "../route/transport/index.js";
|
|
|
3
3
|
import { Protocol } from "../route/protocol.js";
|
|
4
4
|
import { AIError, LLMEvent, Usage, type LLMRequest, type MediaPart, type ProviderMetadata, type ToolDefinition } from "../schema/index.js";
|
|
5
5
|
import { ProviderShared } from "./shared.js";
|
|
6
|
+
import { OpenResponsesOptions } from "./utils/open-responses-options.js";
|
|
6
7
|
import { Lifecycle } from "./utils/lifecycle.js";
|
|
7
8
|
import { ToolStream } from "./utils/tool-stream.js";
|
|
8
9
|
export declare const PATH = "/responses";
|
|
@@ -96,6 +97,13 @@ export declare const Tool: Schema.Struct<{
|
|
|
96
97
|
export declare const ToolChoice: Schema.Union<readonly [Schema.Literals<readonly ["auto", "none", "required"]>, Schema.Struct<{
|
|
97
98
|
readonly type: Schema.tag<"function">;
|
|
98
99
|
readonly name: Schema.String;
|
|
100
|
+
}>, Schema.Struct<{
|
|
101
|
+
readonly type: Schema.tag<"allowed_tools">;
|
|
102
|
+
readonly mode: Schema.Literals<readonly ["auto", "none", "required"]>;
|
|
103
|
+
readonly tools: Schema.$Array<Schema.Struct<{
|
|
104
|
+
readonly type: Schema.tag<"function">;
|
|
105
|
+
readonly name: Schema.String;
|
|
106
|
+
}>>;
|
|
99
107
|
}>]>;
|
|
100
108
|
export declare const coreFields: {
|
|
101
109
|
model: Schema.String;
|
|
@@ -169,12 +177,19 @@ export declare const coreFields: {
|
|
|
169
177
|
tool_choice: Schema.optional<Schema.Union<readonly [Schema.Literals<readonly ["auto", "none", "required"]>, Schema.Struct<{
|
|
170
178
|
readonly type: Schema.tag<"function">;
|
|
171
179
|
readonly name: Schema.String;
|
|
180
|
+
}>, Schema.Struct<{
|
|
181
|
+
readonly type: Schema.tag<"allowed_tools">;
|
|
182
|
+
readonly mode: Schema.Literals<readonly ["auto", "none", "required"]>;
|
|
183
|
+
readonly tools: Schema.$Array<Schema.Struct<{
|
|
184
|
+
readonly type: Schema.tag<"function">;
|
|
185
|
+
readonly name: Schema.String;
|
|
186
|
+
}>>;
|
|
172
187
|
}>]>>;
|
|
173
188
|
store: Schema.optional<Schema.Boolean>;
|
|
174
189
|
truncation: Schema.optional<Schema.Literals<readonly ["auto", "disabled"]>>;
|
|
175
190
|
service_tier: Schema.optional<Schema.Literals<readonly ["auto", "default", "flex", "priority"]>>;
|
|
176
191
|
prompt_cache_key: Schema.optional<Schema.String>;
|
|
177
|
-
include: Schema.optional<Schema.$Array<Schema.
|
|
192
|
+
include: Schema.optional<Schema.$Array<Schema.declare<OpenResponsesOptions.ResponseIncludable, OpenResponsesOptions.ResponseIncludable>>>;
|
|
178
193
|
reasoning: Schema.optional<Schema.Struct<{
|
|
179
194
|
readonly effort: Schema.optional<Schema.String>;
|
|
180
195
|
readonly summary: Schema.optional<Schema.Literals<readonly ["auto", "concise", "detailed"]>>;
|
|
@@ -183,6 +198,8 @@ export declare const coreFields: {
|
|
|
183
198
|
readonly verbosity: Schema.optional<Schema.Literals<readonly ["low", "medium", "high"]>>;
|
|
184
199
|
}>>;
|
|
185
200
|
max_output_tokens: Schema.optional<Schema.Number>;
|
|
201
|
+
max_tool_calls: Schema.optional<Schema.Int>;
|
|
202
|
+
parallel_tool_calls: Schema.optional<Schema.Boolean>;
|
|
186
203
|
temperature: Schema.optional<Schema.Number>;
|
|
187
204
|
top_p: Schema.optional<Schema.Number>;
|
|
188
205
|
};
|
|
@@ -259,12 +276,19 @@ declare const OpenResponsesBody: Schema.Struct<{
|
|
|
259
276
|
readonly tool_choice: Schema.optional<Schema.Union<readonly [Schema.Literals<readonly ["auto", "none", "required"]>, Schema.Struct<{
|
|
260
277
|
readonly type: Schema.tag<"function">;
|
|
261
278
|
readonly name: Schema.String;
|
|
279
|
+
}>, Schema.Struct<{
|
|
280
|
+
readonly type: Schema.tag<"allowed_tools">;
|
|
281
|
+
readonly mode: Schema.Literals<readonly ["auto", "none", "required"]>;
|
|
282
|
+
readonly tools: Schema.$Array<Schema.Struct<{
|
|
283
|
+
readonly type: Schema.tag<"function">;
|
|
284
|
+
readonly name: Schema.String;
|
|
285
|
+
}>>;
|
|
262
286
|
}>]>>;
|
|
263
287
|
readonly store: Schema.optional<Schema.Boolean>;
|
|
264
288
|
readonly truncation: Schema.optional<Schema.Literals<readonly ["auto", "disabled"]>>;
|
|
265
289
|
readonly service_tier: Schema.optional<Schema.Literals<readonly ["auto", "default", "flex", "priority"]>>;
|
|
266
290
|
readonly prompt_cache_key: Schema.optional<Schema.String>;
|
|
267
|
-
readonly include: Schema.optional<Schema.$Array<Schema.
|
|
291
|
+
readonly include: Schema.optional<Schema.$Array<Schema.declare<OpenResponsesOptions.ResponseIncludable, OpenResponsesOptions.ResponseIncludable>>>;
|
|
268
292
|
readonly reasoning: Schema.optional<Schema.Struct<{
|
|
269
293
|
readonly effort: Schema.optional<Schema.String>;
|
|
270
294
|
readonly summary: Schema.optional<Schema.Literals<readonly ["auto", "concise", "detailed"]>>;
|
|
@@ -273,6 +297,8 @@ declare const OpenResponsesBody: Schema.Struct<{
|
|
|
273
297
|
readonly verbosity: Schema.optional<Schema.Literals<readonly ["low", "medium", "high"]>>;
|
|
274
298
|
}>>;
|
|
275
299
|
readonly max_output_tokens: Schema.optional<Schema.Number>;
|
|
300
|
+
readonly max_tool_calls: Schema.optional<Schema.Int>;
|
|
301
|
+
readonly parallel_tool_calls: Schema.optional<Schema.Boolean>;
|
|
276
302
|
readonly temperature: Schema.optional<Schema.Number>;
|
|
277
303
|
readonly top_p: Schema.optional<Schema.Number>;
|
|
278
304
|
}>;
|
|
@@ -417,6 +443,8 @@ export declare const lowerToolChoice: (protocolName: string, toolChoice: NonNull
|
|
|
417
443
|
}, AIError, never>;
|
|
418
444
|
export declare const fromRequestWithExtension: (request: LLMRequest, extension: Extension) => Effect.Effect<{
|
|
419
445
|
truncation?: "auto" | "disabled" | undefined;
|
|
446
|
+
parallel_tool_calls?: boolean | undefined;
|
|
447
|
+
max_tool_calls?: number | undefined;
|
|
420
448
|
service_tier?: "default" | "auto" | "flex" | "priority" | undefined;
|
|
421
449
|
text?: {
|
|
422
450
|
verbosity: "low" | "medium" | "high";
|
|
@@ -425,7 +453,7 @@ export declare const fromRequestWithExtension: (request: LLMRequest, extension:
|
|
|
425
453
|
effort: string | undefined;
|
|
426
454
|
summary: "auto" | "concise" | "detailed" | undefined;
|
|
427
455
|
} | undefined;
|
|
428
|
-
include?: readonly
|
|
456
|
+
include?: readonly OpenResponsesOptions.ResponseIncludable[] | undefined;
|
|
429
457
|
prompt_cache_key?: string | undefined;
|
|
430
458
|
store?: boolean | undefined;
|
|
431
459
|
instructions?: string | undefined;
|
|
@@ -441,6 +469,13 @@ export declare const fromRequestWithExtension: (request: LLMRequest, extension:
|
|
|
441
469
|
strict: boolean;
|
|
442
470
|
}[] | undefined;
|
|
443
471
|
tool_choice: "required" | "none" | "auto" | {
|
|
472
|
+
type: "allowed_tools";
|
|
473
|
+
mode: "required" | "none" | "auto";
|
|
474
|
+
tools: {
|
|
475
|
+
type: "function";
|
|
476
|
+
name: string;
|
|
477
|
+
}[];
|
|
478
|
+
} | {
|
|
444
479
|
type: "function";
|
|
445
480
|
name: string;
|
|
446
481
|
} | undefined;
|
|
@@ -532,14 +567,23 @@ export declare const fromRequest: (request: LLMRequest) => Effect.Effect<{
|
|
|
532
567
|
readonly tool_choice?: "required" | "none" | "auto" | {
|
|
533
568
|
readonly type: "function";
|
|
534
569
|
readonly name: string;
|
|
570
|
+
} | {
|
|
571
|
+
readonly type: "allowed_tools";
|
|
572
|
+
readonly mode: "required" | "none" | "auto";
|
|
573
|
+
readonly tools: readonly {
|
|
574
|
+
readonly type: "function";
|
|
575
|
+
readonly name: string;
|
|
576
|
+
}[];
|
|
535
577
|
} | undefined;
|
|
536
578
|
readonly top_p?: number | undefined;
|
|
537
|
-
readonly include?: readonly ("file_search_call.results" | "web_search_call.results" | "web_search_call.action.sources" | "message.input_image.image_url" | "computer_call_output.output.image_url" | "code_interpreter_call.outputs" | "reasoning.encrypted_content" | "message.output_text.logprobs")[] | undefined;
|
|
538
579
|
readonly store?: boolean | undefined;
|
|
580
|
+
readonly include?: readonly OpenResponsesOptions.ResponseIncludable[] | undefined;
|
|
539
581
|
readonly truncation?: "auto" | "disabled" | undefined;
|
|
540
582
|
readonly prompt_cache_key?: string | undefined;
|
|
541
583
|
readonly service_tier?: "default" | "auto" | "flex" | "priority" | undefined;
|
|
542
584
|
readonly max_output_tokens?: number | undefined;
|
|
585
|
+
readonly max_tool_calls?: number | undefined;
|
|
586
|
+
readonly parallel_tool_calls?: boolean | undefined;
|
|
543
587
|
}, AIError, never>;
|
|
544
588
|
export declare const providerMetadata: (state: ParserState, metadata: Record<string, unknown>) => ProviderMetadata;
|
|
545
589
|
export type StepResult = readonly [ParserState, ReadonlyArray<LLMEvent>];
|
|
@@ -817,14 +861,23 @@ export declare const protocol: Protocol<{
|
|
|
817
861
|
readonly tool_choice?: "required" | "none" | "auto" | {
|
|
818
862
|
readonly type: "function";
|
|
819
863
|
readonly name: string;
|
|
864
|
+
} | {
|
|
865
|
+
readonly type: "allowed_tools";
|
|
866
|
+
readonly mode: "required" | "none" | "auto";
|
|
867
|
+
readonly tools: readonly {
|
|
868
|
+
readonly type: "function";
|
|
869
|
+
readonly name: string;
|
|
870
|
+
}[];
|
|
820
871
|
} | undefined;
|
|
821
872
|
readonly top_p?: number | undefined;
|
|
822
|
-
readonly include?: readonly ("file_search_call.results" | "web_search_call.results" | "web_search_call.action.sources" | "message.input_image.image_url" | "computer_call_output.output.image_url" | "code_interpreter_call.outputs" | "reasoning.encrypted_content" | "message.output_text.logprobs")[] | undefined;
|
|
823
873
|
readonly store?: boolean | undefined;
|
|
874
|
+
readonly include?: readonly OpenResponsesOptions.ResponseIncludable[] | undefined;
|
|
824
875
|
readonly truncation?: "auto" | "disabled" | undefined;
|
|
825
876
|
readonly prompt_cache_key?: string | undefined;
|
|
826
877
|
readonly service_tier?: "default" | "auto" | "flex" | "priority" | undefined;
|
|
827
878
|
readonly max_output_tokens?: number | undefined;
|
|
879
|
+
readonly max_tool_calls?: number | undefined;
|
|
880
|
+
readonly parallel_tool_calls?: boolean | undefined;
|
|
828
881
|
}, string, {
|
|
829
882
|
readonly [x: string]: unknown;
|
|
830
883
|
readonly type: string;
|
|
@@ -963,13 +1016,22 @@ export declare const httpTransport: HttpTransport.HttpJsonTransport<{
|
|
|
963
1016
|
readonly tool_choice?: "required" | "none" | "auto" | {
|
|
964
1017
|
readonly type: "function";
|
|
965
1018
|
readonly name: string;
|
|
1019
|
+
} | {
|
|
1020
|
+
readonly type: "allowed_tools";
|
|
1021
|
+
readonly mode: "required" | "none" | "auto";
|
|
1022
|
+
readonly tools: readonly {
|
|
1023
|
+
readonly type: "function";
|
|
1024
|
+
readonly name: string;
|
|
1025
|
+
}[];
|
|
966
1026
|
} | undefined;
|
|
967
1027
|
readonly top_p?: number | undefined;
|
|
968
|
-
readonly include?: readonly ("file_search_call.results" | "web_search_call.results" | "web_search_call.action.sources" | "message.input_image.image_url" | "computer_call_output.output.image_url" | "code_interpreter_call.outputs" | "reasoning.encrypted_content" | "message.output_text.logprobs")[] | undefined;
|
|
969
1028
|
readonly store?: boolean | undefined;
|
|
1029
|
+
readonly include?: readonly OpenResponsesOptions.ResponseIncludable[] | undefined;
|
|
970
1030
|
readonly truncation?: "auto" | "disabled" | undefined;
|
|
971
1031
|
readonly prompt_cache_key?: string | undefined;
|
|
972
1032
|
readonly service_tier?: "default" | "auto" | "flex" | "priority" | undefined;
|
|
973
1033
|
readonly max_output_tokens?: number | undefined;
|
|
1034
|
+
readonly max_tool_calls?: number | undefined;
|
|
1035
|
+
readonly parallel_tool_calls?: boolean | undefined;
|
|
974
1036
|
}, string>;
|
|
975
1037
|
export * as OpenResponses from "./open-responses.js";
|
|
@@ -94,6 +94,11 @@ export const Tool = Schema.Struct({
|
|
|
94
94
|
export const ToolChoice = Schema.Union([
|
|
95
95
|
Schema.Literals(["auto", "none", "required"]),
|
|
96
96
|
Schema.Struct({ type: Schema.tag("function"), name: Schema.String }),
|
|
97
|
+
Schema.Struct({
|
|
98
|
+
type: Schema.tag("allowed_tools"),
|
|
99
|
+
mode: Schema.Literals(["auto", "none", "required"]),
|
|
100
|
+
tools: Schema.Array(Schema.Struct({ type: Schema.tag("function"), name: Schema.String })),
|
|
101
|
+
}),
|
|
97
102
|
]);
|
|
98
103
|
// Fields shared between the HTTP body and the WebSocket `response.create`
|
|
99
104
|
// message. The HTTP body adds `stream: true`; the WebSocket message adds
|
|
@@ -118,6 +123,8 @@ export const coreFields = {
|
|
|
118
123
|
verbosity: Schema.optional(OpenResponsesOptions.TextVerbositySchema),
|
|
119
124
|
})),
|
|
120
125
|
max_output_tokens: Schema.optional(Schema.Number),
|
|
126
|
+
max_tool_calls: Schema.optional(Schema.Int),
|
|
127
|
+
parallel_tool_calls: Schema.optional(Schema.Boolean),
|
|
121
128
|
temperature: Schema.optional(Schema.Number),
|
|
122
129
|
top_p: Schema.optional(Schema.Number),
|
|
123
130
|
};
|
|
@@ -419,9 +426,21 @@ const lowerOptions = (request) => {
|
|
|
419
426
|
: {}),
|
|
420
427
|
...(options.textVerbosity ? { text: { verbosity: options.textVerbosity } } : {}),
|
|
421
428
|
...(options.serviceTier ? { service_tier: options.serviceTier } : {}),
|
|
429
|
+
...(options.maxToolCalls !== undefined ? { max_tool_calls: options.maxToolCalls } : {}),
|
|
430
|
+
...(options.parallelToolCalls !== undefined ? { parallel_tool_calls: options.parallelToolCalls } : {}),
|
|
422
431
|
...(options.truncation ? { truncation: options.truncation } : {}),
|
|
423
432
|
};
|
|
424
433
|
};
|
|
434
|
+
const allowedToolChoice = (request) => {
|
|
435
|
+
const allowed = OpenResponsesOptions.resolve(request).allowedTools;
|
|
436
|
+
if (!allowed)
|
|
437
|
+
return undefined;
|
|
438
|
+
return {
|
|
439
|
+
type: "allowed_tools",
|
|
440
|
+
mode: allowed.mode,
|
|
441
|
+
tools: allowed.toolNames.map((name) => ({ type: "function", name })),
|
|
442
|
+
};
|
|
443
|
+
};
|
|
425
444
|
export const fromRequestWithExtension = Effect.fn("OpenResponses.fromRequestWithExtension")(function* (request, extension) {
|
|
426
445
|
const generation = request.generation;
|
|
427
446
|
const toolSchemaCompatibility = request.model.compatibility?.toolSchema;
|
|
@@ -431,7 +450,8 @@ export const fromRequestWithExtension = Effect.fn("OpenResponses.fromRequestWith
|
|
|
431
450
|
tools: request.tools.length === 0
|
|
432
451
|
? undefined
|
|
433
452
|
: yield* Effect.forEach(request.tools, (tool) => lowerTool(extension.name, tool, ToolSchemaProjection.modelCompatibility(tool.inputSchema, toolSchemaCompatibility))),
|
|
434
|
-
tool_choice:
|
|
453
|
+
tool_choice: allowedToolChoice(request) ??
|
|
454
|
+
(request.toolChoice ? yield* lowerToolChoice(extension.name, request.toolChoice) : undefined),
|
|
435
455
|
stream: true,
|
|
436
456
|
max_output_tokens: generation?.maxTokens,
|
|
437
457
|
temperature: generation?.temperature,
|
|
@@ -88,13 +88,22 @@ export declare const route: Route<{
|
|
|
88
88
|
readonly tool_choice?: "required" | "none" | "auto" | {
|
|
89
89
|
readonly type: "function";
|
|
90
90
|
readonly name: string;
|
|
91
|
+
} | {
|
|
92
|
+
readonly type: "allowed_tools";
|
|
93
|
+
readonly mode: "required" | "none" | "auto";
|
|
94
|
+
readonly tools: readonly {
|
|
95
|
+
readonly type: "function";
|
|
96
|
+
readonly name: string;
|
|
97
|
+
}[];
|
|
91
98
|
} | undefined;
|
|
92
99
|
readonly top_p?: number | undefined;
|
|
93
|
-
readonly include?: readonly ("file_search_call.results" | "web_search_call.results" | "web_search_call.action.sources" | "message.input_image.image_url" | "computer_call_output.output.image_url" | "code_interpreter_call.outputs" | "reasoning.encrypted_content" | "message.output_text.logprobs")[] | undefined;
|
|
94
100
|
readonly store?: boolean | undefined;
|
|
101
|
+
readonly include?: readonly import("./utils/open-responses-options.js").ResponseIncludable[] | undefined;
|
|
95
102
|
readonly truncation?: "auto" | "disabled" | undefined;
|
|
96
103
|
readonly prompt_cache_key?: string | undefined;
|
|
97
104
|
readonly service_tier?: "default" | "auto" | "flex" | "priority" | undefined;
|
|
98
105
|
readonly max_output_tokens?: number | undefined;
|
|
106
|
+
readonly max_tool_calls?: number | undefined;
|
|
107
|
+
readonly parallel_tool_calls?: boolean | undefined;
|
|
99
108
|
}, import("../route/transport/http.js").HttpPrepared<string>>;
|
|
100
109
|
export * as OpenAICompatibleResponses from "./openai-compatible-responses.js";
|
|
@@ -93,6 +93,13 @@ declare const OpenAIResponsesBody: Schema.Struct<{
|
|
|
93
93
|
readonly tool_choice: Schema.optional<Schema.Union<readonly [Schema.Union<readonly [Schema.Literals<readonly ["auto", "none", "required"]>, Schema.Struct<{
|
|
94
94
|
readonly type: Schema.tag<"function">;
|
|
95
95
|
readonly name: Schema.String;
|
|
96
|
+
}>, Schema.Struct<{
|
|
97
|
+
readonly type: Schema.tag<"allowed_tools">;
|
|
98
|
+
readonly mode: Schema.Literals<readonly ["auto", "none", "required"]>;
|
|
99
|
+
readonly tools: Schema.$Array<Schema.Struct<{
|
|
100
|
+
readonly type: Schema.tag<"function">;
|
|
101
|
+
readonly name: Schema.String;
|
|
102
|
+
}>>;
|
|
96
103
|
}>]>, Schema.Struct<{
|
|
97
104
|
readonly type: Schema.tag<"image_generation">;
|
|
98
105
|
}>]>>;
|
|
@@ -102,7 +109,7 @@ declare const OpenAIResponsesBody: Schema.Struct<{
|
|
|
102
109
|
readonly truncation: Schema.optional<Schema.Literals<readonly ["auto", "disabled"]>>;
|
|
103
110
|
readonly service_tier: Schema.optional<Schema.Literals<readonly ["auto", "default", "flex", "priority"]>>;
|
|
104
111
|
readonly prompt_cache_key: Schema.optional<Schema.String>;
|
|
105
|
-
readonly include: Schema.optional<Schema.$Array<Schema.
|
|
112
|
+
readonly include: Schema.optional<Schema.$Array<Schema.declare<import("./utils/open-responses-options.js").ResponseIncludable, import("./utils/open-responses-options.js").ResponseIncludable>>>;
|
|
106
113
|
readonly reasoning: Schema.optional<Schema.Struct<{
|
|
107
114
|
readonly effort: Schema.optional<Schema.String>;
|
|
108
115
|
readonly summary: Schema.optional<Schema.Literals<readonly ["auto", "concise", "detailed"]>>;
|
|
@@ -111,6 +118,8 @@ declare const OpenAIResponsesBody: Schema.Struct<{
|
|
|
111
118
|
readonly verbosity: Schema.optional<Schema.Literals<readonly ["low", "medium", "high"]>>;
|
|
112
119
|
}>>;
|
|
113
120
|
readonly max_output_tokens: Schema.optional<Schema.Number>;
|
|
121
|
+
readonly max_tool_calls: Schema.optional<Schema.Int>;
|
|
122
|
+
readonly parallel_tool_calls: Schema.optional<Schema.Boolean>;
|
|
114
123
|
readonly temperature: Schema.optional<Schema.Number>;
|
|
115
124
|
readonly top_p: Schema.optional<Schema.Number>;
|
|
116
125
|
}>;
|
|
@@ -215,16 +224,25 @@ export declare const protocol: Protocol<{
|
|
|
215
224
|
readonly tool_choice?: "required" | "none" | "auto" | {
|
|
216
225
|
readonly type: "function";
|
|
217
226
|
readonly name: string;
|
|
227
|
+
} | {
|
|
228
|
+
readonly type: "allowed_tools";
|
|
229
|
+
readonly mode: "required" | "none" | "auto";
|
|
230
|
+
readonly tools: readonly {
|
|
231
|
+
readonly type: "function";
|
|
232
|
+
readonly name: string;
|
|
233
|
+
}[];
|
|
218
234
|
} | {
|
|
219
235
|
readonly type: "image_generation";
|
|
220
236
|
} | undefined;
|
|
221
237
|
readonly top_p?: number | undefined;
|
|
222
|
-
readonly include?: readonly ("file_search_call.results" | "web_search_call.results" | "web_search_call.action.sources" | "message.input_image.image_url" | "computer_call_output.output.image_url" | "code_interpreter_call.outputs" | "reasoning.encrypted_content" | "message.output_text.logprobs")[] | undefined;
|
|
223
238
|
readonly store?: boolean | undefined;
|
|
239
|
+
readonly include?: readonly import("./utils/open-responses-options.js").ResponseIncludable[] | undefined;
|
|
224
240
|
readonly truncation?: "auto" | "disabled" | undefined;
|
|
225
241
|
readonly prompt_cache_key?: string | undefined;
|
|
226
242
|
readonly service_tier?: "default" | "auto" | "flex" | "priority" | undefined;
|
|
227
243
|
readonly max_output_tokens?: number | undefined;
|
|
244
|
+
readonly max_tool_calls?: number | undefined;
|
|
245
|
+
readonly parallel_tool_calls?: boolean | undefined;
|
|
228
246
|
}, string, {
|
|
229
247
|
readonly [x: string]: unknown;
|
|
230
248
|
readonly type: string;
|
|
@@ -380,16 +398,25 @@ export declare const httpTransport: HttpTransport.HttpJsonTransport<{
|
|
|
380
398
|
readonly tool_choice?: "required" | "none" | "auto" | {
|
|
381
399
|
readonly type: "function";
|
|
382
400
|
readonly name: string;
|
|
401
|
+
} | {
|
|
402
|
+
readonly type: "allowed_tools";
|
|
403
|
+
readonly mode: "required" | "none" | "auto";
|
|
404
|
+
readonly tools: readonly {
|
|
405
|
+
readonly type: "function";
|
|
406
|
+
readonly name: string;
|
|
407
|
+
}[];
|
|
383
408
|
} | {
|
|
384
409
|
readonly type: "image_generation";
|
|
385
410
|
} | undefined;
|
|
386
411
|
readonly top_p?: number | undefined;
|
|
387
|
-
readonly include?: readonly ("file_search_call.results" | "web_search_call.results" | "web_search_call.action.sources" | "message.input_image.image_url" | "computer_call_output.output.image_url" | "code_interpreter_call.outputs" | "reasoning.encrypted_content" | "message.output_text.logprobs")[] | undefined;
|
|
388
412
|
readonly store?: boolean | undefined;
|
|
413
|
+
readonly include?: readonly import("./utils/open-responses-options.js").ResponseIncludable[] | undefined;
|
|
389
414
|
readonly truncation?: "auto" | "disabled" | undefined;
|
|
390
415
|
readonly prompt_cache_key?: string | undefined;
|
|
391
416
|
readonly service_tier?: "default" | "auto" | "flex" | "priority" | undefined;
|
|
392
417
|
readonly max_output_tokens?: number | undefined;
|
|
418
|
+
readonly max_tool_calls?: number | undefined;
|
|
419
|
+
readonly parallel_tool_calls?: boolean | undefined;
|
|
393
420
|
}, string>;
|
|
394
421
|
export declare const transport: import("../route/transport/index.js").Transport<{
|
|
395
422
|
readonly input: readonly ({
|
|
@@ -491,16 +518,25 @@ export declare const transport: import("../route/transport/index.js").Transport<
|
|
|
491
518
|
readonly tool_choice?: "required" | "none" | "auto" | {
|
|
492
519
|
readonly type: "function";
|
|
493
520
|
readonly name: string;
|
|
521
|
+
} | {
|
|
522
|
+
readonly type: "allowed_tools";
|
|
523
|
+
readonly mode: "required" | "none" | "auto";
|
|
524
|
+
readonly tools: readonly {
|
|
525
|
+
readonly type: "function";
|
|
526
|
+
readonly name: string;
|
|
527
|
+
}[];
|
|
494
528
|
} | {
|
|
495
529
|
readonly type: "image_generation";
|
|
496
530
|
} | undefined;
|
|
497
531
|
readonly top_p?: number | undefined;
|
|
498
|
-
readonly include?: readonly ("file_search_call.results" | "web_search_call.results" | "web_search_call.action.sources" | "message.input_image.image_url" | "computer_call_output.output.image_url" | "code_interpreter_call.outputs" | "reasoning.encrypted_content" | "message.output_text.logprobs")[] | undefined;
|
|
499
532
|
readonly store?: boolean | undefined;
|
|
533
|
+
readonly include?: readonly import("./utils/open-responses-options.js").ResponseIncludable[] | undefined;
|
|
500
534
|
readonly truncation?: "auto" | "disabled" | undefined;
|
|
501
535
|
readonly prompt_cache_key?: string | undefined;
|
|
502
536
|
readonly service_tier?: "default" | "auto" | "flex" | "priority" | undefined;
|
|
503
537
|
readonly max_output_tokens?: number | undefined;
|
|
538
|
+
readonly max_tool_calls?: number | undefined;
|
|
539
|
+
readonly parallel_tool_calls?: boolean | undefined;
|
|
504
540
|
}, import("./open-responses-channel.js").Prepared, string>;
|
|
505
541
|
export declare const route: Route<{
|
|
506
542
|
readonly input: readonly ({
|
|
@@ -602,15 +638,24 @@ export declare const route: Route<{
|
|
|
602
638
|
readonly tool_choice?: "required" | "none" | "auto" | {
|
|
603
639
|
readonly type: "function";
|
|
604
640
|
readonly name: string;
|
|
641
|
+
} | {
|
|
642
|
+
readonly type: "allowed_tools";
|
|
643
|
+
readonly mode: "required" | "none" | "auto";
|
|
644
|
+
readonly tools: readonly {
|
|
645
|
+
readonly type: "function";
|
|
646
|
+
readonly name: string;
|
|
647
|
+
}[];
|
|
605
648
|
} | {
|
|
606
649
|
readonly type: "image_generation";
|
|
607
650
|
} | undefined;
|
|
608
651
|
readonly top_p?: number | undefined;
|
|
609
|
-
readonly include?: readonly ("file_search_call.results" | "web_search_call.results" | "web_search_call.action.sources" | "message.input_image.image_url" | "computer_call_output.output.image_url" | "code_interpreter_call.outputs" | "reasoning.encrypted_content" | "message.output_text.logprobs")[] | undefined;
|
|
610
652
|
readonly store?: boolean | undefined;
|
|
653
|
+
readonly include?: readonly import("./utils/open-responses-options.js").ResponseIncludable[] | undefined;
|
|
611
654
|
readonly truncation?: "auto" | "disabled" | undefined;
|
|
612
655
|
readonly prompt_cache_key?: string | undefined;
|
|
613
656
|
readonly service_tier?: "default" | "auto" | "flex" | "priority" | undefined;
|
|
614
657
|
readonly max_output_tokens?: number | undefined;
|
|
658
|
+
readonly max_tool_calls?: number | undefined;
|
|
659
|
+
readonly parallel_tool_calls?: boolean | undefined;
|
|
615
660
|
}, import("./open-responses-channel.js").Prepared>;
|
|
616
661
|
export * as OpenAIResponses from "./openai-responses.js";
|
|
@@ -101,7 +101,7 @@ const fromRequest = Effect.fn("OpenAIResponses.fromRequest")(function* (request)
|
|
|
101
101
|
tools: request.tools.length === 0
|
|
102
102
|
? undefined
|
|
103
103
|
: yield* Effect.forEach(request.tools, (tool) => lowerTool(tool, ToolSchemaProjection.modelCompatibility(tool.inputSchema, toolSchemaCompatibility))),
|
|
104
|
-
tool_choice: request.toolChoice ? yield* lowerToolChoice(request.toolChoice, request.tools) : undefined,
|
|
104
|
+
tool_choice: body.tool_choice ?? (request.toolChoice ? yield* lowerToolChoice(request.toolChoice, request.tools) : undefined),
|
|
105
105
|
};
|
|
106
106
|
});
|
|
107
107
|
const HOSTED_TOOLS = {
|
|
@@ -1,25 +1,42 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
|
-
import {
|
|
2
|
+
import { type LLMRequest } from "../../schema/index.js";
|
|
3
3
|
export declare const ResponseIncludables: readonly ["file_search_call.results", "web_search_call.results", "web_search_call.action.sources", "message.input_image.image_url", "computer_call_output.output.image_url", "code_interpreter_call.outputs", "reasoning.encrypted_content", "message.output_text.logprobs"];
|
|
4
|
-
export type ResponseIncludable = (typeof ResponseIncludables)[number];
|
|
4
|
+
export type ResponseIncludable = (typeof ResponseIncludables)[number] | (string & {});
|
|
5
5
|
export declare const ServiceTiers: readonly ["auto", "default", "flex", "priority"];
|
|
6
6
|
export type ServiceTier = (typeof ServiceTiers)[number];
|
|
7
7
|
export declare const Truncations: readonly ["auto", "disabled"];
|
|
8
8
|
export type Truncation = (typeof Truncations)[number];
|
|
9
9
|
export declare const ReasoningEffort: Schema.String;
|
|
10
10
|
export declare const TextVerbositySchema: Schema.Literals<readonly ["low", "medium", "high"]>;
|
|
11
|
-
export declare const ResponseIncludableSchema: Schema.
|
|
11
|
+
export declare const ResponseIncludableSchema: Schema.declare<ResponseIncludable, ResponseIncludable>;
|
|
12
12
|
export declare const ServiceTierSchema: Schema.Literals<readonly ["auto", "default", "flex", "priority"]>;
|
|
13
13
|
export declare const TruncationSchema: Schema.Literals<readonly ["auto", "disabled"]>;
|
|
14
|
-
export
|
|
15
|
-
readonly
|
|
16
|
-
readonly
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
readonly
|
|
21
|
-
readonly
|
|
22
|
-
readonly
|
|
23
|
-
|
|
14
|
+
export declare const AllowedTools: Schema.Struct<{
|
|
15
|
+
readonly toolNames: Schema.$Array<Schema.String>;
|
|
16
|
+
readonly mode: Schema.optional<Schema.Literals<readonly ["auto", "none", "required"]>>;
|
|
17
|
+
}>;
|
|
18
|
+
export type AllowedTools = typeof AllowedTools.Type;
|
|
19
|
+
export declare const Options: Schema.Struct<{
|
|
20
|
+
readonly instructions: Schema.optional<Schema.String>;
|
|
21
|
+
readonly store: Schema.optional<Schema.Boolean>;
|
|
22
|
+
readonly reasoningEffort: Schema.optional<Schema.String>;
|
|
23
|
+
readonly reasoningSummary: Schema.optional<Schema.Literals<readonly ["auto", "concise", "detailed"]>>;
|
|
24
|
+
readonly include: Schema.optional<Schema.$Array<Schema.declare<ResponseIncludable, ResponseIncludable>>>;
|
|
25
|
+
readonly textVerbosity: Schema.optional<Schema.Literals<readonly ["low", "medium", "high"]>>;
|
|
26
|
+
readonly serviceTier: Schema.optional<Schema.Literals<readonly ["auto", "default", "flex", "priority"]>>;
|
|
27
|
+
readonly truncation: Schema.optional<Schema.Literals<readonly ["auto", "disabled"]>>;
|
|
28
|
+
readonly allowedTools: Schema.optional<Schema.Struct<{
|
|
29
|
+
readonly toolNames: Schema.$Array<Schema.String>;
|
|
30
|
+
readonly mode: Schema.optional<Schema.Literals<readonly ["auto", "none", "required"]>>;
|
|
31
|
+
}>>;
|
|
32
|
+
readonly maxToolCalls: Schema.optional<Schema.Int>;
|
|
33
|
+
readonly parallelToolCalls: Schema.optional<Schema.Boolean>;
|
|
34
|
+
}>;
|
|
35
|
+
export type Options = typeof Options.Type;
|
|
36
|
+
export type Resolved = Omit<Options, "allowedTools"> & {
|
|
37
|
+
readonly allowedTools?: AllowedTools & {
|
|
38
|
+
readonly mode: NonNullable<AllowedTools["mode"]>;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
24
41
|
export declare const resolve: (request: LLMRequest) => Resolved;
|
|
25
42
|
export * as OpenResponsesOptions from "./open-responses-options.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Schema } from "effect";
|
|
1
|
+
import { Option, Schema } from "effect";
|
|
2
2
|
import { TextVerbosity } from "../../schema/index.js";
|
|
3
3
|
export const ResponseIncludables = [
|
|
4
4
|
"file_search_call.results",
|
|
@@ -12,35 +12,39 @@ export const ResponseIncludables = [
|
|
|
12
12
|
];
|
|
13
13
|
export const ServiceTiers = ["auto", "default", "flex", "priority"];
|
|
14
14
|
export const Truncations = ["auto", "disabled"];
|
|
15
|
-
const TEXT_VERBOSITY = new Set(["low", "medium", "high"]);
|
|
16
|
-
const INCLUDABLES = new Set(ResponseIncludables);
|
|
17
|
-
const SERVICE_TIERS = new Set(ServiceTiers);
|
|
18
|
-
const TRUNCATIONS = new Set(Truncations);
|
|
19
|
-
const isTextVerbosity = (value) => typeof value === "string" && TEXT_VERBOSITY.has(value);
|
|
20
|
-
const isServiceTier = (value) => typeof value === "string" && SERVICE_TIERS.has(value);
|
|
21
|
-
const isTruncation = (value) => typeof value === "string" && TRUNCATIONS.has(value);
|
|
22
15
|
export const ReasoningEffort = Schema.String;
|
|
23
16
|
export const TextVerbositySchema = TextVerbosity;
|
|
24
|
-
export const ResponseIncludableSchema = Schema.
|
|
17
|
+
export const ResponseIncludableSchema = Schema.declare((value) => typeof value === "string", { title: "ResponseIncludable" });
|
|
25
18
|
export const ServiceTierSchema = Schema.Literals(ServiceTiers);
|
|
26
19
|
export const TruncationSchema = Schema.Literals(Truncations);
|
|
20
|
+
export const AllowedTools = Schema.Struct({
|
|
21
|
+
toolNames: Schema.Array(Schema.String),
|
|
22
|
+
mode: Schema.optional(Schema.Literals(["auto", "none", "required"])),
|
|
23
|
+
});
|
|
24
|
+
export const Options = Schema.Struct({
|
|
25
|
+
instructions: Schema.optional(Schema.String),
|
|
26
|
+
store: Schema.optional(Schema.Boolean),
|
|
27
|
+
reasoningEffort: Schema.optional(ReasoningEffort),
|
|
28
|
+
reasoningSummary: Schema.optional(Schema.Literals(["auto", "concise", "detailed"])),
|
|
29
|
+
include: Schema.optional(Schema.Array(ResponseIncludableSchema)),
|
|
30
|
+
textVerbosity: Schema.optional(TextVerbositySchema),
|
|
31
|
+
serviceTier: Schema.optional(ServiceTierSchema),
|
|
32
|
+
truncation: Schema.optional(TruncationSchema),
|
|
33
|
+
allowedTools: Schema.optional(AllowedTools),
|
|
34
|
+
maxToolCalls: Schema.optional(Schema.Int),
|
|
35
|
+
parallelToolCalls: Schema.optional(Schema.Boolean),
|
|
36
|
+
});
|
|
37
|
+
const decodeOptions = Schema.decodeUnknownOption(Options);
|
|
27
38
|
export const resolve = (request) => {
|
|
28
|
-
const input = request.providerOptions?.[request.model.route.providerMetadataKey ?? "openresponses"];
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
: [];
|
|
32
|
-
const reasoningSummary = input?.reasoningSummary;
|
|
39
|
+
const input = Option.getOrUndefined(decodeOptions(request.providerOptions?.[request.model.route.providerMetadataKey ?? "openresponses"]));
|
|
40
|
+
if (!input)
|
|
41
|
+
return {};
|
|
33
42
|
return {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
? reasoningSummary
|
|
43
|
+
...input,
|
|
44
|
+
include: input.include?.length ? input.include : undefined,
|
|
45
|
+
allowedTools: input.allowedTools && input.allowedTools.toolNames.length > 0
|
|
46
|
+
? { ...input.allowedTools, mode: input.allowedTools.mode ?? "auto" }
|
|
39
47
|
: undefined,
|
|
40
|
-
include: include.length > 0 ? include : undefined,
|
|
41
|
-
textVerbosity: isTextVerbosity(input?.textVerbosity) ? input.textVerbosity : undefined,
|
|
42
|
-
serviceTier: isServiceTier(input?.serviceTier) ? input.serviceTier : undefined,
|
|
43
|
-
truncation: isTruncation(input?.truncation) ? input.truncation : undefined,
|
|
44
48
|
};
|
|
45
49
|
};
|
|
46
50
|
export * as OpenResponsesOptions from "./open-responses-options.js";
|
|
@@ -7,7 +7,7 @@ export declare const OpenAIServiceTiers: readonly ["auto", "default", "flex", "p
|
|
|
7
7
|
export type OpenAIServiceTier = OpenResponsesOptions.ServiceTier;
|
|
8
8
|
export declare const OpenAIReasoningEffort: import("effect/Schema").String;
|
|
9
9
|
export declare const OpenAITextVerbosity: import("effect/Schema").Literals<readonly ["low", "medium", "high"]>;
|
|
10
|
-
export declare const OpenAIResponseIncludable: import("effect/Schema").
|
|
10
|
+
export declare const OpenAIResponseIncludable: import("effect/Schema").declare<OpenResponsesOptions.ResponseIncludable, OpenResponsesOptions.ResponseIncludable>;
|
|
11
11
|
export declare const OpenAIServiceTier: import("effect/Schema").Literals<readonly ["auto", "default", "flex", "priority"]>;
|
|
12
12
|
export declare const isReasoningEffort: (effort: unknown) => effort is OpenAIReasoningEffort;
|
|
13
13
|
export declare const resolve: (request: import("../../schema/messages.js").LLMRequest) => OpenResponsesOptions.Resolved;
|
|
@@ -215,16 +215,25 @@ export declare const routes: (RouteDef<{
|
|
|
215
215
|
readonly tool_choice?: "required" | "none" | "auto" | {
|
|
216
216
|
readonly type: "function";
|
|
217
217
|
readonly name: string;
|
|
218
|
+
} | {
|
|
219
|
+
readonly type: "allowed_tools";
|
|
220
|
+
readonly mode: "required" | "none" | "auto";
|
|
221
|
+
readonly tools: readonly {
|
|
222
|
+
readonly type: "function";
|
|
223
|
+
readonly name: string;
|
|
224
|
+
}[];
|
|
218
225
|
} | {
|
|
219
226
|
readonly type: "image_generation";
|
|
220
227
|
} | undefined;
|
|
221
228
|
readonly top_p?: number | undefined;
|
|
222
|
-
readonly include?: readonly ("file_search_call.results" | "web_search_call.results" | "web_search_call.action.sources" | "message.input_image.image_url" | "computer_call_output.output.image_url" | "code_interpreter_call.outputs" | "reasoning.encrypted_content" | "message.output_text.logprobs")[] | undefined;
|
|
223
229
|
readonly store?: boolean | undefined;
|
|
230
|
+
readonly include?: readonly import("../protocols/utils/open-responses-options.js").ResponseIncludable[] | undefined;
|
|
224
231
|
readonly truncation?: "auto" | "disabled" | undefined;
|
|
225
232
|
readonly prompt_cache_key?: string | undefined;
|
|
226
233
|
readonly service_tier?: "default" | "auto" | "flex" | "priority" | undefined;
|
|
227
234
|
readonly max_output_tokens?: number | undefined;
|
|
235
|
+
readonly max_tool_calls?: number | undefined;
|
|
236
|
+
readonly parallel_tool_calls?: boolean | undefined;
|
|
228
237
|
}, import("../protocols/open-responses-channel.js").Prepared>)[];
|
|
229
238
|
export declare const configure: (input?: Config) => {
|
|
230
239
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
@@ -218,16 +218,25 @@ export declare const routes: (RouteDef<{
|
|
|
218
218
|
readonly tool_choice?: "required" | "none" | "auto" | {
|
|
219
219
|
readonly type: "function";
|
|
220
220
|
readonly name: string;
|
|
221
|
+
} | {
|
|
222
|
+
readonly type: "allowed_tools";
|
|
223
|
+
readonly mode: "required" | "none" | "auto";
|
|
224
|
+
readonly tools: readonly {
|
|
225
|
+
readonly type: "function";
|
|
226
|
+
readonly name: string;
|
|
227
|
+
}[];
|
|
221
228
|
} | {
|
|
222
229
|
readonly type: "image_generation";
|
|
223
230
|
} | undefined;
|
|
224
231
|
readonly top_p?: number | undefined;
|
|
225
|
-
readonly include?: readonly ("file_search_call.results" | "web_search_call.results" | "web_search_call.action.sources" | "message.input_image.image_url" | "computer_call_output.output.image_url" | "code_interpreter_call.outputs" | "reasoning.encrypted_content" | "message.output_text.logprobs")[] | undefined;
|
|
226
232
|
readonly store?: boolean | undefined;
|
|
233
|
+
readonly include?: readonly import("../protocols/utils/open-responses-options.js").ResponseIncludable[] | undefined;
|
|
227
234
|
readonly truncation?: "auto" | "disabled" | undefined;
|
|
228
235
|
readonly prompt_cache_key?: string | undefined;
|
|
229
236
|
readonly service_tier?: "default" | "auto" | "flex" | "priority" | undefined;
|
|
230
237
|
readonly max_output_tokens?: number | undefined;
|
|
238
|
+
readonly max_tool_calls?: number | undefined;
|
|
239
|
+
readonly parallel_tool_calls?: boolean | undefined;
|
|
231
240
|
}, import("../protocols/open-responses-channel.js").Prepared>)[];
|
|
232
241
|
export declare const configure: (input: Config) => {
|
|
233
242
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
@@ -101,14 +101,23 @@ export declare const routes: import("../route/client.js").Route<{
|
|
|
101
101
|
readonly tool_choice?: "required" | "none" | "auto" | {
|
|
102
102
|
readonly type: "function";
|
|
103
103
|
readonly name: string;
|
|
104
|
+
} | {
|
|
105
|
+
readonly type: "allowed_tools";
|
|
106
|
+
readonly mode: "required" | "none" | "auto";
|
|
107
|
+
readonly tools: readonly {
|
|
108
|
+
readonly type: "function";
|
|
109
|
+
readonly name: string;
|
|
110
|
+
}[];
|
|
104
111
|
} | undefined;
|
|
105
112
|
readonly top_p?: number | undefined;
|
|
106
|
-
readonly include?: readonly ("file_search_call.results" | "web_search_call.results" | "web_search_call.action.sources" | "message.input_image.image_url" | "computer_call_output.output.image_url" | "code_interpreter_call.outputs" | "reasoning.encrypted_content" | "message.output_text.logprobs")[] | undefined;
|
|
107
113
|
readonly store?: boolean | undefined;
|
|
114
|
+
readonly include?: readonly import("../protocols/utils/open-responses-options.js").ResponseIncludable[] | undefined;
|
|
108
115
|
readonly truncation?: "auto" | "disabled" | undefined;
|
|
109
116
|
readonly prompt_cache_key?: string | undefined;
|
|
110
117
|
readonly service_tier?: "default" | "auto" | "flex" | "priority" | undefined;
|
|
111
118
|
readonly max_output_tokens?: number | undefined;
|
|
119
|
+
readonly max_tool_calls?: number | undefined;
|
|
120
|
+
readonly parallel_tool_calls?: boolean | undefined;
|
|
112
121
|
}, import("../route/transport/http.js").HttpPrepared<string>>[];
|
|
113
122
|
export declare const configure: (input?: Config) => {
|
|
114
123
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
@@ -1,16 +1,8 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { ProviderOptions
|
|
3
|
-
export
|
|
1
|
+
import type { Options } from "../protocols/utils/open-responses-options.js";
|
|
2
|
+
import type { ProviderOptions } from "../schema/index.js";
|
|
3
|
+
export type OpenResponsesOptionsInput = Options & {
|
|
4
4
|
readonly [key: string]: unknown;
|
|
5
|
-
|
|
6
|
-
readonly store?: boolean;
|
|
7
|
-
readonly reasoningEffort?: ReasoningEffort;
|
|
8
|
-
readonly reasoningSummary?: "auto" | "concise" | "detailed";
|
|
9
|
-
readonly include?: ReadonlyArray<ResponseIncludable>;
|
|
10
|
-
readonly textVerbosity?: TextVerbosity;
|
|
11
|
-
readonly serviceTier?: ServiceTier;
|
|
12
|
-
readonly truncation?: Truncation;
|
|
13
|
-
}
|
|
5
|
+
};
|
|
14
6
|
export type OpenResponsesProviderOptionsInput = ProviderOptions & {
|
|
15
7
|
readonly openresponses?: OpenResponsesOptionsInput;
|
|
16
8
|
};
|
|
@@ -99,14 +99,23 @@ export declare const routes: import("../route/client.js").Route<{
|
|
|
99
99
|
readonly tool_choice?: "required" | "none" | "auto" | {
|
|
100
100
|
readonly type: "function";
|
|
101
101
|
readonly name: string;
|
|
102
|
+
} | {
|
|
103
|
+
readonly type: "allowed_tools";
|
|
104
|
+
readonly mode: "required" | "none" | "auto";
|
|
105
|
+
readonly tools: readonly {
|
|
106
|
+
readonly type: "function";
|
|
107
|
+
readonly name: string;
|
|
108
|
+
}[];
|
|
102
109
|
} | undefined;
|
|
103
110
|
readonly top_p?: number | undefined;
|
|
104
|
-
readonly include?: readonly ("file_search_call.results" | "web_search_call.results" | "web_search_call.action.sources" | "message.input_image.image_url" | "computer_call_output.output.image_url" | "code_interpreter_call.outputs" | "reasoning.encrypted_content" | "message.output_text.logprobs")[] | undefined;
|
|
105
111
|
readonly store?: boolean | undefined;
|
|
112
|
+
readonly include?: readonly import("../protocols/utils/open-responses-options.js").ResponseIncludable[] | undefined;
|
|
106
113
|
readonly truncation?: "auto" | "disabled" | undefined;
|
|
107
114
|
readonly prompt_cache_key?: string | undefined;
|
|
108
115
|
readonly service_tier?: "default" | "auto" | "flex" | "priority" | undefined;
|
|
109
116
|
readonly max_output_tokens?: number | undefined;
|
|
117
|
+
readonly max_tool_calls?: number | undefined;
|
|
118
|
+
readonly parallel_tool_calls?: boolean | undefined;
|
|
110
119
|
}, import("../route/transport/http.js").HttpPrepared<string>>[];
|
|
111
120
|
export declare const configure: (input: Config) => {
|
|
112
121
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
@@ -203,16 +203,25 @@ export declare const routes: (Route<{
|
|
|
203
203
|
readonly tool_choice?: "required" | "none" | "auto" | {
|
|
204
204
|
readonly type: "function";
|
|
205
205
|
readonly name: string;
|
|
206
|
+
} | {
|
|
207
|
+
readonly type: "allowed_tools";
|
|
208
|
+
readonly mode: "required" | "none" | "auto";
|
|
209
|
+
readonly tools: readonly {
|
|
210
|
+
readonly type: "function";
|
|
211
|
+
readonly name: string;
|
|
212
|
+
}[];
|
|
206
213
|
} | {
|
|
207
214
|
readonly type: "image_generation";
|
|
208
215
|
} | undefined;
|
|
209
216
|
readonly top_p?: number | undefined;
|
|
210
|
-
readonly include?: readonly ("file_search_call.results" | "web_search_call.results" | "web_search_call.action.sources" | "message.input_image.image_url" | "computer_call_output.output.image_url" | "code_interpreter_call.outputs" | "reasoning.encrypted_content" | "message.output_text.logprobs")[] | undefined;
|
|
211
217
|
readonly store?: boolean | undefined;
|
|
218
|
+
readonly include?: readonly import("../protocols/utils/open-responses-options.js").ResponseIncludable[] | undefined;
|
|
212
219
|
readonly truncation?: "auto" | "disabled" | undefined;
|
|
213
220
|
readonly prompt_cache_key?: string | undefined;
|
|
214
221
|
readonly service_tier?: "default" | "auto" | "flex" | "priority" | undefined;
|
|
215
222
|
readonly max_output_tokens?: number | undefined;
|
|
223
|
+
readonly max_tool_calls?: number | undefined;
|
|
224
|
+
readonly parallel_tool_calls?: boolean | undefined;
|
|
216
225
|
}, import("../protocols/open-responses-channel.js").Prepared>)[];
|
|
217
226
|
export type Config = RouteDefaultsInput & ProviderAuthOption<"optional"> & {
|
|
218
227
|
readonly baseURL?: string;
|
package/dist/providers/xai.d.ts
CHANGED
|
@@ -213,16 +213,25 @@ export declare const routes: (Route<{
|
|
|
213
213
|
readonly tool_choice?: "required" | "none" | "auto" | {
|
|
214
214
|
readonly type: "function";
|
|
215
215
|
readonly name: string;
|
|
216
|
+
} | {
|
|
217
|
+
readonly type: "allowed_tools";
|
|
218
|
+
readonly mode: "required" | "none" | "auto";
|
|
219
|
+
readonly tools: readonly {
|
|
220
|
+
readonly type: "function";
|
|
221
|
+
readonly name: string;
|
|
222
|
+
}[];
|
|
216
223
|
} | {
|
|
217
224
|
readonly type: "image_generation";
|
|
218
225
|
} | undefined;
|
|
219
226
|
readonly top_p?: number | undefined;
|
|
220
|
-
readonly include?: readonly ("file_search_call.results" | "web_search_call.results" | "web_search_call.action.sources" | "message.input_image.image_url" | "computer_call_output.output.image_url" | "code_interpreter_call.outputs" | "reasoning.encrypted_content" | "message.output_text.logprobs")[] | undefined;
|
|
221
227
|
readonly store?: boolean | undefined;
|
|
228
|
+
readonly include?: readonly import("../protocols/utils/open-responses-options.js").ResponseIncludable[] | undefined;
|
|
222
229
|
readonly truncation?: "auto" | "disabled" | undefined;
|
|
223
230
|
readonly prompt_cache_key?: string | undefined;
|
|
224
231
|
readonly service_tier?: "default" | "auto" | "flex" | "priority" | undefined;
|
|
225
232
|
readonly max_output_tokens?: number | undefined;
|
|
233
|
+
readonly max_tool_calls?: number | undefined;
|
|
234
|
+
readonly parallel_tool_calls?: boolean | undefined;
|
|
226
235
|
}, import("../route/transport/http.js").HttpPrepared<string>>)[];
|
|
227
236
|
export declare const configure: (input?: LanguageModelOptions) => {
|
|
228
237
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
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-17653",
|
|
4
4
|
"name": "@opencode-ai/ai",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@clack/prompts": "1.0.0-alpha.1",
|
|
32
32
|
"@effect/platform-node": "4.0.0-beta.107",
|
|
33
|
-
"@opencode-ai/http-recorder": "0.0.0-dev-
|
|
33
|
+
"@opencode-ai/http-recorder": "0.0.0-dev-17653",
|
|
34
34
|
"@tsconfig/bun": "1.0.9",
|
|
35
35
|
"@types/bun": "1.3.13",
|
|
36
36
|
"@typescript/native-preview": "7.0.0-dev.20251207.1",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@smithy/eventstream-codec": "4.2.14",
|
|
41
41
|
"@smithy/util-utf8": "4.2.2",
|
|
42
|
-
"@opencode-ai/schema": "0.0.0-dev-
|
|
42
|
+
"@opencode-ai/schema": "0.0.0-dev-17653",
|
|
43
43
|
"aws4fetch": "1.0.20",
|
|
44
44
|
"effect": "4.0.0-beta.107",
|
|
45
45
|
"google-auth-library": "10.5.0"
|