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.
Files changed (61) hide show
  1. package/README.md +55 -4
  2. package/guard/fixStructure.cjs +21 -0
  3. package/guard/fixStructure.d.ts +10 -0
  4. package/guard/fixStructure.js +17 -0
  5. package/guard/guard.cjs +69 -0
  6. package/guard/guard.d.ts +28 -0
  7. package/guard/guard.js +65 -0
  8. package/guard/index.cjs +18 -0
  9. package/guard/index.d.ts +2 -0
  10. package/guard/index.js +2 -0
  11. package/index.cjs +1 -0
  12. package/index.d.ts +1 -0
  13. package/index.js +1 -0
  14. package/model-function/generate-structure/StructureFromTextGenerationModel.cjs +15 -4
  15. package/model-function/generate-structure/StructureFromTextGenerationModel.d.ts +2 -1
  16. package/model-function/generate-structure/StructureFromTextGenerationModel.js +15 -4
  17. package/model-function/generate-structure/StructureGenerationModel.d.ts +2 -1
  18. package/model-function/generate-structure/StructureOrTextGenerationModel.d.ts +2 -0
  19. package/model-function/generate-structure/StructureParseError.cjs +34 -0
  20. package/model-function/generate-structure/StructureParseError.d.ts +10 -0
  21. package/model-function/generate-structure/StructureParseError.js +30 -0
  22. package/model-function/generate-structure/StructureValidationError.cjs +10 -3
  23. package/model-function/generate-structure/StructureValidationError.d.ts +3 -1
  24. package/model-function/generate-structure/StructureValidationError.js +10 -3
  25. package/model-function/generate-structure/generateStructure.cjs +2 -1
  26. package/model-function/generate-structure/generateStructure.js +2 -1
  27. package/model-function/generate-structure/generateStructureOrText.cjs +1 -0
  28. package/model-function/generate-structure/generateStructureOrText.js +1 -0
  29. package/model-function/generate-text/TextGenerationModel.d.ts +2 -4
  30. package/model-function/index.cjs +1 -0
  31. package/model-function/index.d.ts +1 -0
  32. package/model-function/index.js +1 -0
  33. package/model-provider/anthropic/AnthropicApiConfiguration.cjs +23 -0
  34. package/model-provider/anthropic/AnthropicApiConfiguration.d.ts +11 -0
  35. package/model-provider/anthropic/AnthropicApiConfiguration.js +19 -0
  36. package/model-provider/anthropic/AnthropicError.cjs +39 -0
  37. package/model-provider/anthropic/AnthropicError.d.ts +37 -0
  38. package/model-provider/anthropic/AnthropicError.js +31 -0
  39. package/model-provider/anthropic/AnthropicPromptFormat.cjs +66 -0
  40. package/model-provider/anthropic/AnthropicPromptFormat.d.ts +11 -0
  41. package/model-provider/anthropic/AnthropicPromptFormat.js +61 -0
  42. package/model-provider/anthropic/AnthropicTextGenerationModel.cjs +226 -0
  43. package/model-provider/anthropic/AnthropicTextGenerationModel.d.ts +102 -0
  44. package/model-provider/anthropic/AnthropicTextGenerationModel.js +219 -0
  45. package/model-provider/anthropic/index.cjs +23 -0
  46. package/model-provider/anthropic/index.d.ts +4 -0
  47. package/model-provider/anthropic/index.js +4 -0
  48. package/model-provider/huggingface/HuggingFaceTextGenerationModel.d.ts +1 -1
  49. package/model-provider/index.cjs +1 -0
  50. package/model-provider/index.d.ts +1 -0
  51. package/model-provider/index.js +1 -0
  52. package/model-provider/llamacpp/LlamaCppTextGenerationModel.cjs +0 -3
  53. package/model-provider/llamacpp/LlamaCppTextGenerationModel.d.ts +0 -1
  54. package/model-provider/llamacpp/LlamaCppTextGenerationModel.js +0 -3
  55. package/model-provider/openai/chat/OpenAIChatModel.cjs +47 -20
  56. package/model-provider/openai/chat/OpenAIChatModel.d.ts +36 -2
  57. package/model-provider/openai/chat/OpenAIChatModel.js +47 -20
  58. package/package.json +1 -1
  59. package/prompt/PromptFormatTextGenerationModel.cjs +3 -3
  60. package/prompt/PromptFormatTextGenerationModel.d.ts +1 -1
  61. 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),