@zenning/openai 1.4.6 → 1.4.7
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.js +54 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +54 -0
- package/dist/index.mjs.map +1 -1
- package/internal/dist/index.js +54 -0
- package/internal/dist/index.js.map +1 -1
- package/internal/dist/index.mjs +54 -0
- package/internal/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2967,6 +2967,14 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
2967
2967
|
stack: error instanceof Error ? error.stack : void 0
|
|
2968
2968
|
});
|
|
2969
2969
|
}
|
|
2970
|
+
} else if (isResponseInProgressChunk(value)) {
|
|
2971
|
+
console.log("\u23F3 Response in progress (ignored):", value.type);
|
|
2972
|
+
} else if (isResponseContentPartAddedChunk(value)) {
|
|
2973
|
+
console.log("\u{1F4DD} Content part added (ignored):", value.type);
|
|
2974
|
+
} else if (isResponseOutputTextDoneChunk(value)) {
|
|
2975
|
+
console.log("\u2705 Output text done (ignored):", value.type);
|
|
2976
|
+
} else if (isResponseContentPartDoneChunk(value)) {
|
|
2977
|
+
console.log("\u2705 Content part done (ignored):", value.type);
|
|
2970
2978
|
} else {
|
|
2971
2979
|
console.log("\u2753 Unhandled chunk type:", value.type, JSON.stringify(value, null, 2));
|
|
2972
2980
|
}
|
|
@@ -3171,6 +3179,36 @@ var responseReasoningSummaryTextDeltaSchema = import_zod11.z.object({
|
|
|
3171
3179
|
summary_index: import_zod11.z.number(),
|
|
3172
3180
|
delta: import_zod11.z.string()
|
|
3173
3181
|
});
|
|
3182
|
+
var responseInProgressChunkSchema = import_zod11.z.object({
|
|
3183
|
+
type: import_zod11.z.literal("response.in_progress"),
|
|
3184
|
+
sequence_number: import_zod11.z.number(),
|
|
3185
|
+
response: import_zod11.z.any()
|
|
3186
|
+
});
|
|
3187
|
+
var responseContentPartAddedChunkSchema = import_zod11.z.object({
|
|
3188
|
+
type: import_zod11.z.literal("response.content_part.added"),
|
|
3189
|
+
sequence_number: import_zod11.z.number(),
|
|
3190
|
+
item_id: import_zod11.z.string(),
|
|
3191
|
+
output_index: import_zod11.z.number(),
|
|
3192
|
+
content_index: import_zod11.z.number(),
|
|
3193
|
+
part: import_zod11.z.any()
|
|
3194
|
+
});
|
|
3195
|
+
var responseOutputTextDoneChunkSchema = import_zod11.z.object({
|
|
3196
|
+
type: import_zod11.z.literal("response.output_text.done"),
|
|
3197
|
+
sequence_number: import_zod11.z.number(),
|
|
3198
|
+
item_id: import_zod11.z.string(),
|
|
3199
|
+
output_index: import_zod11.z.number(),
|
|
3200
|
+
content_index: import_zod11.z.number(),
|
|
3201
|
+
text: import_zod11.z.string(),
|
|
3202
|
+
logprobs: import_zod11.z.array(import_zod11.z.any()).optional()
|
|
3203
|
+
});
|
|
3204
|
+
var responseContentPartDoneChunkSchema = import_zod11.z.object({
|
|
3205
|
+
type: import_zod11.z.literal("response.content_part.done"),
|
|
3206
|
+
sequence_number: import_zod11.z.number(),
|
|
3207
|
+
item_id: import_zod11.z.string(),
|
|
3208
|
+
output_index: import_zod11.z.number(),
|
|
3209
|
+
content_index: import_zod11.z.number(),
|
|
3210
|
+
part: import_zod11.z.any()
|
|
3211
|
+
});
|
|
3174
3212
|
var openaiResponsesChunkSchema = import_zod11.z.union([
|
|
3175
3213
|
textDeltaChunkSchema,
|
|
3176
3214
|
responseFinishedChunkSchema,
|
|
@@ -3180,6 +3218,10 @@ var openaiResponsesChunkSchema = import_zod11.z.union([
|
|
|
3180
3218
|
responseOutputItemAddedSchema,
|
|
3181
3219
|
responseAnnotationAddedSchema,
|
|
3182
3220
|
responseReasoningSummaryTextDeltaSchema,
|
|
3221
|
+
responseInProgressChunkSchema,
|
|
3222
|
+
responseContentPartAddedChunkSchema,
|
|
3223
|
+
responseOutputTextDoneChunkSchema,
|
|
3224
|
+
responseContentPartDoneChunkSchema,
|
|
3183
3225
|
import_zod11.z.object({ type: import_zod11.z.string() }).passthrough()
|
|
3184
3226
|
// fallback for unknown chunks
|
|
3185
3227
|
]);
|
|
@@ -3207,6 +3249,18 @@ function isResponseAnnotationAddedChunk(chunk) {
|
|
|
3207
3249
|
function isResponseReasoningSummaryTextDeltaChunk(chunk) {
|
|
3208
3250
|
return chunk.type === "response.reasoning_summary_text.delta";
|
|
3209
3251
|
}
|
|
3252
|
+
function isResponseInProgressChunk(chunk) {
|
|
3253
|
+
return chunk.type === "response.in_progress";
|
|
3254
|
+
}
|
|
3255
|
+
function isResponseContentPartAddedChunk(chunk) {
|
|
3256
|
+
return chunk.type === "response.content_part.added";
|
|
3257
|
+
}
|
|
3258
|
+
function isResponseOutputTextDoneChunk(chunk) {
|
|
3259
|
+
return chunk.type === "response.output_text.done";
|
|
3260
|
+
}
|
|
3261
|
+
function isResponseContentPartDoneChunk(chunk) {
|
|
3262
|
+
return chunk.type === "response.content_part.done";
|
|
3263
|
+
}
|
|
3210
3264
|
function getResponsesModelConfig(modelId) {
|
|
3211
3265
|
if (modelId.startsWith("o")) {
|
|
3212
3266
|
if (modelId.startsWith("o1-mini") || modelId.startsWith("o1-preview")) {
|