modelfusion 0.21.0 → 0.22.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 (86) hide show
  1. package/composed-function/summarize/SummarizationFunction.d.ts +1 -1
  2. package/composed-function/summarize/summarizeRecursively.d.ts +1 -1
  3. package/composed-function/summarize/summarizeRecursivelyWithTextGenerationAndTokenSplitting.d.ts +1 -1
  4. package/{run → core}/DefaultRun.cjs +1 -1
  5. package/{run → core}/DefaultRun.js +1 -1
  6. package/{run → core}/FunctionEvent.d.ts +30 -6
  7. package/index.cjs +1 -1
  8. package/index.d.ts +1 -1
  9. package/index.js +1 -1
  10. package/model-function/Model.d.ts +1 -1
  11. package/model-function/ModelCallEvent.d.ts +20 -5
  12. package/model-function/ModelFunctionOptions.d.ts +1 -1
  13. package/model-function/SuccessfulModelCall.cjs +4 -2
  14. package/model-function/SuccessfulModelCall.d.ts +1 -1
  15. package/model-function/SuccessfulModelCall.js +4 -2
  16. package/model-function/embed-text/TextEmbeddingEvent.d.ts +12 -12
  17. package/model-function/embed-text/TextEmbeddingModel.d.ts +1 -1
  18. package/model-function/embed-text/embedText.cjs +6 -61
  19. package/model-function/embed-text/embedText.d.ts +1 -1
  20. package/model-function/embed-text/embedText.js +6 -61
  21. package/model-function/executeCall.cjs +32 -19
  22. package/model-function/executeCall.d.ts +4 -12
  23. package/model-function/executeCall.js +32 -19
  24. package/model-function/generate-image/ImageGenerationEvent.d.ts +9 -11
  25. package/model-function/generate-image/generateImage.cjs +2 -27
  26. package/model-function/generate-image/generateImage.js +2 -27
  27. package/model-function/generate-json/JsonGenerationEvent.d.ts +3 -16
  28. package/model-function/generate-json/generateJson.cjs +2 -27
  29. package/model-function/generate-json/generateJson.js +2 -27
  30. package/model-function/generate-json/generateJsonOrText.cjs +2 -27
  31. package/model-function/generate-json/generateJsonOrText.js +2 -27
  32. package/model-function/generate-text/TextGenerationEvent.d.ts +10 -10
  33. package/model-function/generate-text/TextStreamingEvent.d.ts +4 -17
  34. package/model-function/generate-text/generateText.cjs +2 -27
  35. package/model-function/generate-text/generateText.js +2 -27
  36. package/model-function/generate-text/streamText.cjs +24 -29
  37. package/model-function/generate-text/streamText.js +24 -29
  38. package/model-function/synthesize-speech/SpeechSynthesisEvent.d.ts +11 -10
  39. package/model-function/synthesize-speech/synthesizeSpeech.cjs +2 -28
  40. package/model-function/synthesize-speech/synthesizeSpeech.js +2 -28
  41. package/model-function/transcribe-speech/TranscriptionEvent.d.ts +9 -11
  42. package/model-function/transcribe-speech/transcribe.cjs +2 -27
  43. package/model-function/transcribe-speech/transcribe.js +2 -27
  44. package/model-provider/cohere/CohereTextEmbeddingModel.d.ts +3 -3
  45. package/model-provider/cohere/CohereTokenizer.d.ts +1 -1
  46. package/model-provider/llamacpp/LlamaCppTokenizer.d.ts +1 -1
  47. package/package.json +1 -1
  48. package/text-chunk/split/SplitFunction.d.ts +1 -1
  49. package/tool/ExecuteToolEvent.d.ts +7 -16
  50. package/tool/Tool.d.ts +1 -1
  51. package/tool/WebSearchTool.cjs +25 -0
  52. package/tool/WebSearchTool.d.ts +56 -1
  53. package/tool/WebSearchTool.js +25 -0
  54. package/tool/executeTool.cjs +14 -8
  55. package/tool/executeTool.d.ts +1 -1
  56. package/tool/executeTool.js +14 -8
  57. package/vector-index/VectorIndex.d.ts +1 -1
  58. package/vector-index/memory/MemoryVectorIndex.d.ts +1 -1
  59. package/vector-index/pinecone/PineconeVectorIndex.d.ts +1 -1
  60. /package/{run → core}/ConsoleLogger.cjs +0 -0
  61. /package/{run → core}/ConsoleLogger.d.ts +0 -0
  62. /package/{run → core}/ConsoleLogger.js +0 -0
  63. /package/{run → core}/DefaultRun.d.ts +0 -0
  64. /package/{run → core}/FunctionEvent.cjs +0 -0
  65. /package/{run → core}/FunctionEvent.js +0 -0
  66. /package/{run → core}/FunctionEventSource.cjs +0 -0
  67. /package/{run → core}/FunctionEventSource.d.ts +0 -0
  68. /package/{run → core}/FunctionEventSource.js +0 -0
  69. /package/{run → core}/FunctionObserver.cjs +0 -0
  70. /package/{run → core}/FunctionObserver.d.ts +0 -0
  71. /package/{run → core}/FunctionObserver.js +0 -0
  72. /package/{run → core}/FunctionOptions.cjs +0 -0
  73. /package/{run → core}/FunctionOptions.d.ts +0 -0
  74. /package/{run → core}/FunctionOptions.js +0 -0
  75. /package/{run → core}/GlobalFunctionObservers.cjs +0 -0
  76. /package/{run → core}/GlobalFunctionObservers.d.ts +0 -0
  77. /package/{run → core}/GlobalFunctionObservers.js +0 -0
  78. /package/{run → core}/Run.cjs +0 -0
  79. /package/{run → core}/Run.d.ts +0 -0
  80. /package/{run → core}/Run.js +0 -0
  81. /package/{run → core}/Vector.cjs +0 -0
  82. /package/{run → core}/Vector.d.ts +0 -0
  83. /package/{run → core}/Vector.js +0 -0
  84. /package/{run → core}/index.cjs +0 -0
  85. /package/{run → core}/index.d.ts +0 -0
  86. /package/{run → core}/index.js +0 -0
@@ -1,6 +1,6 @@
1
1
  import { nanoid as createId } from "nanoid";
2
- import { FunctionEventSource } from "../run/FunctionEventSource.js";
3
- import { getGlobalFunctionObservers } from "../run/GlobalFunctionObservers.js";
2
+ import { FunctionEventSource } from "../core/FunctionEventSource.js";
3
+ import { getGlobalFunctionObservers } from "../core/GlobalFunctionObservers.js";
4
4
  import { startDurationMeasurement } from "../util/DurationMeasurement.js";
5
5
  import { AbortError } from "../util/api/AbortError.js";
6
6
  import { runSafe } from "../util/runSafe.js";
@@ -64,7 +64,7 @@ async function doExecuteTool(tool, input, options) {
64
64
  sessionId: run?.sessionId,
65
65
  userId: run?.userId,
66
66
  functionId: options?.functionId,
67
- tool: tool,
67
+ toolName: tool.name,
68
68
  input,
69
69
  };
70
70
  eventSource.notify({
@@ -86,14 +86,18 @@ async function doExecuteTool(tool, input, options) {
86
86
  if (result.isAborted) {
87
87
  eventSource.notify({
88
88
  ...finishMetadata,
89
- status: "abort",
89
+ result: {
90
+ status: "abort",
91
+ },
90
92
  });
91
93
  throw new AbortError();
92
94
  }
93
95
  eventSource.notify({
94
96
  ...finishMetadata,
95
- status: "error",
96
- error: result.error,
97
+ result: {
98
+ status: "error",
99
+ error: result.error,
100
+ },
97
101
  });
98
102
  throw new ToolExecutionError({
99
103
  toolName: tool.name,
@@ -106,8 +110,10 @@ async function doExecuteTool(tool, input, options) {
106
110
  const output = result.output;
107
111
  eventSource.notify({
108
112
  ...finishMetadata,
109
- status: "success",
110
- output,
113
+ result: {
114
+ status: "success",
115
+ output,
116
+ },
111
117
  });
112
118
  return {
113
119
  output,
@@ -1,4 +1,4 @@
1
- import { Vector } from "../run/Vector.js";
1
+ import { Vector } from "../core/Vector.js";
2
2
  export interface VectorIndex<DATA, INDEX> {
3
3
  upsertMany(data: Array<{
4
4
  id: string;
@@ -1,5 +1,5 @@
1
1
  import z from "zod";
2
- import { Vector } from "../../run/Vector.js";
2
+ import { Vector } from "../../core/Vector.js";
3
3
  import { VectorIndex } from "../VectorIndex.js";
4
4
  /**
5
5
  * A very simple vector index that stores all entries in memory. Useful when you only have
@@ -1,6 +1,6 @@
1
1
  import { VectorOperationsApi } from "@pinecone-database/pinecone/dist/pinecone-generated-ts-fetch/index.js";
2
2
  import { z } from "zod";
3
- import { Vector } from "../../run/Vector.js";
3
+ import { Vector } from "../../core/Vector.js";
4
4
  import { VectorIndex } from "../VectorIndex.js";
5
5
  export declare class PineconeVectorIndex<DATA extends object | undefined> implements VectorIndex<DATA, PineconeVectorIndex<DATA>> {
6
6
  readonly index: VectorOperationsApi;
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
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