@zenning/openai 1.4.1 → 1.4.3
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.d.mts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +24 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +24 -4
- package/dist/index.mjs.map +1 -1
- package/internal/dist/index.d.mts +3 -0
- package/internal/dist/index.d.ts +3 -0
- package/internal/dist/index.js +24 -4
- package/internal/dist/index.js.map +1 -1
- package/internal/dist/index.mjs +24 -4
- package/internal/dist/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -355,6 +355,7 @@ declare class OpenAIResponsesLanguageModel implements LanguageModelV1 {
|
|
|
355
355
|
declare const openaiResponsesProviderOptionsSchema: z.ZodObject<{
|
|
356
356
|
metadata: z.ZodOptional<z.ZodNullable<z.ZodAny>>;
|
|
357
357
|
parallelToolCalls: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
358
|
+
include: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
|
|
358
359
|
previousResponseId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
359
360
|
forceNoTemperature: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
360
361
|
store: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
@@ -369,6 +370,7 @@ declare const openaiResponsesProviderOptionsSchema: z.ZodObject<{
|
|
|
369
370
|
store?: boolean | null | undefined;
|
|
370
371
|
metadata?: any;
|
|
371
372
|
reasoningEffort?: string | null | undefined;
|
|
373
|
+
include?: string[] | null | undefined;
|
|
372
374
|
instructions?: string | null | undefined;
|
|
373
375
|
parallelToolCalls?: boolean | null | undefined;
|
|
374
376
|
previousResponseId?: string | null | undefined;
|
|
@@ -380,6 +382,7 @@ declare const openaiResponsesProviderOptionsSchema: z.ZodObject<{
|
|
|
380
382
|
store?: boolean | null | undefined;
|
|
381
383
|
metadata?: any;
|
|
382
384
|
reasoningEffort?: string | null | undefined;
|
|
385
|
+
include?: string[] | null | undefined;
|
|
383
386
|
instructions?: string | null | undefined;
|
|
384
387
|
parallelToolCalls?: boolean | null | undefined;
|
|
385
388
|
previousResponseId?: string | null | undefined;
|
package/internal/dist/index.d.ts
CHANGED
|
@@ -355,6 +355,7 @@ declare class OpenAIResponsesLanguageModel implements LanguageModelV1 {
|
|
|
355
355
|
declare const openaiResponsesProviderOptionsSchema: z.ZodObject<{
|
|
356
356
|
metadata: z.ZodOptional<z.ZodNullable<z.ZodAny>>;
|
|
357
357
|
parallelToolCalls: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
358
|
+
include: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
|
|
358
359
|
previousResponseId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
359
360
|
forceNoTemperature: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
360
361
|
store: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
@@ -369,6 +370,7 @@ declare const openaiResponsesProviderOptionsSchema: z.ZodObject<{
|
|
|
369
370
|
store?: boolean | null | undefined;
|
|
370
371
|
metadata?: any;
|
|
371
372
|
reasoningEffort?: string | null | undefined;
|
|
373
|
+
include?: string[] | null | undefined;
|
|
372
374
|
instructions?: string | null | undefined;
|
|
373
375
|
parallelToolCalls?: boolean | null | undefined;
|
|
374
376
|
previousResponseId?: string | null | undefined;
|
|
@@ -380,6 +382,7 @@ declare const openaiResponsesProviderOptionsSchema: z.ZodObject<{
|
|
|
380
382
|
store?: boolean | null | undefined;
|
|
381
383
|
metadata?: any;
|
|
382
384
|
reasoningEffort?: string | null | undefined;
|
|
385
|
+
include?: string[] | null | undefined;
|
|
383
386
|
instructions?: string | null | undefined;
|
|
384
387
|
parallelToolCalls?: boolean | null | undefined;
|
|
385
388
|
previousResponseId?: string | null | undefined;
|
package/internal/dist/index.js
CHANGED
|
@@ -2238,6 +2238,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
2238
2238
|
// provider options:
|
|
2239
2239
|
metadata: openaiOptions == null ? void 0 : openaiOptions.metadata,
|
|
2240
2240
|
parallel_tool_calls: openaiOptions == null ? void 0 : openaiOptions.parallelToolCalls,
|
|
2241
|
+
include: openaiOptions == null ? void 0 : openaiOptions.include,
|
|
2241
2242
|
previous_response_id: openaiOptions == null ? void 0 : openaiOptions.previousResponseId,
|
|
2242
2243
|
store: openaiOptions == null ? void 0 : openaiOptions.store,
|
|
2243
2244
|
user: openaiOptions == null ? void 0 : openaiOptions.user,
|
|
@@ -2257,7 +2258,6 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
2257
2258
|
truncation: "auto"
|
|
2258
2259
|
}
|
|
2259
2260
|
};
|
|
2260
|
-
console.log("baseArgs", JSON.stringify(baseArgs));
|
|
2261
2261
|
if (modelConfig.isReasoningModel) {
|
|
2262
2262
|
if (baseArgs.temperature != null) {
|
|
2263
2263
|
baseArgs.temperature = void 0;
|
|
@@ -2412,6 +2412,10 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
2412
2412
|
args: output.arguments
|
|
2413
2413
|
}));
|
|
2414
2414
|
const reasoningSummary = (_b = (_a = response.output.find((item) => item.type === "reasoning")) == null ? void 0 : _a.summary) != null ? _b : null;
|
|
2415
|
+
console.log(JSON.stringify({
|
|
2416
|
+
msg: "ai-sdk: content annotations",
|
|
2417
|
+
annotations: outputTextElements.flatMap((content) => content.annotations)
|
|
2418
|
+
}));
|
|
2415
2419
|
return {
|
|
2416
2420
|
text: outputTextElements.map((content) => content.text).join("\n"),
|
|
2417
2421
|
sources: outputTextElements.flatMap(
|
|
@@ -2566,13 +2570,23 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
2566
2570
|
cachedPromptTokens = (_c = (_b = value.response.usage.input_tokens_details) == null ? void 0 : _b.cached_tokens) != null ? _c : cachedPromptTokens;
|
|
2567
2571
|
reasoningTokens = (_e = (_d = value.response.usage.output_tokens_details) == null ? void 0 : _d.reasoning_tokens) != null ? _e : reasoningTokens;
|
|
2568
2572
|
} else if (isResponseAnnotationAddedChunk(value)) {
|
|
2573
|
+
console.log(JSON.stringify({
|
|
2574
|
+
msg: "ai-sdk: source (stream)",
|
|
2575
|
+
source: value.annotation
|
|
2576
|
+
}));
|
|
2569
2577
|
controller.enqueue({
|
|
2570
2578
|
type: "source",
|
|
2571
2579
|
source: {
|
|
2572
2580
|
sourceType: "url",
|
|
2573
2581
|
id: (_h = (_g = (_f = self.config).generateId) == null ? void 0 : _g.call(_f)) != null ? _h : (0, import_provider_utils10.generateId)(),
|
|
2574
|
-
|
|
2575
|
-
|
|
2582
|
+
file: value.annotation.type && value.annotation.type === "file_citation" ? {
|
|
2583
|
+
type: value.annotation.type,
|
|
2584
|
+
file_id: value.annotation.file_id,
|
|
2585
|
+
filename: value.annotation.filename,
|
|
2586
|
+
index: value.annotation.index
|
|
2587
|
+
} : void 0,
|
|
2588
|
+
url: value.annotation.type && value.annotation.type === "url_citation" ? value.annotation.url : void 0,
|
|
2589
|
+
title: value.annotation.type && value.annotation.type === "url_citation" ? value.annotation.title : void 0
|
|
2576
2590
|
}
|
|
2577
2591
|
});
|
|
2578
2592
|
}
|
|
@@ -2675,7 +2689,12 @@ var responseAnnotationAddedSchema = import_zod8.z.object({
|
|
|
2675
2689
|
type: import_zod8.z.literal("url_citation"),
|
|
2676
2690
|
url: import_zod8.z.string(),
|
|
2677
2691
|
title: import_zod8.z.string()
|
|
2678
|
-
})
|
|
2692
|
+
}).or(import_zod8.z.object({
|
|
2693
|
+
type: import_zod8.z.literal("file_citation"),
|
|
2694
|
+
file_id: import_zod8.z.string(),
|
|
2695
|
+
filename: import_zod8.z.string(),
|
|
2696
|
+
index: import_zod8.z.number()
|
|
2697
|
+
}))
|
|
2679
2698
|
});
|
|
2680
2699
|
var responseReasoningSummaryTextDeltaSchema = import_zod8.z.object({
|
|
2681
2700
|
type: import_zod8.z.literal("response.reasoning_summary_text.delta"),
|
|
@@ -2744,6 +2763,7 @@ function getResponsesModelConfig(modelId) {
|
|
|
2744
2763
|
var openaiResponsesProviderOptionsSchema = import_zod8.z.object({
|
|
2745
2764
|
metadata: import_zod8.z.any().nullish(),
|
|
2746
2765
|
parallelToolCalls: import_zod8.z.boolean().nullish(),
|
|
2766
|
+
include: import_zod8.z.array(import_zod8.z.string()).nullish(),
|
|
2747
2767
|
previousResponseId: import_zod8.z.string().nullish(),
|
|
2748
2768
|
forceNoTemperature: import_zod8.z.boolean().nullish(),
|
|
2749
2769
|
store: import_zod8.z.boolean().nullish(),
|