modelfusion 0.41.3 → 0.43.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/README.md +55 -4
- package/guard/fixStructure.cjs +21 -0
- package/guard/fixStructure.d.ts +10 -0
- package/guard/fixStructure.js +17 -0
- package/guard/guard.cjs +69 -0
- package/guard/guard.d.ts +28 -0
- package/guard/guard.js +65 -0
- package/guard/index.cjs +18 -0
- package/guard/index.d.ts +2 -0
- package/guard/index.js +2 -0
- package/index.cjs +1 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/model-function/generate-structure/StructureFromTextGenerationModel.cjs +15 -4
- package/model-function/generate-structure/StructureFromTextGenerationModel.d.ts +2 -1
- package/model-function/generate-structure/StructureFromTextGenerationModel.js +15 -4
- package/model-function/generate-structure/StructureGenerationModel.d.ts +2 -1
- package/model-function/generate-structure/StructureOrTextGenerationModel.d.ts +2 -0
- package/model-function/generate-structure/StructureParseError.cjs +34 -0
- package/model-function/generate-structure/StructureParseError.d.ts +10 -0
- package/model-function/generate-structure/StructureParseError.js +30 -0
- package/model-function/generate-structure/StructureValidationError.cjs +10 -3
- package/model-function/generate-structure/StructureValidationError.d.ts +3 -1
- package/model-function/generate-structure/StructureValidationError.js +10 -3
- package/model-function/generate-structure/generateStructure.cjs +2 -1
- package/model-function/generate-structure/generateStructure.js +2 -1
- package/model-function/generate-structure/generateStructureOrText.cjs +1 -0
- package/model-function/generate-structure/generateStructureOrText.js +1 -0
- package/model-function/generate-text/TextGenerationModel.d.ts +2 -4
- package/model-function/index.cjs +1 -0
- package/model-function/index.d.ts +1 -0
- package/model-function/index.js +1 -0
- package/model-provider/anthropic/AnthropicApiConfiguration.cjs +23 -0
- package/model-provider/anthropic/AnthropicApiConfiguration.d.ts +11 -0
- package/model-provider/anthropic/AnthropicApiConfiguration.js +19 -0
- package/model-provider/anthropic/AnthropicError.cjs +39 -0
- package/model-provider/anthropic/AnthropicError.d.ts +37 -0
- package/model-provider/anthropic/AnthropicError.js +31 -0
- package/model-provider/anthropic/AnthropicPromptFormat.cjs +66 -0
- package/model-provider/anthropic/AnthropicPromptFormat.d.ts +11 -0
- package/model-provider/anthropic/AnthropicPromptFormat.js +61 -0
- package/model-provider/anthropic/AnthropicTextGenerationModel.cjs +226 -0
- package/model-provider/anthropic/AnthropicTextGenerationModel.d.ts +102 -0
- package/model-provider/anthropic/AnthropicTextGenerationModel.js +219 -0
- package/model-provider/anthropic/index.cjs +23 -0
- package/model-provider/anthropic/index.d.ts +4 -0
- package/model-provider/anthropic/index.js +4 -0
- package/model-provider/huggingface/HuggingFaceTextGenerationModel.d.ts +1 -1
- package/model-provider/index.cjs +1 -0
- package/model-provider/index.d.ts +1 -0
- package/model-provider/index.js +1 -0
- package/model-provider/llamacpp/LlamaCppTextGenerationModel.cjs +0 -3
- package/model-provider/llamacpp/LlamaCppTextGenerationModel.d.ts +0 -1
- package/model-provider/llamacpp/LlamaCppTextGenerationModel.js +0 -3
- package/model-provider/openai/chat/OpenAIChatModel.cjs +47 -20
- package/model-provider/openai/chat/OpenAIChatModel.d.ts +36 -2
- package/model-provider/openai/chat/OpenAIChatModel.js +47 -20
- package/package.json +1 -1
- package/prompt/PromptFormatTextGenerationModel.cjs +3 -3
- package/prompt/PromptFormatTextGenerationModel.d.ts +1 -1
- package/prompt/PromptFormatTextGenerationModel.js +3 -3
@@ -41,6 +41,9 @@ class PromptFormatTextGenerationModel {
|
|
41
41
|
const mappedPrompt = this.promptFormat.format(prompt);
|
42
42
|
return this.model.doGenerateText(mappedPrompt, options);
|
43
43
|
}
|
44
|
+
get settingsForEvent() {
|
45
|
+
return this.model.settingsForEvent;
|
46
|
+
}
|
44
47
|
withPromptFormat(promptFormat) {
|
45
48
|
return new PromptFormatTextGenerationModel({
|
46
49
|
model: this.withSettings({
|
@@ -52,9 +55,6 @@ class PromptFormatTextGenerationModel {
|
|
52
55
|
promptFormat,
|
53
56
|
});
|
54
57
|
}
|
55
|
-
get settingsForEvent() {
|
56
|
-
return this.model.settingsForEvent;
|
57
|
-
}
|
58
58
|
withSettings(additionalSettings) {
|
59
59
|
return new PromptFormatTextGenerationModel({
|
60
60
|
model: this.model.withSettings(additionalSettings),
|
@@ -22,7 +22,7 @@ export declare class PromptFormatTextGenerationModel<PROMPT, MODEL_PROMPT, SETTI
|
|
22
22
|
totalTokens: number;
|
23
23
|
} | undefined;
|
24
24
|
}>;
|
25
|
-
withPromptFormat<INPUT_PROMPT>(promptFormat: PromptFormat<INPUT_PROMPT, PROMPT>): PromptFormatTextGenerationModel<INPUT_PROMPT, PROMPT, SETTINGS, this>;
|
26
25
|
get settingsForEvent(): Partial<SETTINGS>;
|
26
|
+
withPromptFormat<INPUT_PROMPT>(promptFormat: PromptFormat<INPUT_PROMPT, PROMPT>): PromptFormatTextGenerationModel<INPUT_PROMPT, PROMPT, SETTINGS, this>;
|
27
27
|
withSettings(additionalSettings: Partial<SETTINGS>): this;
|
28
28
|
}
|
@@ -38,6 +38,9 @@ export class PromptFormatTextGenerationModel {
|
|
38
38
|
const mappedPrompt = this.promptFormat.format(prompt);
|
39
39
|
return this.model.doGenerateText(mappedPrompt, options);
|
40
40
|
}
|
41
|
+
get settingsForEvent() {
|
42
|
+
return this.model.settingsForEvent;
|
43
|
+
}
|
41
44
|
withPromptFormat(promptFormat) {
|
42
45
|
return new PromptFormatTextGenerationModel({
|
43
46
|
model: this.withSettings({
|
@@ -49,9 +52,6 @@ export class PromptFormatTextGenerationModel {
|
|
49
52
|
promptFormat,
|
50
53
|
});
|
51
54
|
}
|
52
|
-
get settingsForEvent() {
|
53
|
-
return this.model.settingsForEvent;
|
54
|
-
}
|
55
55
|
withSettings(additionalSettings) {
|
56
56
|
return new PromptFormatTextGenerationModel({
|
57
57
|
model: this.model.withSettings(additionalSettings),
|