modelfusion 0.20.0 → 0.21.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 (131) hide show
  1. package/README.md +6 -8
  2. package/composed-function/summarize/SummarizationFunction.d.ts +3 -3
  3. package/model-function/Model.d.ts +5 -2
  4. package/model-function/ModelCallEvent.d.ts +3 -3
  5. package/model-function/ModelFunctionOptions.d.ts +4 -0
  6. package/model-function/SuccessfulModelCall.cjs +3 -15
  7. package/model-function/SuccessfulModelCall.d.ts +2 -2
  8. package/model-function/SuccessfulModelCall.js +3 -15
  9. package/model-function/embed-text/TextEmbeddingEvent.d.ts +6 -8
  10. package/model-function/embed-text/TextEmbeddingModel.d.ts +2 -2
  11. package/model-function/embed-text/embedText.cjs +16 -22
  12. package/model-function/embed-text/embedText.d.ts +3 -3
  13. package/model-function/embed-text/embedText.js +16 -22
  14. package/model-function/executeCall.cjs +30 -8
  15. package/model-function/executeCall.d.ts +16 -9
  16. package/model-function/executeCall.js +30 -8
  17. package/model-function/generate-image/ImageGenerationEvent.d.ts +6 -8
  18. package/model-function/generate-image/ImageGenerationModel.d.ts +2 -2
  19. package/model-function/generate-image/generateImage.cjs +8 -11
  20. package/model-function/generate-image/generateImage.d.ts +2 -2
  21. package/model-function/generate-image/generateImage.js +8 -11
  22. package/model-function/generate-json/GenerateJsonModel.d.ts +2 -2
  23. package/model-function/generate-json/GenerateJsonOrTextModel.d.ts +2 -2
  24. package/model-function/generate-json/JsonGenerationEvent.d.ts +6 -8
  25. package/model-function/generate-json/JsonTextGenerationModel.d.ts +2 -2
  26. package/model-function/generate-json/generateJson.cjs +8 -11
  27. package/model-function/generate-json/generateJson.d.ts +2 -2
  28. package/model-function/generate-json/generateJson.js +8 -11
  29. package/model-function/generate-json/generateJsonOrText.cjs +8 -11
  30. package/model-function/generate-json/generateJsonOrText.d.ts +2 -2
  31. package/model-function/generate-json/generateJsonOrText.js +8 -11
  32. package/model-function/generate-text/TextGenerationEvent.d.ts +6 -8
  33. package/model-function/generate-text/TextGenerationModel.d.ts +3 -3
  34. package/model-function/generate-text/TextStreamingEvent.d.ts +6 -8
  35. package/model-function/generate-text/generateText.cjs +8 -11
  36. package/model-function/generate-text/generateText.d.ts +2 -2
  37. package/model-function/generate-text/generateText.js +8 -11
  38. package/model-function/generate-text/streamText.cjs +38 -23
  39. package/model-function/generate-text/streamText.d.ts +5 -5
  40. package/model-function/generate-text/streamText.js +38 -23
  41. package/model-function/index.cjs +1 -1
  42. package/model-function/index.d.ts +1 -1
  43. package/model-function/index.js +1 -1
  44. package/model-function/synthesize-speech/SpeechSynthesisEvent.d.ts +6 -8
  45. package/model-function/synthesize-speech/SpeechSynthesisModel.d.ts +2 -2
  46. package/model-function/synthesize-speech/synthesizeSpeech.cjs +8 -10
  47. package/model-function/synthesize-speech/synthesizeSpeech.d.ts +2 -2
  48. package/model-function/synthesize-speech/synthesizeSpeech.js +8 -10
  49. package/model-function/transcribe-speech/TranscriptionEvent.d.ts +6 -8
  50. package/model-function/transcribe-speech/TranscriptionModel.d.ts +2 -2
  51. package/model-function/transcribe-speech/transcribe.cjs +8 -11
  52. package/model-function/transcribe-speech/transcribe.d.ts +2 -2
  53. package/model-function/transcribe-speech/transcribe.js +8 -11
  54. package/model-provider/automatic1111/Automatic1111ImageGenerationModel.d.ts +3 -3
  55. package/model-provider/cohere/CohereTextEmbeddingModel.d.ts +3 -3
  56. package/model-provider/cohere/CohereTextGenerationModel.d.ts +4 -4
  57. package/model-provider/elevenlabs/ElevenLabsSpeechSynthesisModel.d.ts +2 -2
  58. package/model-provider/huggingface/HuggingFaceTextEmbeddingModel.d.ts +3 -3
  59. package/model-provider/huggingface/HuggingFaceTextGenerationModel.d.ts +3 -3
  60. package/model-provider/llamacpp/LlamaCppTextEmbeddingModel.d.ts +3 -3
  61. package/model-provider/llamacpp/LlamaCppTextGenerationModel.d.ts +4 -4
  62. package/model-provider/openai/OpenAIImageGenerationModel.d.ts +3 -3
  63. package/model-provider/openai/OpenAITextEmbeddingModel.d.ts +3 -3
  64. package/model-provider/openai/OpenAITextGenerationModel.d.ts +4 -4
  65. package/model-provider/openai/OpenAITranscriptionModel.d.ts +3 -3
  66. package/model-provider/openai/chat/OpenAIChatModel.d.ts +5 -5
  67. package/model-provider/stability/StabilityImageGenerationModel.d.ts +3 -3
  68. package/package.json +1 -1
  69. package/prompt/PromptFormatTextGenerationModel.d.ts +3 -3
  70. package/run/ConsoleLogger.cjs +1 -4
  71. package/run/ConsoleLogger.d.ts +4 -5
  72. package/run/ConsoleLogger.js +1 -4
  73. package/run/DefaultRun.cjs +1 -4
  74. package/run/DefaultRun.d.ts +5 -5
  75. package/run/DefaultRun.js +1 -4
  76. package/run/FunctionEvent.d.ts +51 -0
  77. package/run/{RunFunctionEventSource.js → FunctionEventSource.cjs} +7 -13
  78. package/run/FunctionEventSource.d.ts +12 -0
  79. package/run/{RunFunctionEventSource.cjs → FunctionEventSource.js} +3 -17
  80. package/run/FunctionObserver.d.ts +7 -0
  81. package/run/FunctionOptions.d.ts +19 -0
  82. package/run/GlobalFunctionObservers.cjs +12 -0
  83. package/run/GlobalFunctionObservers.d.ts +3 -0
  84. package/run/GlobalFunctionObservers.js +7 -0
  85. package/run/Run.d.ts +2 -2
  86. package/run/index.cjs +5 -5
  87. package/run/index.d.ts +5 -5
  88. package/run/index.js +5 -5
  89. package/text-chunk/SimilarTextChunksFromVectorIndexRetriever.cjs +1 -0
  90. package/text-chunk/SimilarTextChunksFromVectorIndexRetriever.d.ts +2 -2
  91. package/text-chunk/SimilarTextChunksFromVectorIndexRetriever.js +1 -0
  92. package/text-chunk/retrieve-text-chunks/TextChunkRetriever.d.ts +2 -2
  93. package/text-chunk/retrieve-text-chunks/retrieveTextChunks.d.ts +2 -2
  94. package/text-chunk/split/SplitFunction.d.ts +3 -3
  95. package/text-chunk/upsertTextChunks.d.ts +2 -2
  96. package/tool/ExecuteToolEvent.d.ts +6 -8
  97. package/tool/Tool.d.ts +3 -3
  98. package/tool/WebSearchTool.d.ts +2 -1
  99. package/tool/executeTool.cjs +28 -26
  100. package/tool/executeTool.d.ts +5 -4
  101. package/tool/executeTool.js +28 -26
  102. package/tool/index.cjs +1 -0
  103. package/tool/index.d.ts +1 -0
  104. package/tool/index.js +1 -0
  105. package/tool/useTool.cjs +2 -6
  106. package/tool/useTool.d.ts +2 -2
  107. package/tool/useTool.js +2 -6
  108. package/tool/useToolOrGenerateText.cjs +1 -3
  109. package/tool/useToolOrGenerateText.d.ts +2 -2
  110. package/tool/useToolOrGenerateText.js +1 -3
  111. package/util/DurationMeasurement.cjs +6 -0
  112. package/util/DurationMeasurement.d.ts +1 -0
  113. package/util/DurationMeasurement.js +6 -0
  114. package/util/api/postToApi.cjs +8 -0
  115. package/util/api/postToApi.js +8 -0
  116. package/model-function/FunctionOptions.d.ts +0 -6
  117. package/run/IdMetadata.d.ts +0 -7
  118. package/run/RunFunction.d.ts +0 -9
  119. package/run/RunFunctionEvent.d.ts +0 -12
  120. package/run/RunFunctionEventSource.d.ts +0 -13
  121. package/run/RunFunctionObserver.cjs +0 -2
  122. package/run/RunFunctionObserver.d.ts +0 -5
  123. package/run/RunFunctionObserver.js +0 -1
  124. /package/model-function/{FunctionOptions.cjs → ModelFunctionOptions.cjs} +0 -0
  125. /package/model-function/{FunctionOptions.js → ModelFunctionOptions.js} +0 -0
  126. /package/run/{IdMetadata.cjs → FunctionEvent.cjs} +0 -0
  127. /package/run/{IdMetadata.js → FunctionEvent.js} +0 -0
  128. /package/run/{RunFunction.cjs → FunctionObserver.cjs} +0 -0
  129. /package/run/{RunFunction.js → FunctionObserver.js} +0 -0
  130. /package/run/{RunFunctionEvent.cjs → FunctionOptions.cjs} +0 -0
  131. /package/run/{RunFunctionEvent.js → FunctionOptions.js} +0 -0
@@ -1,9 +0,0 @@
1
- import { Run } from "./Run.js";
2
- /**
3
- * Standardized function signature for functions that are part of a run.
4
- *
5
- * This enables wrapping and chaining of run functions.
6
- */
7
- export type RunFunction<INPUT, OUTPUT> = (input: INPUT, options?: {
8
- run?: Run;
9
- }) => PromiseLike<OUTPUT>;
@@ -1,12 +0,0 @@
1
- import { ExecuteToolFinishedEvent, ExecuteToolStartedEvent } from "tool/ExecuteToolEvent.js";
2
- import { ModelCallFinishedEvent, ModelCallStartedEvent } from "../model-function/ModelCallEvent.js";
3
- import { IdMetadata } from "./IdMetadata.js";
4
- export type RunFunctionEvent = RunFunctionStartedEvent | RunFunctionFinishedEvent;
5
- export type RunFunctionStartedEventMetadata = IdMetadata & {
6
- startEpochSeconds: number;
7
- };
8
- export type RunFunctionStartedEvent = ModelCallStartedEvent | ExecuteToolStartedEvent;
9
- export type RunFunctionFinishedEventMetadata = RunFunctionStartedEventMetadata & {
10
- durationInMs: number;
11
- };
12
- export type RunFunctionFinishedEvent = ModelCallFinishedEvent | ExecuteToolFinishedEvent;
@@ -1,13 +0,0 @@
1
- import { ErrorHandler } from "../util/ErrorHandler.js";
2
- import { RunFunctionFinishedEvent, RunFunctionStartedEvent } from "./RunFunctionEvent.js";
3
- import { RunFunctionObserver } from "./RunFunctionObserver.js";
4
- export declare class RunFunctionEventSource {
5
- readonly observers: RunFunctionObserver[];
6
- readonly errorHandler: ErrorHandler;
7
- constructor({ observers, errorHandler, }: {
8
- observers: RunFunctionObserver[];
9
- errorHandler?: ErrorHandler;
10
- });
11
- notifyRunFunctionStarted(event: RunFunctionStartedEvent): void;
12
- notifyRunFunctionFinished(event: RunFunctionFinishedEvent): void;
13
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,5 +0,0 @@
1
- import { RunFunctionFinishedEvent, RunFunctionStartedEvent } from "./RunFunctionEvent.js";
2
- export type RunFunctionObserver = {
3
- onRunFunctionStarted?: (event: RunFunctionStartedEvent) => void;
4
- onRunFunctionFinished?: (event: RunFunctionFinishedEvent) => void;
5
- };
@@ -1 +0,0 @@
1
- export {};
File without changes
File without changes
File without changes
File without changes
File without changes