modelfusion 0.92.0 → 0.93.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 (184) hide show
  1. package/README.md +19 -19
  2. package/core/api/ApiCallError.cjs +9 -1
  3. package/core/api/ApiCallError.d.ts +4 -1
  4. package/core/api/ApiCallError.js +9 -1
  5. package/model-function/{PromptFormat.d.ts → PromptTemplate.d.ts} +2 -2
  6. package/model-function/generate-image/ImageGenerationModel.d.ts +2 -2
  7. package/model-function/generate-image/{PromptFormatImageGenerationModel.cjs → PromptTemplateImageGenerationModel.cjs} +11 -11
  8. package/model-function/generate-image/PromptTemplateImageGenerationModel.d.ts +20 -0
  9. package/model-function/generate-image/{PromptFormatImageGenerationModel.js → PromptTemplateImageGenerationModel.js} +9 -9
  10. package/model-function/generate-structure/StructureFromTextGenerationModel.cjs +6 -6
  11. package/model-function/generate-structure/StructureFromTextGenerationModel.d.ts +4 -4
  12. package/model-function/generate-structure/StructureFromTextGenerationModel.js +6 -6
  13. package/model-function/generate-structure/{StructureFromTextPromptFormat.d.ts → StructureFromTextPromptTemplate.d.ts} +1 -1
  14. package/model-function/generate-structure/StructureFromTextStreamingModel.cjs +4 -4
  15. package/model-function/generate-structure/StructureFromTextStreamingModel.d.ts +2 -2
  16. package/model-function/generate-structure/StructureFromTextStreamingModel.js +4 -4
  17. package/model-function/generate-structure/index.cjs +1 -1
  18. package/model-function/generate-structure/index.d.ts +1 -1
  19. package/model-function/generate-structure/index.js +1 -1
  20. package/model-function/generate-structure/jsonStructurePrompt.d.ts +2 -2
  21. package/model-function/generate-text/{PromptFormatTextGenerationModel.cjs → PromptTemplateTextGenerationModel.cjs} +21 -21
  22. package/model-function/generate-text/PromptTemplateTextGenerationModel.d.ts +35 -0
  23. package/model-function/generate-text/{PromptFormatTextGenerationModel.js → PromptTemplateTextGenerationModel.js} +19 -19
  24. package/model-function/generate-text/PromptTemplateTextStreamingModel.cjs +38 -0
  25. package/model-function/generate-text/PromptTemplateTextStreamingModel.d.ts +16 -0
  26. package/model-function/generate-text/PromptTemplateTextStreamingModel.js +34 -0
  27. package/model-function/generate-text/TextGenerationModel.d.ts +3 -3
  28. package/model-function/generate-text/TextGenerationPromptTemplate.d.ts +11 -0
  29. package/model-function/generate-text/index.cjs +4 -4
  30. package/model-function/generate-text/index.d.ts +4 -4
  31. package/model-function/generate-text/index.js +4 -4
  32. package/model-function/generate-text/{prompt-format/AlpacaPromptFormat.cjs → prompt-template/AlpacaPromptTemplate.cjs} +5 -2
  33. package/model-function/generate-text/{prompt-format/AlpacaPromptFormat.d.ts → prompt-template/AlpacaPromptTemplate.d.ts} +5 -5
  34. package/model-function/generate-text/{prompt-format/AlpacaPromptFormat.js → prompt-template/AlpacaPromptTemplate.js} +5 -2
  35. package/model-function/generate-text/prompt-template/AlpacaPromptTemplate.test.cjs +31 -0
  36. package/model-function/generate-text/prompt-template/AlpacaPromptTemplate.test.js +29 -0
  37. package/model-function/generate-text/{prompt-format/ChatMLPromptFormat.cjs → prompt-template/ChatMLPromptTemplate.cjs} +5 -5
  38. package/model-function/generate-text/{prompt-format/ChatMLPromptFormat.d.ts → prompt-template/ChatMLPromptTemplate.d.ts} +7 -7
  39. package/model-function/generate-text/{prompt-format/ChatMLPromptFormat.js → prompt-template/ChatMLPromptTemplate.js} +5 -5
  40. package/model-function/generate-text/prompt-template/ChatMLPromptTemplate.test.cjs +49 -0
  41. package/model-function/generate-text/prompt-template/ChatMLPromptTemplate.test.js +47 -0
  42. package/model-function/generate-text/{prompt-format → prompt-template}/ChatPrompt.d.ts +1 -1
  43. package/model-function/generate-text/prompt-template/Content.js +1 -0
  44. package/model-function/generate-text/{prompt-format → prompt-template}/InstructionPrompt.d.ts +7 -0
  45. package/model-function/generate-text/prompt-template/InstructionPrompt.js +1 -0
  46. package/model-function/generate-text/{prompt-format/Llama2PromptFormat.cjs → prompt-template/Llama2PromptTemplate.cjs} +8 -7
  47. package/model-function/generate-text/{prompt-format/Llama2PromptFormat.d.ts → prompt-template/Llama2PromptTemplate.d.ts} +7 -6
  48. package/model-function/generate-text/{prompt-format/Llama2PromptFormat.js → prompt-template/Llama2PromptTemplate.js} +8 -7
  49. package/model-function/generate-text/prompt-template/Llama2PromptTemplate.test.cjs +49 -0
  50. package/model-function/generate-text/prompt-template/Llama2PromptTemplate.test.d.ts +1 -0
  51. package/model-function/generate-text/prompt-template/Llama2PromptTemplate.test.js +47 -0
  52. package/model-function/generate-text/{prompt-format/TextPromptFormat.cjs → prompt-template/TextPromptTemplate.cjs} +3 -0
  53. package/model-function/generate-text/{prompt-format/TextPromptFormat.d.ts → prompt-template/TextPromptTemplate.d.ts} +4 -4
  54. package/model-function/generate-text/{prompt-format/TextPromptFormat.js → prompt-template/TextPromptTemplate.js} +3 -0
  55. package/model-function/generate-text/prompt-template/TextPromptTemplate.test.cjs +49 -0
  56. package/model-function/generate-text/prompt-template/TextPromptTemplate.test.d.ts +1 -0
  57. package/model-function/generate-text/prompt-template/TextPromptTemplate.test.js +47 -0
  58. package/model-function/generate-text/{prompt-format/VicunaPromptFormat.d.ts → prompt-template/VicunaPromptTemplate.d.ts} +2 -2
  59. package/model-function/generate-text/prompt-template/VicunaPromptTemplate.test.cjs +21 -0
  60. package/model-function/generate-text/prompt-template/VicunaPromptTemplate.test.d.ts +1 -0
  61. package/model-function/generate-text/prompt-template/VicunaPromptTemplate.test.js +19 -0
  62. package/model-function/generate-text/{prompt-format → prompt-template}/index.cjs +6 -6
  63. package/model-function/generate-text/prompt-template/index.d.ts +10 -0
  64. package/model-function/generate-text/prompt-template/index.js +10 -0
  65. package/model-function/index.cjs +2 -2
  66. package/model-function/index.d.ts +2 -2
  67. package/model-function/index.js +2 -2
  68. package/model-provider/anthropic/{AnthropicPromptFormat.cjs → AnthropicPromptTemplate.cjs} +15 -8
  69. package/model-provider/anthropic/AnthropicPromptTemplate.d.ts +17 -0
  70. package/model-provider/anthropic/{AnthropicPromptFormat.js → AnthropicPromptTemplate.js} +15 -8
  71. package/model-provider/anthropic/AnthropicPromptTemplate.test.cjs +49 -0
  72. package/model-provider/anthropic/AnthropicPromptTemplate.test.d.ts +1 -0
  73. package/model-provider/anthropic/AnthropicPromptTemplate.test.js +47 -0
  74. package/model-provider/anthropic/AnthropicTextGenerationModel.cjs +12 -12
  75. package/model-provider/anthropic/AnthropicTextGenerationModel.d.ts +9 -9
  76. package/model-provider/anthropic/AnthropicTextGenerationModel.js +12 -12
  77. package/model-provider/anthropic/index.cjs +2 -2
  78. package/model-provider/anthropic/index.d.ts +1 -1
  79. package/model-provider/anthropic/index.js +1 -1
  80. package/model-provider/automatic1111/Automatic1111ImageGenerationModel.cjs +5 -5
  81. package/model-provider/automatic1111/Automatic1111ImageGenerationModel.d.ts +4 -4
  82. package/model-provider/automatic1111/Automatic1111ImageGenerationModel.js +5 -5
  83. package/model-provider/automatic1111/Automatic1111ImageGenerationPrompt.d.ts +2 -2
  84. package/model-provider/cohere/CohereTextGenerationModel.cjs +10 -10
  85. package/model-provider/cohere/CohereTextGenerationModel.d.ts +7 -7
  86. package/model-provider/cohere/CohereTextGenerationModel.js +10 -10
  87. package/model-provider/huggingface/HuggingFaceTextGenerationModel.cjs +4 -4
  88. package/model-provider/huggingface/HuggingFaceTextGenerationModel.d.ts +3 -3
  89. package/model-provider/huggingface/HuggingFaceTextGenerationModel.js +4 -4
  90. package/model-provider/llamacpp/{LlamaCppBakLLaVA1Format.cjs → LlamaCppBakLLaVA1PromptTemplate.cjs} +1 -1
  91. package/model-provider/llamacpp/LlamaCppBakLLaVA1PromptTemplate.d.ts +11 -0
  92. package/model-provider/llamacpp/{LlamaCppBakLLaVA1Format.js → LlamaCppBakLLaVA1PromptTemplate.js} +1 -1
  93. package/model-provider/llamacpp/LlamaCppTextGenerationModel.cjs +12 -12
  94. package/model-provider/llamacpp/LlamaCppTextGenerationModel.d.ts +7 -7
  95. package/model-provider/llamacpp/LlamaCppTextGenerationModel.js +12 -12
  96. package/model-provider/llamacpp/index.cjs +2 -2
  97. package/model-provider/llamacpp/index.d.ts +1 -1
  98. package/model-provider/llamacpp/index.js +1 -1
  99. package/model-provider/ollama/OllamaError.cjs +25 -24
  100. package/model-provider/ollama/OllamaError.d.ts +1 -11
  101. package/model-provider/ollama/OllamaError.js +24 -22
  102. package/model-provider/ollama/OllamaTextGenerationModel.cjs +47 -10
  103. package/model-provider/ollama/OllamaTextGenerationModel.d.ts +12 -8
  104. package/model-provider/ollama/OllamaTextGenerationModel.js +48 -11
  105. package/model-provider/ollama/OllamaTextGenerationModel.test.cjs +63 -0
  106. package/model-provider/ollama/OllamaTextGenerationModel.test.d.ts +1 -0
  107. package/model-provider/ollama/OllamaTextGenerationModel.test.js +61 -0
  108. package/model-provider/ollama/index.cjs +1 -3
  109. package/model-provider/ollama/index.d.ts +1 -1
  110. package/model-provider/ollama/index.js +0 -1
  111. package/model-provider/openai/OpenAICompletionModel.cjs +10 -10
  112. package/model-provider/openai/OpenAICompletionModel.d.ts +7 -7
  113. package/model-provider/openai/OpenAICompletionModel.js +10 -10
  114. package/model-provider/openai/OpenAIError.cjs +13 -29
  115. package/model-provider/openai/OpenAIError.d.ts +2 -11
  116. package/model-provider/openai/OpenAIError.js +11 -26
  117. package/model-provider/openai/OpenAIImageGenerationModel.cjs +4 -4
  118. package/model-provider/openai/OpenAIImageGenerationModel.d.ts +3 -3
  119. package/model-provider/openai/OpenAIImageGenerationModel.js +4 -4
  120. package/model-provider/openai/chat/OpenAIChatFunctionCallStructureGenerationModel.cjs +16 -16
  121. package/model-provider/openai/chat/OpenAIChatFunctionCallStructureGenerationModel.d.ts +14 -14
  122. package/model-provider/openai/chat/OpenAIChatFunctionCallStructureGenerationModel.js +16 -16
  123. package/model-provider/openai/chat/OpenAIChatMessage.d.ts +1 -1
  124. package/model-provider/openai/chat/OpenAIChatModel.cjs +15 -15
  125. package/model-provider/openai/chat/OpenAIChatModel.d.ts +12 -12
  126. package/model-provider/openai/chat/OpenAIChatModel.js +15 -15
  127. package/model-provider/openai/chat/{OpenAIChatPromptFormat.cjs → OpenAIChatPromptTemplate.cjs} +1 -1
  128. package/model-provider/openai/chat/OpenAIChatPromptTemplate.d.ts +20 -0
  129. package/model-provider/openai/chat/{OpenAIChatPromptFormat.js → OpenAIChatPromptTemplate.js} +1 -1
  130. package/model-provider/openai/index.cjs +2 -4
  131. package/model-provider/openai/index.d.ts +2 -2
  132. package/model-provider/openai/index.js +1 -2
  133. package/model-provider/openai-compatible/OpenAICompatibleChatModel.cjs +14 -14
  134. package/model-provider/openai-compatible/OpenAICompatibleChatModel.d.ts +11 -11
  135. package/model-provider/openai-compatible/OpenAICompatibleChatModel.js +14 -14
  136. package/model-provider/stability/StabilityImageGenerationModel.cjs +5 -5
  137. package/model-provider/stability/StabilityImageGenerationModel.d.ts +4 -4
  138. package/model-provider/stability/StabilityImageGenerationModel.js +5 -5
  139. package/model-provider/stability/StabilityImageGenerationPrompt.d.ts +2 -2
  140. package/model-provider/whispercpp/WhisperCppTranscriptionModel.cjs +5 -8
  141. package/model-provider/whispercpp/WhisperCppTranscriptionModel.js +5 -8
  142. package/package.json +5 -4
  143. package/tool/generate-tool-call/TextGenerationToolCallModel.d.ts +2 -2
  144. package/tool/generate-tool-calls-or-text/TextGenerationToolCallsOrGenerateTextModel.cjs +6 -6
  145. package/tool/generate-tool-calls-or-text/TextGenerationToolCallsOrGenerateTextModel.d.ts +4 -4
  146. package/tool/generate-tool-calls-or-text/TextGenerationToolCallsOrGenerateTextModel.js +6 -6
  147. package/util/AsyncQueue.test.cjs +20 -21
  148. package/util/AsyncQueue.test.js +9 -10
  149. package/util/isDeepEqualData.test.cjs +14 -15
  150. package/util/isDeepEqualData.test.js +14 -15
  151. package/util/runSafe.test.cjs +12 -13
  152. package/util/runSafe.test.js +6 -7
  153. package/model-function/generate-image/PromptFormatImageGenerationModel.d.ts +0 -20
  154. package/model-function/generate-text/PromptFormatTextGenerationModel.d.ts +0 -35
  155. package/model-function/generate-text/PromptFormatTextStreamingModel.cjs +0 -38
  156. package/model-function/generate-text/PromptFormatTextStreamingModel.d.ts +0 -16
  157. package/model-function/generate-text/PromptFormatTextStreamingModel.js +0 -34
  158. package/model-function/generate-text/TextGenerationPromptFormat.d.ts +0 -11
  159. package/model-function/generate-text/prompt-format/index.d.ts +0 -10
  160. package/model-function/generate-text/prompt-format/index.js +0 -10
  161. package/model-provider/anthropic/AnthropicPromptFormat.d.ts +0 -17
  162. package/model-provider/llamacpp/LlamaCppBakLLaVA1Format.d.ts +0 -11
  163. package/model-provider/openai/chat/OpenAIChatPromptFormat.d.ts +0 -20
  164. /package/model-function/{PromptFormat.cjs → PromptTemplate.cjs} +0 -0
  165. /package/model-function/{PromptFormat.js → PromptTemplate.js} +0 -0
  166. /package/model-function/generate-structure/{StructureFromTextPromptFormat.cjs → StructureFromTextPromptTemplate.cjs} +0 -0
  167. /package/model-function/generate-structure/{StructureFromTextPromptFormat.js → StructureFromTextPromptTemplate.js} +0 -0
  168. /package/model-function/generate-text/{TextGenerationPromptFormat.cjs → TextGenerationPromptTemplate.cjs} +0 -0
  169. /package/model-function/generate-text/{TextGenerationPromptFormat.js → TextGenerationPromptTemplate.js} +0 -0
  170. /package/model-function/generate-text/{prompt-format/Content.js → prompt-template/AlpacaPromptTemplate.test.d.ts} +0 -0
  171. /package/model-function/generate-text/{prompt-format/InstructionPrompt.js → prompt-template/ChatMLPromptTemplate.test.d.ts} +0 -0
  172. /package/model-function/generate-text/{prompt-format → prompt-template}/ChatPrompt.cjs +0 -0
  173. /package/model-function/generate-text/{prompt-format → prompt-template}/ChatPrompt.js +0 -0
  174. /package/model-function/generate-text/{prompt-format → prompt-template}/Content.cjs +0 -0
  175. /package/model-function/generate-text/{prompt-format → prompt-template}/Content.d.ts +0 -0
  176. /package/model-function/generate-text/{prompt-format → prompt-template}/InstructionPrompt.cjs +0 -0
  177. /package/model-function/generate-text/{prompt-format → prompt-template}/InvalidPromptError.cjs +0 -0
  178. /package/model-function/generate-text/{prompt-format → prompt-template}/InvalidPromptError.d.ts +0 -0
  179. /package/model-function/generate-text/{prompt-format → prompt-template}/InvalidPromptError.js +0 -0
  180. /package/model-function/generate-text/{prompt-format/VicunaPromptFormat.cjs → prompt-template/VicunaPromptTemplate.cjs} +0 -0
  181. /package/model-function/generate-text/{prompt-format/VicunaPromptFormat.js → prompt-template/VicunaPromptTemplate.js} +0 -0
  182. /package/model-function/generate-text/{prompt-format → prompt-template}/trimChatPrompt.cjs +0 -0
  183. /package/model-function/generate-text/{prompt-format → prompt-template}/trimChatPrompt.d.ts +0 -0
  184. /package/model-function/generate-text/{prompt-format → prompt-template}/trimChatPrompt.js +0 -0
@@ -4,9 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const node_assert_1 = __importDefault(require("node:assert"));
7
- const vitest_1 = require("vitest");
8
7
  const isDeepEqualData_js_1 = require("./isDeepEqualData.cjs");
9
- (0, vitest_1.test)("checks if two primitives are equal", async () => {
8
+ it("should check if two primitives are equal", async () => {
10
9
  let x = 1;
11
10
  let y = 1;
12
11
  let result = (0, isDeepEqualData_js_1.isDeepEqualData)(x, y);
@@ -16,48 +15,48 @@ const isDeepEqualData_js_1 = require("./isDeepEqualData.cjs");
16
15
  result = (0, isDeepEqualData_js_1.isDeepEqualData)(x, y);
17
16
  node_assert_1.default.equal(result, false);
18
17
  });
19
- (0, vitest_1.test)("returns false for different types", async () => {
18
+ it("should return false for different types", async () => {
20
19
  const obj = { a: 1 };
21
20
  const num = 1;
22
21
  const result = (0, isDeepEqualData_js_1.isDeepEqualData)(obj, num);
23
22
  node_assert_1.default.equal(result, false);
24
23
  });
25
- (0, vitest_1.test)("returns false for null values compared with objects", async () => {
24
+ it("should return false for null values compared with objects", async () => {
26
25
  const obj = { a: 1 };
27
26
  const result = (0, isDeepEqualData_js_1.isDeepEqualData)(obj, null);
28
27
  node_assert_1.default.equal(result, false);
29
28
  });
30
- (0, vitest_1.test)("identifies two equal objects", async () => {
29
+ it("should identify two equal objects", async () => {
31
30
  const obj1 = { a: 1, b: 2 };
32
31
  const obj2 = { a: 1, b: 2 };
33
32
  const result = (0, isDeepEqualData_js_1.isDeepEqualData)(obj1, obj2);
34
33
  node_assert_1.default.equal(result, true);
35
34
  });
36
- (0, vitest_1.test)("identifies two objects with different values", async () => {
35
+ it("should identify two objects with different values", async () => {
37
36
  const obj1 = { a: 1, b: 2 };
38
37
  const obj2 = { a: 1, b: 3 };
39
38
  const result = (0, isDeepEqualData_js_1.isDeepEqualData)(obj1, obj2);
40
39
  node_assert_1.default.equal(result, false);
41
40
  });
42
- (0, vitest_1.test)("identifies two objects with different number of keys", async () => {
41
+ it("should identify two objects with different number of keys", async () => {
43
42
  const obj1 = { a: 1, b: 2 };
44
43
  const obj2 = { a: 1, b: 2, c: 3 };
45
44
  const result = (0, isDeepEqualData_js_1.isDeepEqualData)(obj1, obj2);
46
45
  node_assert_1.default.equal(result, false);
47
46
  });
48
- (0, vitest_1.test)("handles nested objects", async () => {
47
+ it("should handle nested objects", async () => {
49
48
  const obj1 = { a: { c: 1 }, b: 2 };
50
49
  const obj2 = { a: { c: 1 }, b: 2 };
51
50
  const result = (0, isDeepEqualData_js_1.isDeepEqualData)(obj1, obj2);
52
51
  node_assert_1.default.equal(result, true);
53
52
  });
54
- (0, vitest_1.test)("detects inequality in nested objects", async () => {
53
+ it("should detect inequality in nested objects", async () => {
55
54
  const obj1 = { a: { c: 1 }, b: 2 };
56
55
  const obj2 = { a: { c: 2 }, b: 2 };
57
56
  const result = (0, isDeepEqualData_js_1.isDeepEqualData)(obj1, obj2);
58
57
  node_assert_1.default.equal(result, false);
59
58
  });
60
- (0, vitest_1.test)("compares arrays correctly", async () => {
59
+ it("should compare arrays correctly", async () => {
61
60
  const arr1 = [1, 2, 3];
62
61
  const arr2 = [1, 2, 3];
63
62
  const result = (0, isDeepEqualData_js_1.isDeepEqualData)(arr1, arr2);
@@ -67,18 +66,18 @@ const isDeepEqualData_js_1 = require("./isDeepEqualData.cjs");
67
66
  const result2 = (0, isDeepEqualData_js_1.isDeepEqualData)(arr3, arr4);
68
67
  node_assert_1.default.equal(result2, false);
69
68
  });
70
- (0, vitest_1.test)("returns false for null comparison with object", () => {
69
+ it("should return false for null comparison with object", () => {
71
70
  const obj = { a: 1 };
72
71
  const result = (0, isDeepEqualData_js_1.isDeepEqualData)(obj, null);
73
72
  node_assert_1.default.equal(result, false);
74
73
  });
75
- (0, vitest_1.test)("distinguishes between array and object with same enumerable properties", () => {
74
+ it("should distinguish between array and object with same enumerable properties", () => {
76
75
  const obj = { 0: "one", 1: "two", length: 2 };
77
76
  const arr = ["one", "two"];
78
77
  const result = (0, isDeepEqualData_js_1.isDeepEqualData)(obj, arr);
79
78
  node_assert_1.default.equal(result, false);
80
79
  });
81
- (0, vitest_1.test)("returns false when comparing objects with different prototypes", () => {
80
+ it("should return false when comparing objects with different prototypes", () => {
82
81
  const obj1 = Object.create({ a: 1 });
83
82
  const obj2 = Object.create(null);
84
83
  obj1.b = 2;
@@ -86,14 +85,14 @@ const isDeepEqualData_js_1 = require("./isDeepEqualData.cjs");
86
85
  const result = (0, isDeepEqualData_js_1.isDeepEqualData)(obj1, obj2);
87
86
  node_assert_1.default.equal(result, false);
88
87
  });
89
- (0, vitest_1.test)("handles date object comparisons correctly", () => {
88
+ it("should handle date object comparisons correctly", () => {
90
89
  const date1 = new Date(2000, 0, 1);
91
90
  const date2 = new Date(2000, 0, 1);
92
91
  const date3 = new Date(2000, 0, 2);
93
92
  node_assert_1.default.equal((0, isDeepEqualData_js_1.isDeepEqualData)(date1, date2), true);
94
93
  node_assert_1.default.equal((0, isDeepEqualData_js_1.isDeepEqualData)(date1, date3), false);
95
94
  });
96
- (0, vitest_1.test)("handles function comparisons", () => {
95
+ it("should handle function comparisons", () => {
97
96
  const func1 = () => {
98
97
  console.log("hello");
99
98
  };
@@ -1,7 +1,6 @@
1
1
  import assert from "node:assert";
2
- import { test } from "vitest";
3
2
  import { isDeepEqualData } from "./isDeepEqualData.js";
4
- test("checks if two primitives are equal", async () => {
3
+ it("should check if two primitives are equal", async () => {
5
4
  let x = 1;
6
5
  let y = 1;
7
6
  let result = isDeepEqualData(x, y);
@@ -11,48 +10,48 @@ test("checks if two primitives are equal", async () => {
11
10
  result = isDeepEqualData(x, y);
12
11
  assert.equal(result, false);
13
12
  });
14
- test("returns false for different types", async () => {
13
+ it("should return false for different types", async () => {
15
14
  const obj = { a: 1 };
16
15
  const num = 1;
17
16
  const result = isDeepEqualData(obj, num);
18
17
  assert.equal(result, false);
19
18
  });
20
- test("returns false for null values compared with objects", async () => {
19
+ it("should return false for null values compared with objects", async () => {
21
20
  const obj = { a: 1 };
22
21
  const result = isDeepEqualData(obj, null);
23
22
  assert.equal(result, false);
24
23
  });
25
- test("identifies two equal objects", async () => {
24
+ it("should identify two equal objects", async () => {
26
25
  const obj1 = { a: 1, b: 2 };
27
26
  const obj2 = { a: 1, b: 2 };
28
27
  const result = isDeepEqualData(obj1, obj2);
29
28
  assert.equal(result, true);
30
29
  });
31
- test("identifies two objects with different values", async () => {
30
+ it("should identify two objects with different values", async () => {
32
31
  const obj1 = { a: 1, b: 2 };
33
32
  const obj2 = { a: 1, b: 3 };
34
33
  const result = isDeepEqualData(obj1, obj2);
35
34
  assert.equal(result, false);
36
35
  });
37
- test("identifies two objects with different number of keys", async () => {
36
+ it("should identify two objects with different number of keys", async () => {
38
37
  const obj1 = { a: 1, b: 2 };
39
38
  const obj2 = { a: 1, b: 2, c: 3 };
40
39
  const result = isDeepEqualData(obj1, obj2);
41
40
  assert.equal(result, false);
42
41
  });
43
- test("handles nested objects", async () => {
42
+ it("should handle nested objects", async () => {
44
43
  const obj1 = { a: { c: 1 }, b: 2 };
45
44
  const obj2 = { a: { c: 1 }, b: 2 };
46
45
  const result = isDeepEqualData(obj1, obj2);
47
46
  assert.equal(result, true);
48
47
  });
49
- test("detects inequality in nested objects", async () => {
48
+ it("should detect inequality in nested objects", async () => {
50
49
  const obj1 = { a: { c: 1 }, b: 2 };
51
50
  const obj2 = { a: { c: 2 }, b: 2 };
52
51
  const result = isDeepEqualData(obj1, obj2);
53
52
  assert.equal(result, false);
54
53
  });
55
- test("compares arrays correctly", async () => {
54
+ it("should compare arrays correctly", async () => {
56
55
  const arr1 = [1, 2, 3];
57
56
  const arr2 = [1, 2, 3];
58
57
  const result = isDeepEqualData(arr1, arr2);
@@ -62,18 +61,18 @@ test("compares arrays correctly", async () => {
62
61
  const result2 = isDeepEqualData(arr3, arr4);
63
62
  assert.equal(result2, false);
64
63
  });
65
- test("returns false for null comparison with object", () => {
64
+ it("should return false for null comparison with object", () => {
66
65
  const obj = { a: 1 };
67
66
  const result = isDeepEqualData(obj, null);
68
67
  assert.equal(result, false);
69
68
  });
70
- test("distinguishes between array and object with same enumerable properties", () => {
69
+ it("should distinguish between array and object with same enumerable properties", () => {
71
70
  const obj = { 0: "one", 1: "two", length: 2 };
72
71
  const arr = ["one", "two"];
73
72
  const result = isDeepEqualData(obj, arr);
74
73
  assert.equal(result, false);
75
74
  });
76
- test("returns false when comparing objects with different prototypes", () => {
75
+ it("should return false when comparing objects with different prototypes", () => {
77
76
  const obj1 = Object.create({ a: 1 });
78
77
  const obj2 = Object.create(null);
79
78
  obj1.b = 2;
@@ -81,14 +80,14 @@ test("returns false when comparing objects with different prototypes", () => {
81
80
  const result = isDeepEqualData(obj1, obj2);
82
81
  assert.equal(result, false);
83
82
  });
84
- test("handles date object comparisons correctly", () => {
83
+ it("should handle date object comparisons correctly", () => {
85
84
  const date1 = new Date(2000, 0, 1);
86
85
  const date2 = new Date(2000, 0, 1);
87
86
  const date3 = new Date(2000, 0, 2);
88
87
  assert.equal(isDeepEqualData(date1, date2), true);
89
88
  assert.equal(isDeepEqualData(date1, date3), false);
90
89
  });
91
- test("handles function comparisons", () => {
90
+ it("should handle function comparisons", () => {
92
91
  const func1 = () => {
93
92
  console.log("hello");
94
93
  };
@@ -1,58 +1,57 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const vitest_1 = require("vitest");
4
3
  const runSafe_js_1 = require("./runSafe.cjs");
5
- (0, vitest_1.test)("catch thrown error in sync function", async () => {
4
+ it("should catch thrown error in sync function", async () => {
6
5
  const error = new Error("test error");
7
6
  const result = await (0, runSafe_js_1.runSafe)(() => {
8
7
  throw error;
9
8
  });
10
- (0, vitest_1.expect)(result).toEqual({
9
+ expect(result).toEqual({
11
10
  ok: false,
12
11
  error,
13
12
  });
14
13
  });
15
- (0, vitest_1.test)("catch thrown string in sync function", async () => {
14
+ it("should catch thrown string in sync function", async () => {
16
15
  const result = await (0, runSafe_js_1.runSafe)(() => {
17
16
  throw "test error";
18
17
  });
19
- (0, vitest_1.expect)(result).toEqual({
18
+ expect(result).toEqual({
20
19
  ok: false,
21
20
  error: "test error",
22
21
  });
23
22
  });
24
- (0, vitest_1.test)("catch thrown error in async function", async () => {
23
+ it("should catch thrown error in async function", async () => {
25
24
  const error = new Error("test error");
26
25
  const result = await (0, runSafe_js_1.runSafe)(async () => {
27
26
  throw error;
28
27
  });
29
- (0, vitest_1.expect)(result).toEqual({
28
+ expect(result).toEqual({
30
29
  ok: false,
31
30
  error,
32
31
  });
33
32
  });
34
- (0, vitest_1.test)("catch thrown string in async function", async () => {
33
+ it("should catch thrown string in async function", async () => {
35
34
  const result = await (0, runSafe_js_1.runSafe)(async () => {
36
35
  throw "test error";
37
36
  });
38
- (0, vitest_1.expect)(result).toEqual({
37
+ expect(result).toEqual({
39
38
  ok: false,
40
39
  error: "test error",
41
40
  });
42
41
  });
43
- (0, vitest_1.test)("catch rejected Promise", async () => {
42
+ it("should catch rejected Promise", async () => {
44
43
  const error = new Error("test error");
45
44
  const result = await (0, runSafe_js_1.runSafe)(async () => {
46
45
  return Promise.reject(error);
47
46
  });
48
- (0, vitest_1.expect)(result).toEqual({
47
+ expect(result).toEqual({
49
48
  ok: false,
50
49
  error,
51
50
  });
52
51
  });
53
- (0, vitest_1.test)("no error", async () => {
52
+ it("should not throw error", async () => {
54
53
  const result = await (0, runSafe_js_1.runSafe)(async () => "result");
55
- (0, vitest_1.expect)(result).toEqual({
54
+ expect(result).toEqual({
56
55
  ok: true,
57
56
  value: "result",
58
57
  });
@@ -1,6 +1,5 @@
1
- import { expect, test } from "vitest";
2
1
  import { runSafe } from "./runSafe.js";
3
- test("catch thrown error in sync function", async () => {
2
+ it("should catch thrown error in sync function", async () => {
4
3
  const error = new Error("test error");
5
4
  const result = await runSafe(() => {
6
5
  throw error;
@@ -10,7 +9,7 @@ test("catch thrown error in sync function", async () => {
10
9
  error,
11
10
  });
12
11
  });
13
- test("catch thrown string in sync function", async () => {
12
+ it("should catch thrown string in sync function", async () => {
14
13
  const result = await runSafe(() => {
15
14
  throw "test error";
16
15
  });
@@ -19,7 +18,7 @@ test("catch thrown string in sync function", async () => {
19
18
  error: "test error",
20
19
  });
21
20
  });
22
- test("catch thrown error in async function", async () => {
21
+ it("should catch thrown error in async function", async () => {
23
22
  const error = new Error("test error");
24
23
  const result = await runSafe(async () => {
25
24
  throw error;
@@ -29,7 +28,7 @@ test("catch thrown error in async function", async () => {
29
28
  error,
30
29
  });
31
30
  });
32
- test("catch thrown string in async function", async () => {
31
+ it("should catch thrown string in async function", async () => {
33
32
  const result = await runSafe(async () => {
34
33
  throw "test error";
35
34
  });
@@ -38,7 +37,7 @@ test("catch thrown string in async function", async () => {
38
37
  error: "test error",
39
38
  });
40
39
  });
41
- test("catch rejected Promise", async () => {
40
+ it("should catch rejected Promise", async () => {
42
41
  const error = new Error("test error");
43
42
  const result = await runSafe(async () => {
44
43
  return Promise.reject(error);
@@ -48,7 +47,7 @@ test("catch rejected Promise", async () => {
48
47
  error,
49
48
  });
50
49
  });
51
- test("no error", async () => {
50
+ it("should not throw error", async () => {
52
51
  const result = await runSafe(async () => "result");
53
52
  expect(result).toEqual({
54
53
  ok: true,
@@ -1,20 +0,0 @@
1
- import { FunctionOptions } from "../../core/FunctionOptions.js";
2
- import { PromptFormat } from "../PromptFormat.js";
3
- import { ImageGenerationModel, ImageGenerationModelSettings } from "./ImageGenerationModel.js";
4
- export declare class PromptFormatImageGenerationModel<PROMPT, MODEL_PROMPT, SETTINGS extends ImageGenerationModelSettings, MODEL extends ImageGenerationModel<MODEL_PROMPT, SETTINGS>> implements ImageGenerationModel<PROMPT, SETTINGS> {
5
- readonly model: MODEL;
6
- readonly promptFormat: PromptFormat<PROMPT, MODEL_PROMPT>;
7
- constructor({ model, promptFormat, }: {
8
- model: MODEL;
9
- promptFormat: PromptFormat<PROMPT, MODEL_PROMPT>;
10
- });
11
- get modelInformation(): import("../ModelInformation.js").ModelInformation;
12
- get settings(): SETTINGS;
13
- doGenerateImage(prompt: PROMPT, options?: FunctionOptions): PromiseLike<{
14
- response: unknown;
15
- base64Image: string;
16
- }>;
17
- get settingsForEvent(): Partial<SETTINGS>;
18
- withPromptFormat<INPUT_PROMPT>(promptFormat: PromptFormat<INPUT_PROMPT, PROMPT>): PromptFormatImageGenerationModel<INPUT_PROMPT, PROMPT, SETTINGS, this>;
19
- withSettings(additionalSettings: Partial<SETTINGS>): this;
20
- }
@@ -1,35 +0,0 @@
1
- import { FunctionOptions } from "../../core/FunctionOptions.js";
2
- import { StructureFromTextGenerationModel } from "../../model-function/generate-structure/StructureFromTextGenerationModel.js";
3
- import { StructureFromTextPromptFormat } from "../../model-function/generate-structure/StructureFromTextPromptFormat.js";
4
- import { TextGenerationToolCallModel, ToolCallPromptFormat } from "../../tool/generate-tool-call/TextGenerationToolCallModel.js";
5
- import { TextGenerationToolCallsOrGenerateTextModel, ToolCallsOrGenerateTextPromptFormat } from "../../tool/generate-tool-calls-or-text/TextGenerationToolCallsOrGenerateTextModel.js";
6
- import { TextGenerationModel, TextGenerationModelSettings } from "./TextGenerationModel.js";
7
- import { TextGenerationPromptFormat } from "./TextGenerationPromptFormat.js";
8
- export declare class PromptFormatTextGenerationModel<PROMPT, MODEL_PROMPT, SETTINGS extends TextGenerationModelSettings, MODEL extends TextGenerationModel<MODEL_PROMPT, SETTINGS>> implements TextGenerationModel<PROMPT, SETTINGS> {
9
- readonly model: MODEL;
10
- readonly promptFormat: TextGenerationPromptFormat<PROMPT, MODEL_PROMPT>;
11
- constructor({ model, promptFormat, }: {
12
- model: MODEL;
13
- promptFormat: TextGenerationPromptFormat<PROMPT, MODEL_PROMPT>;
14
- });
15
- get modelInformation(): import("../ModelInformation.js").ModelInformation;
16
- get settings(): SETTINGS;
17
- get tokenizer(): MODEL["tokenizer"];
18
- get contextWindowSize(): MODEL["contextWindowSize"];
19
- get countPromptTokens(): MODEL["countPromptTokens"] extends undefined ? undefined : (prompt: PROMPT) => PromiseLike<number>;
20
- doGenerateText(prompt: PROMPT, options?: FunctionOptions): PromiseLike<{
21
- response: unknown;
22
- text: string;
23
- usage?: {
24
- promptTokens: number;
25
- completionTokens: number;
26
- totalTokens: number;
27
- } | undefined;
28
- }>;
29
- get settingsForEvent(): Partial<SETTINGS>;
30
- asToolCallGenerationModel<INPUT_PROMPT>(promptFormat: ToolCallPromptFormat<INPUT_PROMPT, PROMPT>): TextGenerationToolCallModel<INPUT_PROMPT, PROMPT, this>;
31
- asToolCallsOrTextGenerationModel<INPUT_PROMPT>(promptFormat: ToolCallsOrGenerateTextPromptFormat<INPUT_PROMPT, PROMPT>): TextGenerationToolCallsOrGenerateTextModel<INPUT_PROMPT, PROMPT, this>;
32
- asStructureGenerationModel<INPUT_PROMPT>(promptFormat: StructureFromTextPromptFormat<INPUT_PROMPT, PROMPT>): StructureFromTextGenerationModel<INPUT_PROMPT, PROMPT, this>;
33
- withPromptFormat<INPUT_PROMPT>(promptFormat: TextGenerationPromptFormat<INPUT_PROMPT, PROMPT>): PromptFormatTextGenerationModel<INPUT_PROMPT, PROMPT, SETTINGS, this>;
34
- withSettings(additionalSettings: Partial<SETTINGS>): this;
35
- }
@@ -1,38 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PromptFormatTextStreamingModel = void 0;
4
- const StructureFromTextStreamingModel_js_1 = require("../../model-function/generate-structure/StructureFromTextStreamingModel.cjs");
5
- const PromptFormatTextGenerationModel_js_1 = require("./PromptFormatTextGenerationModel.cjs");
6
- class PromptFormatTextStreamingModel extends PromptFormatTextGenerationModel_js_1.PromptFormatTextGenerationModel {
7
- constructor(options) {
8
- super(options);
9
- }
10
- doStreamText(prompt, options) {
11
- const mappedPrompt = this.promptFormat.format(prompt);
12
- return this.model.doStreamText(mappedPrompt, options);
13
- }
14
- asStructureGenerationModel(promptFormat) {
15
- return new StructureFromTextStreamingModel_js_1.StructureFromTextStreamingModel({
16
- model: this,
17
- format: promptFormat,
18
- });
19
- }
20
- withPromptFormat(promptFormat) {
21
- return new PromptFormatTextStreamingModel({
22
- model: this.withSettings({
23
- stopSequences: [
24
- ...(this.settings.stopSequences ?? []),
25
- ...promptFormat.stopSequences,
26
- ],
27
- }),
28
- promptFormat,
29
- });
30
- }
31
- withSettings(additionalSettings) {
32
- return new PromptFormatTextStreamingModel({
33
- model: this.model.withSettings(additionalSettings),
34
- promptFormat: this.promptFormat,
35
- });
36
- }
37
- }
38
- exports.PromptFormatTextStreamingModel = PromptFormatTextStreamingModel;
@@ -1,16 +0,0 @@
1
- import { FunctionOptions } from "../../core/FunctionOptions.js";
2
- import { StructureFromTextPromptFormat } from "../../model-function/generate-structure/StructureFromTextPromptFormat.js";
3
- import { StructureFromTextStreamingModel } from "../../model-function/generate-structure/StructureFromTextStreamingModel.js";
4
- import { PromptFormatTextGenerationModel } from "./PromptFormatTextGenerationModel.js";
5
- import { TextGenerationModelSettings, TextStreamingModel } from "./TextGenerationModel.js";
6
- import { TextGenerationPromptFormat } from "./TextGenerationPromptFormat.js";
7
- export declare class PromptFormatTextStreamingModel<PROMPT, MODEL_PROMPT, SETTINGS extends TextGenerationModelSettings, MODEL extends TextStreamingModel<MODEL_PROMPT, SETTINGS>> extends PromptFormatTextGenerationModel<PROMPT, MODEL_PROMPT, SETTINGS, MODEL> implements TextStreamingModel<PROMPT, SETTINGS> {
8
- constructor(options: {
9
- model: MODEL;
10
- promptFormat: TextGenerationPromptFormat<PROMPT, MODEL_PROMPT>;
11
- });
12
- doStreamText(prompt: PROMPT, options?: FunctionOptions): PromiseLike<AsyncIterable<import("../Delta.js").Delta<string>>>;
13
- asStructureGenerationModel<INPUT_PROMPT>(promptFormat: StructureFromTextPromptFormat<INPUT_PROMPT, PROMPT>): StructureFromTextStreamingModel<INPUT_PROMPT, PROMPT, this>;
14
- withPromptFormat<INPUT_PROMPT>(promptFormat: TextGenerationPromptFormat<INPUT_PROMPT, PROMPT>): PromptFormatTextStreamingModel<INPUT_PROMPT, PROMPT, SETTINGS, this>;
15
- withSettings(additionalSettings: Partial<SETTINGS>): this;
16
- }
@@ -1,34 +0,0 @@
1
- import { StructureFromTextStreamingModel } from "../../model-function/generate-structure/StructureFromTextStreamingModel.js";
2
- import { PromptFormatTextGenerationModel } from "./PromptFormatTextGenerationModel.js";
3
- export class PromptFormatTextStreamingModel extends PromptFormatTextGenerationModel {
4
- constructor(options) {
5
- super(options);
6
- }
7
- doStreamText(prompt, options) {
8
- const mappedPrompt = this.promptFormat.format(prompt);
9
- return this.model.doStreamText(mappedPrompt, options);
10
- }
11
- asStructureGenerationModel(promptFormat) {
12
- return new StructureFromTextStreamingModel({
13
- model: this,
14
- format: promptFormat,
15
- });
16
- }
17
- withPromptFormat(promptFormat) {
18
- return new PromptFormatTextStreamingModel({
19
- model: this.withSettings({
20
- stopSequences: [
21
- ...(this.settings.stopSequences ?? []),
22
- ...promptFormat.stopSequences,
23
- ],
24
- }),
25
- promptFormat,
26
- });
27
- }
28
- withSettings(additionalSettings) {
29
- return new PromptFormatTextStreamingModel({
30
- model: this.model.withSettings(additionalSettings),
31
- promptFormat: this.promptFormat,
32
- });
33
- }
34
- }
@@ -1,11 +0,0 @@
1
- import { PromptFormat } from "../PromptFormat.js";
2
- /**
3
- * Prompt formats format a source prompt into the structure of a target prompt.
4
- */
5
- export interface TextGenerationPromptFormat<SOURCE_PROMPT, TARGET_PROMPT> extends PromptFormat<SOURCE_PROMPT, TARGET_PROMPT> {
6
- /**
7
- * The texts that should be used as default stop sequences.
8
- * This is e.g. important for chat formats.
9
- */
10
- stopSequences: string[];
11
- }
@@ -1,10 +0,0 @@
1
- export * as AlpacaPromptFormat from "./AlpacaPromptFormat.js";
2
- export * as ChatMLPromptFormat from "./ChatMLPromptFormat.js";
3
- export * from "./ChatPrompt.js";
4
- export * from "./Content.js";
5
- export * from "./InstructionPrompt.js";
6
- export * as Llama2PromptFormat from "./Llama2PromptFormat.js";
7
- export * from "./InvalidPromptError.js";
8
- export * as TextPromptFormat from "./TextPromptFormat.js";
9
- export * as VicunaPromptFormat from "./VicunaPromptFormat.js";
10
- export * from "./trimChatPrompt.js";
@@ -1,10 +0,0 @@
1
- export * as AlpacaPromptFormat from "./AlpacaPromptFormat.js";
2
- export * as ChatMLPromptFormat from "./ChatMLPromptFormat.js";
3
- export * from "./ChatPrompt.js";
4
- export * from "./Content.js";
5
- export * from "./InstructionPrompt.js";
6
- export * as Llama2PromptFormat from "./Llama2PromptFormat.js";
7
- export * from "./InvalidPromptError.js";
8
- export * as TextPromptFormat from "./TextPromptFormat.js";
9
- export * as VicunaPromptFormat from "./VicunaPromptFormat.js";
10
- export * from "./trimChatPrompt.js";
@@ -1,17 +0,0 @@
1
- import { TextGenerationPromptFormat } from "../../model-function/generate-text/TextGenerationPromptFormat.js";
2
- import { TextChatPrompt } from "../../model-function/generate-text/prompt-format/ChatPrompt.js";
3
- import { TextInstructionPrompt } from "../../model-function/generate-text/prompt-format/InstructionPrompt.js";
4
- /**
5
- * Formats a text prompt as an Anthropic prompt.
6
- */
7
- export declare function text(): TextGenerationPromptFormat<string, string>;
8
- /**
9
- * Formats an instruction prompt as an Anthropic prompt.
10
- */
11
- export declare function instruction(): TextGenerationPromptFormat<TextInstructionPrompt, string>;
12
- /**
13
- * Formats a chat prompt as an Anthropic prompt.
14
- *
15
- * @see https://docs.anthropic.com/claude/docs/constructing-a-prompt
16
- */
17
- export declare function chat(): TextGenerationPromptFormat<TextChatPrompt, string>;
@@ -1,11 +0,0 @@
1
- import { TextGenerationPromptFormat } from "../../model-function/generate-text/TextGenerationPromptFormat.js";
2
- import { MultiModalChatPrompt } from "../../model-function/generate-text/prompt-format/ChatPrompt.js";
3
- import { MultiModalInstructionPrompt } from "../../model-function/generate-text/prompt-format/InstructionPrompt.js";
4
- import { LlamaCppTextGenerationPrompt } from "./LlamaCppTextGenerationModel.js";
5
- /**
6
- * BakLLaVA 1 uses a Vicuna 1 prompt. This mapping combines it with the LlamaCpp prompt structure.
7
- *
8
- * @see https://github.com/SkunkworksAI/BakLLaVA
9
- */
10
- export declare function instruction(): TextGenerationPromptFormat<MultiModalInstructionPrompt, LlamaCppTextGenerationPrompt>;
11
- export declare function chat(): TextGenerationPromptFormat<MultiModalChatPrompt, LlamaCppTextGenerationPrompt>;
@@ -1,20 +0,0 @@
1
- import { TextGenerationPromptFormat } from "../../../model-function/generate-text/TextGenerationPromptFormat.js";
2
- import { MultiModalChatPrompt, TextChatPrompt } from "../../../model-function/generate-text/prompt-format/ChatPrompt.js";
3
- import { MultiModalInstructionPrompt, TextInstructionPrompt } from "../../../model-function/generate-text/prompt-format/InstructionPrompt.js";
4
- import { OpenAIChatMessage } from "./OpenAIChatMessage.js";
5
- /**
6
- * OpenAIMessage[] identity chat format.
7
- */
8
- export declare function identity(): TextGenerationPromptFormat<Array<OpenAIChatMessage>, Array<OpenAIChatMessage>>;
9
- /**
10
- * Formats a text prompt as an OpenAI chat prompt.
11
- */
12
- export declare function text(): TextGenerationPromptFormat<string, Array<OpenAIChatMessage>>;
13
- /**
14
- * Formats an instruction prompt as an OpenAI chat prompt.
15
- */
16
- export declare function instruction(): TextGenerationPromptFormat<MultiModalInstructionPrompt | TextInstructionPrompt, Array<OpenAIChatMessage>>;
17
- /**
18
- * Formats a chat prompt as an OpenAI chat prompt.
19
- */
20
- export declare function chat(): TextGenerationPromptFormat<MultiModalChatPrompt | TextChatPrompt, Array<OpenAIChatMessage>>;