@opencode/ai 2.3.0 → 2.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +65 -18
- package/dist/cache-policy.js +4 -2
- package/dist/effect.d.ts +3 -1
- package/dist/generation.d.ts +10 -10
- package/dist/generation.js +8 -14
- package/dist/image-client.d.ts +56 -59
- package/dist/image-client.js +47 -8
- package/dist/image.d.ts +36 -95
- package/dist/image.js +11 -14
- package/dist/index.d.ts +25 -25
- package/dist/index.js +29 -22
- package/dist/llm.d.ts +4 -1
- package/dist/llm.js +10 -1
- package/dist/media-client.d.ts +18 -6
- package/dist/media-client.js +42 -37
- package/dist/media.d.ts +17 -1
- package/dist/media.js +28 -7
- 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/assemblyai-transcription.js +7 -6
- package/dist/protocols/cartesia-speech.d.ts +0 -8
- package/dist/protocols/deepgram-speech.d.ts +0 -8
- package/dist/protocols/elevenlabs-speech.d.ts +0 -8
- package/dist/protocols/google-interactions-video.d.ts +4 -9
- package/dist/protocols/google-interactions-video.js +9 -10
- package/dist/protocols/google-speech.d.ts +0 -8
- package/dist/protocols/google-transcription.d.ts +0 -8
- package/dist/protocols/meta-messages.d.ts +24 -2
- package/dist/protocols/meta-responses.d.ts +52 -0
- package/dist/protocols/minimax-video.d.ts +6 -15
- package/dist/protocols/minimax-video.js +25 -27
- package/dist/protocols/open-responses.d.ts +410 -138
- package/dist/protocols/open-responses.js +47 -28
- package/dist/protocols/openai-chat.js +7 -3
- 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-images.d.ts +0 -8
- package/dist/protocols/openai-responses.d.ts +153 -0
- package/dist/protocols/openai-responses.js +68 -7
- package/dist/protocols/openai-speech.d.ts +0 -8
- package/dist/protocols/openai-transcription.d.ts +0 -8
- package/dist/protocols/openrouter-video.d.ts +4 -9
- package/dist/protocols/openrouter-video.js +14 -13
- package/dist/protocols/seedance-video.d.ts +4 -9
- package/dist/protocols/seedance-video.js +13 -12
- package/dist/protocols/utils/gateway-protocol.js +1 -0
- package/dist/protocols/utils/responses-compaction.js +14 -4
- package/dist/protocols/xai-responses.d.ts +26 -0
- package/dist/protocols/xai-video.d.ts +4 -9
- package/dist/protocols/xai-video.js +13 -9
- 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/google.d.ts +3 -3
- package/dist/providers/google.js +5 -2
- 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/xai/videos.d.ts +2 -0
- package/dist/providers/xai/videos.js +1 -0
- package/dist/providers/xai.d.ts +4 -3
- package/dist/providers/xai.js +5 -1
- package/dist/providers/zai-coding-plan.d.ts +50 -2
- package/dist/public.d.ts +5 -4
- package/dist/public.js +1 -1
- package/dist/route/client.d.ts +2 -0
- package/dist/route/client.js +5 -1
- package/dist/route/executor-service.d.ts +14 -1
- package/dist/route/executor-service.js +28 -1
- package/dist/route/executor.d.ts +5 -2
- package/dist/route/executor.js +20 -5
- package/dist/route/media-protocol.d.ts +12 -7
- package/dist/route/media-protocol.js +11 -4
- package/dist/route/media.js +12 -3
- 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/speech-client.d.ts +5 -5
- package/dist/speech.d.ts +7 -88
- package/dist/speech.js +1 -3
- 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/dist/transcription-client.d.ts +5 -5
- package/dist/transcription.d.ts +7 -88
- package/dist/transcription.js +1 -3
- package/dist/video-client.d.ts +6 -6
- package/dist/video-client.js +13 -11
- package/dist/video.d.ts +17 -73
- package/dist/video.js +9 -8
- package/package.json +7 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Effect, Schema } from "effect";
|
|
2
2
|
import { HttpTransport } from "../route/transport/index.js";
|
|
3
3
|
import { Protocol } from "../route/protocol.js";
|
|
4
|
-
import { AIError, LLMEvent, Usage, type LLMRequest, type MediaPart, type ProviderMetadata, type ToolDefinition } from "../schema/index.js";
|
|
4
|
+
import { AIError, LLMEvent, Usage, type LLMRequest, type MediaPart, type ProviderMetadata, type ToolChanges, type ToolDefinition } from "../schema/index.js";
|
|
5
5
|
import type { Media } from "../media.js";
|
|
6
6
|
import { OpenResponsesOptions } from "./utils/open-responses-options.js";
|
|
7
7
|
import { Lifecycle } from "./utils/lifecycle.js";
|
|
@@ -105,6 +105,53 @@ export declare const HostedToolReplay: Schema.StructWithRest<Schema.Struct<{
|
|
|
105
105
|
readonly id: Schema.String;
|
|
106
106
|
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>;
|
|
107
107
|
export type HostedToolReplayItem = Schema.Schema.Type<typeof HostedToolReplay>;
|
|
108
|
+
export declare const Tool: Schema.Struct<{
|
|
109
|
+
readonly type: Schema.tag<"function">;
|
|
110
|
+
readonly name: Schema.String;
|
|
111
|
+
readonly description: Schema.String;
|
|
112
|
+
readonly parameters: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
113
|
+
readonly strict: Schema.optional<Schema.Boolean>;
|
|
114
|
+
}>;
|
|
115
|
+
export declare const CustomTool: Schema.Struct<{
|
|
116
|
+
readonly type: Schema.tag<"custom">;
|
|
117
|
+
readonly name: Schema.String;
|
|
118
|
+
readonly description: Schema.String;
|
|
119
|
+
readonly format: Schema.Union<readonly [Schema.Struct<{
|
|
120
|
+
readonly type: Schema.tag<"text">;
|
|
121
|
+
}>, Schema.Struct<{
|
|
122
|
+
readonly type: Schema.tag<"grammar">;
|
|
123
|
+
readonly syntax: Schema.Literals<readonly ["lark", "regex"]>;
|
|
124
|
+
readonly definition: Schema.String;
|
|
125
|
+
}>]>;
|
|
126
|
+
}>;
|
|
127
|
+
export declare const HostedTool: Schema.StructWithRest<Schema.Struct<{
|
|
128
|
+
readonly type: Schema.String;
|
|
129
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>;
|
|
130
|
+
export type HostedTool = Schema.Schema.Type<typeof HostedTool>;
|
|
131
|
+
export declare const AdditionalTools: Schema.Struct<{
|
|
132
|
+
readonly type: Schema.Literal<"additional_tools">;
|
|
133
|
+
readonly role: Schema.Literal<"developer">;
|
|
134
|
+
readonly tools: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
135
|
+
readonly type: Schema.tag<"function">;
|
|
136
|
+
readonly name: Schema.String;
|
|
137
|
+
readonly description: Schema.String;
|
|
138
|
+
readonly parameters: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
139
|
+
readonly strict: Schema.optional<Schema.Boolean>;
|
|
140
|
+
}>, Schema.Struct<{
|
|
141
|
+
readonly type: Schema.tag<"custom">;
|
|
142
|
+
readonly name: Schema.String;
|
|
143
|
+
readonly description: Schema.String;
|
|
144
|
+
readonly format: Schema.Union<readonly [Schema.Struct<{
|
|
145
|
+
readonly type: Schema.tag<"text">;
|
|
146
|
+
}>, Schema.Struct<{
|
|
147
|
+
readonly type: Schema.tag<"grammar">;
|
|
148
|
+
readonly syntax: Schema.Literals<readonly ["lark", "regex"]>;
|
|
149
|
+
readonly definition: Schema.String;
|
|
150
|
+
}>]>;
|
|
151
|
+
}>, Schema.StructWithRest<Schema.Struct<{
|
|
152
|
+
readonly type: Schema.String;
|
|
153
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>]>>;
|
|
154
|
+
}>;
|
|
108
155
|
export declare const InputItem: Schema.Union<readonly [Schema.Struct<{
|
|
109
156
|
readonly type: Schema.Literal<"compaction">;
|
|
110
157
|
readonly id: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
@@ -114,6 +161,29 @@ export declare const InputItem: Schema.Union<readonly [Schema.Struct<{
|
|
|
114
161
|
readonly reasoning: Schema.Struct<{
|
|
115
162
|
readonly effort: Schema.declare<OpenResponsesOptions.ReasoningEffort, OpenResponsesOptions.ReasoningEffort>;
|
|
116
163
|
}>;
|
|
164
|
+
}>, Schema.Struct<{
|
|
165
|
+
readonly type: Schema.Literal<"additional_tools">;
|
|
166
|
+
readonly role: Schema.Literal<"developer">;
|
|
167
|
+
readonly tools: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
168
|
+
readonly type: Schema.tag<"function">;
|
|
169
|
+
readonly name: Schema.String;
|
|
170
|
+
readonly description: Schema.String;
|
|
171
|
+
readonly parameters: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
172
|
+
readonly strict: Schema.optional<Schema.Boolean>;
|
|
173
|
+
}>, Schema.Struct<{
|
|
174
|
+
readonly type: Schema.tag<"custom">;
|
|
175
|
+
readonly name: Schema.String;
|
|
176
|
+
readonly description: Schema.String;
|
|
177
|
+
readonly format: Schema.Union<readonly [Schema.Struct<{
|
|
178
|
+
readonly type: Schema.tag<"text">;
|
|
179
|
+
}>, Schema.Struct<{
|
|
180
|
+
readonly type: Schema.tag<"grammar">;
|
|
181
|
+
readonly syntax: Schema.Literals<readonly ["lark", "regex"]>;
|
|
182
|
+
readonly definition: Schema.String;
|
|
183
|
+
}>]>;
|
|
184
|
+
}>, Schema.StructWithRest<Schema.Struct<{
|
|
185
|
+
readonly type: Schema.String;
|
|
186
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>]>>;
|
|
117
187
|
}>, Schema.Struct<{
|
|
118
188
|
readonly type: Schema.tag<"message">;
|
|
119
189
|
readonly role: Schema.tag<"system">;
|
|
@@ -226,29 +296,7 @@ export declare const InputItem: Schema.Union<readonly [Schema.Struct<{
|
|
|
226
296
|
readonly type: Schema.String;
|
|
227
297
|
readonly id: Schema.String;
|
|
228
298
|
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>]>;
|
|
229
|
-
|
|
230
|
-
readonly type: Schema.tag<"function">;
|
|
231
|
-
readonly name: Schema.String;
|
|
232
|
-
readonly description: Schema.String;
|
|
233
|
-
readonly parameters: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
234
|
-
readonly strict: Schema.optional<Schema.Boolean>;
|
|
235
|
-
}>;
|
|
236
|
-
export declare const CustomTool: Schema.Struct<{
|
|
237
|
-
readonly type: Schema.tag<"custom">;
|
|
238
|
-
readonly name: Schema.String;
|
|
239
|
-
readonly description: Schema.String;
|
|
240
|
-
readonly format: Schema.Union<readonly [Schema.Struct<{
|
|
241
|
-
readonly type: Schema.tag<"text">;
|
|
242
|
-
}>, Schema.Struct<{
|
|
243
|
-
readonly type: Schema.tag<"grammar">;
|
|
244
|
-
readonly syntax: Schema.Literals<readonly ["lark", "regex"]>;
|
|
245
|
-
readonly definition: Schema.String;
|
|
246
|
-
}>]>;
|
|
247
|
-
}>;
|
|
248
|
-
export declare const HostedTool: Schema.StructWithRest<Schema.Struct<{
|
|
249
|
-
readonly type: Schema.String;
|
|
250
|
-
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>;
|
|
251
|
-
export type HostedTool = Schema.Schema.Type<typeof HostedTool>;
|
|
299
|
+
type OpenResponsesInputItem = Schema.Schema.Type<typeof InputItem>;
|
|
252
300
|
export declare const ToolChoice: Schema.Union<readonly [Schema.Literals<readonly ["auto", "none", "required"]>, Schema.Struct<{
|
|
253
301
|
readonly type: Schema.Literals<readonly ["function", "custom"]>;
|
|
254
302
|
readonly name: Schema.String;
|
|
@@ -271,6 +319,29 @@ export declare const coreFields: {
|
|
|
271
319
|
readonly reasoning: Schema.Struct<{
|
|
272
320
|
readonly effort: Schema.declare<OpenResponsesOptions.ReasoningEffort, OpenResponsesOptions.ReasoningEffort>;
|
|
273
321
|
}>;
|
|
322
|
+
}>, Schema.Struct<{
|
|
323
|
+
readonly type: Schema.Literal<"additional_tools">;
|
|
324
|
+
readonly role: Schema.Literal<"developer">;
|
|
325
|
+
readonly tools: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
326
|
+
readonly type: Schema.tag<"function">;
|
|
327
|
+
readonly name: Schema.String;
|
|
328
|
+
readonly description: Schema.String;
|
|
329
|
+
readonly parameters: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
330
|
+
readonly strict: Schema.optional<Schema.Boolean>;
|
|
331
|
+
}>, Schema.Struct<{
|
|
332
|
+
readonly type: Schema.tag<"custom">;
|
|
333
|
+
readonly name: Schema.String;
|
|
334
|
+
readonly description: Schema.String;
|
|
335
|
+
readonly format: Schema.Union<readonly [Schema.Struct<{
|
|
336
|
+
readonly type: Schema.tag<"text">;
|
|
337
|
+
}>, Schema.Struct<{
|
|
338
|
+
readonly type: Schema.tag<"grammar">;
|
|
339
|
+
readonly syntax: Schema.Literals<readonly ["lark", "regex"]>;
|
|
340
|
+
readonly definition: Schema.String;
|
|
341
|
+
}>]>;
|
|
342
|
+
}>, Schema.StructWithRest<Schema.Struct<{
|
|
343
|
+
readonly type: Schema.String;
|
|
344
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>]>>;
|
|
274
345
|
}>, Schema.Struct<{
|
|
275
346
|
readonly type: Schema.tag<"message">;
|
|
276
347
|
readonly role: Schema.tag<"system">;
|
|
@@ -452,6 +523,29 @@ export declare const OpenResponsesBody: Schema.Struct<{
|
|
|
452
523
|
readonly reasoning: Schema.Struct<{
|
|
453
524
|
readonly effort: Schema.declare<OpenResponsesOptions.ReasoningEffort, OpenResponsesOptions.ReasoningEffort>;
|
|
454
525
|
}>;
|
|
526
|
+
}>, Schema.Struct<{
|
|
527
|
+
readonly type: Schema.Literal<"additional_tools">;
|
|
528
|
+
readonly role: Schema.Literal<"developer">;
|
|
529
|
+
readonly tools: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
530
|
+
readonly type: Schema.tag<"function">;
|
|
531
|
+
readonly name: Schema.String;
|
|
532
|
+
readonly description: Schema.String;
|
|
533
|
+
readonly parameters: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
534
|
+
readonly strict: Schema.optional<Schema.Boolean>;
|
|
535
|
+
}>, Schema.Struct<{
|
|
536
|
+
readonly type: Schema.tag<"custom">;
|
|
537
|
+
readonly name: Schema.String;
|
|
538
|
+
readonly description: Schema.String;
|
|
539
|
+
readonly format: Schema.Union<readonly [Schema.Struct<{
|
|
540
|
+
readonly type: Schema.tag<"text">;
|
|
541
|
+
}>, Schema.Struct<{
|
|
542
|
+
readonly type: Schema.tag<"grammar">;
|
|
543
|
+
readonly syntax: Schema.Literals<readonly ["lark", "regex"]>;
|
|
544
|
+
readonly definition: Schema.String;
|
|
545
|
+
}>]>;
|
|
546
|
+
}>, Schema.StructWithRest<Schema.Struct<{
|
|
547
|
+
readonly type: Schema.String;
|
|
548
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>]>>;
|
|
455
549
|
}>, Schema.Struct<{
|
|
456
550
|
readonly type: Schema.tag<"message">;
|
|
457
551
|
readonly role: Schema.tag<"system">;
|
|
@@ -915,6 +1009,8 @@ export interface ProviderAdapter {
|
|
|
915
1009
|
readonly request: LLMRequest;
|
|
916
1010
|
}) => MediaInput | undefined;
|
|
917
1011
|
readonly restoreHostedToolItem?: (item: unknown) => HostedToolReplayItem | undefined;
|
|
1012
|
+
/** Lowers a `Message.tools(...)` marker sent in place; routes without it must fold tool updates. */
|
|
1013
|
+
readonly lowerToolChanges?: (changes: ToolChanges) => Effect.Effect<ReadonlyArray<OpenResponsesInputItem>, AIError>;
|
|
918
1014
|
}
|
|
919
1015
|
export interface ParserState {
|
|
920
1016
|
readonly provider: LLMRequest["model"]["provider"];
|
|
@@ -991,6 +1087,166 @@ export declare const lowerToolChoice: (protocolName: string, toolChoice: NonNull
|
|
|
991
1087
|
type: "custom" | "function";
|
|
992
1088
|
name: string;
|
|
993
1089
|
}, AIError, never>;
|
|
1090
|
+
export declare const lowerMessages: (request: LLMRequest<import("../schema/options.js").LanguageModel<{
|
|
1091
|
+
readonly [x: string]: unknown;
|
|
1092
|
+
}, import("../route.js").CompactionOperations | undefined>>, adapter: ProviderAdapter) => Effect.Effect<({
|
|
1093
|
+
readonly type: "configuration_update";
|
|
1094
|
+
readonly reasoning: {
|
|
1095
|
+
readonly effort: OpenResponsesOptions.ReasoningEffort;
|
|
1096
|
+
};
|
|
1097
|
+
} | {
|
|
1098
|
+
readonly type: "additional_tools";
|
|
1099
|
+
readonly role: "developer";
|
|
1100
|
+
readonly tools: readonly ({
|
|
1101
|
+
readonly type: "custom";
|
|
1102
|
+
readonly name: string;
|
|
1103
|
+
readonly description: string;
|
|
1104
|
+
readonly format: {
|
|
1105
|
+
readonly type: "text";
|
|
1106
|
+
} | {
|
|
1107
|
+
readonly type: "grammar";
|
|
1108
|
+
readonly syntax: "lark" | "regex";
|
|
1109
|
+
readonly definition: string;
|
|
1110
|
+
};
|
|
1111
|
+
} | {
|
|
1112
|
+
readonly type: "function";
|
|
1113
|
+
readonly name: string;
|
|
1114
|
+
readonly description: string;
|
|
1115
|
+
readonly parameters: {
|
|
1116
|
+
readonly [x: string]: unknown;
|
|
1117
|
+
};
|
|
1118
|
+
readonly strict?: boolean | undefined;
|
|
1119
|
+
} | {
|
|
1120
|
+
readonly [x: string]: unknown;
|
|
1121
|
+
readonly type: string;
|
|
1122
|
+
})[];
|
|
1123
|
+
} | {
|
|
1124
|
+
readonly type: "message";
|
|
1125
|
+
readonly role: "system";
|
|
1126
|
+
readonly content: string;
|
|
1127
|
+
} | {
|
|
1128
|
+
readonly type: "message";
|
|
1129
|
+
readonly role: "developer";
|
|
1130
|
+
readonly content: string;
|
|
1131
|
+
} | {
|
|
1132
|
+
readonly type: "custom_tool_call_output" | "function_call_output";
|
|
1133
|
+
readonly call_id: string;
|
|
1134
|
+
readonly output: string | readonly ({
|
|
1135
|
+
readonly type: "input_text";
|
|
1136
|
+
readonly text: string;
|
|
1137
|
+
} | {
|
|
1138
|
+
readonly type: "input_video";
|
|
1139
|
+
readonly video_url: string;
|
|
1140
|
+
} | {
|
|
1141
|
+
readonly type: "input_image";
|
|
1142
|
+
readonly image_url: string;
|
|
1143
|
+
readonly detail?: string | undefined;
|
|
1144
|
+
} | {
|
|
1145
|
+
readonly type: "input_file";
|
|
1146
|
+
readonly filename?: string | undefined;
|
|
1147
|
+
readonly detail?: string | undefined;
|
|
1148
|
+
readonly file_data?: string | undefined;
|
|
1149
|
+
readonly file_url?: string | undefined;
|
|
1150
|
+
})[];
|
|
1151
|
+
} | {
|
|
1152
|
+
readonly type: "reasoning";
|
|
1153
|
+
readonly id?: string | undefined;
|
|
1154
|
+
readonly summary: readonly {
|
|
1155
|
+
readonly type: "summary_text";
|
|
1156
|
+
readonly text: string;
|
|
1157
|
+
}[];
|
|
1158
|
+
readonly encrypted_content?: string | null | undefined;
|
|
1159
|
+
} | {
|
|
1160
|
+
readonly type: "compaction";
|
|
1161
|
+
readonly id?: string | null | undefined;
|
|
1162
|
+
readonly encrypted_content: string;
|
|
1163
|
+
} | {
|
|
1164
|
+
readonly type: "message";
|
|
1165
|
+
readonly role: "user";
|
|
1166
|
+
readonly content: readonly ({
|
|
1167
|
+
readonly type: "input_text";
|
|
1168
|
+
readonly text: string;
|
|
1169
|
+
} | {
|
|
1170
|
+
readonly type: "input_video";
|
|
1171
|
+
readonly video_url: string;
|
|
1172
|
+
} | {
|
|
1173
|
+
readonly type: "input_image";
|
|
1174
|
+
readonly image_url: string;
|
|
1175
|
+
readonly detail?: string | undefined;
|
|
1176
|
+
} | {
|
|
1177
|
+
readonly type: "input_file";
|
|
1178
|
+
readonly filename?: string | undefined;
|
|
1179
|
+
readonly detail?: string | undefined;
|
|
1180
|
+
readonly file_data?: string | undefined;
|
|
1181
|
+
readonly file_url?: string | undefined;
|
|
1182
|
+
})[];
|
|
1183
|
+
readonly id?: string | undefined;
|
|
1184
|
+
readonly status?: string | undefined;
|
|
1185
|
+
} | {
|
|
1186
|
+
readonly type: "message";
|
|
1187
|
+
readonly id?: string | undefined;
|
|
1188
|
+
readonly role: "assistant";
|
|
1189
|
+
readonly content: readonly {
|
|
1190
|
+
readonly type: "output_text";
|
|
1191
|
+
readonly text: string;
|
|
1192
|
+
}[];
|
|
1193
|
+
readonly phase?: "commentary" | "final_answer" | null | undefined;
|
|
1194
|
+
readonly status?: string | undefined;
|
|
1195
|
+
} | {
|
|
1196
|
+
readonly type: "function_call";
|
|
1197
|
+
readonly id?: string | undefined;
|
|
1198
|
+
readonly call_id: string;
|
|
1199
|
+
readonly name: string;
|
|
1200
|
+
readonly namespace?: string | undefined;
|
|
1201
|
+
readonly arguments: string;
|
|
1202
|
+
} | {
|
|
1203
|
+
readonly type: "custom_tool_call";
|
|
1204
|
+
readonly id?: string | undefined;
|
|
1205
|
+
readonly call_id: string;
|
|
1206
|
+
readonly name: string;
|
|
1207
|
+
readonly input: string;
|
|
1208
|
+
} | {
|
|
1209
|
+
readonly [x: string]: unknown;
|
|
1210
|
+
readonly type: "web_search_call";
|
|
1211
|
+
readonly id: string;
|
|
1212
|
+
readonly status?: string | undefined;
|
|
1213
|
+
readonly action?: {
|
|
1214
|
+
readonly [x: string]: unknown;
|
|
1215
|
+
} | null | undefined;
|
|
1216
|
+
} | {
|
|
1217
|
+
readonly [x: string]: unknown;
|
|
1218
|
+
readonly type: "file_search_call";
|
|
1219
|
+
readonly id: string;
|
|
1220
|
+
readonly status?: string | undefined;
|
|
1221
|
+
readonly queries?: readonly string[] | undefined;
|
|
1222
|
+
readonly results?: readonly {
|
|
1223
|
+
readonly [x: string]: unknown;
|
|
1224
|
+
}[] | null | undefined;
|
|
1225
|
+
} | {
|
|
1226
|
+
readonly [x: string]: unknown;
|
|
1227
|
+
readonly type: "code_interpreter_call";
|
|
1228
|
+
readonly id: string;
|
|
1229
|
+
readonly status?: string | undefined;
|
|
1230
|
+
readonly code?: string | null | undefined;
|
|
1231
|
+
readonly container_id?: string | null | undefined;
|
|
1232
|
+
readonly outputs?: readonly {
|
|
1233
|
+
readonly [x: string]: unknown;
|
|
1234
|
+
}[] | null | undefined;
|
|
1235
|
+
} | {
|
|
1236
|
+
readonly [x: string]: unknown;
|
|
1237
|
+
readonly type: "mcp_call";
|
|
1238
|
+
readonly id: string;
|
|
1239
|
+
readonly status?: string | undefined;
|
|
1240
|
+
readonly server_label?: string | undefined;
|
|
1241
|
+
readonly name?: string | undefined;
|
|
1242
|
+
readonly arguments?: string | undefined;
|
|
1243
|
+
readonly output?: string | null | undefined;
|
|
1244
|
+
readonly error?: unknown;
|
|
1245
|
+
} | {
|
|
1246
|
+
readonly [x: string]: unknown;
|
|
1247
|
+
readonly type: string;
|
|
1248
|
+
readonly id: string;
|
|
1249
|
+
})[], AIError, never>;
|
|
994
1250
|
export declare const lowerConversation: (request: LLMRequest<import("../schema/options.js").LanguageModel<{
|
|
995
1251
|
readonly [x: string]: unknown;
|
|
996
1252
|
}, import("../route.js").CompactionOperations | undefined>>, adapter: ProviderAdapter) => Effect.Effect<{
|
|
@@ -1000,6 +1256,32 @@ export declare const lowerConversation: (request: LLMRequest<import("../schema/o
|
|
|
1000
1256
|
readonly reasoning: {
|
|
1001
1257
|
readonly effort: OpenResponsesOptions.ReasoningEffort;
|
|
1002
1258
|
};
|
|
1259
|
+
} | {
|
|
1260
|
+
readonly type: "additional_tools";
|
|
1261
|
+
readonly role: "developer";
|
|
1262
|
+
readonly tools: readonly ({
|
|
1263
|
+
readonly type: "custom";
|
|
1264
|
+
readonly name: string;
|
|
1265
|
+
readonly description: string;
|
|
1266
|
+
readonly format: {
|
|
1267
|
+
readonly type: "text";
|
|
1268
|
+
} | {
|
|
1269
|
+
readonly type: "grammar";
|
|
1270
|
+
readonly syntax: "lark" | "regex";
|
|
1271
|
+
readonly definition: string;
|
|
1272
|
+
};
|
|
1273
|
+
} | {
|
|
1274
|
+
readonly type: "function";
|
|
1275
|
+
readonly name: string;
|
|
1276
|
+
readonly description: string;
|
|
1277
|
+
readonly parameters: {
|
|
1278
|
+
readonly [x: string]: unknown;
|
|
1279
|
+
};
|
|
1280
|
+
readonly strict?: boolean | undefined;
|
|
1281
|
+
} | {
|
|
1282
|
+
readonly [x: string]: unknown;
|
|
1283
|
+
readonly type: string;
|
|
1284
|
+
})[];
|
|
1003
1285
|
} | {
|
|
1004
1286
|
readonly type: "message";
|
|
1005
1287
|
readonly role: "system";
|
|
@@ -1085,49 +1367,11 @@ export declare const lowerConversation: (request: LLMRequest<import("../schema/o
|
|
|
1085
1367
|
readonly call_id: string;
|
|
1086
1368
|
readonly name: string;
|
|
1087
1369
|
readonly input: string;
|
|
1088
|
-
} | {
|
|
1089
|
-
readonly [x: string]: unknown;
|
|
1090
|
-
readonly type: "web_search_call";
|
|
1091
|
-
readonly id: string;
|
|
1092
|
-
readonly status?: string | undefined;
|
|
1093
|
-
readonly action?: {
|
|
1094
|
-
readonly [x: string]: unknown;
|
|
1095
|
-
} | null | undefined;
|
|
1096
|
-
} | {
|
|
1097
|
-
readonly [x: string]: unknown;
|
|
1098
|
-
readonly type: "file_search_call";
|
|
1099
|
-
readonly id: string;
|
|
1100
|
-
readonly status?: string | undefined;
|
|
1101
|
-
readonly queries?: readonly string[] | undefined;
|
|
1102
|
-
readonly results?: readonly {
|
|
1103
|
-
readonly [x: string]: unknown;
|
|
1104
|
-
}[] | null | undefined;
|
|
1105
|
-
} | {
|
|
1106
|
-
readonly [x: string]: unknown;
|
|
1107
|
-
readonly type: "code_interpreter_call";
|
|
1108
|
-
readonly id: string;
|
|
1109
|
-
readonly status?: string | undefined;
|
|
1110
|
-
readonly code?: string | null | undefined;
|
|
1111
|
-
readonly container_id?: string | null | undefined;
|
|
1112
|
-
readonly outputs?: readonly {
|
|
1113
|
-
readonly [x: string]: unknown;
|
|
1114
|
-
}[] | null | undefined;
|
|
1115
|
-
} | {
|
|
1116
|
-
readonly [x: string]: unknown;
|
|
1117
|
-
readonly type: "mcp_call";
|
|
1118
|
-
readonly id: string;
|
|
1119
|
-
readonly status?: string | undefined;
|
|
1120
|
-
readonly server_label?: string | undefined;
|
|
1121
|
-
readonly name?: string | undefined;
|
|
1122
|
-
readonly arguments?: string | undefined;
|
|
1123
|
-
readonly output?: string | null | undefined;
|
|
1124
|
-
readonly error?: unknown;
|
|
1125
1370
|
} | {
|
|
1126
1371
|
readonly [x: string]: unknown;
|
|
1127
1372
|
readonly type: string;
|
|
1128
1373
|
readonly id: string;
|
|
1129
1374
|
})[];
|
|
1130
|
-
instructions?: string | undefined;
|
|
1131
1375
|
}, AIError, never>;
|
|
1132
1376
|
export declare const lowerGeneration: (request: LLMRequest, options?: OpenResponsesOptions.Resolved) => {
|
|
1133
1377
|
stream: true;
|
|
@@ -1177,6 +1421,32 @@ export declare const fromRequestWithAdapter: (request: LLMRequest<import("../sch
|
|
|
1177
1421
|
readonly reasoning: {
|
|
1178
1422
|
readonly effort: OpenResponsesOptions.ReasoningEffort;
|
|
1179
1423
|
};
|
|
1424
|
+
} | {
|
|
1425
|
+
readonly type: "additional_tools";
|
|
1426
|
+
readonly role: "developer";
|
|
1427
|
+
readonly tools: readonly ({
|
|
1428
|
+
readonly type: "custom";
|
|
1429
|
+
readonly name: string;
|
|
1430
|
+
readonly description: string;
|
|
1431
|
+
readonly format: {
|
|
1432
|
+
readonly type: "text";
|
|
1433
|
+
} | {
|
|
1434
|
+
readonly type: "grammar";
|
|
1435
|
+
readonly syntax: "lark" | "regex";
|
|
1436
|
+
readonly definition: string;
|
|
1437
|
+
};
|
|
1438
|
+
} | {
|
|
1439
|
+
readonly type: "function";
|
|
1440
|
+
readonly name: string;
|
|
1441
|
+
readonly description: string;
|
|
1442
|
+
readonly parameters: {
|
|
1443
|
+
readonly [x: string]: unknown;
|
|
1444
|
+
};
|
|
1445
|
+
readonly strict?: boolean | undefined;
|
|
1446
|
+
} | {
|
|
1447
|
+
readonly [x: string]: unknown;
|
|
1448
|
+
readonly type: string;
|
|
1449
|
+
})[];
|
|
1180
1450
|
} | {
|
|
1181
1451
|
readonly type: "message";
|
|
1182
1452
|
readonly role: "system";
|
|
@@ -1262,49 +1532,11 @@ export declare const fromRequestWithAdapter: (request: LLMRequest<import("../sch
|
|
|
1262
1532
|
readonly call_id: string;
|
|
1263
1533
|
readonly name: string;
|
|
1264
1534
|
readonly input: string;
|
|
1265
|
-
} | {
|
|
1266
|
-
readonly [x: string]: unknown;
|
|
1267
|
-
readonly type: "web_search_call";
|
|
1268
|
-
readonly id: string;
|
|
1269
|
-
readonly status?: string | undefined;
|
|
1270
|
-
readonly action?: {
|
|
1271
|
-
readonly [x: string]: unknown;
|
|
1272
|
-
} | null | undefined;
|
|
1273
|
-
} | {
|
|
1274
|
-
readonly [x: string]: unknown;
|
|
1275
|
-
readonly type: "file_search_call";
|
|
1276
|
-
readonly id: string;
|
|
1277
|
-
readonly status?: string | undefined;
|
|
1278
|
-
readonly queries?: readonly string[] | undefined;
|
|
1279
|
-
readonly results?: readonly {
|
|
1280
|
-
readonly [x: string]: unknown;
|
|
1281
|
-
}[] | null | undefined;
|
|
1282
|
-
} | {
|
|
1283
|
-
readonly [x: string]: unknown;
|
|
1284
|
-
readonly type: "code_interpreter_call";
|
|
1285
|
-
readonly id: string;
|
|
1286
|
-
readonly status?: string | undefined;
|
|
1287
|
-
readonly code?: string | null | undefined;
|
|
1288
|
-
readonly container_id?: string | null | undefined;
|
|
1289
|
-
readonly outputs?: readonly {
|
|
1290
|
-
readonly [x: string]: unknown;
|
|
1291
|
-
}[] | null | undefined;
|
|
1292
|
-
} | {
|
|
1293
|
-
readonly [x: string]: unknown;
|
|
1294
|
-
readonly type: "mcp_call";
|
|
1295
|
-
readonly id: string;
|
|
1296
|
-
readonly status?: string | undefined;
|
|
1297
|
-
readonly server_label?: string | undefined;
|
|
1298
|
-
readonly name?: string | undefined;
|
|
1299
|
-
readonly arguments?: string | undefined;
|
|
1300
|
-
readonly output?: string | null | undefined;
|
|
1301
|
-
readonly error?: unknown;
|
|
1302
1535
|
} | {
|
|
1303
1536
|
readonly [x: string]: unknown;
|
|
1304
1537
|
readonly type: string;
|
|
1305
1538
|
readonly id: string;
|
|
1306
1539
|
})[];
|
|
1307
|
-
instructions?: string | undefined;
|
|
1308
1540
|
stream: true;
|
|
1309
1541
|
max_output_tokens: number | undefined;
|
|
1310
1542
|
temperature: number | undefined;
|
|
@@ -1375,6 +1607,32 @@ export declare const fromRequest: (request: LLMRequest) => Effect.Effect<{
|
|
|
1375
1607
|
readonly reasoning: {
|
|
1376
1608
|
readonly effort: OpenResponsesOptions.ReasoningEffort;
|
|
1377
1609
|
};
|
|
1610
|
+
} | {
|
|
1611
|
+
readonly type: "additional_tools";
|
|
1612
|
+
readonly role: "developer";
|
|
1613
|
+
readonly tools: readonly ({
|
|
1614
|
+
readonly type: "custom";
|
|
1615
|
+
readonly name: string;
|
|
1616
|
+
readonly description: string;
|
|
1617
|
+
readonly format: {
|
|
1618
|
+
readonly type: "text";
|
|
1619
|
+
} | {
|
|
1620
|
+
readonly type: "grammar";
|
|
1621
|
+
readonly syntax: "lark" | "regex";
|
|
1622
|
+
readonly definition: string;
|
|
1623
|
+
};
|
|
1624
|
+
} | {
|
|
1625
|
+
readonly type: "function";
|
|
1626
|
+
readonly name: string;
|
|
1627
|
+
readonly description: string;
|
|
1628
|
+
readonly parameters: {
|
|
1629
|
+
readonly [x: string]: unknown;
|
|
1630
|
+
};
|
|
1631
|
+
readonly strict?: boolean | undefined;
|
|
1632
|
+
} | {
|
|
1633
|
+
readonly [x: string]: unknown;
|
|
1634
|
+
readonly type: string;
|
|
1635
|
+
})[];
|
|
1378
1636
|
} | {
|
|
1379
1637
|
readonly type: "message";
|
|
1380
1638
|
readonly role: "system";
|
|
@@ -1460,49 +1718,11 @@ export declare const fromRequest: (request: LLMRequest) => Effect.Effect<{
|
|
|
1460
1718
|
readonly call_id: string;
|
|
1461
1719
|
readonly name: string;
|
|
1462
1720
|
readonly input: string;
|
|
1463
|
-
} | {
|
|
1464
|
-
readonly [x: string]: unknown;
|
|
1465
|
-
readonly type: "web_search_call";
|
|
1466
|
-
readonly id: string;
|
|
1467
|
-
readonly status?: string | undefined;
|
|
1468
|
-
readonly action?: {
|
|
1469
|
-
readonly [x: string]: unknown;
|
|
1470
|
-
} | null | undefined;
|
|
1471
|
-
} | {
|
|
1472
|
-
readonly [x: string]: unknown;
|
|
1473
|
-
readonly type: "file_search_call";
|
|
1474
|
-
readonly id: string;
|
|
1475
|
-
readonly status?: string | undefined;
|
|
1476
|
-
readonly queries?: readonly string[] | undefined;
|
|
1477
|
-
readonly results?: readonly {
|
|
1478
|
-
readonly [x: string]: unknown;
|
|
1479
|
-
}[] | null | undefined;
|
|
1480
|
-
} | {
|
|
1481
|
-
readonly [x: string]: unknown;
|
|
1482
|
-
readonly type: "code_interpreter_call";
|
|
1483
|
-
readonly id: string;
|
|
1484
|
-
readonly status?: string | undefined;
|
|
1485
|
-
readonly code?: string | null | undefined;
|
|
1486
|
-
readonly container_id?: string | null | undefined;
|
|
1487
|
-
readonly outputs?: readonly {
|
|
1488
|
-
readonly [x: string]: unknown;
|
|
1489
|
-
}[] | null | undefined;
|
|
1490
|
-
} | {
|
|
1491
|
-
readonly [x: string]: unknown;
|
|
1492
|
-
readonly type: "mcp_call";
|
|
1493
|
-
readonly id: string;
|
|
1494
|
-
readonly status?: string | undefined;
|
|
1495
|
-
readonly server_label?: string | undefined;
|
|
1496
|
-
readonly name?: string | undefined;
|
|
1497
|
-
readonly arguments?: string | undefined;
|
|
1498
|
-
readonly output?: string | null | undefined;
|
|
1499
|
-
readonly error?: unknown;
|
|
1500
1721
|
} | {
|
|
1501
1722
|
readonly [x: string]: unknown;
|
|
1502
1723
|
readonly type: string;
|
|
1503
1724
|
readonly id: string;
|
|
1504
1725
|
})[];
|
|
1505
|
-
instructions?: string | undefined;
|
|
1506
1726
|
stream: true;
|
|
1507
1727
|
max_output_tokens: number | undefined;
|
|
1508
1728
|
temperature: number | undefined;
|
|
@@ -1791,6 +2011,32 @@ export declare const protocol: Protocol<{
|
|
|
1791
2011
|
readonly reasoning: {
|
|
1792
2012
|
readonly effort: OpenResponsesOptions.ReasoningEffort;
|
|
1793
2013
|
};
|
|
2014
|
+
} | {
|
|
2015
|
+
readonly type: "additional_tools";
|
|
2016
|
+
readonly role: "developer";
|
|
2017
|
+
readonly tools: readonly ({
|
|
2018
|
+
readonly type: "custom";
|
|
2019
|
+
readonly name: string;
|
|
2020
|
+
readonly description: string;
|
|
2021
|
+
readonly format: {
|
|
2022
|
+
readonly type: "text";
|
|
2023
|
+
} | {
|
|
2024
|
+
readonly type: "grammar";
|
|
2025
|
+
readonly syntax: "lark" | "regex";
|
|
2026
|
+
readonly definition: string;
|
|
2027
|
+
};
|
|
2028
|
+
} | {
|
|
2029
|
+
readonly type: "function";
|
|
2030
|
+
readonly name: string;
|
|
2031
|
+
readonly description: string;
|
|
2032
|
+
readonly parameters: {
|
|
2033
|
+
readonly [x: string]: unknown;
|
|
2034
|
+
};
|
|
2035
|
+
readonly strict?: boolean | undefined;
|
|
2036
|
+
} | {
|
|
2037
|
+
readonly [x: string]: unknown;
|
|
2038
|
+
readonly type: string;
|
|
2039
|
+
})[];
|
|
1794
2040
|
} | {
|
|
1795
2041
|
readonly type: "message";
|
|
1796
2042
|
readonly role: "system";
|
|
@@ -2047,6 +2293,32 @@ export declare const httpTransport: HttpTransport.HttpJsonTransport<{
|
|
|
2047
2293
|
readonly reasoning: {
|
|
2048
2294
|
readonly effort: OpenResponsesOptions.ReasoningEffort;
|
|
2049
2295
|
};
|
|
2296
|
+
} | {
|
|
2297
|
+
readonly type: "additional_tools";
|
|
2298
|
+
readonly role: "developer";
|
|
2299
|
+
readonly tools: readonly ({
|
|
2300
|
+
readonly type: "custom";
|
|
2301
|
+
readonly name: string;
|
|
2302
|
+
readonly description: string;
|
|
2303
|
+
readonly format: {
|
|
2304
|
+
readonly type: "text";
|
|
2305
|
+
} | {
|
|
2306
|
+
readonly type: "grammar";
|
|
2307
|
+
readonly syntax: "lark" | "regex";
|
|
2308
|
+
readonly definition: string;
|
|
2309
|
+
};
|
|
2310
|
+
} | {
|
|
2311
|
+
readonly type: "function";
|
|
2312
|
+
readonly name: string;
|
|
2313
|
+
readonly description: string;
|
|
2314
|
+
readonly parameters: {
|
|
2315
|
+
readonly [x: string]: unknown;
|
|
2316
|
+
};
|
|
2317
|
+
readonly strict?: boolean | undefined;
|
|
2318
|
+
} | {
|
|
2319
|
+
readonly [x: string]: unknown;
|
|
2320
|
+
readonly type: string;
|
|
2321
|
+
})[];
|
|
2050
2322
|
} | {
|
|
2051
2323
|
readonly type: "message";
|
|
2052
2324
|
readonly role: "system";
|