supercompat 3.18.0 → 4.0.0
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/index.cjs +0 -16448
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -329
- package/dist/index.d.ts +1 -329
- package/dist/index.js +0 -16349
- package/dist/index.js.map +1 -1
- package/dist/openai/index.cjs +94218 -0
- package/dist/openai/index.cjs.map +1 -0
- package/dist/openai/index.d.cts +547 -0
- package/dist/openai/index.d.ts +547 -0
- package/dist/openai/index.js +94082 -0
- package/dist/openai/index.js.map +1 -0
- package/dist/supercompat.cjs.map +1 -1
- package/dist/supercompat.js.map +1 -1
- package/package.json +5 -4
|
@@ -0,0 +1,547 @@
|
|
|
1
|
+
export { supercompat } from '../supercompat.js';
|
|
2
|
+
import OpenAI, { AzureOpenAI } from 'openai';
|
|
3
|
+
import { AIProjectClient } from '@azure/ai-projects';
|
|
4
|
+
import { Mistral } from '@mistralai/mistralai';
|
|
5
|
+
import Anthropic from '@anthropic-ai/sdk';
|
|
6
|
+
import { GoogleGenAI } from '@google/genai';
|
|
7
|
+
import { OpenRouter } from '@openrouter/sdk';
|
|
8
|
+
import { MessageWithRun, StorageAdapterArgs, RequestHandler, RunAdapterWithAssistant } from '../types/index.js';
|
|
9
|
+
import { PrismaClient } from '@prisma/client';
|
|
10
|
+
|
|
11
|
+
declare const groqClientAdapter: ({ groq, }: {
|
|
12
|
+
groq: any;
|
|
13
|
+
}) => {
|
|
14
|
+
client: any;
|
|
15
|
+
requestHandlers: {
|
|
16
|
+
'^/v1/models$': {
|
|
17
|
+
get: (_url: string, _options: any) => Promise<Response>;
|
|
18
|
+
};
|
|
19
|
+
'^/v1/chat/completions$': {
|
|
20
|
+
post: (_url: string, options: any) => Promise<Response>;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
declare const openaiClientAdapter: ({ openai, }: {
|
|
26
|
+
openai: OpenAI;
|
|
27
|
+
}) => {
|
|
28
|
+
client: OpenAI;
|
|
29
|
+
requestHandlers: {
|
|
30
|
+
'^/v1/models$': {
|
|
31
|
+
get: (_url: string, _options: any) => Promise<Response>;
|
|
32
|
+
};
|
|
33
|
+
'^/(?:v1|/?openai)/chat/completions$': {
|
|
34
|
+
post: (_url: string, options: any) => Promise<Response>;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
declare const azureOpenaiClientAdapter: ({ azureOpenai, }: {
|
|
40
|
+
azureOpenai: AzureOpenAI;
|
|
41
|
+
}) => {
|
|
42
|
+
type: string;
|
|
43
|
+
client: AzureOpenAI;
|
|
44
|
+
requestHandlers: {
|
|
45
|
+
'^/(?:v1|/?openai)/chat/completions$': {
|
|
46
|
+
post: (_url: string, options: any) => Promise<Response>;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Client adapter for Azure AI Projects.
|
|
53
|
+
*
|
|
54
|
+
* Supports both Azure Agents API and Azure Responses API:
|
|
55
|
+
*
|
|
56
|
+
* @example Azure Agents API
|
|
57
|
+
* ```typescript
|
|
58
|
+
* const client = supercompat({
|
|
59
|
+
* client: azureAiProjectClientAdapter({ azureAiProject }),
|
|
60
|
+
* storage: azureAgentsStorageAdapter(),
|
|
61
|
+
* runAdapter: azureAgentsRunAdapter({ ... })
|
|
62
|
+
* })
|
|
63
|
+
* ```
|
|
64
|
+
*
|
|
65
|
+
* @example Azure Responses API
|
|
66
|
+
* ```typescript
|
|
67
|
+
* const client = supercompat({
|
|
68
|
+
* client: azureAiProjectClientAdapter({ azureAiProject }),
|
|
69
|
+
* storage: azureResponsesStorageAdapter(),
|
|
70
|
+
* runAdapter: responsesRunAdapter({ ... })
|
|
71
|
+
* })
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
declare const azureAiProjectClientAdapter: ({ azureAiProject, }: {
|
|
75
|
+
azureAiProject: AIProjectClient;
|
|
76
|
+
}) => {
|
|
77
|
+
type: string;
|
|
78
|
+
client: AIProjectClient;
|
|
79
|
+
requestHandlers: {
|
|
80
|
+
'^/v1/models$': {
|
|
81
|
+
get: (_url: string, _options: any) => Promise<Response>;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
declare const mistralClientAdapter: ({ mistral, }: {
|
|
87
|
+
mistral: Mistral;
|
|
88
|
+
}) => {
|
|
89
|
+
client: Mistral;
|
|
90
|
+
requestHandlers: {
|
|
91
|
+
'^/v1/models$': {
|
|
92
|
+
get: (_url: string, _options: any) => Promise<Response>;
|
|
93
|
+
};
|
|
94
|
+
'^/v1/chat/completions$': {
|
|
95
|
+
post: (_url: string, options: any) => Promise<Response>;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
declare const perplexityClientAdapter: ({ perplexity, }: {
|
|
101
|
+
perplexity: OpenAI;
|
|
102
|
+
}) => {
|
|
103
|
+
client: OpenAI;
|
|
104
|
+
requestHandlers: {
|
|
105
|
+
'^/v1/models$': {
|
|
106
|
+
get: (_url: string, _options: any) => Promise<Response>;
|
|
107
|
+
};
|
|
108
|
+
'^/v1/chat/completions$': {
|
|
109
|
+
post: (_url: string, options: any) => Promise<Response>;
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
declare const anthropicClientAdapter: ({ anthropic, }: {
|
|
115
|
+
anthropic: Anthropic;
|
|
116
|
+
}) => {
|
|
117
|
+
client: Anthropic;
|
|
118
|
+
requestHandlers: {
|
|
119
|
+
'^/v1/models$': {
|
|
120
|
+
get: (_url: string, _options: any) => Promise<Response>;
|
|
121
|
+
};
|
|
122
|
+
'^/v1/chat/completions$': {
|
|
123
|
+
post: (_url: string, options: any) => Promise<Response>;
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
declare const togetherClientAdapter: ({ together, }: {
|
|
129
|
+
together: OpenAI;
|
|
130
|
+
}) => {
|
|
131
|
+
client: OpenAI;
|
|
132
|
+
requestHandlers: {
|
|
133
|
+
'^/v1/models$': {
|
|
134
|
+
get: (_url: string, _options: any) => Promise<Response>;
|
|
135
|
+
};
|
|
136
|
+
'^/(?:v1|/?openai)/chat/completions$': {
|
|
137
|
+
post: (_url: string, options: any) => Promise<Response>;
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
declare const googleClientAdapter: ({ google, }: {
|
|
143
|
+
google: GoogleGenAI;
|
|
144
|
+
}) => {
|
|
145
|
+
client: GoogleGenAI;
|
|
146
|
+
requestHandlers: {
|
|
147
|
+
'^/v1/models$': {
|
|
148
|
+
get: (_url: string, _options: any) => Promise<Response>;
|
|
149
|
+
};
|
|
150
|
+
'^/(?:v1|/?openai)/chat/completions$': {
|
|
151
|
+
post: (_url: string, options: any) => Promise<Response>;
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
declare const humirisClientAdapter: ({ humiris, }: {
|
|
157
|
+
humiris: OpenAI;
|
|
158
|
+
}) => {
|
|
159
|
+
client: OpenAI;
|
|
160
|
+
requestHandlers: {
|
|
161
|
+
'^/v1/models$': {
|
|
162
|
+
get: (_url: string, _options: any) => Promise<Response>;
|
|
163
|
+
};
|
|
164
|
+
'^/(?:v1|/?openai)/chat/completions$': {
|
|
165
|
+
post: (_url: string, options: any) => Promise<Response>;
|
|
166
|
+
};
|
|
167
|
+
};
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
declare const ollamaClientAdapter: ({ ollama, }: {
|
|
171
|
+
ollama: OpenAI;
|
|
172
|
+
}) => {
|
|
173
|
+
client: OpenAI;
|
|
174
|
+
requestHandlers: {
|
|
175
|
+
'^/v1/models$': {
|
|
176
|
+
get: (_url: string, _options: any) => Promise<Response>;
|
|
177
|
+
};
|
|
178
|
+
'^/(?:v1|/?openai)/chat/completions$': {
|
|
179
|
+
post: (_url: string, options: any) => Promise<Response>;
|
|
180
|
+
};
|
|
181
|
+
};
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
declare const openRouterClientAdapter: ({ openRouter, provider, }: {
|
|
185
|
+
openRouter: OpenRouter;
|
|
186
|
+
provider?: Record<string, unknown>;
|
|
187
|
+
}) => {
|
|
188
|
+
client: OpenRouter;
|
|
189
|
+
requestHandlers: {
|
|
190
|
+
'^/v1/models$': {
|
|
191
|
+
get: (_url: string, _options: any) => Promise<Response>;
|
|
192
|
+
};
|
|
193
|
+
'^/(?:v1|/?openai)/chat/completions$': {
|
|
194
|
+
post: (_url: string, options: {
|
|
195
|
+
body: string;
|
|
196
|
+
}) => Promise<Response>;
|
|
197
|
+
};
|
|
198
|
+
};
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
declare const completionsRunAdapter: () => {
|
|
202
|
+
handleRun: ({ client, run, onEvent, getMessages, }: {
|
|
203
|
+
client: OpenAI;
|
|
204
|
+
run: OpenAI.Beta.Threads.Run;
|
|
205
|
+
onEvent: (event: OpenAI.Beta.AssistantStreamEvent) => Promise<any>;
|
|
206
|
+
getMessages: () => Promise<MessageWithRun[]>;
|
|
207
|
+
}) => Promise<any>;
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
type Args = {
|
|
211
|
+
select?: {
|
|
212
|
+
id?: boolean;
|
|
213
|
+
};
|
|
214
|
+
};
|
|
215
|
+
declare const responsesRunAdapter: ({ getOpenaiAssistant: getDirectOpenaiAssistant, waitUntil }: {
|
|
216
|
+
getOpenaiAssistant: (args?: Args) => Promise<OpenAI.Beta.Assistants.Assistant> | OpenAI.Beta.Assistants.Assistant | Pick<OpenAI.Beta.Assistants.Assistant, "id"> | Promise<Pick<OpenAI.Beta.Assistants.Assistant, "id">>;
|
|
217
|
+
waitUntil?: <T>(p: Promise<T>) => void | Promise<void>;
|
|
218
|
+
}) => {
|
|
219
|
+
handleRun: ({ client, threadId, response, onEvent, }: {
|
|
220
|
+
client: OpenAI;
|
|
221
|
+
threadId: string;
|
|
222
|
+
response: AsyncIterable<any>;
|
|
223
|
+
onEvent: (event: OpenAI.Beta.AssistantStreamEvent) => Promise<any>;
|
|
224
|
+
}) => Promise<void>;
|
|
225
|
+
getOpenaiAssistant: ({ select: { id } }?: Args) => Promise<OpenAI.Beta.Assistants.Assistant | {
|
|
226
|
+
id: string;
|
|
227
|
+
}>;
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
declare const azureAgentsRunAdapter: ({ azureAiProject, }: {
|
|
231
|
+
azureAiProject: AIProjectClient;
|
|
232
|
+
}) => {
|
|
233
|
+
handleRun: ({ threadId, assistantId, instructions, tools, onEvent, }: {
|
|
234
|
+
threadId: string;
|
|
235
|
+
assistantId: string;
|
|
236
|
+
instructions?: string;
|
|
237
|
+
tools?: any[];
|
|
238
|
+
onEvent: (event: OpenAI.Beta.AssistantStreamEvent) => Promise<any>;
|
|
239
|
+
}) => Promise<void>;
|
|
240
|
+
};
|
|
241
|
+
|
|
242
|
+
declare const perplexityAgentRunAdapter: ({ apiKey, baseURL, preset, }: {
|
|
243
|
+
apiKey: string;
|
|
244
|
+
baseURL?: string;
|
|
245
|
+
preset?: string;
|
|
246
|
+
}) => {
|
|
247
|
+
handleRun: ({ run, onEvent, getMessages, }: {
|
|
248
|
+
client: OpenAI;
|
|
249
|
+
run: OpenAI.Beta.Threads.Run;
|
|
250
|
+
onEvent: (event: OpenAI.Beta.AssistantStreamEvent) => Promise<any>;
|
|
251
|
+
getMessages: () => Promise<MessageWithRun[]>;
|
|
252
|
+
}) => Promise<any>;
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* OpenAI run adapter for the Responses API surface.
|
|
257
|
+
*
|
|
258
|
+
* Calls OpenAI's native Responses API directly and streams events through.
|
|
259
|
+
* Supports all built-in tools (web_search, file_search, code_interpreter, computer_use).
|
|
260
|
+
*/
|
|
261
|
+
|
|
262
|
+
type ResponsesRunEvent$4 = {
|
|
263
|
+
type: string;
|
|
264
|
+
[key: string]: any;
|
|
265
|
+
};
|
|
266
|
+
type HandleArgs$4 = {
|
|
267
|
+
requestBody: any;
|
|
268
|
+
onEvent: (event: ResponsesRunEvent$4) => Promise<void>;
|
|
269
|
+
};
|
|
270
|
+
declare const openaiResponsesRunAdapter: ({ openai, }: {
|
|
271
|
+
openai: OpenAI;
|
|
272
|
+
}) => {
|
|
273
|
+
type: "responses-openai";
|
|
274
|
+
handleRun: ({ requestBody, onEvent, }: HandleArgs$4) => Promise<void>;
|
|
275
|
+
};
|
|
276
|
+
|
|
277
|
+
type ResponsesRunEvent$3 = {
|
|
278
|
+
type: string;
|
|
279
|
+
[key: string]: any;
|
|
280
|
+
};
|
|
281
|
+
type HandleArgs$3 = {
|
|
282
|
+
requestBody: any;
|
|
283
|
+
onEvent: (event: ResponsesRunEvent$3) => Promise<void>;
|
|
284
|
+
};
|
|
285
|
+
declare const azureResponsesRunAdapter: ({ azureAiProject, }: {
|
|
286
|
+
azureAiProject: AIProjectClient;
|
|
287
|
+
}) => {
|
|
288
|
+
type: "responses-azure";
|
|
289
|
+
handleRun: ({ requestBody, onEvent, }: HandleArgs$3) => Promise<void>;
|
|
290
|
+
};
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* Anthropic run adapter for the Responses API surface.
|
|
294
|
+
*
|
|
295
|
+
* Calls Anthropic's beta.messages.create() with native beta tools
|
|
296
|
+
* (web_search, code_execution, computer_use) and translates Anthropic
|
|
297
|
+
* streaming events → Responses API events.
|
|
298
|
+
*
|
|
299
|
+
* Also handles regular function tools via Anthropic's tool_use format.
|
|
300
|
+
*/
|
|
301
|
+
|
|
302
|
+
type ResponsesRunEvent$2 = {
|
|
303
|
+
type: string;
|
|
304
|
+
[key: string]: any;
|
|
305
|
+
};
|
|
306
|
+
type HandleArgs$2 = {
|
|
307
|
+
requestBody: any;
|
|
308
|
+
onEvent: (event: ResponsesRunEvent$2) => Promise<void>;
|
|
309
|
+
};
|
|
310
|
+
declare const anthropicRunAdapter: ({ anthropic, }: {
|
|
311
|
+
anthropic: Anthropic;
|
|
312
|
+
}) => {
|
|
313
|
+
type: "responses-anthropic";
|
|
314
|
+
handleRun: ({ requestBody, onEvent, }: HandleArgs$2) => Promise<void>;
|
|
315
|
+
};
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* Azure Agents run adapter for the Responses API surface.
|
|
319
|
+
*
|
|
320
|
+
* Creates an Azure Agent with the requested tools, runs it, and translates
|
|
321
|
+
* Azure Agent streaming events → Responses API events.
|
|
322
|
+
*
|
|
323
|
+
* Supports: file_search, code_interpreter, function tools.
|
|
324
|
+
*/
|
|
325
|
+
|
|
326
|
+
type ResponsesRunEvent$1 = {
|
|
327
|
+
type: string;
|
|
328
|
+
[key: string]: any;
|
|
329
|
+
};
|
|
330
|
+
type HandleArgs$1 = {
|
|
331
|
+
requestBody: any;
|
|
332
|
+
onEvent: (event: ResponsesRunEvent$1) => Promise<void>;
|
|
333
|
+
agentId?: string;
|
|
334
|
+
threadId?: string;
|
|
335
|
+
};
|
|
336
|
+
declare const azureAgentsResponsesRunAdapter: ({ azureAiProject, }: {
|
|
337
|
+
azureAiProject: AIProjectClient;
|
|
338
|
+
}) => {
|
|
339
|
+
type: "responses-azure-agents";
|
|
340
|
+
handleRun: ({ requestBody, onEvent, agentId: existingAgentId, threadId: existingThreadId, }: HandleArgs$1) => Promise<void>;
|
|
341
|
+
};
|
|
342
|
+
|
|
343
|
+
/**
|
|
344
|
+
* Gemini run adapter for the Responses API surface.
|
|
345
|
+
*
|
|
346
|
+
* Calls Google's Gemini API with native computer_use support.
|
|
347
|
+
* Translates Gemini streaming events → Responses API events.
|
|
348
|
+
*
|
|
349
|
+
* For non-computer-use tools, delegates to completions path.
|
|
350
|
+
*/
|
|
351
|
+
|
|
352
|
+
type ResponsesRunEvent = {
|
|
353
|
+
type: string;
|
|
354
|
+
[key: string]: any;
|
|
355
|
+
};
|
|
356
|
+
type HandleArgs = {
|
|
357
|
+
requestBody: any;
|
|
358
|
+
onEvent: (event: ResponsesRunEvent) => Promise<void>;
|
|
359
|
+
};
|
|
360
|
+
declare const geminiRunAdapter: ({ google, }: {
|
|
361
|
+
google: GoogleGenAI;
|
|
362
|
+
}) => {
|
|
363
|
+
type: "responses-gemini";
|
|
364
|
+
handleRun: ({ requestBody, onEvent, }: HandleArgs) => Promise<void>;
|
|
365
|
+
};
|
|
366
|
+
|
|
367
|
+
declare const prismaStorageAdapter: ({ prisma, }: {
|
|
368
|
+
prisma: PrismaClient;
|
|
369
|
+
}) => (args: StorageAdapterArgs) => {
|
|
370
|
+
requestHandlers: {
|
|
371
|
+
[x: string]: {
|
|
372
|
+
get?: RequestHandler;
|
|
373
|
+
post?: RequestHandler;
|
|
374
|
+
delete?: RequestHandler;
|
|
375
|
+
} | {
|
|
376
|
+
get?: RequestHandler;
|
|
377
|
+
post?: RequestHandler;
|
|
378
|
+
delete?: RequestHandler;
|
|
379
|
+
};
|
|
380
|
+
};
|
|
381
|
+
};
|
|
382
|
+
|
|
383
|
+
type MethodHandlers$2 = {
|
|
384
|
+
get?: RequestHandler;
|
|
385
|
+
post?: RequestHandler;
|
|
386
|
+
delete?: RequestHandler;
|
|
387
|
+
};
|
|
388
|
+
declare const memoryStorageAdapter: () => ((args: StorageAdapterArgs) => {
|
|
389
|
+
requestHandlers: Record<string, MethodHandlers$2>;
|
|
390
|
+
});
|
|
391
|
+
|
|
392
|
+
type MethodHandlers$1 = {
|
|
393
|
+
get?: RequestHandler;
|
|
394
|
+
post?: RequestHandler;
|
|
395
|
+
delete?: RequestHandler;
|
|
396
|
+
};
|
|
397
|
+
type ResponsesStorageAdapterArgs = StorageAdapterArgs & {
|
|
398
|
+
runAdapter: RunAdapterWithAssistant;
|
|
399
|
+
};
|
|
400
|
+
declare const responsesStorageAdapter: ({ deferItemCreationUntilRun, }?: {
|
|
401
|
+
deferItemCreationUntilRun?: boolean;
|
|
402
|
+
}) => ((args: ResponsesStorageAdapterArgs) => {
|
|
403
|
+
requestHandlers: Record<string, MethodHandlers$1>;
|
|
404
|
+
});
|
|
405
|
+
|
|
406
|
+
type AzureAgentsStorageAdapterArgs = StorageAdapterArgs & {
|
|
407
|
+
runAdapter: RunAdapterWithAssistant;
|
|
408
|
+
};
|
|
409
|
+
declare const azureAgentsStorageAdapter: ({ azureAiProject, prisma, }: {
|
|
410
|
+
azureAiProject: AIProjectClient;
|
|
411
|
+
prisma: PrismaClient;
|
|
412
|
+
}) => ({ runAdapter }: AzureAgentsStorageAdapterArgs) => {
|
|
413
|
+
requestHandlers: {
|
|
414
|
+
'^/(?:v1|/?openai)/assistants$': {
|
|
415
|
+
post: RequestHandler;
|
|
416
|
+
};
|
|
417
|
+
'^/(?:v1|/?openai)/threads$': {
|
|
418
|
+
post: RequestHandler;
|
|
419
|
+
};
|
|
420
|
+
"^/(?:v1|/?openai)/threads/runs$": {
|
|
421
|
+
post: RequestHandler;
|
|
422
|
+
};
|
|
423
|
+
"^/(?:v1|/?openai)/threads/([^/]+)$": {
|
|
424
|
+
get: RequestHandler;
|
|
425
|
+
post: RequestHandler;
|
|
426
|
+
delete: RequestHandler;
|
|
427
|
+
};
|
|
428
|
+
"^/(?:v1|/?openai)/threads/([^/]+)/messages$": {
|
|
429
|
+
post: RequestHandler;
|
|
430
|
+
get: RequestHandler;
|
|
431
|
+
};
|
|
432
|
+
"^/(?:v1|/?openai)/threads/([^/]+)/messages/([^/]+)$": {
|
|
433
|
+
get: RequestHandler;
|
|
434
|
+
post: RequestHandler;
|
|
435
|
+
delete: RequestHandler;
|
|
436
|
+
};
|
|
437
|
+
"^/(?:v1|/?openai)/threads/([^/]+)/runs$": {
|
|
438
|
+
get: RequestHandler;
|
|
439
|
+
post: RequestHandler;
|
|
440
|
+
};
|
|
441
|
+
"^/(?:v1|/?openai)/threads/([^/]+)/runs/([^/]+)$": {
|
|
442
|
+
get: RequestHandler;
|
|
443
|
+
post: RequestHandler;
|
|
444
|
+
};
|
|
445
|
+
"^/(?:v1|/?openai)/threads/([^/]+)/runs/([^/]+)/steps/([^/]+)$": {
|
|
446
|
+
get: RequestHandler;
|
|
447
|
+
};
|
|
448
|
+
"^/(?:v1|/?openai)/threads/([^/]+)/runs/([^/]+)/steps$": {
|
|
449
|
+
get: RequestHandler;
|
|
450
|
+
};
|
|
451
|
+
"^/(?:v1|/?openai)/threads/([^/]+)/runs/([^/]+)/submit_tool_outputs$": {
|
|
452
|
+
post: RequestHandler;
|
|
453
|
+
};
|
|
454
|
+
"^/(?:v1|/?openai)/threads/([^/]+)/runs/([^/]+)/cancel$": {
|
|
455
|
+
post: RequestHandler;
|
|
456
|
+
};
|
|
457
|
+
"^/(?:v1|/?openai)/files/([^/]+)$": {
|
|
458
|
+
delete: RequestHandler;
|
|
459
|
+
get: RequestHandler;
|
|
460
|
+
};
|
|
461
|
+
"^/(?:v1|/?openai)/files/([^/]+)/content$": {
|
|
462
|
+
get: RequestHandler;
|
|
463
|
+
};
|
|
464
|
+
'^/(?:v1|/?openai)/files$': {
|
|
465
|
+
post: RequestHandler;
|
|
466
|
+
};
|
|
467
|
+
'^/(?:v1|/?openai)/vector_stores$': {
|
|
468
|
+
post: RequestHandler;
|
|
469
|
+
};
|
|
470
|
+
'^/(?:v1|/?openai)/vector_stores/[^/]+$': {
|
|
471
|
+
get: RequestHandler;
|
|
472
|
+
delete: RequestHandler;
|
|
473
|
+
};
|
|
474
|
+
};
|
|
475
|
+
};
|
|
476
|
+
|
|
477
|
+
type MethodHandlers = {
|
|
478
|
+
get?: RequestHandler;
|
|
479
|
+
post?: RequestHandler;
|
|
480
|
+
delete?: RequestHandler;
|
|
481
|
+
};
|
|
482
|
+
type AzureResponsesStorageAdapterArgs = StorageAdapterArgs & {
|
|
483
|
+
runAdapter: RunAdapterWithAssistant;
|
|
484
|
+
originalClient?: any;
|
|
485
|
+
};
|
|
486
|
+
/**
|
|
487
|
+
* Storage adapter for Azure's Responses API (conversations + responses endpoints).
|
|
488
|
+
*
|
|
489
|
+
* Use this with Azure AI Projects and azureAiProjectClientAdapter:
|
|
490
|
+
*
|
|
491
|
+
* @example
|
|
492
|
+
* ```typescript
|
|
493
|
+
* const azureAiProject = new AIProjectClient(endpoint, credential)
|
|
494
|
+
*
|
|
495
|
+
* const client = supercompat({
|
|
496
|
+
* client: azureAiProjectClientAdapter({ azureAiProject }),
|
|
497
|
+
* storage: azureResponsesStorageAdapter(),
|
|
498
|
+
* runAdapter: responsesRunAdapter({ getOpenaiAssistant: () => assistant }),
|
|
499
|
+
* })
|
|
500
|
+
* ```
|
|
501
|
+
*/
|
|
502
|
+
declare const azureResponsesStorageAdapter: () => ((args: AzureResponsesStorageAdapterArgs) => {
|
|
503
|
+
requestHandlers: Record<string, MethodHandlers>;
|
|
504
|
+
});
|
|
505
|
+
|
|
506
|
+
type ComputerAction = Record<string, unknown> & {
|
|
507
|
+
type: string;
|
|
508
|
+
};
|
|
509
|
+
declare const isOpenaiComputerUseModel: ({ model, }: {
|
|
510
|
+
model: string | null | undefined;
|
|
511
|
+
}) => boolean;
|
|
512
|
+
declare const serializeComputerUseTool: ({ useOpenaiComputerTool, tool, }: {
|
|
513
|
+
useOpenaiComputerTool: boolean;
|
|
514
|
+
tool: Record<string, unknown>;
|
|
515
|
+
}) => {
|
|
516
|
+
type: "computer";
|
|
517
|
+
computer: Record<string, unknown>;
|
|
518
|
+
computer_use_preview?: undefined;
|
|
519
|
+
} | {
|
|
520
|
+
type: "computer_use_preview";
|
|
521
|
+
computer_use_preview: Record<string, unknown>;
|
|
522
|
+
computer?: undefined;
|
|
523
|
+
};
|
|
524
|
+
declare const getComputerCallActions: ({ item, }: {
|
|
525
|
+
item: {
|
|
526
|
+
action?: unknown;
|
|
527
|
+
actions?: unknown;
|
|
528
|
+
};
|
|
529
|
+
}) => ComputerAction[];
|
|
530
|
+
declare const serializeCompatComputerCall: ({ item, }: {
|
|
531
|
+
item: {
|
|
532
|
+
call_id: string;
|
|
533
|
+
pending_safety_checks?: unknown;
|
|
534
|
+
action?: unknown;
|
|
535
|
+
actions?: unknown;
|
|
536
|
+
};
|
|
537
|
+
}) => {
|
|
538
|
+
id: string;
|
|
539
|
+
type: "computer_call";
|
|
540
|
+
computer_call: {
|
|
541
|
+
pending_safety_checks: any[];
|
|
542
|
+
actions?: ComputerAction[] | undefined;
|
|
543
|
+
action?: ComputerAction | undefined;
|
|
544
|
+
};
|
|
545
|
+
};
|
|
546
|
+
|
|
547
|
+
export { anthropicClientAdapter, anthropicRunAdapter, azureAgentsResponsesRunAdapter, azureAgentsRunAdapter, azureAgentsStorageAdapter, azureAiProjectClientAdapter, azureOpenaiClientAdapter, azureResponsesRunAdapter, azureResponsesStorageAdapter, completionsRunAdapter, geminiRunAdapter, getComputerCallActions, googleClientAdapter, groqClientAdapter, humirisClientAdapter, isOpenaiComputerUseModel, memoryStorageAdapter, mistralClientAdapter, ollamaClientAdapter, openRouterClientAdapter, openaiClientAdapter, openaiResponsesRunAdapter, perplexityAgentRunAdapter, perplexityClientAdapter, prismaStorageAdapter, responsesRunAdapter, responsesStorageAdapter, serializeCompatComputerCall, serializeComputerUseTool, togetherClientAdapter };
|