modelfusion 0.67.0 → 0.68.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/browser/invokeFlow.cjs +1 -1
- package/browser/invokeFlow.js +1 -1
- package/browser/readEventSource.cjs +2 -2
- package/browser/readEventSource.d.ts +1 -1
- package/browser/readEventSource.js +2 -2
- package/browser/readEventSourceStream.cjs +2 -2
- package/browser/readEventSourceStream.d.ts +1 -1
- package/browser/readEventSourceStream.js +2 -2
- package/core/index.cjs +1 -1
- package/core/index.d.ts +1 -1
- package/core/index.js +1 -1
- package/{util → core/schema}/JSONParseError.cjs +6 -6
- package/{util → core/schema}/JSONParseError.d.ts +3 -3
- package/{util → core/schema}/JSONParseError.js +6 -6
- package/core/{structure → schema}/ZodStructureDefinition.cjs +1 -1
- package/core/{structure → schema}/ZodStructureDefinition.d.ts +1 -1
- package/core/{structure → schema}/ZodStructureDefinition.js +1 -1
- package/core/{structure → schema}/index.cjs +2 -0
- package/core/{structure → schema}/index.d.ts +2 -0
- package/core/{structure → schema}/index.js +2 -0
- package/core/schema/parseJSON.cjs +56 -0
- package/core/schema/parseJSON.d.ts +58 -0
- package/core/schema/parseJSON.js +48 -0
- package/model-function/generate-structure/StructureFromTextGenerationModel.d.ts +1 -1
- package/model-function/generate-structure/StructureGenerationModel.d.ts +1 -1
- package/model-function/generate-structure/StructureOrTextGenerationModel.d.ts +1 -1
- package/model-function/generate-structure/generateStructure.d.ts +1 -1
- package/model-function/generate-structure/generateStructureOrText.d.ts +1 -1
- package/model-function/generate-structure/streamStructure.d.ts +1 -1
- package/model-provider/anthropic/AnthropicError.cjs +8 -4
- package/model-provider/anthropic/AnthropicError.d.ts +3 -19
- package/model-provider/anthropic/AnthropicError.js +8 -4
- package/model-provider/anthropic/AnthropicTextGenerationModel.cjs +8 -4
- package/model-provider/anthropic/AnthropicTextGenerationModel.js +8 -4
- package/model-provider/automatic1111/Automatic1111Error.cjs +8 -4
- package/model-provider/automatic1111/Automatic1111Error.d.ts +3 -13
- package/model-provider/automatic1111/Automatic1111Error.js +8 -4
- package/model-provider/cohere/CohereError.cjs +8 -4
- package/model-provider/cohere/CohereError.d.ts +3 -7
- package/model-provider/cohere/CohereError.js +8 -4
- package/model-provider/cohere/CohereTextGenerationModel.cjs +3 -2
- package/model-provider/cohere/CohereTextGenerationModel.js +3 -2
- package/model-provider/elevenlabs/ElevenLabsSpeechModel.cjs +28 -24
- package/model-provider/elevenlabs/ElevenLabsSpeechModel.d.ts +1 -1
- package/model-provider/elevenlabs/ElevenLabsSpeechModel.js +28 -24
- package/model-provider/huggingface/HuggingFaceError.cjs +8 -4
- package/model-provider/huggingface/HuggingFaceError.d.ts +3 -7
- package/model-provider/huggingface/HuggingFaceError.js +8 -4
- package/model-provider/llamacpp/LlamaCppError.cjs +8 -4
- package/model-provider/llamacpp/LlamaCppError.d.ts +3 -7
- package/model-provider/llamacpp/LlamaCppError.js +8 -4
- package/model-provider/llamacpp/LlamaCppTextGenerationModel.cjs +10 -6
- package/model-provider/llamacpp/LlamaCppTextGenerationModel.js +10 -6
- package/model-provider/ollama/OllamaTextGenerationModel.cjs +3 -2
- package/model-provider/ollama/OllamaTextGenerationModel.js +3 -2
- package/model-provider/openai/OpenAICompletionModel.cjs +8 -4
- package/model-provider/openai/OpenAICompletionModel.js +8 -4
- package/model-provider/openai/OpenAIError.cjs +8 -4
- package/model-provider/openai/OpenAIError.d.ts +3 -27
- package/model-provider/openai/OpenAIError.js +8 -4
- package/model-provider/openai/chat/OpenAIChatModel.d.ts +1 -1
- package/model-provider/openai/chat/OpenAIChatStreamIterable.cjs +8 -4
- package/model-provider/openai/chat/OpenAIChatStreamIterable.js +8 -4
- package/model-provider/stability/StabilityError.cjs +8 -4
- package/model-provider/stability/StabilityError.d.ts +3 -7
- package/model-provider/stability/StabilityError.js +8 -4
- package/package.json +1 -1
- package/tool/Tool.d.ts +3 -3
- package/tool/WebSearchTool.cjs +1 -1
- package/tool/WebSearchTool.d.ts +1 -1
- package/tool/WebSearchTool.js +1 -1
- package/util/index.cjs +0 -2
- package/util/index.d.ts +0 -2
- package/util/index.js +0 -2
- package/util/streaming/parseJsonStream.cjs +2 -2
- package/util/streaming/parseJsonStream.d.ts +2 -1
- package/util/streaming/parseJsonStream.js +2 -2
- package/vector-index/memory/MemoryVectorIndex.cjs +5 -4
- package/vector-index/memory/MemoryVectorIndex.d.ts +1 -1
- package/vector-index/memory/MemoryVectorIndex.js +5 -4
- package/util/parseJSON.cjs +0 -67
- package/util/parseJSON.d.ts +0 -18
- package/util/parseJSON.js +0 -58
- /package/core/{structure → schema}/JsonSchemaProducer.cjs +0 -0
- /package/core/{structure → schema}/JsonSchemaProducer.d.ts +0 -0
- /package/core/{structure → schema}/JsonSchemaProducer.js +0 -0
- /package/core/{structure → schema}/Schema.cjs +0 -0
- /package/core/{structure → schema}/Schema.d.ts +0 -0
- /package/core/{structure → schema}/Schema.js +0 -0
- /package/core/{structure → schema}/StructureDefinition.cjs +0 -0
- /package/core/{structure → schema}/StructureDefinition.d.ts +0 -0
- /package/core/{structure → schema}/StructureDefinition.js +0 -0
- /package/core/{structure → schema}/UncheckedSchema.cjs +0 -0
- /package/core/{structure → schema}/UncheckedSchema.d.ts +0 -0
- /package/core/{structure → schema}/UncheckedSchema.js +0 -0
- /package/core/{structure → schema}/UncheckedStructureDefinition.cjs +0 -0
- /package/core/{structure → schema}/UncheckedStructureDefinition.d.ts +0 -0
- /package/core/{structure → schema}/UncheckedStructureDefinition.js +0 -0
- /package/core/{structure → schema}/ZodSchema.cjs +0 -0
- /package/core/{structure → schema}/ZodSchema.d.ts +0 -0
- /package/core/{structure → schema}/ZodSchema.js +0 -0
package/util/parseJSON.cjs
DELETED
@@ -1,67 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
-
};
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
exports.safeParseJsonWithSchema = exports.safeParseJsonWithZod = exports.parseJsonWithZod = void 0;
|
7
|
-
const secure_json_parse_1 = __importDefault(require("secure-json-parse"));
|
8
|
-
const JSONParseError_js_1 = require("./JSONParseError.cjs");
|
9
|
-
function parseJsonWithZod(json, schema) {
|
10
|
-
try {
|
11
|
-
const parsedJson = secure_json_parse_1.default.parse(json);
|
12
|
-
return schema.parse(parsedJson);
|
13
|
-
}
|
14
|
-
catch (error) {
|
15
|
-
throw new JSONParseError_js_1.JSONParseError({
|
16
|
-
valueText: json,
|
17
|
-
cause: error,
|
18
|
-
});
|
19
|
-
}
|
20
|
-
}
|
21
|
-
exports.parseJsonWithZod = parseJsonWithZod;
|
22
|
-
function safeParseJsonWithZod(json, schema) {
|
23
|
-
try {
|
24
|
-
const parsedJson = secure_json_parse_1.default.parse(json);
|
25
|
-
const validationResult = schema.safeParse(parsedJson);
|
26
|
-
if (validationResult.success) {
|
27
|
-
return validationResult;
|
28
|
-
}
|
29
|
-
return {
|
30
|
-
success: false,
|
31
|
-
error: new JSONParseError_js_1.JSONParseError({
|
32
|
-
valueText: json,
|
33
|
-
cause: validationResult.error,
|
34
|
-
}),
|
35
|
-
};
|
36
|
-
}
|
37
|
-
catch (error) {
|
38
|
-
throw new JSONParseError_js_1.JSONParseError({
|
39
|
-
valueText: json,
|
40
|
-
cause: error,
|
41
|
-
});
|
42
|
-
}
|
43
|
-
}
|
44
|
-
exports.safeParseJsonWithZod = safeParseJsonWithZod;
|
45
|
-
function safeParseJsonWithSchema(json, schema) {
|
46
|
-
try {
|
47
|
-
const parsedJson = secure_json_parse_1.default.parse(json);
|
48
|
-
const validationResult = schema.validate(parsedJson);
|
49
|
-
if (validationResult.success) {
|
50
|
-
return validationResult;
|
51
|
-
}
|
52
|
-
return {
|
53
|
-
success: false,
|
54
|
-
error: new JSONParseError_js_1.JSONParseError({
|
55
|
-
valueText: json,
|
56
|
-
cause: validationResult.error,
|
57
|
-
}),
|
58
|
-
};
|
59
|
-
}
|
60
|
-
catch (error) {
|
61
|
-
throw new JSONParseError_js_1.JSONParseError({
|
62
|
-
valueText: json,
|
63
|
-
cause: error,
|
64
|
-
});
|
65
|
-
}
|
66
|
-
}
|
67
|
-
exports.safeParseJsonWithSchema = safeParseJsonWithSchema;
|
package/util/parseJSON.d.ts
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
import { z } from "zod";
|
2
|
-
import { Schema } from "../core/structure/Schema.js";
|
3
|
-
import { JSONParseError } from "./JSONParseError.js";
|
4
|
-
export declare function parseJsonWithZod<T>(json: string, schema: z.Schema<T>): T;
|
5
|
-
export declare function safeParseJsonWithZod<T>(json: string, schema: z.Schema<T>): {
|
6
|
-
success: true;
|
7
|
-
data: T;
|
8
|
-
} | {
|
9
|
-
success: false;
|
10
|
-
error: JSONParseError;
|
11
|
-
};
|
12
|
-
export declare function safeParseJsonWithSchema<T>(json: string, schema: Schema<T>): {
|
13
|
-
success: true;
|
14
|
-
data: T;
|
15
|
-
} | {
|
16
|
-
success: false;
|
17
|
-
error: JSONParseError;
|
18
|
-
};
|
package/util/parseJSON.js
DELETED
@@ -1,58 +0,0 @@
|
|
1
|
-
import SecureJSON from "secure-json-parse";
|
2
|
-
import { JSONParseError } from "./JSONParseError.js";
|
3
|
-
export function parseJsonWithZod(json, schema) {
|
4
|
-
try {
|
5
|
-
const parsedJson = SecureJSON.parse(json);
|
6
|
-
return schema.parse(parsedJson);
|
7
|
-
}
|
8
|
-
catch (error) {
|
9
|
-
throw new JSONParseError({
|
10
|
-
valueText: json,
|
11
|
-
cause: error,
|
12
|
-
});
|
13
|
-
}
|
14
|
-
}
|
15
|
-
export function safeParseJsonWithZod(json, schema) {
|
16
|
-
try {
|
17
|
-
const parsedJson = SecureJSON.parse(json);
|
18
|
-
const validationResult = schema.safeParse(parsedJson);
|
19
|
-
if (validationResult.success) {
|
20
|
-
return validationResult;
|
21
|
-
}
|
22
|
-
return {
|
23
|
-
success: false,
|
24
|
-
error: new JSONParseError({
|
25
|
-
valueText: json,
|
26
|
-
cause: validationResult.error,
|
27
|
-
}),
|
28
|
-
};
|
29
|
-
}
|
30
|
-
catch (error) {
|
31
|
-
throw new JSONParseError({
|
32
|
-
valueText: json,
|
33
|
-
cause: error,
|
34
|
-
});
|
35
|
-
}
|
36
|
-
}
|
37
|
-
export function safeParseJsonWithSchema(json, schema) {
|
38
|
-
try {
|
39
|
-
const parsedJson = SecureJSON.parse(json);
|
40
|
-
const validationResult = schema.validate(parsedJson);
|
41
|
-
if (validationResult.success) {
|
42
|
-
return validationResult;
|
43
|
-
}
|
44
|
-
return {
|
45
|
-
success: false,
|
46
|
-
error: new JSONParseError({
|
47
|
-
valueText: json,
|
48
|
-
cause: validationResult.error,
|
49
|
-
}),
|
50
|
-
};
|
51
|
-
}
|
52
|
-
catch (error) {
|
53
|
-
throw new JSONParseError({
|
54
|
-
valueText: json,
|
55
|
-
cause: error,
|
56
|
-
});
|
57
|
-
}
|
58
|
-
}
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|