modelfusion 0.65.0 → 0.65.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/model-provider/openai/chat/OpenAIChatModel.cjs +4 -4
- package/model-provider/openai/chat/OpenAIChatModel.d.ts +11 -11
- package/model-provider/openai/chat/OpenAIChatModel.js +4 -4
- package/model-provider/openai/chat/OpenAIChatStreamIterable.cjs +3 -2
- package/model-provider/openai/chat/OpenAIChatStreamIterable.js +3 -2
- package/package.json +1 -1
@@ -388,10 +388,6 @@ class OpenAIChatModel extends AbstractModel_js_1.AbstractModel {
|
|
388
388
|
exports.OpenAIChatModel = OpenAIChatModel;
|
389
389
|
const openAIChatResponseSchema = zod_1.z.object({
|
390
390
|
id: zod_1.z.string(),
|
391
|
-
object: zod_1.z.literal("chat.completion"),
|
392
|
-
created: zod_1.z.number(),
|
393
|
-
model: zod_1.z.string(),
|
394
|
-
system_fingerprint: zod_1.z.string(),
|
395
391
|
choices: zod_1.z.array(zod_1.z.object({
|
396
392
|
message: zod_1.z.object({
|
397
393
|
role: zod_1.z.literal("assistant"),
|
@@ -413,6 +409,10 @@ const openAIChatResponseSchema = zod_1.z.object({
|
|
413
409
|
"function_call",
|
414
410
|
]),
|
415
411
|
})),
|
412
|
+
created: zod_1.z.number(),
|
413
|
+
model: zod_1.z.string(),
|
414
|
+
system_fingerprint: zod_1.z.string().optional(),
|
415
|
+
object: zod_1.z.literal("chat.completion"),
|
416
416
|
usage: zod_1.z.object({
|
417
417
|
prompt_tokens: zod_1.z.number(),
|
418
418
|
completion_tokens: zod_1.z.number(),
|
@@ -198,7 +198,7 @@ export declare class OpenAIChatModel extends AbstractModel<OpenAIChatSettings> i
|
|
198
198
|
logprobs?: any;
|
199
199
|
}[];
|
200
200
|
created: number;
|
201
|
-
system_fingerprint
|
201
|
+
system_fingerprint?: string | undefined;
|
202
202
|
};
|
203
203
|
text: string;
|
204
204
|
usage: {
|
@@ -239,7 +239,7 @@ export declare class OpenAIChatModel extends AbstractModel<OpenAIChatSettings> i
|
|
239
239
|
logprobs?: any;
|
240
240
|
}[];
|
241
241
|
created: number;
|
242
|
-
system_fingerprint
|
242
|
+
system_fingerprint?: string | undefined;
|
243
243
|
};
|
244
244
|
valueText: string;
|
245
245
|
value: any;
|
@@ -274,7 +274,7 @@ export declare class OpenAIChatModel extends AbstractModel<OpenAIChatSettings> i
|
|
274
274
|
logprobs?: any;
|
275
275
|
}[];
|
276
276
|
created: number;
|
277
|
-
system_fingerprint
|
277
|
+
system_fingerprint?: string | undefined;
|
278
278
|
};
|
279
279
|
structureAndText: {
|
280
280
|
structure: null;
|
@@ -311,7 +311,7 @@ export declare class OpenAIChatModel extends AbstractModel<OpenAIChatSettings> i
|
|
311
311
|
logprobs?: any;
|
312
312
|
}[];
|
313
313
|
created: number;
|
314
|
-
system_fingerprint
|
314
|
+
system_fingerprint?: string | undefined;
|
315
315
|
};
|
316
316
|
structureAndText: {
|
317
317
|
structure: string;
|
@@ -343,10 +343,6 @@ export declare class OpenAIChatModel extends AbstractModel<OpenAIChatSettings> i
|
|
343
343
|
}
|
344
344
|
declare const openAIChatResponseSchema: z.ZodObject<{
|
345
345
|
id: z.ZodString;
|
346
|
-
object: z.ZodLiteral<"chat.completion">;
|
347
|
-
created: z.ZodNumber;
|
348
|
-
model: z.ZodString;
|
349
|
-
system_fingerprint: z.ZodString;
|
350
346
|
choices: z.ZodArray<z.ZodObject<{
|
351
347
|
message: z.ZodObject<{
|
352
348
|
role: z.ZodLiteral<"assistant">;
|
@@ -404,6 +400,10 @@ declare const openAIChatResponseSchema: z.ZodObject<{
|
|
404
400
|
index: number;
|
405
401
|
logprobs?: any;
|
406
402
|
}>, "many">;
|
403
|
+
created: z.ZodNumber;
|
404
|
+
model: z.ZodString;
|
405
|
+
system_fingerprint: z.ZodOptional<z.ZodString>;
|
406
|
+
object: z.ZodLiteral<"chat.completion">;
|
407
407
|
usage: z.ZodObject<{
|
408
408
|
prompt_tokens: z.ZodNumber;
|
409
409
|
completion_tokens: z.ZodNumber;
|
@@ -440,7 +440,7 @@ declare const openAIChatResponseSchema: z.ZodObject<{
|
|
440
440
|
logprobs?: any;
|
441
441
|
}[];
|
442
442
|
created: number;
|
443
|
-
system_fingerprint
|
443
|
+
system_fingerprint?: string | undefined;
|
444
444
|
}, {
|
445
445
|
object: "chat.completion";
|
446
446
|
usage: {
|
@@ -464,7 +464,7 @@ declare const openAIChatResponseSchema: z.ZodObject<{
|
|
464
464
|
logprobs?: any;
|
465
465
|
}[];
|
466
466
|
created: number;
|
467
|
-
system_fingerprint
|
467
|
+
system_fingerprint?: string | undefined;
|
468
468
|
}>;
|
469
469
|
export type OpenAIChatResponse = z.infer<typeof openAIChatResponseSchema>;
|
470
470
|
export type OpenAIChatResponseFormatType<T> = {
|
@@ -500,7 +500,7 @@ export declare const OpenAIChatResponseFormat: {
|
|
500
500
|
logprobs?: any;
|
501
501
|
}[];
|
502
502
|
created: number;
|
503
|
-
system_fingerprint
|
503
|
+
system_fingerprint?: string | undefined;
|
504
504
|
}>;
|
505
505
|
};
|
506
506
|
/**
|
@@ -378,10 +378,6 @@ export class OpenAIChatModel extends AbstractModel {
|
|
378
378
|
}
|
379
379
|
const openAIChatResponseSchema = z.object({
|
380
380
|
id: z.string(),
|
381
|
-
object: z.literal("chat.completion"),
|
382
|
-
created: z.number(),
|
383
|
-
model: z.string(),
|
384
|
-
system_fingerprint: z.string(),
|
385
381
|
choices: z.array(z.object({
|
386
382
|
message: z.object({
|
387
383
|
role: z.literal("assistant"),
|
@@ -403,6 +399,10 @@ const openAIChatResponseSchema = z.object({
|
|
403
399
|
"function_call",
|
404
400
|
]),
|
405
401
|
})),
|
402
|
+
created: z.number(),
|
403
|
+
model: z.string(),
|
404
|
+
system_fingerprint: z.string().optional(),
|
405
|
+
object: z.literal("chat.completion"),
|
406
406
|
usage: z.object({
|
407
407
|
prompt_tokens: z.number(),
|
408
408
|
completion_tokens: z.number(),
|
@@ -6,6 +6,7 @@ const AsyncQueue_js_1 = require("../../../util/AsyncQueue.cjs");
|
|
6
6
|
const parseEventSourceStream_js_1 = require("../../../util/streaming/parseEventSourceStream.cjs");
|
7
7
|
const parseJSON_js_1 = require("../../../util/parseJSON.cjs");
|
8
8
|
const chatResponseStreamEventSchema = zod_1.z.object({
|
9
|
+
id: zod_1.z.string(),
|
9
10
|
choices: zod_1.z.array(zod_1.z.object({
|
10
11
|
delta: zod_1.z.object({
|
11
12
|
role: zod_1.z.enum(["assistant", "user"]).optional(),
|
@@ -30,9 +31,9 @@ const chatResponseStreamEventSchema = zod_1.z.object({
|
|
30
31
|
index: zod_1.z.number(),
|
31
32
|
})),
|
32
33
|
created: zod_1.z.number(),
|
33
|
-
id: zod_1.z.string(),
|
34
34
|
model: zod_1.z.string(),
|
35
|
-
|
35
|
+
system_fingerprint: zod_1.z.string().optional(),
|
36
|
+
object: zod_1.z.literal("chat.completion.chunk"),
|
36
37
|
});
|
37
38
|
async function createOpenAIChatDeltaIterableQueue(stream, extractDeltaValue) {
|
38
39
|
const queue = new AsyncQueue_js_1.AsyncQueue();
|
@@ -3,6 +3,7 @@ import { AsyncQueue } from "../../../util/AsyncQueue.js";
|
|
3
3
|
import { parseEventSourceStream } from "../../../util/streaming/parseEventSourceStream.js";
|
4
4
|
import { safeParseJsonWithZod } from "../../../util/parseJSON.js";
|
5
5
|
const chatResponseStreamEventSchema = z.object({
|
6
|
+
id: z.string(),
|
6
7
|
choices: z.array(z.object({
|
7
8
|
delta: z.object({
|
8
9
|
role: z.enum(["assistant", "user"]).optional(),
|
@@ -27,9 +28,9 @@ const chatResponseStreamEventSchema = z.object({
|
|
27
28
|
index: z.number(),
|
28
29
|
})),
|
29
30
|
created: z.number(),
|
30
|
-
id: z.string(),
|
31
31
|
model: z.string(),
|
32
|
-
|
32
|
+
system_fingerprint: z.string().optional(),
|
33
|
+
object: z.literal("chat.completion.chunk"),
|
33
34
|
});
|
34
35
|
export async function createOpenAIChatDeltaIterableQueue(stream, extractDeltaValue) {
|
35
36
|
const queue = new AsyncQueue();
|
package/package.json
CHANGED