modelfusion 0.45.1 → 0.45.2

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.
@@ -29,9 +29,12 @@ class OpenAICostCalculator {
29
29
  return null;
30
30
  }
31
31
  if ((0, OpenAITextEmbeddingModel_js_1.isOpenAIEmbeddingModel)(model)) {
32
+ const responses = Array.isArray(call.result.response)
33
+ ? call.result.response
34
+ : [call.result.response];
32
35
  return (0, OpenAITextEmbeddingModel_js_1.calculateOpenAIEmbeddingCostInMillicents)({
33
36
  model,
34
- responses: call.result.response,
37
+ responses,
35
38
  });
36
39
  }
37
40
  break;
@@ -26,9 +26,12 @@ export class OpenAICostCalculator {
26
26
  return null;
27
27
  }
28
28
  if (isOpenAIEmbeddingModel(model)) {
29
+ const responses = Array.isArray(call.result.response)
30
+ ? call.result.response
31
+ : [call.result.response];
29
32
  return calculateOpenAIEmbeddingCostInMillicents({
30
33
  model,
31
- responses: call.result.response,
34
+ responses,
32
35
  });
33
36
  }
34
37
  break;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "modelfusion",
3
3
  "description": "Build multimodal applications, chatbots, and agents with JavaScript and TypeScript.",
4
- "version": "0.45.1",
4
+ "version": "0.45.2",
5
5
  "author": "Lars Grammel",
6
6
  "license": "MIT",
7
7
  "keywords": [