@opencode-ai/ai 0.0.0-bootstrap.0 → 0.0.0-next-15618
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 +176 -1
- package/dist/cache-policy.d.ts +2 -0
- package/dist/cache-policy.js +108 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +9 -0
- package/dist/llm.d.ts +223 -0
- package/dist/llm.js +81 -0
- package/dist/protocols/anthropic-messages.d.ts +503 -0
- package/dist/protocols/anthropic-messages.js +745 -0
- package/dist/protocols/bedrock-converse.d.ts +476 -0
- package/dist/protocols/bedrock-converse.js +526 -0
- package/dist/protocols/bedrock-event-stream.d.ts +9 -0
- package/dist/protocols/bedrock-event-stream.js +64 -0
- package/dist/protocols/gemini.d.ts +220 -0
- package/dist/protocols/gemini.js +420 -0
- package/dist/protocols/google-vertex-anthropic.d.ts +494 -0
- package/dist/protocols/google-vertex-anthropic.js +33 -0
- package/dist/protocols/google-vertex-gemini.d.ts +59 -0
- package/dist/protocols/google-vertex-gemini.js +18 -0
- package/dist/protocols/index.d.ts +9 -0
- package/dist/protocols/index.js +9 -0
- package/dist/protocols/openai-chat.d.ts +391 -0
- package/dist/protocols/openai-chat.js +423 -0
- package/dist/protocols/openai-compatible-chat.d.ts +73 -0
- package/dist/protocols/openai-compatible-chat.js +20 -0
- package/dist/protocols/openai-compatible-responses.d.ts +85 -0
- package/dist/protocols/openai-compatible-responses.js +18 -0
- package/dist/protocols/openai-responses.d.ts +613 -0
- package/dist/protocols/openai-responses.js +828 -0
- package/dist/protocols/shared.d.ts +192 -0
- package/dist/protocols/shared.js +236 -0
- package/dist/protocols/utils/bedrock-auth.d.ts +18 -0
- package/dist/protocols/utils/bedrock-auth.js +41 -0
- package/dist/protocols/utils/bedrock-cache.d.ts +15 -0
- package/dist/protocols/utils/bedrock-cache.js +29 -0
- package/dist/protocols/utils/bedrock-media.d.ts +49 -0
- package/dist/protocols/utils/bedrock-media.js +68 -0
- package/dist/protocols/utils/cache.d.ts +6 -0
- package/dist/protocols/utils/cache.js +8 -0
- package/dist/protocols/utils/gemini-tool-schema.d.ts +2 -0
- package/dist/protocols/utils/gemini-tool-schema.js +83 -0
- package/dist/protocols/utils/lifecycle.d.ts +19 -0
- package/dist/protocols/utils/lifecycle.js +65 -0
- package/dist/protocols/utils/openai-options.d.ts +22 -0
- package/dist/protocols/utils/openai-options.js +64 -0
- package/dist/protocols/utils/tool-schema.d.ts +7 -0
- package/dist/protocols/utils/tool-schema.js +79 -0
- package/dist/protocols/utils/tool-stream.d.ts +155 -0
- package/dist/protocols/utils/tool-stream.js +136 -0
- package/dist/protocols.d.ts +1 -0
- package/dist/protocols.js +1 -0
- package/dist/provider-error.d.ts +13 -0
- package/dist/provider-error.js +122 -0
- package/dist/provider-package.d.ts +13 -0
- package/dist/provider-package.js +1 -0
- package/dist/provider.d.ts +23 -0
- package/dist/provider.js +2 -0
- package/dist/providers/amazon-bedrock.d.ts +150 -0
- package/dist/providers/amazon-bedrock.js +41 -0
- package/dist/providers/anthropic-compatible.d.ts +183 -0
- package/dist/providers/anthropic-compatible.js +44 -0
- package/dist/providers/anthropic.d.ts +181 -0
- package/dist/providers/anthropic.js +39 -0
- package/dist/providers/azure/chat.d.ts +2 -0
- package/dist/providers/azure/chat.js +1 -0
- package/dist/providers/azure/responses.d.ts +2 -0
- package/dist/providers/azure/responses.js +1 -0
- package/dist/providers/azure.d.ts +183 -0
- package/dist/providers/azure.js +89 -0
- package/dist/providers/cloudflare.d.ts +232 -0
- package/dist/providers/cloudflare.js +87 -0
- package/dist/providers/github-copilot.d.ts +167 -0
- package/dist/providers/github-copilot.js +47 -0
- package/dist/providers/google-vertex/anthropic.d.ts +2 -0
- package/dist/providers/google-vertex/anthropic.js +1 -0
- package/dist/providers/google-vertex-anthropic.d.ts +181 -0
- package/dist/providers/google-vertex-anthropic.js +46 -0
- package/dist/providers/google-vertex-shared.d.ts +22 -0
- package/dist/providers/google-vertex-shared.js +61 -0
- package/dist/providers/google-vertex.d.ts +93 -0
- package/dist/providers/google-vertex.js +49 -0
- package/dist/providers/google.d.ts +85 -0
- package/dist/providers/google.js +33 -0
- package/dist/providers/index.d.ts +15 -0
- package/dist/providers/index.js +15 -0
- package/dist/providers/openai/chat.d.ts +2 -0
- package/dist/providers/openai/chat.js +1 -0
- package/dist/providers/openai/responses.d.ts +2 -0
- package/dist/providers/openai/responses.js +1 -0
- package/dist/providers/openai-compatible/responses.d.ts +1 -0
- package/dist/providers/openai-compatible/responses.js +1 -0
- package/dist/providers/openai-compatible-profile.d.ts +43 -0
- package/dist/providers/openai-compatible-profile.js +12 -0
- package/dist/providers/openai-compatible-responses.d.ts +107 -0
- package/dist/providers/openai-compatible-responses.js +33 -0
- package/dist/providers/openai-compatible.d.ts +130 -0
- package/dist/providers/openai-compatible.js +55 -0
- package/dist/providers/openai-options.d.ts +30 -0
- package/dist/providers/openai-options.js +42 -0
- package/dist/providers/openai.d.ts +264 -0
- package/dist/providers/openai.js +62 -0
- package/dist/providers/openrouter.d.ts +321 -0
- package/dist/providers/openrouter.js +65 -0
- package/dist/providers/xai.d.ts +169 -0
- package/dist/providers/xai.js +43 -0
- package/dist/providers.d.ts +1 -0
- package/dist/providers.js +1 -0
- package/dist/route/auth-options.d.ts +34 -0
- package/dist/route/auth-options.js +14 -0
- package/dist/route/auth.d.ts +49 -0
- package/dist/route/auth.js +89 -0
- package/dist/route/client.d.ts +330 -0
- package/dist/route/client.js +211 -0
- package/dist/route/endpoint.d.ts +28 -0
- package/dist/route/endpoint.js +21 -0
- package/dist/route/executor.d.ts +12 -0
- package/dist/route/executor.js +229 -0
- package/dist/route/framing.d.ts +23 -0
- package/dist/route/framing.js +4 -0
- package/dist/route/index.d.ts +16 -0
- package/dist/route/index.js +9 -0
- package/dist/route/protocol.d.ts +76 -0
- package/dist/route/protocol.js +17 -0
- package/dist/route/transport/http.d.ts +33 -0
- package/dist/route/transport/http.js +98 -0
- package/dist/route/transport/index.d.ts +27 -0
- package/dist/route/transport/index.js +4 -0
- package/dist/route/transport/websocket.d.ts +56 -0
- package/dist/route/transport/websocket.js +181 -0
- package/dist/route.d.ts +1 -0
- package/dist/route.js +1 -0
- package/dist/schema/errors.d.ts +153 -0
- package/dist/schema/errors.js +150 -0
- package/dist/schema/events.d.ts +4292 -0
- package/dist/schema/events.js +482 -0
- package/dist/schema/ids.d.ts +30 -0
- package/dist/schema/ids.js +18 -0
- package/dist/schema/index.d.ts +5 -0
- package/dist/schema/index.js +5 -0
- package/dist/schema/messages.d.ts +385 -0
- package/dist/schema/messages.js +246 -0
- package/dist/schema/options.d.ts +143 -0
- package/dist/schema/options.js +195 -0
- package/dist/tool-runtime.d.ts +15 -0
- package/dist/tool-runtime.js +35 -0
- package/dist/tool.d.ts +134 -0
- package/dist/tool.js +66 -0
- package/dist/utils/record.d.ts +2 -0
- package/dist/utils/record.js +2 -0
- package/package.json +36 -9
- package/index.js +0 -1
|
@@ -0,0 +1,613 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { Route } from "../route/client";
|
|
3
|
+
import { HttpTransport } from "../route/transport";
|
|
4
|
+
import { Protocol } from "../route/protocol";
|
|
5
|
+
import { Lifecycle } from "./utils/lifecycle";
|
|
6
|
+
import { ToolStream } from "./utils/tool-stream";
|
|
7
|
+
export declare const DEFAULT_BASE_URL = "https://api.openai.com/v1";
|
|
8
|
+
export declare const PATH = "/responses";
|
|
9
|
+
declare const OpenAIResponsesBody: Schema.Struct<{
|
|
10
|
+
readonly stream: Schema.Literal<true>;
|
|
11
|
+
readonly model: Schema.String;
|
|
12
|
+
readonly input: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
13
|
+
readonly role: Schema.tag<"system">;
|
|
14
|
+
readonly content: Schema.String;
|
|
15
|
+
}>, Schema.Struct<{
|
|
16
|
+
readonly role: Schema.tag<"user">;
|
|
17
|
+
readonly content: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
18
|
+
readonly type: Schema.tag<"input_text">;
|
|
19
|
+
readonly text: Schema.String;
|
|
20
|
+
}>, Schema.Struct<{
|
|
21
|
+
readonly type: Schema.tag<"input_image">;
|
|
22
|
+
readonly image_url: Schema.String;
|
|
23
|
+
}>]>>;
|
|
24
|
+
}>, Schema.Struct<{
|
|
25
|
+
readonly role: Schema.tag<"assistant">;
|
|
26
|
+
readonly content: Schema.$Array<Schema.Struct<{
|
|
27
|
+
readonly type: Schema.tag<"output_text">;
|
|
28
|
+
readonly text: Schema.String;
|
|
29
|
+
}>>;
|
|
30
|
+
}>, Schema.Struct<{
|
|
31
|
+
readonly type: Schema.tag<"reasoning">;
|
|
32
|
+
readonly id: Schema.optionalKey<Schema.String>;
|
|
33
|
+
readonly summary: Schema.$Array<Schema.Struct<{
|
|
34
|
+
readonly type: Schema.tag<"summary_text">;
|
|
35
|
+
readonly text: Schema.String;
|
|
36
|
+
}>>;
|
|
37
|
+
readonly encrypted_content: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
38
|
+
}>, Schema.Struct<{
|
|
39
|
+
readonly type: Schema.tag<"item_reference">;
|
|
40
|
+
readonly id: Schema.String;
|
|
41
|
+
}>, Schema.Struct<{
|
|
42
|
+
readonly type: Schema.tag<"function_call">;
|
|
43
|
+
readonly call_id: Schema.String;
|
|
44
|
+
readonly name: Schema.String;
|
|
45
|
+
readonly arguments: Schema.String;
|
|
46
|
+
}>, Schema.Struct<{
|
|
47
|
+
readonly type: Schema.tag<"function_call_output">;
|
|
48
|
+
readonly call_id: Schema.String;
|
|
49
|
+
readonly output: Schema.Union<readonly [Schema.String, Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
50
|
+
readonly type: Schema.tag<"input_text">;
|
|
51
|
+
readonly text: Schema.String;
|
|
52
|
+
}>, Schema.Struct<{
|
|
53
|
+
readonly type: Schema.tag<"input_image">;
|
|
54
|
+
readonly image_url: Schema.String;
|
|
55
|
+
}>]>>]>;
|
|
56
|
+
}>]>>;
|
|
57
|
+
readonly instructions: Schema.optional<Schema.String>;
|
|
58
|
+
readonly tools: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
59
|
+
readonly type: Schema.tag<"function">;
|
|
60
|
+
readonly name: Schema.String;
|
|
61
|
+
readonly description: Schema.String;
|
|
62
|
+
readonly parameters: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
63
|
+
readonly strict: Schema.optional<Schema.Boolean>;
|
|
64
|
+
}>>>;
|
|
65
|
+
readonly tool_choice: Schema.optional<Schema.Union<readonly [Schema.Literals<readonly ["auto", "none", "required"]>, Schema.Struct<{
|
|
66
|
+
readonly type: Schema.tag<"function">;
|
|
67
|
+
readonly name: Schema.String;
|
|
68
|
+
}>]>>;
|
|
69
|
+
readonly store: Schema.optional<Schema.Boolean>;
|
|
70
|
+
readonly service_tier: Schema.optional<Schema.Literals<readonly ["auto", "default", "flex", "priority"]>>;
|
|
71
|
+
readonly prompt_cache_key: Schema.optional<Schema.String>;
|
|
72
|
+
readonly include: Schema.optional<Schema.$Array<Schema.Literals<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"]>>>;
|
|
73
|
+
readonly reasoning: Schema.optional<Schema.Struct<{
|
|
74
|
+
readonly effort: Schema.optional<Schema.String>;
|
|
75
|
+
readonly summary: Schema.optional<Schema.Literal<"auto">>;
|
|
76
|
+
}>>;
|
|
77
|
+
readonly text: Schema.optional<Schema.Struct<{
|
|
78
|
+
readonly verbosity: Schema.optional<Schema.Literals<readonly ["low", "medium", "high"]>>;
|
|
79
|
+
}>>;
|
|
80
|
+
readonly max_output_tokens: Schema.optional<Schema.Number>;
|
|
81
|
+
readonly temperature: Schema.optional<Schema.Number>;
|
|
82
|
+
readonly top_p: Schema.optional<Schema.Number>;
|
|
83
|
+
}>;
|
|
84
|
+
export type OpenAIResponsesBody = Schema.Schema.Type<typeof OpenAIResponsesBody>;
|
|
85
|
+
/**
|
|
86
|
+
* The OpenAI Responses protocol — request body construction, body schema, and
|
|
87
|
+
* the streaming-event state machine. Used by native OpenAI and (once
|
|
88
|
+
* registered) Azure OpenAI Responses.
|
|
89
|
+
*/
|
|
90
|
+
export declare const protocol: Protocol<{
|
|
91
|
+
readonly stream: true;
|
|
92
|
+
readonly model: string;
|
|
93
|
+
readonly input: readonly ({
|
|
94
|
+
readonly role: "system";
|
|
95
|
+
readonly content: string;
|
|
96
|
+
} | {
|
|
97
|
+
readonly role: "user";
|
|
98
|
+
readonly content: readonly ({
|
|
99
|
+
readonly type: "input_text";
|
|
100
|
+
readonly text: string;
|
|
101
|
+
} | {
|
|
102
|
+
readonly type: "input_image";
|
|
103
|
+
readonly image_url: string;
|
|
104
|
+
})[];
|
|
105
|
+
} | {
|
|
106
|
+
readonly role: "assistant";
|
|
107
|
+
readonly content: readonly {
|
|
108
|
+
readonly type: "output_text";
|
|
109
|
+
readonly text: string;
|
|
110
|
+
}[];
|
|
111
|
+
} | {
|
|
112
|
+
readonly type: "reasoning";
|
|
113
|
+
readonly summary: readonly {
|
|
114
|
+
readonly type: "summary_text";
|
|
115
|
+
readonly text: string;
|
|
116
|
+
}[];
|
|
117
|
+
readonly id?: string | undefined;
|
|
118
|
+
readonly encrypted_content?: string | null | undefined;
|
|
119
|
+
} | {
|
|
120
|
+
readonly type: "item_reference";
|
|
121
|
+
readonly id: string;
|
|
122
|
+
} | {
|
|
123
|
+
readonly type: "function_call";
|
|
124
|
+
readonly call_id: string;
|
|
125
|
+
readonly name: string;
|
|
126
|
+
readonly arguments: string;
|
|
127
|
+
} | {
|
|
128
|
+
readonly type: "function_call_output";
|
|
129
|
+
readonly call_id: string;
|
|
130
|
+
readonly output: string | readonly ({
|
|
131
|
+
readonly type: "input_text";
|
|
132
|
+
readonly text: string;
|
|
133
|
+
} | {
|
|
134
|
+
readonly type: "input_image";
|
|
135
|
+
readonly image_url: string;
|
|
136
|
+
})[];
|
|
137
|
+
})[];
|
|
138
|
+
readonly instructions?: string | undefined;
|
|
139
|
+
readonly tools?: readonly {
|
|
140
|
+
readonly type: "function";
|
|
141
|
+
readonly name: string;
|
|
142
|
+
readonly description: string;
|
|
143
|
+
readonly parameters: {
|
|
144
|
+
readonly [x: string]: unknown;
|
|
145
|
+
};
|
|
146
|
+
readonly strict?: boolean | undefined;
|
|
147
|
+
}[] | undefined;
|
|
148
|
+
readonly tool_choice?: "required" | "none" | "auto" | {
|
|
149
|
+
readonly type: "function";
|
|
150
|
+
readonly name: string;
|
|
151
|
+
} | undefined;
|
|
152
|
+
readonly store?: boolean | undefined;
|
|
153
|
+
readonly service_tier?: "auto" | "default" | "flex" | "priority" | undefined;
|
|
154
|
+
readonly prompt_cache_key?: string | undefined;
|
|
155
|
+
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;
|
|
156
|
+
readonly reasoning?: {
|
|
157
|
+
readonly effort?: string | undefined;
|
|
158
|
+
readonly summary?: "auto" | undefined;
|
|
159
|
+
} | undefined;
|
|
160
|
+
readonly text?: {
|
|
161
|
+
readonly verbosity?: "low" | "medium" | "high" | undefined;
|
|
162
|
+
} | undefined;
|
|
163
|
+
readonly max_output_tokens?: number | undefined;
|
|
164
|
+
readonly temperature?: number | undefined;
|
|
165
|
+
readonly top_p?: number | undefined;
|
|
166
|
+
}, string, {
|
|
167
|
+
readonly type: string;
|
|
168
|
+
readonly delta?: string | undefined;
|
|
169
|
+
readonly item_id?: string | undefined;
|
|
170
|
+
readonly summary_index?: number | undefined;
|
|
171
|
+
readonly item?: {
|
|
172
|
+
readonly type: string;
|
|
173
|
+
readonly id?: string | undefined;
|
|
174
|
+
readonly call_id?: string | undefined;
|
|
175
|
+
readonly name?: string | undefined;
|
|
176
|
+
readonly arguments?: string | undefined;
|
|
177
|
+
readonly status?: string | undefined;
|
|
178
|
+
readonly action?: unknown;
|
|
179
|
+
readonly queries?: unknown;
|
|
180
|
+
readonly results?: unknown;
|
|
181
|
+
readonly code?: string | undefined;
|
|
182
|
+
readonly container_id?: string | undefined;
|
|
183
|
+
readonly outputs?: unknown;
|
|
184
|
+
readonly server_label?: string | undefined;
|
|
185
|
+
readonly output?: unknown;
|
|
186
|
+
readonly error?: unknown;
|
|
187
|
+
readonly encrypted_content?: string | null | undefined;
|
|
188
|
+
} | undefined;
|
|
189
|
+
readonly response?: {
|
|
190
|
+
readonly [x: string]: unknown;
|
|
191
|
+
readonly id?: string | undefined;
|
|
192
|
+
readonly service_tier?: string | null | undefined;
|
|
193
|
+
readonly incomplete_details?: {
|
|
194
|
+
readonly reason: string;
|
|
195
|
+
} | null | undefined;
|
|
196
|
+
readonly usage?: {
|
|
197
|
+
readonly input_tokens?: number | undefined;
|
|
198
|
+
readonly input_tokens_details?: {
|
|
199
|
+
readonly cached_tokens?: number | undefined;
|
|
200
|
+
} | null | undefined;
|
|
201
|
+
readonly output_tokens?: number | undefined;
|
|
202
|
+
readonly output_tokens_details?: {
|
|
203
|
+
readonly reasoning_tokens?: number | undefined;
|
|
204
|
+
} | null | undefined;
|
|
205
|
+
readonly total_tokens?: number | undefined;
|
|
206
|
+
} | null | undefined;
|
|
207
|
+
readonly error?: {
|
|
208
|
+
readonly code?: string | null | undefined;
|
|
209
|
+
readonly message?: string | null | undefined;
|
|
210
|
+
readonly param?: string | null | undefined;
|
|
211
|
+
} | null | undefined;
|
|
212
|
+
} | undefined;
|
|
213
|
+
readonly code?: string | null | undefined;
|
|
214
|
+
readonly message?: string | undefined;
|
|
215
|
+
readonly param?: string | null | undefined;
|
|
216
|
+
readonly error?: {
|
|
217
|
+
readonly code?: string | null | undefined;
|
|
218
|
+
readonly message?: string | null | undefined;
|
|
219
|
+
readonly param?: string | null | undefined;
|
|
220
|
+
} | null | undefined;
|
|
221
|
+
}, {
|
|
222
|
+
hasFunctionCall: boolean;
|
|
223
|
+
tools: Partial<Record<string, ToolStream.PendingTool>>;
|
|
224
|
+
lifecycle: Lifecycle.State;
|
|
225
|
+
reasoningItems: {};
|
|
226
|
+
store: boolean | undefined;
|
|
227
|
+
}>;
|
|
228
|
+
export declare const httpTransport: HttpTransport.HttpJsonTransport<{
|
|
229
|
+
readonly stream: true;
|
|
230
|
+
readonly model: string;
|
|
231
|
+
readonly input: readonly ({
|
|
232
|
+
readonly role: "system";
|
|
233
|
+
readonly content: string;
|
|
234
|
+
} | {
|
|
235
|
+
readonly role: "user";
|
|
236
|
+
readonly content: readonly ({
|
|
237
|
+
readonly type: "input_text";
|
|
238
|
+
readonly text: string;
|
|
239
|
+
} | {
|
|
240
|
+
readonly type: "input_image";
|
|
241
|
+
readonly image_url: string;
|
|
242
|
+
})[];
|
|
243
|
+
} | {
|
|
244
|
+
readonly role: "assistant";
|
|
245
|
+
readonly content: readonly {
|
|
246
|
+
readonly type: "output_text";
|
|
247
|
+
readonly text: string;
|
|
248
|
+
}[];
|
|
249
|
+
} | {
|
|
250
|
+
readonly type: "reasoning";
|
|
251
|
+
readonly summary: readonly {
|
|
252
|
+
readonly type: "summary_text";
|
|
253
|
+
readonly text: string;
|
|
254
|
+
}[];
|
|
255
|
+
readonly id?: string | undefined;
|
|
256
|
+
readonly encrypted_content?: string | null | undefined;
|
|
257
|
+
} | {
|
|
258
|
+
readonly type: "item_reference";
|
|
259
|
+
readonly id: string;
|
|
260
|
+
} | {
|
|
261
|
+
readonly type: "function_call";
|
|
262
|
+
readonly call_id: string;
|
|
263
|
+
readonly name: string;
|
|
264
|
+
readonly arguments: string;
|
|
265
|
+
} | {
|
|
266
|
+
readonly type: "function_call_output";
|
|
267
|
+
readonly call_id: string;
|
|
268
|
+
readonly output: string | readonly ({
|
|
269
|
+
readonly type: "input_text";
|
|
270
|
+
readonly text: string;
|
|
271
|
+
} | {
|
|
272
|
+
readonly type: "input_image";
|
|
273
|
+
readonly image_url: string;
|
|
274
|
+
})[];
|
|
275
|
+
})[];
|
|
276
|
+
readonly instructions?: string | undefined;
|
|
277
|
+
readonly tools?: readonly {
|
|
278
|
+
readonly type: "function";
|
|
279
|
+
readonly name: string;
|
|
280
|
+
readonly description: string;
|
|
281
|
+
readonly parameters: {
|
|
282
|
+
readonly [x: string]: unknown;
|
|
283
|
+
};
|
|
284
|
+
readonly strict?: boolean | undefined;
|
|
285
|
+
}[] | undefined;
|
|
286
|
+
readonly tool_choice?: "required" | "none" | "auto" | {
|
|
287
|
+
readonly type: "function";
|
|
288
|
+
readonly name: string;
|
|
289
|
+
} | undefined;
|
|
290
|
+
readonly store?: boolean | undefined;
|
|
291
|
+
readonly service_tier?: "auto" | "default" | "flex" | "priority" | undefined;
|
|
292
|
+
readonly prompt_cache_key?: string | undefined;
|
|
293
|
+
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;
|
|
294
|
+
readonly reasoning?: {
|
|
295
|
+
readonly effort?: string | undefined;
|
|
296
|
+
readonly summary?: "auto" | undefined;
|
|
297
|
+
} | undefined;
|
|
298
|
+
readonly text?: {
|
|
299
|
+
readonly verbosity?: "low" | "medium" | "high" | undefined;
|
|
300
|
+
} | undefined;
|
|
301
|
+
readonly max_output_tokens?: number | undefined;
|
|
302
|
+
readonly temperature?: number | undefined;
|
|
303
|
+
readonly top_p?: number | undefined;
|
|
304
|
+
}, string>;
|
|
305
|
+
export declare const route: Route<{
|
|
306
|
+
readonly stream: true;
|
|
307
|
+
readonly model: string;
|
|
308
|
+
readonly input: readonly ({
|
|
309
|
+
readonly role: "system";
|
|
310
|
+
readonly content: string;
|
|
311
|
+
} | {
|
|
312
|
+
readonly role: "user";
|
|
313
|
+
readonly content: readonly ({
|
|
314
|
+
readonly type: "input_text";
|
|
315
|
+
readonly text: string;
|
|
316
|
+
} | {
|
|
317
|
+
readonly type: "input_image";
|
|
318
|
+
readonly image_url: string;
|
|
319
|
+
})[];
|
|
320
|
+
} | {
|
|
321
|
+
readonly role: "assistant";
|
|
322
|
+
readonly content: readonly {
|
|
323
|
+
readonly type: "output_text";
|
|
324
|
+
readonly text: string;
|
|
325
|
+
}[];
|
|
326
|
+
} | {
|
|
327
|
+
readonly type: "reasoning";
|
|
328
|
+
readonly summary: readonly {
|
|
329
|
+
readonly type: "summary_text";
|
|
330
|
+
readonly text: string;
|
|
331
|
+
}[];
|
|
332
|
+
readonly id?: string | undefined;
|
|
333
|
+
readonly encrypted_content?: string | null | undefined;
|
|
334
|
+
} | {
|
|
335
|
+
readonly type: "item_reference";
|
|
336
|
+
readonly id: string;
|
|
337
|
+
} | {
|
|
338
|
+
readonly type: "function_call";
|
|
339
|
+
readonly call_id: string;
|
|
340
|
+
readonly name: string;
|
|
341
|
+
readonly arguments: string;
|
|
342
|
+
} | {
|
|
343
|
+
readonly type: "function_call_output";
|
|
344
|
+
readonly call_id: string;
|
|
345
|
+
readonly output: string | readonly ({
|
|
346
|
+
readonly type: "input_text";
|
|
347
|
+
readonly text: string;
|
|
348
|
+
} | {
|
|
349
|
+
readonly type: "input_image";
|
|
350
|
+
readonly image_url: string;
|
|
351
|
+
})[];
|
|
352
|
+
})[];
|
|
353
|
+
readonly instructions?: string | undefined;
|
|
354
|
+
readonly tools?: readonly {
|
|
355
|
+
readonly type: "function";
|
|
356
|
+
readonly name: string;
|
|
357
|
+
readonly description: string;
|
|
358
|
+
readonly parameters: {
|
|
359
|
+
readonly [x: string]: unknown;
|
|
360
|
+
};
|
|
361
|
+
readonly strict?: boolean | undefined;
|
|
362
|
+
}[] | undefined;
|
|
363
|
+
readonly tool_choice?: "required" | "none" | "auto" | {
|
|
364
|
+
readonly type: "function";
|
|
365
|
+
readonly name: string;
|
|
366
|
+
} | undefined;
|
|
367
|
+
readonly store?: boolean | undefined;
|
|
368
|
+
readonly service_tier?: "auto" | "default" | "flex" | "priority" | undefined;
|
|
369
|
+
readonly prompt_cache_key?: string | undefined;
|
|
370
|
+
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;
|
|
371
|
+
readonly reasoning?: {
|
|
372
|
+
readonly effort?: string | undefined;
|
|
373
|
+
readonly summary?: "auto" | undefined;
|
|
374
|
+
} | undefined;
|
|
375
|
+
readonly text?: {
|
|
376
|
+
readonly verbosity?: "low" | "medium" | "high" | undefined;
|
|
377
|
+
} | undefined;
|
|
378
|
+
readonly max_output_tokens?: number | undefined;
|
|
379
|
+
readonly temperature?: number | undefined;
|
|
380
|
+
readonly top_p?: number | undefined;
|
|
381
|
+
}, HttpTransport.HttpPrepared<string>>;
|
|
382
|
+
export declare const webSocketTransport: import("../route/transport/websocket").JsonTransport<{
|
|
383
|
+
readonly stream: true;
|
|
384
|
+
readonly model: string;
|
|
385
|
+
readonly input: readonly ({
|
|
386
|
+
readonly role: "system";
|
|
387
|
+
readonly content: string;
|
|
388
|
+
} | {
|
|
389
|
+
readonly role: "user";
|
|
390
|
+
readonly content: readonly ({
|
|
391
|
+
readonly type: "input_text";
|
|
392
|
+
readonly text: string;
|
|
393
|
+
} | {
|
|
394
|
+
readonly type: "input_image";
|
|
395
|
+
readonly image_url: string;
|
|
396
|
+
})[];
|
|
397
|
+
} | {
|
|
398
|
+
readonly role: "assistant";
|
|
399
|
+
readonly content: readonly {
|
|
400
|
+
readonly type: "output_text";
|
|
401
|
+
readonly text: string;
|
|
402
|
+
}[];
|
|
403
|
+
} | {
|
|
404
|
+
readonly type: "reasoning";
|
|
405
|
+
readonly summary: readonly {
|
|
406
|
+
readonly type: "summary_text";
|
|
407
|
+
readonly text: string;
|
|
408
|
+
}[];
|
|
409
|
+
readonly id?: string | undefined;
|
|
410
|
+
readonly encrypted_content?: string | null | undefined;
|
|
411
|
+
} | {
|
|
412
|
+
readonly type: "item_reference";
|
|
413
|
+
readonly id: string;
|
|
414
|
+
} | {
|
|
415
|
+
readonly type: "function_call";
|
|
416
|
+
readonly call_id: string;
|
|
417
|
+
readonly name: string;
|
|
418
|
+
readonly arguments: string;
|
|
419
|
+
} | {
|
|
420
|
+
readonly type: "function_call_output";
|
|
421
|
+
readonly call_id: string;
|
|
422
|
+
readonly output: string | readonly ({
|
|
423
|
+
readonly type: "input_text";
|
|
424
|
+
readonly text: string;
|
|
425
|
+
} | {
|
|
426
|
+
readonly type: "input_image";
|
|
427
|
+
readonly image_url: string;
|
|
428
|
+
})[];
|
|
429
|
+
})[];
|
|
430
|
+
readonly instructions?: string | undefined;
|
|
431
|
+
readonly tools?: readonly {
|
|
432
|
+
readonly type: "function";
|
|
433
|
+
readonly name: string;
|
|
434
|
+
readonly description: string;
|
|
435
|
+
readonly parameters: {
|
|
436
|
+
readonly [x: string]: unknown;
|
|
437
|
+
};
|
|
438
|
+
readonly strict?: boolean | undefined;
|
|
439
|
+
}[] | undefined;
|
|
440
|
+
readonly tool_choice?: "required" | "none" | "auto" | {
|
|
441
|
+
readonly type: "function";
|
|
442
|
+
readonly name: string;
|
|
443
|
+
} | undefined;
|
|
444
|
+
readonly store?: boolean | undefined;
|
|
445
|
+
readonly service_tier?: "auto" | "default" | "flex" | "priority" | undefined;
|
|
446
|
+
readonly prompt_cache_key?: string | undefined;
|
|
447
|
+
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;
|
|
448
|
+
readonly reasoning?: {
|
|
449
|
+
readonly effort?: string | undefined;
|
|
450
|
+
readonly summary?: "auto" | undefined;
|
|
451
|
+
} | undefined;
|
|
452
|
+
readonly text?: {
|
|
453
|
+
readonly verbosity?: "low" | "medium" | "high" | undefined;
|
|
454
|
+
} | undefined;
|
|
455
|
+
readonly max_output_tokens?: number | undefined;
|
|
456
|
+
readonly temperature?: number | undefined;
|
|
457
|
+
readonly top_p?: number | undefined;
|
|
458
|
+
}, {
|
|
459
|
+
readonly [x: string]: unknown;
|
|
460
|
+
readonly model: string;
|
|
461
|
+
readonly input: readonly ({
|
|
462
|
+
readonly role: "system";
|
|
463
|
+
readonly content: string;
|
|
464
|
+
} | {
|
|
465
|
+
readonly role: "user";
|
|
466
|
+
readonly content: readonly ({
|
|
467
|
+
readonly type: "input_text";
|
|
468
|
+
readonly text: string;
|
|
469
|
+
} | {
|
|
470
|
+
readonly type: "input_image";
|
|
471
|
+
readonly image_url: string;
|
|
472
|
+
})[];
|
|
473
|
+
} | {
|
|
474
|
+
readonly role: "assistant";
|
|
475
|
+
readonly content: readonly {
|
|
476
|
+
readonly type: "output_text";
|
|
477
|
+
readonly text: string;
|
|
478
|
+
}[];
|
|
479
|
+
} | {
|
|
480
|
+
readonly type: "reasoning";
|
|
481
|
+
readonly summary: readonly {
|
|
482
|
+
readonly type: "summary_text";
|
|
483
|
+
readonly text: string;
|
|
484
|
+
}[];
|
|
485
|
+
readonly id?: string | undefined;
|
|
486
|
+
readonly encrypted_content?: string | null | undefined;
|
|
487
|
+
} | {
|
|
488
|
+
readonly type: "item_reference";
|
|
489
|
+
readonly id: string;
|
|
490
|
+
} | {
|
|
491
|
+
readonly type: "function_call";
|
|
492
|
+
readonly call_id: string;
|
|
493
|
+
readonly name: string;
|
|
494
|
+
readonly arguments: string;
|
|
495
|
+
} | {
|
|
496
|
+
readonly type: "function_call_output";
|
|
497
|
+
readonly call_id: string;
|
|
498
|
+
readonly output: string | readonly ({
|
|
499
|
+
readonly type: "input_text";
|
|
500
|
+
readonly text: string;
|
|
501
|
+
} | {
|
|
502
|
+
readonly type: "input_image";
|
|
503
|
+
readonly image_url: string;
|
|
504
|
+
})[];
|
|
505
|
+
})[];
|
|
506
|
+
readonly type: "response.create";
|
|
507
|
+
readonly instructions?: string | undefined;
|
|
508
|
+
readonly tools?: readonly {
|
|
509
|
+
readonly type: "function";
|
|
510
|
+
readonly name: string;
|
|
511
|
+
readonly description: string;
|
|
512
|
+
readonly parameters: {
|
|
513
|
+
readonly [x: string]: unknown;
|
|
514
|
+
};
|
|
515
|
+
readonly strict?: boolean | undefined;
|
|
516
|
+
}[] | undefined;
|
|
517
|
+
readonly tool_choice?: "required" | "none" | "auto" | {
|
|
518
|
+
readonly type: "function";
|
|
519
|
+
readonly name: string;
|
|
520
|
+
} | undefined;
|
|
521
|
+
readonly store?: boolean | undefined;
|
|
522
|
+
readonly service_tier?: "auto" | "default" | "flex" | "priority" | undefined;
|
|
523
|
+
readonly prompt_cache_key?: string | undefined;
|
|
524
|
+
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;
|
|
525
|
+
readonly reasoning?: {
|
|
526
|
+
readonly effort?: string | undefined;
|
|
527
|
+
readonly summary?: "auto" | undefined;
|
|
528
|
+
} | undefined;
|
|
529
|
+
readonly text?: {
|
|
530
|
+
readonly verbosity?: "low" | "medium" | "high" | undefined;
|
|
531
|
+
} | undefined;
|
|
532
|
+
readonly max_output_tokens?: number | undefined;
|
|
533
|
+
readonly temperature?: number | undefined;
|
|
534
|
+
readonly top_p?: number | undefined;
|
|
535
|
+
}>;
|
|
536
|
+
export declare const webSocketRoute: Route<{
|
|
537
|
+
readonly stream: true;
|
|
538
|
+
readonly model: string;
|
|
539
|
+
readonly input: readonly ({
|
|
540
|
+
readonly role: "system";
|
|
541
|
+
readonly content: string;
|
|
542
|
+
} | {
|
|
543
|
+
readonly role: "user";
|
|
544
|
+
readonly content: readonly ({
|
|
545
|
+
readonly type: "input_text";
|
|
546
|
+
readonly text: string;
|
|
547
|
+
} | {
|
|
548
|
+
readonly type: "input_image";
|
|
549
|
+
readonly image_url: string;
|
|
550
|
+
})[];
|
|
551
|
+
} | {
|
|
552
|
+
readonly role: "assistant";
|
|
553
|
+
readonly content: readonly {
|
|
554
|
+
readonly type: "output_text";
|
|
555
|
+
readonly text: string;
|
|
556
|
+
}[];
|
|
557
|
+
} | {
|
|
558
|
+
readonly type: "reasoning";
|
|
559
|
+
readonly summary: readonly {
|
|
560
|
+
readonly type: "summary_text";
|
|
561
|
+
readonly text: string;
|
|
562
|
+
}[];
|
|
563
|
+
readonly id?: string | undefined;
|
|
564
|
+
readonly encrypted_content?: string | null | undefined;
|
|
565
|
+
} | {
|
|
566
|
+
readonly type: "item_reference";
|
|
567
|
+
readonly id: string;
|
|
568
|
+
} | {
|
|
569
|
+
readonly type: "function_call";
|
|
570
|
+
readonly call_id: string;
|
|
571
|
+
readonly name: string;
|
|
572
|
+
readonly arguments: string;
|
|
573
|
+
} | {
|
|
574
|
+
readonly type: "function_call_output";
|
|
575
|
+
readonly call_id: string;
|
|
576
|
+
readonly output: string | readonly ({
|
|
577
|
+
readonly type: "input_text";
|
|
578
|
+
readonly text: string;
|
|
579
|
+
} | {
|
|
580
|
+
readonly type: "input_image";
|
|
581
|
+
readonly image_url: string;
|
|
582
|
+
})[];
|
|
583
|
+
})[];
|
|
584
|
+
readonly instructions?: string | undefined;
|
|
585
|
+
readonly tools?: readonly {
|
|
586
|
+
readonly type: "function";
|
|
587
|
+
readonly name: string;
|
|
588
|
+
readonly description: string;
|
|
589
|
+
readonly parameters: {
|
|
590
|
+
readonly [x: string]: unknown;
|
|
591
|
+
};
|
|
592
|
+
readonly strict?: boolean | undefined;
|
|
593
|
+
}[] | undefined;
|
|
594
|
+
readonly tool_choice?: "required" | "none" | "auto" | {
|
|
595
|
+
readonly type: "function";
|
|
596
|
+
readonly name: string;
|
|
597
|
+
} | undefined;
|
|
598
|
+
readonly store?: boolean | undefined;
|
|
599
|
+
readonly service_tier?: "auto" | "default" | "flex" | "priority" | undefined;
|
|
600
|
+
readonly prompt_cache_key?: string | undefined;
|
|
601
|
+
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;
|
|
602
|
+
readonly reasoning?: {
|
|
603
|
+
readonly effort?: string | undefined;
|
|
604
|
+
readonly summary?: "auto" | undefined;
|
|
605
|
+
} | undefined;
|
|
606
|
+
readonly text?: {
|
|
607
|
+
readonly verbosity?: "low" | "medium" | "high" | undefined;
|
|
608
|
+
} | undefined;
|
|
609
|
+
readonly max_output_tokens?: number | undefined;
|
|
610
|
+
readonly temperature?: number | undefined;
|
|
611
|
+
readonly top_p?: number | undefined;
|
|
612
|
+
}, import("../route/transport/websocket").JsonPrepared>;
|
|
613
|
+
export * as OpenAIResponses from "./openai-responses";
|