supercompat 4.0.4 → 4.1.1
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/openai/index.cjs +11093 -11008
- package/dist/openai/index.cjs.map +1 -1
- package/dist/openai/index.d.cts +62 -62
- package/dist/openai/index.d.ts +62 -62
- package/dist/openai/index.js +11065 -10976
- package/dist/openai/index.js.map +1 -1
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.cts +45 -16
- package/dist/types/index.d.ts +45 -16
- package/package.json +1 -1
package/dist/openai/index.d.cts
CHANGED
|
@@ -5,7 +5,7 @@ import { Mistral } from '@mistralai/mistralai';
|
|
|
5
5
|
import Anthropic from '@anthropic-ai/sdk';
|
|
6
6
|
import { GoogleGenAI } from '@google/genai';
|
|
7
7
|
import { OpenRouter } from '@openrouter/sdk';
|
|
8
|
-
import { MessageWithRun, StorageAdapterArgs, RequestHandler, RunAdapterWithAssistant } from '../types/index.cjs';
|
|
8
|
+
import { AssistantsRunBody, ResponsesRunBody, MessageWithRun, RunAdapterBody, StorageAdapterArgs, RequestHandler, RunAdapterWithAssistant } from '../types/index.cjs';
|
|
9
9
|
import { PrismaClient } from '@prisma/client';
|
|
10
10
|
|
|
11
11
|
declare const groqClientAdapter: ({ groq, }: {
|
|
@@ -67,7 +67,7 @@ declare const azureOpenaiClientAdapter: ({ azureOpenai, }: {
|
|
|
67
67
|
* const client = supercompat({
|
|
68
68
|
* client: azureAiProjectClientAdapter({ azureAiProject }),
|
|
69
69
|
* storage: azureResponsesStorageAdapter(),
|
|
70
|
-
* runAdapter:
|
|
70
|
+
* runAdapter: azureResponsesRunAdapter({ ... })
|
|
71
71
|
* })
|
|
72
72
|
* ```
|
|
73
73
|
*/
|
|
@@ -199,42 +199,19 @@ declare const openRouterClientAdapter: ({ openRouter, provider, }: {
|
|
|
199
199
|
};
|
|
200
200
|
|
|
201
201
|
declare const completionsRunAdapter: () => {
|
|
202
|
-
handleRun: ({ client,
|
|
202
|
+
handleRun: ({ client, body, onEvent, getMessages, }: {
|
|
203
203
|
client: OpenAI;
|
|
204
|
-
|
|
204
|
+
body: AssistantsRunBody | ResponsesRunBody;
|
|
205
205
|
onEvent: (event: OpenAI.Beta.AssistantStreamEvent) => Promise<any>;
|
|
206
|
-
getMessages
|
|
206
|
+
getMessages?: () => Promise<MessageWithRun[]>;
|
|
207
207
|
}) => Promise<any>;
|
|
208
208
|
};
|
|
209
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
210
|
declare const azureAgentsRunAdapter: ({ azureAiProject, }: {
|
|
231
211
|
azureAiProject: AIProjectClient;
|
|
232
212
|
}) => {
|
|
233
|
-
handleRun: ({
|
|
234
|
-
|
|
235
|
-
assistantId: string;
|
|
236
|
-
instructions?: string;
|
|
237
|
-
tools?: any[];
|
|
213
|
+
handleRun: ({ body, onEvent, }: {
|
|
214
|
+
body: RunAdapterBody;
|
|
238
215
|
onEvent: (event: OpenAI.Beta.AssistantStreamEvent) => Promise<any>;
|
|
239
216
|
}) => Promise<void>;
|
|
240
217
|
};
|
|
@@ -244,9 +221,9 @@ declare const perplexityAgentRunAdapter: ({ apiKey, baseURL, preset, }: {
|
|
|
244
221
|
baseURL?: string;
|
|
245
222
|
preset?: string;
|
|
246
223
|
}) => {
|
|
247
|
-
handleRun: ({
|
|
224
|
+
handleRun: ({ body, onEvent, getMessages, }: {
|
|
248
225
|
client: OpenAI;
|
|
249
|
-
|
|
226
|
+
body: RunAdapterBody;
|
|
250
227
|
onEvent: (event: OpenAI.Beta.AssistantStreamEvent) => Promise<any>;
|
|
251
228
|
getMessages: () => Promise<MessageWithRun[]>;
|
|
252
229
|
}) => Promise<any>;
|
|
@@ -257,36 +234,59 @@ declare const perplexityAgentRunAdapter: ({ apiKey, baseURL, preset, }: {
|
|
|
257
234
|
*
|
|
258
235
|
* Calls OpenAI's native Responses API directly and streams events through.
|
|
259
236
|
* Supports all built-in tools (web_search, file_search, code_interpreter, computer_use).
|
|
237
|
+
*
|
|
238
|
+
* When used with openaiResponsesStorageAdapter (Assistants surface), pass getOpenaiAssistant
|
|
239
|
+
* so the storage adapter can resolve assistant data for building the request body.
|
|
260
240
|
*/
|
|
261
241
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
};
|
|
270
|
-
declare const openaiResponsesRunAdapter: ({ openai, }: {
|
|
271
|
-
openai: OpenAI;
|
|
242
|
+
declare const openaiResponsesRunAdapter: ({ getOpenaiAssistant, waitUntil, }?: {
|
|
243
|
+
getOpenaiAssistant?: (args?: {
|
|
244
|
+
select?: {
|
|
245
|
+
id?: boolean;
|
|
246
|
+
};
|
|
247
|
+
}) => Promise<OpenAI.Beta.Assistants.Assistant> | OpenAI.Beta.Assistants.Assistant | Pick<OpenAI.Beta.Assistants.Assistant, "id"> | Promise<Pick<OpenAI.Beta.Assistants.Assistant, "id">>;
|
|
248
|
+
waitUntil?: <T>(p: Promise<T>) => void | Promise<void>;
|
|
272
249
|
}) => {
|
|
250
|
+
handleRun: ({ client, body, onEvent, }: {
|
|
251
|
+
client: OpenAI;
|
|
252
|
+
body: RunAdapterBody;
|
|
253
|
+
onEvent: (event: OpenAI.Responses.ResponseStreamEvent) => Promise<void>;
|
|
254
|
+
}) => Promise<void>;
|
|
255
|
+
getOpenaiAssistant?: ((args?: {
|
|
256
|
+
select?: {
|
|
257
|
+
id?: boolean;
|
|
258
|
+
};
|
|
259
|
+
}) => Promise<OpenAI.Beta.Assistants.Assistant> | OpenAI.Beta.Assistants.Assistant | Pick<OpenAI.Beta.Assistants.Assistant, "id"> | Promise<Pick<OpenAI.Beta.Assistants.Assistant, "id">>) | undefined;
|
|
273
260
|
type: "responses-openai";
|
|
274
|
-
handleRun: ({ requestBody, onEvent, }: HandleArgs$4) => Promise<void>;
|
|
275
261
|
};
|
|
276
262
|
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
declare const azureResponsesRunAdapter: ({ azureAiProject, }: {
|
|
263
|
+
/**
|
|
264
|
+
* Azure Responses run adapter for the Responses API surface.
|
|
265
|
+
*
|
|
266
|
+
* Calls Azure's native Responses API directly and streams events through.
|
|
267
|
+
* Uses AIProjectClient.getOpenAIClient() to obtain an authenticated OpenAI client,
|
|
268
|
+
* since the supercompat client wrapper doesn't handle Azure auth for direct API calls.
|
|
269
|
+
*/
|
|
270
|
+
|
|
271
|
+
declare const azureResponsesRunAdapter: ({ azureAiProject, getOpenaiAssistant, }: {
|
|
286
272
|
azureAiProject: AIProjectClient;
|
|
273
|
+
getOpenaiAssistant?: (args?: {
|
|
274
|
+
select?: {
|
|
275
|
+
id?: boolean;
|
|
276
|
+
};
|
|
277
|
+
}) => Promise<OpenAI.Beta.Assistants.Assistant> | OpenAI.Beta.Assistants.Assistant | Pick<OpenAI.Beta.Assistants.Assistant, "id"> | Promise<Pick<OpenAI.Beta.Assistants.Assistant, "id">>;
|
|
287
278
|
}) => {
|
|
279
|
+
handleRun: ({ body, onEvent, }: {
|
|
280
|
+
client?: OpenAI;
|
|
281
|
+
body: RunAdapterBody;
|
|
282
|
+
onEvent: (event: OpenAI.Responses.ResponseStreamEvent) => Promise<void>;
|
|
283
|
+
}) => Promise<void>;
|
|
284
|
+
getOpenaiAssistant?: ((args?: {
|
|
285
|
+
select?: {
|
|
286
|
+
id?: boolean;
|
|
287
|
+
};
|
|
288
|
+
}) => Promise<OpenAI.Beta.Assistants.Assistant> | OpenAI.Beta.Assistants.Assistant | Pick<OpenAI.Beta.Assistants.Assistant, "id"> | Promise<Pick<OpenAI.Beta.Assistants.Assistant, "id">>) | undefined;
|
|
288
289
|
type: "responses-azure";
|
|
289
|
-
handleRun: ({ requestBody, onEvent, }: HandleArgs$3) => Promise<void>;
|
|
290
290
|
};
|
|
291
291
|
|
|
292
292
|
/**
|
|
@@ -304,14 +304,14 @@ type ResponsesRunEvent$2 = {
|
|
|
304
304
|
[key: string]: any;
|
|
305
305
|
};
|
|
306
306
|
type HandleArgs$2 = {
|
|
307
|
-
|
|
307
|
+
body: ResponsesRunBody;
|
|
308
308
|
onEvent: (event: ResponsesRunEvent$2) => Promise<void>;
|
|
309
309
|
};
|
|
310
310
|
declare const anthropicRunAdapter: ({ anthropic, }: {
|
|
311
311
|
anthropic: Anthropic;
|
|
312
312
|
}) => {
|
|
313
313
|
type: "responses-anthropic";
|
|
314
|
-
handleRun: ({ requestBody, onEvent, }: HandleArgs$2) => Promise<void>;
|
|
314
|
+
handleRun: ({ body: requestBody, onEvent, }: HandleArgs$2) => Promise<void>;
|
|
315
315
|
};
|
|
316
316
|
|
|
317
317
|
/**
|
|
@@ -328,7 +328,7 @@ type ResponsesRunEvent$1 = {
|
|
|
328
328
|
[key: string]: any;
|
|
329
329
|
};
|
|
330
330
|
type HandleArgs$1 = {
|
|
331
|
-
|
|
331
|
+
body: ResponsesRunBody;
|
|
332
332
|
onEvent: (event: ResponsesRunEvent$1) => Promise<void>;
|
|
333
333
|
agentId?: string;
|
|
334
334
|
threadId?: string;
|
|
@@ -337,7 +337,7 @@ declare const azureAgentsResponsesRunAdapter: ({ azureAiProject, }: {
|
|
|
337
337
|
azureAiProject: AIProjectClient;
|
|
338
338
|
}) => {
|
|
339
339
|
type: "responses-azure-agents";
|
|
340
|
-
handleRun: ({ requestBody, onEvent, agentId: existingAgentId, threadId: existingThreadId, }: HandleArgs$1) => Promise<void>;
|
|
340
|
+
handleRun: ({ body: requestBody, onEvent, agentId: existingAgentId, threadId: existingThreadId, }: HandleArgs$1) => Promise<void>;
|
|
341
341
|
};
|
|
342
342
|
|
|
343
343
|
/**
|
|
@@ -354,14 +354,14 @@ type ResponsesRunEvent = {
|
|
|
354
354
|
[key: string]: any;
|
|
355
355
|
};
|
|
356
356
|
type HandleArgs = {
|
|
357
|
-
|
|
357
|
+
body: ResponsesRunBody;
|
|
358
358
|
onEvent: (event: ResponsesRunEvent) => Promise<void>;
|
|
359
359
|
};
|
|
360
360
|
declare const geminiRunAdapter: ({ google, }: {
|
|
361
361
|
google: GoogleGenAI;
|
|
362
362
|
}) => {
|
|
363
363
|
type: "responses-gemini";
|
|
364
|
-
handleRun: ({ requestBody, onEvent, }: HandleArgs) => Promise<void>;
|
|
364
|
+
handleRun: ({ body: requestBody, onEvent, }: HandleArgs) => Promise<void>;
|
|
365
365
|
};
|
|
366
366
|
|
|
367
367
|
declare const prismaStorageAdapter: ({ prisma, }: {
|
|
@@ -397,7 +397,7 @@ type MethodHandlers$1 = {
|
|
|
397
397
|
type ResponsesStorageAdapterArgs = StorageAdapterArgs & {
|
|
398
398
|
runAdapter: RunAdapterWithAssistant;
|
|
399
399
|
};
|
|
400
|
-
declare const
|
|
400
|
+
declare const openaiResponsesStorageAdapter: ({ deferItemCreationUntilRun, }?: {
|
|
401
401
|
deferItemCreationUntilRun?: boolean;
|
|
402
402
|
}) => ((args: ResponsesStorageAdapterArgs) => {
|
|
403
403
|
requestHandlers: Record<string, MethodHandlers$1>;
|
|
@@ -495,7 +495,7 @@ type AzureResponsesStorageAdapterArgs = StorageAdapterArgs & {
|
|
|
495
495
|
* const client = supercompat({
|
|
496
496
|
* client: azureAiProjectClientAdapter({ azureAiProject }),
|
|
497
497
|
* storage: azureResponsesStorageAdapter(),
|
|
498
|
-
* runAdapter:
|
|
498
|
+
* runAdapter: azureResponsesRunAdapter({ getOpenaiAssistant: () => assistant }),
|
|
499
499
|
* })
|
|
500
500
|
* ```
|
|
501
501
|
*/
|
|
@@ -544,4 +544,4 @@ declare const serializeCompatComputerCall: ({ item, }: {
|
|
|
544
544
|
};
|
|
545
545
|
};
|
|
546
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,
|
|
547
|
+
export { anthropicClientAdapter, anthropicRunAdapter, azureAgentsResponsesRunAdapter, azureAgentsRunAdapter, azureAgentsStorageAdapter, azureAiProjectClientAdapter, azureOpenaiClientAdapter, azureResponsesRunAdapter, azureResponsesStorageAdapter, completionsRunAdapter, geminiRunAdapter, getComputerCallActions, googleClientAdapter, groqClientAdapter, humirisClientAdapter, isOpenaiComputerUseModel, memoryStorageAdapter, mistralClientAdapter, ollamaClientAdapter, openRouterClientAdapter, openaiClientAdapter, openaiResponsesRunAdapter, openaiResponsesStorageAdapter, perplexityAgentRunAdapter, perplexityClientAdapter, prismaStorageAdapter, serializeCompatComputerCall, serializeComputerUseTool, togetherClientAdapter };
|
package/dist/openai/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { Mistral } from '@mistralai/mistralai';
|
|
|
5
5
|
import Anthropic from '@anthropic-ai/sdk';
|
|
6
6
|
import { GoogleGenAI } from '@google/genai';
|
|
7
7
|
import { OpenRouter } from '@openrouter/sdk';
|
|
8
|
-
import { MessageWithRun, StorageAdapterArgs, RequestHandler, RunAdapterWithAssistant } from '../types/index.js';
|
|
8
|
+
import { AssistantsRunBody, ResponsesRunBody, MessageWithRun, RunAdapterBody, StorageAdapterArgs, RequestHandler, RunAdapterWithAssistant } from '../types/index.js';
|
|
9
9
|
import { PrismaClient } from '@prisma/client';
|
|
10
10
|
|
|
11
11
|
declare const groqClientAdapter: ({ groq, }: {
|
|
@@ -67,7 +67,7 @@ declare const azureOpenaiClientAdapter: ({ azureOpenai, }: {
|
|
|
67
67
|
* const client = supercompat({
|
|
68
68
|
* client: azureAiProjectClientAdapter({ azureAiProject }),
|
|
69
69
|
* storage: azureResponsesStorageAdapter(),
|
|
70
|
-
* runAdapter:
|
|
70
|
+
* runAdapter: azureResponsesRunAdapter({ ... })
|
|
71
71
|
* })
|
|
72
72
|
* ```
|
|
73
73
|
*/
|
|
@@ -199,42 +199,19 @@ declare const openRouterClientAdapter: ({ openRouter, provider, }: {
|
|
|
199
199
|
};
|
|
200
200
|
|
|
201
201
|
declare const completionsRunAdapter: () => {
|
|
202
|
-
handleRun: ({ client,
|
|
202
|
+
handleRun: ({ client, body, onEvent, getMessages, }: {
|
|
203
203
|
client: OpenAI;
|
|
204
|
-
|
|
204
|
+
body: AssistantsRunBody | ResponsesRunBody;
|
|
205
205
|
onEvent: (event: OpenAI.Beta.AssistantStreamEvent) => Promise<any>;
|
|
206
|
-
getMessages
|
|
206
|
+
getMessages?: () => Promise<MessageWithRun[]>;
|
|
207
207
|
}) => Promise<any>;
|
|
208
208
|
};
|
|
209
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
210
|
declare const azureAgentsRunAdapter: ({ azureAiProject, }: {
|
|
231
211
|
azureAiProject: AIProjectClient;
|
|
232
212
|
}) => {
|
|
233
|
-
handleRun: ({
|
|
234
|
-
|
|
235
|
-
assistantId: string;
|
|
236
|
-
instructions?: string;
|
|
237
|
-
tools?: any[];
|
|
213
|
+
handleRun: ({ body, onEvent, }: {
|
|
214
|
+
body: RunAdapterBody;
|
|
238
215
|
onEvent: (event: OpenAI.Beta.AssistantStreamEvent) => Promise<any>;
|
|
239
216
|
}) => Promise<void>;
|
|
240
217
|
};
|
|
@@ -244,9 +221,9 @@ declare const perplexityAgentRunAdapter: ({ apiKey, baseURL, preset, }: {
|
|
|
244
221
|
baseURL?: string;
|
|
245
222
|
preset?: string;
|
|
246
223
|
}) => {
|
|
247
|
-
handleRun: ({
|
|
224
|
+
handleRun: ({ body, onEvent, getMessages, }: {
|
|
248
225
|
client: OpenAI;
|
|
249
|
-
|
|
226
|
+
body: RunAdapterBody;
|
|
250
227
|
onEvent: (event: OpenAI.Beta.AssistantStreamEvent) => Promise<any>;
|
|
251
228
|
getMessages: () => Promise<MessageWithRun[]>;
|
|
252
229
|
}) => Promise<any>;
|
|
@@ -257,36 +234,59 @@ declare const perplexityAgentRunAdapter: ({ apiKey, baseURL, preset, }: {
|
|
|
257
234
|
*
|
|
258
235
|
* Calls OpenAI's native Responses API directly and streams events through.
|
|
259
236
|
* Supports all built-in tools (web_search, file_search, code_interpreter, computer_use).
|
|
237
|
+
*
|
|
238
|
+
* When used with openaiResponsesStorageAdapter (Assistants surface), pass getOpenaiAssistant
|
|
239
|
+
* so the storage adapter can resolve assistant data for building the request body.
|
|
260
240
|
*/
|
|
261
241
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
};
|
|
270
|
-
declare const openaiResponsesRunAdapter: ({ openai, }: {
|
|
271
|
-
openai: OpenAI;
|
|
242
|
+
declare const openaiResponsesRunAdapter: ({ getOpenaiAssistant, waitUntil, }?: {
|
|
243
|
+
getOpenaiAssistant?: (args?: {
|
|
244
|
+
select?: {
|
|
245
|
+
id?: boolean;
|
|
246
|
+
};
|
|
247
|
+
}) => Promise<OpenAI.Beta.Assistants.Assistant> | OpenAI.Beta.Assistants.Assistant | Pick<OpenAI.Beta.Assistants.Assistant, "id"> | Promise<Pick<OpenAI.Beta.Assistants.Assistant, "id">>;
|
|
248
|
+
waitUntil?: <T>(p: Promise<T>) => void | Promise<void>;
|
|
272
249
|
}) => {
|
|
250
|
+
handleRun: ({ client, body, onEvent, }: {
|
|
251
|
+
client: OpenAI;
|
|
252
|
+
body: RunAdapterBody;
|
|
253
|
+
onEvent: (event: OpenAI.Responses.ResponseStreamEvent) => Promise<void>;
|
|
254
|
+
}) => Promise<void>;
|
|
255
|
+
getOpenaiAssistant?: ((args?: {
|
|
256
|
+
select?: {
|
|
257
|
+
id?: boolean;
|
|
258
|
+
};
|
|
259
|
+
}) => Promise<OpenAI.Beta.Assistants.Assistant> | OpenAI.Beta.Assistants.Assistant | Pick<OpenAI.Beta.Assistants.Assistant, "id"> | Promise<Pick<OpenAI.Beta.Assistants.Assistant, "id">>) | undefined;
|
|
273
260
|
type: "responses-openai";
|
|
274
|
-
handleRun: ({ requestBody, onEvent, }: HandleArgs$4) => Promise<void>;
|
|
275
261
|
};
|
|
276
262
|
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
declare const azureResponsesRunAdapter: ({ azureAiProject, }: {
|
|
263
|
+
/**
|
|
264
|
+
* Azure Responses run adapter for the Responses API surface.
|
|
265
|
+
*
|
|
266
|
+
* Calls Azure's native Responses API directly and streams events through.
|
|
267
|
+
* Uses AIProjectClient.getOpenAIClient() to obtain an authenticated OpenAI client,
|
|
268
|
+
* since the supercompat client wrapper doesn't handle Azure auth for direct API calls.
|
|
269
|
+
*/
|
|
270
|
+
|
|
271
|
+
declare const azureResponsesRunAdapter: ({ azureAiProject, getOpenaiAssistant, }: {
|
|
286
272
|
azureAiProject: AIProjectClient;
|
|
273
|
+
getOpenaiAssistant?: (args?: {
|
|
274
|
+
select?: {
|
|
275
|
+
id?: boolean;
|
|
276
|
+
};
|
|
277
|
+
}) => Promise<OpenAI.Beta.Assistants.Assistant> | OpenAI.Beta.Assistants.Assistant | Pick<OpenAI.Beta.Assistants.Assistant, "id"> | Promise<Pick<OpenAI.Beta.Assistants.Assistant, "id">>;
|
|
287
278
|
}) => {
|
|
279
|
+
handleRun: ({ body, onEvent, }: {
|
|
280
|
+
client?: OpenAI;
|
|
281
|
+
body: RunAdapterBody;
|
|
282
|
+
onEvent: (event: OpenAI.Responses.ResponseStreamEvent) => Promise<void>;
|
|
283
|
+
}) => Promise<void>;
|
|
284
|
+
getOpenaiAssistant?: ((args?: {
|
|
285
|
+
select?: {
|
|
286
|
+
id?: boolean;
|
|
287
|
+
};
|
|
288
|
+
}) => Promise<OpenAI.Beta.Assistants.Assistant> | OpenAI.Beta.Assistants.Assistant | Pick<OpenAI.Beta.Assistants.Assistant, "id"> | Promise<Pick<OpenAI.Beta.Assistants.Assistant, "id">>) | undefined;
|
|
288
289
|
type: "responses-azure";
|
|
289
|
-
handleRun: ({ requestBody, onEvent, }: HandleArgs$3) => Promise<void>;
|
|
290
290
|
};
|
|
291
291
|
|
|
292
292
|
/**
|
|
@@ -304,14 +304,14 @@ type ResponsesRunEvent$2 = {
|
|
|
304
304
|
[key: string]: any;
|
|
305
305
|
};
|
|
306
306
|
type HandleArgs$2 = {
|
|
307
|
-
|
|
307
|
+
body: ResponsesRunBody;
|
|
308
308
|
onEvent: (event: ResponsesRunEvent$2) => Promise<void>;
|
|
309
309
|
};
|
|
310
310
|
declare const anthropicRunAdapter: ({ anthropic, }: {
|
|
311
311
|
anthropic: Anthropic;
|
|
312
312
|
}) => {
|
|
313
313
|
type: "responses-anthropic";
|
|
314
|
-
handleRun: ({ requestBody, onEvent, }: HandleArgs$2) => Promise<void>;
|
|
314
|
+
handleRun: ({ body: requestBody, onEvent, }: HandleArgs$2) => Promise<void>;
|
|
315
315
|
};
|
|
316
316
|
|
|
317
317
|
/**
|
|
@@ -328,7 +328,7 @@ type ResponsesRunEvent$1 = {
|
|
|
328
328
|
[key: string]: any;
|
|
329
329
|
};
|
|
330
330
|
type HandleArgs$1 = {
|
|
331
|
-
|
|
331
|
+
body: ResponsesRunBody;
|
|
332
332
|
onEvent: (event: ResponsesRunEvent$1) => Promise<void>;
|
|
333
333
|
agentId?: string;
|
|
334
334
|
threadId?: string;
|
|
@@ -337,7 +337,7 @@ declare const azureAgentsResponsesRunAdapter: ({ azureAiProject, }: {
|
|
|
337
337
|
azureAiProject: AIProjectClient;
|
|
338
338
|
}) => {
|
|
339
339
|
type: "responses-azure-agents";
|
|
340
|
-
handleRun: ({ requestBody, onEvent, agentId: existingAgentId, threadId: existingThreadId, }: HandleArgs$1) => Promise<void>;
|
|
340
|
+
handleRun: ({ body: requestBody, onEvent, agentId: existingAgentId, threadId: existingThreadId, }: HandleArgs$1) => Promise<void>;
|
|
341
341
|
};
|
|
342
342
|
|
|
343
343
|
/**
|
|
@@ -354,14 +354,14 @@ type ResponsesRunEvent = {
|
|
|
354
354
|
[key: string]: any;
|
|
355
355
|
};
|
|
356
356
|
type HandleArgs = {
|
|
357
|
-
|
|
357
|
+
body: ResponsesRunBody;
|
|
358
358
|
onEvent: (event: ResponsesRunEvent) => Promise<void>;
|
|
359
359
|
};
|
|
360
360
|
declare const geminiRunAdapter: ({ google, }: {
|
|
361
361
|
google: GoogleGenAI;
|
|
362
362
|
}) => {
|
|
363
363
|
type: "responses-gemini";
|
|
364
|
-
handleRun: ({ requestBody, onEvent, }: HandleArgs) => Promise<void>;
|
|
364
|
+
handleRun: ({ body: requestBody, onEvent, }: HandleArgs) => Promise<void>;
|
|
365
365
|
};
|
|
366
366
|
|
|
367
367
|
declare const prismaStorageAdapter: ({ prisma, }: {
|
|
@@ -397,7 +397,7 @@ type MethodHandlers$1 = {
|
|
|
397
397
|
type ResponsesStorageAdapterArgs = StorageAdapterArgs & {
|
|
398
398
|
runAdapter: RunAdapterWithAssistant;
|
|
399
399
|
};
|
|
400
|
-
declare const
|
|
400
|
+
declare const openaiResponsesStorageAdapter: ({ deferItemCreationUntilRun, }?: {
|
|
401
401
|
deferItemCreationUntilRun?: boolean;
|
|
402
402
|
}) => ((args: ResponsesStorageAdapterArgs) => {
|
|
403
403
|
requestHandlers: Record<string, MethodHandlers$1>;
|
|
@@ -495,7 +495,7 @@ type AzureResponsesStorageAdapterArgs = StorageAdapterArgs & {
|
|
|
495
495
|
* const client = supercompat({
|
|
496
496
|
* client: azureAiProjectClientAdapter({ azureAiProject }),
|
|
497
497
|
* storage: azureResponsesStorageAdapter(),
|
|
498
|
-
* runAdapter:
|
|
498
|
+
* runAdapter: azureResponsesRunAdapter({ getOpenaiAssistant: () => assistant }),
|
|
499
499
|
* })
|
|
500
500
|
* ```
|
|
501
501
|
*/
|
|
@@ -544,4 +544,4 @@ declare const serializeCompatComputerCall: ({ item, }: {
|
|
|
544
544
|
};
|
|
545
545
|
};
|
|
546
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,
|
|
547
|
+
export { anthropicClientAdapter, anthropicRunAdapter, azureAgentsResponsesRunAdapter, azureAgentsRunAdapter, azureAgentsStorageAdapter, azureAiProjectClientAdapter, azureOpenaiClientAdapter, azureResponsesRunAdapter, azureResponsesStorageAdapter, completionsRunAdapter, geminiRunAdapter, getComputerCallActions, googleClientAdapter, groqClientAdapter, humirisClientAdapter, isOpenaiComputerUseModel, memoryStorageAdapter, mistralClientAdapter, ollamaClientAdapter, openRouterClientAdapter, openaiClientAdapter, openaiResponsesRunAdapter, openaiResponsesStorageAdapter, perplexityAgentRunAdapter, perplexityClientAdapter, prismaStorageAdapter, serializeCompatComputerCall, serializeComputerUseTool, togetherClientAdapter };
|