modelfusion 0.133.0 → 0.134.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 (971) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/index.cjs +10800 -24
  3. package/index.cjs.map +1 -0
  4. package/index.d.cts +9519 -0
  5. package/index.d.ts +9519 -9
  6. package/index.js +10577 -9
  7. package/index.js.map +1 -0
  8. package/internal/index.cjs +874 -28
  9. package/internal/index.cjs.map +1 -0
  10. package/internal/index.d.cts +675 -0
  11. package/internal/index.d.ts +675 -8
  12. package/internal/index.js +831 -7
  13. package/internal/index.js.map +1 -0
  14. package/package.json +6 -6
  15. package/core/DefaultRun.cjs +0 -72
  16. package/core/DefaultRun.d.ts +0 -24
  17. package/core/DefaultRun.js +0 -68
  18. package/core/ExecuteFunctionEvent.cjs +0 -2
  19. package/core/ExecuteFunctionEvent.d.ts +0 -7
  20. package/core/ExecuteFunctionEvent.js +0 -1
  21. package/core/ExtensionFunctionEvent.cjs +0 -2
  22. package/core/ExtensionFunctionEvent.d.ts +0 -11
  23. package/core/ExtensionFunctionEvent.js +0 -1
  24. package/core/FunctionEvent.cjs +0 -2
  25. package/core/FunctionEvent.d.ts +0 -85
  26. package/core/FunctionEvent.js +0 -1
  27. package/core/FunctionEventSource.cjs +0 -32
  28. package/core/FunctionEventSource.d.ts +0 -12
  29. package/core/FunctionEventSource.js +0 -28
  30. package/core/FunctionObserver.cjs +0 -2
  31. package/core/FunctionObserver.d.ts +0 -7
  32. package/core/FunctionObserver.js +0 -1
  33. package/core/FunctionOptions.cjs +0 -2
  34. package/core/FunctionOptions.d.ts +0 -49
  35. package/core/FunctionOptions.js +0 -1
  36. package/core/LogFormat.cjs +0 -10
  37. package/core/LogFormat.d.ts +0 -9
  38. package/core/LogFormat.js +0 -9
  39. package/core/ModelFusionConfiguration.cjs +0 -21
  40. package/core/ModelFusionConfiguration.d.ts +0 -6
  41. package/core/ModelFusionConfiguration.js +0 -14
  42. package/core/Run.cjs +0 -2
  43. package/core/Run.d.ts +0 -31
  44. package/core/Run.js +0 -1
  45. package/core/Vector.cjs +0 -2
  46. package/core/Vector.d.ts +0 -5
  47. package/core/Vector.js +0 -1
  48. package/core/api/AbortError.cjs +0 -9
  49. package/core/api/AbortError.d.ts +0 -3
  50. package/core/api/AbortError.js +0 -5
  51. package/core/api/AbstractApiConfiguration.cjs +0 -37
  52. package/core/api/AbstractApiConfiguration.d.ts +0 -17
  53. package/core/api/AbstractApiConfiguration.js +0 -33
  54. package/core/api/ApiCallError.cjs +0 -73
  55. package/core/api/ApiCallError.d.ts +0 -30
  56. package/core/api/ApiCallError.js +0 -69
  57. package/core/api/ApiConfiguration.cjs +0 -2
  58. package/core/api/ApiConfiguration.d.ts +0 -41
  59. package/core/api/ApiConfiguration.js +0 -1
  60. package/core/api/ApiFacade.cjs +0 -20
  61. package/core/api/ApiFacade.d.ts +0 -4
  62. package/core/api/ApiFacade.js +0 -4
  63. package/core/api/BaseUrlApiConfiguration.cjs +0 -78
  64. package/core/api/BaseUrlApiConfiguration.d.ts +0 -37
  65. package/core/api/BaseUrlApiConfiguration.js +0 -73
  66. package/core/api/BaseUrlApiConfiguration.test.cjs +0 -11
  67. package/core/api/BaseUrlApiConfiguration.test.d.ts +0 -1
  68. package/core/api/BaseUrlApiConfiguration.test.js +0 -9
  69. package/core/api/CustomHeaderProvider.cjs +0 -2
  70. package/core/api/CustomHeaderProvider.d.ts +0 -2
  71. package/core/api/CustomHeaderProvider.js +0 -1
  72. package/core/api/LoadAPIKeyError.cjs +0 -16
  73. package/core/api/LoadAPIKeyError.d.ts +0 -9
  74. package/core/api/LoadAPIKeyError.js +0 -12
  75. package/core/api/RetryError.cjs +0 -42
  76. package/core/api/RetryError.d.ts +0 -18
  77. package/core/api/RetryError.js +0 -38
  78. package/core/api/RetryFunction.cjs +0 -2
  79. package/core/api/RetryFunction.d.ts +0 -1
  80. package/core/api/RetryFunction.js +0 -1
  81. package/core/api/ThrottleFunction.cjs +0 -2
  82. package/core/api/ThrottleFunction.d.ts +0 -1
  83. package/core/api/ThrottleFunction.js +0 -1
  84. package/core/api/callWithRetryAndThrottle.cjs +0 -7
  85. package/core/api/callWithRetryAndThrottle.d.ts +0 -7
  86. package/core/api/callWithRetryAndThrottle.js +0 -3
  87. package/core/api/index.cjs +0 -42
  88. package/core/api/index.d.ts +0 -13
  89. package/core/api/index.js +0 -13
  90. package/core/api/loadApiKey.cjs +0 -22
  91. package/core/api/loadApiKey.d.ts +0 -6
  92. package/core/api/loadApiKey.js +0 -18
  93. package/core/api/postToApi.cjs +0 -185
  94. package/core/api/postToApi.d.ts +0 -37
  95. package/core/api/postToApi.js +0 -175
  96. package/core/api/retryNever.cjs +0 -8
  97. package/core/api/retryNever.d.ts +0 -4
  98. package/core/api/retryNever.js +0 -4
  99. package/core/api/retryWithExponentialBackoff.cjs +0 -50
  100. package/core/api/retryWithExponentialBackoff.d.ts +0 -10
  101. package/core/api/retryWithExponentialBackoff.js +0 -46
  102. package/core/api/throttleMaxConcurrency.cjs +0 -65
  103. package/core/api/throttleMaxConcurrency.d.ts +0 -7
  104. package/core/api/throttleMaxConcurrency.js +0 -61
  105. package/core/api/throttleOff.cjs +0 -8
  106. package/core/api/throttleOff.d.ts +0 -5
  107. package/core/api/throttleOff.js +0 -4
  108. package/core/cache/Cache.cjs +0 -2
  109. package/core/cache/Cache.d.ts +0 -12
  110. package/core/cache/Cache.js +0 -1
  111. package/core/cache/MemoryCache.cjs +0 -23
  112. package/core/cache/MemoryCache.d.ts +0 -15
  113. package/core/cache/MemoryCache.js +0 -19
  114. package/core/cache/index.cjs +0 -18
  115. package/core/cache/index.d.ts +0 -2
  116. package/core/cache/index.js +0 -2
  117. package/core/executeFunction.cjs +0 -13
  118. package/core/executeFunction.d.ts +0 -2
  119. package/core/executeFunction.js +0 -9
  120. package/core/executeFunctionCall.cjs +0 -86
  121. package/core/executeFunctionCall.d.ts +0 -10
  122. package/core/executeFunctionCall.js +0 -82
  123. package/core/getFunctionCallLogger.cjs +0 -106
  124. package/core/getFunctionCallLogger.d.ts +0 -3
  125. package/core/getFunctionCallLogger.js +0 -102
  126. package/core/getRun.cjs +0 -57
  127. package/core/getRun.d.ts +0 -9
  128. package/core/getRun.js +0 -29
  129. package/core/index.cjs +0 -44
  130. package/core/index.d.ts +0 -15
  131. package/core/index.js +0 -15
  132. package/core/schema/JSONParseError.cjs +0 -37
  133. package/core/schema/JSONParseError.d.ts +0 -15
  134. package/core/schema/JSONParseError.js +0 -33
  135. package/core/schema/JsonSchemaProducer.cjs +0 -2
  136. package/core/schema/JsonSchemaProducer.d.ts +0 -9
  137. package/core/schema/JsonSchemaProducer.js +0 -1
  138. package/core/schema/Schema.cjs +0 -2
  139. package/core/schema/Schema.d.ts +0 -20
  140. package/core/schema/Schema.js +0 -1
  141. package/core/schema/TypeValidationError.cjs +0 -36
  142. package/core/schema/TypeValidationError.d.ts +0 -15
  143. package/core/schema/TypeValidationError.js +0 -32
  144. package/core/schema/UncheckedSchema.cjs +0 -30
  145. package/core/schema/UncheckedSchema.d.ts +0 -16
  146. package/core/schema/UncheckedSchema.js +0 -25
  147. package/core/schema/ZodSchema.cjs +0 -47
  148. package/core/schema/ZodSchema.d.ts +0 -27
  149. package/core/schema/ZodSchema.js +0 -42
  150. package/core/schema/index.cjs +0 -24
  151. package/core/schema/index.d.ts +0 -8
  152. package/core/schema/index.js +0 -8
  153. package/core/schema/parseJSON.cjs +0 -48
  154. package/core/schema/parseJSON.d.ts +0 -57
  155. package/core/schema/parseJSON.js +0 -40
  156. package/core/schema/validateTypes.cjs +0 -65
  157. package/core/schema/validateTypes.d.ts +0 -34
  158. package/core/schema/validateTypes.js +0 -60
  159. package/model-function/AbstractModel.cjs +0 -22
  160. package/model-function/AbstractModel.d.ts +0 -13
  161. package/model-function/AbstractModel.js +0 -18
  162. package/model-function/Delta.cjs +0 -2
  163. package/model-function/Delta.d.ts +0 -7
  164. package/model-function/Delta.js +0 -1
  165. package/model-function/Model.cjs +0 -2
  166. package/model-function/Model.d.ts +0 -31
  167. package/model-function/Model.js +0 -1
  168. package/model-function/ModelCallEvent.cjs +0 -2
  169. package/model-function/ModelCallEvent.d.ts +0 -57
  170. package/model-function/ModelCallEvent.js +0 -1
  171. package/model-function/ModelCallMetadata.cjs +0 -2
  172. package/model-function/ModelCallMetadata.d.ts +0 -13
  173. package/model-function/ModelCallMetadata.js +0 -1
  174. package/model-function/ModelInformation.cjs +0 -2
  175. package/model-function/ModelInformation.d.ts +0 -4
  176. package/model-function/ModelInformation.js +0 -1
  177. package/model-function/PromptTemplate.cjs +0 -2
  178. package/model-function/PromptTemplate.d.ts +0 -9
  179. package/model-function/PromptTemplate.js +0 -1
  180. package/model-function/classify/Classifier.cjs +0 -2
  181. package/model-function/classify/Classifier.d.ts +0 -10
  182. package/model-function/classify/Classifier.js +0 -1
  183. package/model-function/classify/ClassifyEvent.cjs +0 -2
  184. package/model-function/classify/ClassifyEvent.d.ts +0 -20
  185. package/model-function/classify/ClassifyEvent.js +0 -1
  186. package/model-function/classify/EmbeddingSimilarityClassifier.cjs +0 -97
  187. package/model-function/classify/EmbeddingSimilarityClassifier.d.ts +0 -40
  188. package/model-function/classify/EmbeddingSimilarityClassifier.js +0 -93
  189. package/model-function/classify/classify.cjs +0 -27
  190. package/model-function/classify/classify.d.ts +0 -17
  191. package/model-function/classify/classify.js +0 -23
  192. package/model-function/classify/index.cjs +0 -20
  193. package/model-function/classify/index.d.ts +0 -4
  194. package/model-function/classify/index.js +0 -4
  195. package/model-function/embed/EmbeddingEvent.cjs +0 -2
  196. package/model-function/embed/EmbeddingEvent.d.ts +0 -21
  197. package/model-function/embed/EmbeddingEvent.js +0 -1
  198. package/model-function/embed/EmbeddingModel.cjs +0 -2
  199. package/model-function/embed/EmbeddingModel.d.ts +0 -23
  200. package/model-function/embed/EmbeddingModel.js +0 -1
  201. package/model-function/embed/embed.cjs +0 -77
  202. package/model-function/embed/embed.d.ts +0 -67
  203. package/model-function/embed/embed.js +0 -72
  204. package/model-function/executeStandardCall.cjs +0 -111
  205. package/model-function/executeStandardCall.d.ts +0 -19
  206. package/model-function/executeStandardCall.js +0 -107
  207. package/model-function/executeStreamCall.cjs +0 -180
  208. package/model-function/executeStreamCall.d.ts +0 -20
  209. package/model-function/executeStreamCall.js +0 -176
  210. package/model-function/generate-image/ImageGenerationEvent.cjs +0 -2
  211. package/model-function/generate-image/ImageGenerationEvent.d.ts +0 -18
  212. package/model-function/generate-image/ImageGenerationEvent.js +0 -1
  213. package/model-function/generate-image/ImageGenerationModel.cjs +0 -2
  214. package/model-function/generate-image/ImageGenerationModel.d.ts +0 -22
  215. package/model-function/generate-image/ImageGenerationModel.js +0 -1
  216. package/model-function/generate-image/PromptTemplateImageGenerationModel.cjs +0 -44
  217. package/model-function/generate-image/PromptTemplateImageGenerationModel.d.ts +0 -20
  218. package/model-function/generate-image/PromptTemplateImageGenerationModel.js +0 -40
  219. package/model-function/generate-image/generateImage.cjs +0 -33
  220. package/model-function/generate-image/generateImage.d.ts +0 -43
  221. package/model-function/generate-image/generateImage.js +0 -29
  222. package/model-function/generate-object/ObjectFromTextGenerationModel.cjs +0 -69
  223. package/model-function/generate-object/ObjectFromTextGenerationModel.d.ts +0 -24
  224. package/model-function/generate-object/ObjectFromTextGenerationModel.js +0 -65
  225. package/model-function/generate-object/ObjectFromTextPromptTemplate.cjs +0 -2
  226. package/model-function/generate-object/ObjectFromTextPromptTemplate.d.ts +0 -30
  227. package/model-function/generate-object/ObjectFromTextPromptTemplate.js +0 -1
  228. package/model-function/generate-object/ObjectFromTextStreamingModel.cjs +0 -48
  229. package/model-function/generate-object/ObjectFromTextStreamingModel.d.ts +0 -19
  230. package/model-function/generate-object/ObjectFromTextStreamingModel.js +0 -44
  231. package/model-function/generate-object/ObjectGenerationEvent.cjs +0 -2
  232. package/model-function/generate-object/ObjectGenerationEvent.d.ts +0 -23
  233. package/model-function/generate-object/ObjectGenerationEvent.js +0 -1
  234. package/model-function/generate-object/ObjectGenerationModel.cjs +0 -2
  235. package/model-function/generate-object/ObjectGenerationModel.d.ts +0 -24
  236. package/model-function/generate-object/ObjectGenerationModel.js +0 -1
  237. package/model-function/generate-object/ObjectParseError.cjs +0 -36
  238. package/model-function/generate-object/ObjectParseError.d.ts +0 -15
  239. package/model-function/generate-object/ObjectParseError.js +0 -32
  240. package/model-function/generate-object/ObjectStream.cjs +0 -57
  241. package/model-function/generate-object/ObjectStream.d.ts +0 -32
  242. package/model-function/generate-object/ObjectStream.js +0 -52
  243. package/model-function/generate-object/ObjectStreamingEvent.cjs +0 -2
  244. package/model-function/generate-object/ObjectStreamingEvent.d.ts +0 -7
  245. package/model-function/generate-object/ObjectStreamingEvent.js +0 -1
  246. package/model-function/generate-object/ObjectValidationError.cjs +0 -44
  247. package/model-function/generate-object/ObjectValidationError.d.ts +0 -18
  248. package/model-function/generate-object/ObjectValidationError.js +0 -40
  249. package/model-function/generate-object/generateObject.cjs +0 -45
  250. package/model-function/generate-object/generateObject.d.ts +0 -56
  251. package/model-function/generate-object/generateObject.js +0 -41
  252. package/model-function/generate-object/index.cjs +0 -28
  253. package/model-function/generate-object/index.d.ts +0 -12
  254. package/model-function/generate-object/index.js +0 -12
  255. package/model-function/generate-object/jsonObjectPrompt.cjs +0 -51
  256. package/model-function/generate-object/jsonObjectPrompt.d.ts +0 -15
  257. package/model-function/generate-object/jsonObjectPrompt.js +0 -48
  258. package/model-function/generate-object/streamObject.cjs +0 -80
  259. package/model-function/generate-object/streamObject.d.ts +0 -57
  260. package/model-function/generate-object/streamObject.js +0 -76
  261. package/model-function/generate-speech/SpeechGenerationEvent.cjs +0 -2
  262. package/model-function/generate-speech/SpeechGenerationEvent.d.ts +0 -26
  263. package/model-function/generate-speech/SpeechGenerationEvent.js +0 -1
  264. package/model-function/generate-speech/SpeechGenerationModel.cjs +0 -2
  265. package/model-function/generate-speech/SpeechGenerationModel.d.ts +0 -14
  266. package/model-function/generate-speech/SpeechGenerationModel.js +0 -1
  267. package/model-function/generate-speech/generateSpeech.cjs +0 -27
  268. package/model-function/generate-speech/generateSpeech.d.ts +0 -34
  269. package/model-function/generate-speech/generateSpeech.js +0 -23
  270. package/model-function/generate-speech/index.cjs +0 -20
  271. package/model-function/generate-speech/index.d.ts +0 -4
  272. package/model-function/generate-speech/index.js +0 -4
  273. package/model-function/generate-speech/streamSpeech.cjs +0 -33
  274. package/model-function/generate-speech/streamSpeech.d.ts +0 -40
  275. package/model-function/generate-speech/streamSpeech.js +0 -29
  276. package/model-function/generate-text/PromptTemplateFullTextModel.cjs +0 -24
  277. package/model-function/generate-text/PromptTemplateFullTextModel.d.ts +0 -40
  278. package/model-function/generate-text/PromptTemplateFullTextModel.js +0 -20
  279. package/model-function/generate-text/PromptTemplateTextGenerationModel.cjs +0 -84
  280. package/model-function/generate-text/PromptTemplateTextGenerationModel.d.ts +0 -47
  281. package/model-function/generate-text/PromptTemplateTextGenerationModel.js +0 -80
  282. package/model-function/generate-text/PromptTemplateTextStreamingModel.cjs +0 -36
  283. package/model-function/generate-text/PromptTemplateTextStreamingModel.d.ts +0 -19
  284. package/model-function/generate-text/PromptTemplateTextStreamingModel.js +0 -32
  285. package/model-function/generate-text/TextGenerationEvent.cjs +0 -2
  286. package/model-function/generate-text/TextGenerationEvent.d.ts +0 -29
  287. package/model-function/generate-text/TextGenerationEvent.js +0 -1
  288. package/model-function/generate-text/TextGenerationModel.cjs +0 -9
  289. package/model-function/generate-text/TextGenerationModel.d.ts +0 -126
  290. package/model-function/generate-text/TextGenerationModel.js +0 -6
  291. package/model-function/generate-text/TextGenerationPromptTemplate.cjs +0 -2
  292. package/model-function/generate-text/TextGenerationPromptTemplate.d.ts +0 -11
  293. package/model-function/generate-text/TextGenerationPromptTemplate.js +0 -1
  294. package/model-function/generate-text/TextGenerationResult.cjs +0 -2
  295. package/model-function/generate-text/TextGenerationResult.d.ts +0 -11
  296. package/model-function/generate-text/TextGenerationResult.js +0 -1
  297. package/model-function/generate-text/generateText.cjs +0 -82
  298. package/model-function/generate-text/generateText.d.ts +0 -41
  299. package/model-function/generate-text/generateText.js +0 -78
  300. package/model-function/generate-text/index.cjs +0 -26
  301. package/model-function/generate-text/index.d.ts +0 -10
  302. package/model-function/generate-text/index.js +0 -10
  303. package/model-function/generate-text/prompt-template/AlpacaPromptTemplate.cjs +0 -90
  304. package/model-function/generate-text/prompt-template/AlpacaPromptTemplate.d.ts +0 -51
  305. package/model-function/generate-text/prompt-template/AlpacaPromptTemplate.js +0 -84
  306. package/model-function/generate-text/prompt-template/AlpacaPromptTemplate.test.cjs +0 -31
  307. package/model-function/generate-text/prompt-template/AlpacaPromptTemplate.test.d.ts +0 -1
  308. package/model-function/generate-text/prompt-template/AlpacaPromptTemplate.test.js +0 -29
  309. package/model-function/generate-text/prompt-template/ChatMLPromptTemplate.cjs +0 -96
  310. package/model-function/generate-text/prompt-template/ChatMLPromptTemplate.d.ts +0 -35
  311. package/model-function/generate-text/prompt-template/ChatMLPromptTemplate.js +0 -90
  312. package/model-function/generate-text/prompt-template/ChatMLPromptTemplate.test.cjs +0 -60
  313. package/model-function/generate-text/prompt-template/ChatMLPromptTemplate.test.d.ts +0 -1
  314. package/model-function/generate-text/prompt-template/ChatMLPromptTemplate.test.js +0 -58
  315. package/model-function/generate-text/prompt-template/ChatPrompt.cjs +0 -44
  316. package/model-function/generate-text/prompt-template/ChatPrompt.d.ts +0 -58
  317. package/model-function/generate-text/prompt-template/ChatPrompt.js +0 -41
  318. package/model-function/generate-text/prompt-template/ContentPart.cjs +0 -11
  319. package/model-function/generate-text/prompt-template/ContentPart.d.ts +0 -31
  320. package/model-function/generate-text/prompt-template/ContentPart.js +0 -7
  321. package/model-function/generate-text/prompt-template/InstructionPrompt.cjs +0 -2
  322. package/model-function/generate-text/prompt-template/InstructionPrompt.d.ts +0 -32
  323. package/model-function/generate-text/prompt-template/InstructionPrompt.js +0 -1
  324. package/model-function/generate-text/prompt-template/InvalidPromptError.cjs +0 -28
  325. package/model-function/generate-text/prompt-template/InvalidPromptError.d.ts +0 -13
  326. package/model-function/generate-text/prompt-template/InvalidPromptError.js +0 -24
  327. package/model-function/generate-text/prompt-template/Llama2PromptTemplate.cjs +0 -135
  328. package/model-function/generate-text/prompt-template/Llama2PromptTemplate.d.ts +0 -55
  329. package/model-function/generate-text/prompt-template/Llama2PromptTemplate.js +0 -128
  330. package/model-function/generate-text/prompt-template/Llama2PromptTemplate.test.cjs +0 -60
  331. package/model-function/generate-text/prompt-template/Llama2PromptTemplate.test.d.ts +0 -1
  332. package/model-function/generate-text/prompt-template/Llama2PromptTemplate.test.js +0 -58
  333. package/model-function/generate-text/prompt-template/MistralInstructPromptTemplate.cjs +0 -150
  334. package/model-function/generate-text/prompt-template/MistralInstructPromptTemplate.d.ts +0 -62
  335. package/model-function/generate-text/prompt-template/MistralInstructPromptTemplate.js +0 -143
  336. package/model-function/generate-text/prompt-template/MistralInstructPromptTemplate.test.cjs +0 -60
  337. package/model-function/generate-text/prompt-template/MistralInstructPromptTemplate.test.d.ts +0 -1
  338. package/model-function/generate-text/prompt-template/MistralInstructPromptTemplate.test.js +0 -58
  339. package/model-function/generate-text/prompt-template/NeuralChatPromptTemplate.cjs +0 -86
  340. package/model-function/generate-text/prompt-template/NeuralChatPromptTemplate.d.ts +0 -23
  341. package/model-function/generate-text/prompt-template/NeuralChatPromptTemplate.js +0 -80
  342. package/model-function/generate-text/prompt-template/NeuralChatPromptTemplate.test.cjs +0 -60
  343. package/model-function/generate-text/prompt-template/NeuralChatPromptTemplate.test.d.ts +0 -1
  344. package/model-function/generate-text/prompt-template/NeuralChatPromptTemplate.test.js +0 -58
  345. package/model-function/generate-text/prompt-template/PromptTemplateProvider.cjs +0 -2
  346. package/model-function/generate-text/prompt-template/PromptTemplateProvider.d.ts +0 -8
  347. package/model-function/generate-text/prompt-template/PromptTemplateProvider.js +0 -1
  348. package/model-function/generate-text/prompt-template/SynthiaPromptTemplate.cjs +0 -78
  349. package/model-function/generate-text/prompt-template/SynthiaPromptTemplate.d.ts +0 -35
  350. package/model-function/generate-text/prompt-template/SynthiaPromptTemplate.js +0 -72
  351. package/model-function/generate-text/prompt-template/SynthiaPromptTemplate.test.cjs +0 -60
  352. package/model-function/generate-text/prompt-template/SynthiaPromptTemplate.test.d.ts +0 -1
  353. package/model-function/generate-text/prompt-template/SynthiaPromptTemplate.test.js +0 -58
  354. package/model-function/generate-text/prompt-template/TextPromptTemplate.cjs +0 -69
  355. package/model-function/generate-text/prompt-template/TextPromptTemplate.d.ts +0 -23
  356. package/model-function/generate-text/prompt-template/TextPromptTemplate.js +0 -63
  357. package/model-function/generate-text/prompt-template/TextPromptTemplate.test.cjs +0 -60
  358. package/model-function/generate-text/prompt-template/TextPromptTemplate.test.d.ts +0 -1
  359. package/model-function/generate-text/prompt-template/TextPromptTemplate.test.js +0 -58
  360. package/model-function/generate-text/prompt-template/VicunaPromptTemplate.cjs +0 -86
  361. package/model-function/generate-text/prompt-template/VicunaPromptTemplate.d.ts +0 -25
  362. package/model-function/generate-text/prompt-template/VicunaPromptTemplate.js +0 -80
  363. package/model-function/generate-text/prompt-template/VicunaPromptTemplate.test.cjs +0 -60
  364. package/model-function/generate-text/prompt-template/VicunaPromptTemplate.test.d.ts +0 -1
  365. package/model-function/generate-text/prompt-template/VicunaPromptTemplate.test.js +0 -58
  366. package/model-function/generate-text/prompt-template/index.cjs +0 -43
  367. package/model-function/generate-text/prompt-template/index.d.ts +0 -14
  368. package/model-function/generate-text/prompt-template/index.js +0 -14
  369. package/model-function/generate-text/prompt-template/trimChatPrompt.cjs +0 -46
  370. package/model-function/generate-text/prompt-template/trimChatPrompt.d.ts +0 -17
  371. package/model-function/generate-text/prompt-template/trimChatPrompt.js +0 -42
  372. package/model-function/generate-text/streamText.cjs +0 -54
  373. package/model-function/generate-text/streamText.d.ts +0 -42
  374. package/model-function/generate-text/streamText.js +0 -50
  375. package/model-function/generate-transcription/TranscriptionEvent.cjs +0 -2
  376. package/model-function/generate-transcription/TranscriptionEvent.d.ts +0 -18
  377. package/model-function/generate-transcription/TranscriptionEvent.js +0 -1
  378. package/model-function/generate-transcription/TranscriptionModel.cjs +0 -2
  379. package/model-function/generate-transcription/TranscriptionModel.d.ts +0 -14
  380. package/model-function/generate-transcription/TranscriptionModel.js +0 -1
  381. package/model-function/generate-transcription/generateTranscription.cjs +0 -22
  382. package/model-function/generate-transcription/generateTranscription.d.ts +0 -41
  383. package/model-function/generate-transcription/generateTranscription.js +0 -18
  384. package/model-function/index.cjs +0 -38
  385. package/model-function/index.d.ts +0 -22
  386. package/model-function/index.js +0 -22
  387. package/model-function/tokenize-text/Tokenizer.cjs +0 -2
  388. package/model-function/tokenize-text/Tokenizer.d.ts +0 -43
  389. package/model-function/tokenize-text/Tokenizer.js +0 -1
  390. package/model-function/tokenize-text/countTokens.cjs +0 -10
  391. package/model-function/tokenize-text/countTokens.d.ts +0 -5
  392. package/model-function/tokenize-text/countTokens.js +0 -6
  393. package/model-provider/automatic1111/Automatic1111ApiConfiguration.cjs +0 -22
  394. package/model-provider/automatic1111/Automatic1111ApiConfiguration.d.ts +0 -8
  395. package/model-provider/automatic1111/Automatic1111ApiConfiguration.js +0 -18
  396. package/model-provider/automatic1111/Automatic1111Error.cjs +0 -16
  397. package/model-provider/automatic1111/Automatic1111Error.d.ts +0 -22
  398. package/model-provider/automatic1111/Automatic1111Error.js +0 -13
  399. package/model-provider/automatic1111/Automatic1111Facade.cjs +0 -24
  400. package/model-provider/automatic1111/Automatic1111Facade.d.ts +0 -16
  401. package/model-provider/automatic1111/Automatic1111Facade.js +0 -19
  402. package/model-provider/automatic1111/Automatic1111ImageGenerationModel.cjs +0 -101
  403. package/model-provider/automatic1111/Automatic1111ImageGenerationModel.d.ts +0 -68
  404. package/model-provider/automatic1111/Automatic1111ImageGenerationModel.js +0 -97
  405. package/model-provider/automatic1111/Automatic1111ImageGenerationPrompt.cjs +0 -12
  406. package/model-provider/automatic1111/Automatic1111ImageGenerationPrompt.d.ts +0 -9
  407. package/model-provider/automatic1111/Automatic1111ImageGenerationPrompt.js +0 -8
  408. package/model-provider/automatic1111/index.cjs +0 -33
  409. package/model-provider/automatic1111/index.d.ts +0 -5
  410. package/model-provider/automatic1111/index.js +0 -4
  411. package/model-provider/cohere/CohereApiConfiguration.cjs +0 -30
  412. package/model-provider/cohere/CohereApiConfiguration.d.ts +0 -10
  413. package/model-provider/cohere/CohereApiConfiguration.js +0 -26
  414. package/model-provider/cohere/CohereError.cjs +0 -13
  415. package/model-provider/cohere/CohereError.d.ts +0 -11
  416. package/model-provider/cohere/CohereError.js +0 -10
  417. package/model-provider/cohere/CohereFacade.cjs +0 -80
  418. package/model-provider/cohere/CohereFacade.d.ts +0 -68
  419. package/model-provider/cohere/CohereFacade.js +0 -73
  420. package/model-provider/cohere/CohereTextEmbeddingModel.cjs +0 -170
  421. package/model-provider/cohere/CohereTextEmbeddingModel.d.ts +0 -131
  422. package/model-provider/cohere/CohereTextEmbeddingModel.js +0 -166
  423. package/model-provider/cohere/CohereTextGenerationModel.cjs +0 -244
  424. package/model-provider/cohere/CohereTextGenerationModel.d.ts +0 -379
  425. package/model-provider/cohere/CohereTextGenerationModel.js +0 -240
  426. package/model-provider/cohere/CohereTextGenerationModel.test.cjs +0 -36
  427. package/model-provider/cohere/CohereTextGenerationModel.test.d.ts +0 -1
  428. package/model-provider/cohere/CohereTextGenerationModel.test.js +0 -34
  429. package/model-provider/cohere/CohereTokenizer.cjs +0 -116
  430. package/model-provider/cohere/CohereTokenizer.d.ts +0 -113
  431. package/model-provider/cohere/CohereTokenizer.js +0 -112
  432. package/model-provider/cohere/index.cjs +0 -34
  433. package/model-provider/cohere/index.d.ts +0 -6
  434. package/model-provider/cohere/index.js +0 -5
  435. package/model-provider/elevenlabs/ElevenLabsApiConfiguration.cjs +0 -33
  436. package/model-provider/elevenlabs/ElevenLabsApiConfiguration.d.ts +0 -11
  437. package/model-provider/elevenlabs/ElevenLabsApiConfiguration.js +0 -29
  438. package/model-provider/elevenlabs/ElevenLabsFacade.cjs +0 -27
  439. package/model-provider/elevenlabs/ElevenLabsFacade.d.ts +0 -21
  440. package/model-provider/elevenlabs/ElevenLabsFacade.js +0 -22
  441. package/model-provider/elevenlabs/ElevenLabsSpeechModel.cjs +0 -218
  442. package/model-provider/elevenlabs/ElevenLabsSpeechModel.d.ts +0 -43
  443. package/model-provider/elevenlabs/ElevenLabsSpeechModel.js +0 -214
  444. package/model-provider/elevenlabs/index.cjs +0 -32
  445. package/model-provider/elevenlabs/index.d.ts +0 -3
  446. package/model-provider/elevenlabs/index.js +0 -3
  447. package/model-provider/huggingface/HuggingFaceApiConfiguration.cjs +0 -30
  448. package/model-provider/huggingface/HuggingFaceApiConfiguration.d.ts +0 -10
  449. package/model-provider/huggingface/HuggingFaceApiConfiguration.js +0 -26
  450. package/model-provider/huggingface/HuggingFaceError.cjs +0 -13
  451. package/model-provider/huggingface/HuggingFaceError.d.ts +0 -11
  452. package/model-provider/huggingface/HuggingFaceError.js +0 -10
  453. package/model-provider/huggingface/HuggingFaceFacade.cjs +0 -64
  454. package/model-provider/huggingface/HuggingFaceFacade.d.ts +0 -55
  455. package/model-provider/huggingface/HuggingFaceFacade.js +0 -58
  456. package/model-provider/huggingface/HuggingFaceTextEmbeddingModel.cjs +0 -131
  457. package/model-provider/huggingface/HuggingFaceTextEmbeddingModel.d.ts +0 -56
  458. package/model-provider/huggingface/HuggingFaceTextEmbeddingModel.js +0 -127
  459. package/model-provider/huggingface/HuggingFaceTextGenerationModel.cjs +0 -144
  460. package/model-provider/huggingface/HuggingFaceTextGenerationModel.d.ts +0 -84
  461. package/model-provider/huggingface/HuggingFaceTextGenerationModel.js +0 -140
  462. package/model-provider/huggingface/index.cjs +0 -33
  463. package/model-provider/huggingface/index.d.ts +0 -5
  464. package/model-provider/huggingface/index.js +0 -4
  465. package/model-provider/index.cjs +0 -28
  466. package/model-provider/index.d.ts +0 -12
  467. package/model-provider/index.js +0 -12
  468. package/model-provider/llamacpp/LlamaCppApiConfiguration.cjs +0 -22
  469. package/model-provider/llamacpp/LlamaCppApiConfiguration.d.ts +0 -8
  470. package/model-provider/llamacpp/LlamaCppApiConfiguration.js +0 -18
  471. package/model-provider/llamacpp/LlamaCppBakLLaVA1PromptTemplate.cjs +0 -119
  472. package/model-provider/llamacpp/LlamaCppBakLLaVA1PromptTemplate.d.ts +0 -15
  473. package/model-provider/llamacpp/LlamaCppBakLLaVA1PromptTemplate.js +0 -113
  474. package/model-provider/llamacpp/LlamaCppCompletionModel.cjs +0 -326
  475. package/model-provider/llamacpp/LlamaCppCompletionModel.d.ts +0 -957
  476. package/model-provider/llamacpp/LlamaCppCompletionModel.js +0 -322
  477. package/model-provider/llamacpp/LlamaCppCompletionModel.test.cjs +0 -40
  478. package/model-provider/llamacpp/LlamaCppCompletionModel.test.d.ts +0 -1
  479. package/model-provider/llamacpp/LlamaCppCompletionModel.test.js +0 -38
  480. package/model-provider/llamacpp/LlamaCppError.cjs +0 -13
  481. package/model-provider/llamacpp/LlamaCppError.d.ts +0 -11
  482. package/model-provider/llamacpp/LlamaCppError.js +0 -10
  483. package/model-provider/llamacpp/LlamaCppFacade.cjs +0 -55
  484. package/model-provider/llamacpp/LlamaCppFacade.d.ts +0 -19
  485. package/model-provider/llamacpp/LlamaCppFacade.js +0 -25
  486. package/model-provider/llamacpp/LlamaCppGrammars.cjs +0 -86
  487. package/model-provider/llamacpp/LlamaCppGrammars.d.ts +0 -19
  488. package/model-provider/llamacpp/LlamaCppGrammars.js +0 -82
  489. package/model-provider/llamacpp/LlamaCppPrompt.cjs +0 -93
  490. package/model-provider/llamacpp/LlamaCppPrompt.d.ts +0 -47
  491. package/model-provider/llamacpp/LlamaCppPrompt.js +0 -65
  492. package/model-provider/llamacpp/LlamaCppTextEmbeddingModel.cjs +0 -96
  493. package/model-provider/llamacpp/LlamaCppTextEmbeddingModel.d.ts +0 -39
  494. package/model-provider/llamacpp/LlamaCppTextEmbeddingModel.js +0 -92
  495. package/model-provider/llamacpp/LlamaCppTokenizer.cjs +0 -64
  496. package/model-provider/llamacpp/LlamaCppTokenizer.d.ts +0 -32
  497. package/model-provider/llamacpp/LlamaCppTokenizer.js +0 -60
  498. package/model-provider/llamacpp/convertJsonSchemaToGBNF.cjs +0 -113
  499. package/model-provider/llamacpp/convertJsonSchemaToGBNF.d.ts +0 -7
  500. package/model-provider/llamacpp/convertJsonSchemaToGBNF.js +0 -109
  501. package/model-provider/llamacpp/convertJsonSchemaToGBNF.test.cjs +0 -150
  502. package/model-provider/llamacpp/convertJsonSchemaToGBNF.test.d.ts +0 -1
  503. package/model-provider/llamacpp/convertJsonSchemaToGBNF.test.js +0 -148
  504. package/model-provider/llamacpp/index.cjs +0 -34
  505. package/model-provider/llamacpp/index.d.ts +0 -6
  506. package/model-provider/llamacpp/index.js +0 -5
  507. package/model-provider/lmnt/LmntApiConfiguration.cjs +0 -30
  508. package/model-provider/lmnt/LmntApiConfiguration.d.ts +0 -10
  509. package/model-provider/lmnt/LmntApiConfiguration.js +0 -26
  510. package/model-provider/lmnt/LmntFacade.cjs +0 -24
  511. package/model-provider/lmnt/LmntFacade.d.ts +0 -18
  512. package/model-provider/lmnt/LmntFacade.js +0 -19
  513. package/model-provider/lmnt/LmntSpeechModel.cjs +0 -103
  514. package/model-provider/lmnt/LmntSpeechModel.d.ts +0 -73
  515. package/model-provider/lmnt/LmntSpeechModel.js +0 -99
  516. package/model-provider/lmnt/index.cjs +0 -32
  517. package/model-provider/lmnt/index.d.ts +0 -3
  518. package/model-provider/lmnt/index.js +0 -3
  519. package/model-provider/mistral/MistralApiConfiguration.cjs +0 -30
  520. package/model-provider/mistral/MistralApiConfiguration.d.ts +0 -10
  521. package/model-provider/mistral/MistralApiConfiguration.js +0 -26
  522. package/model-provider/mistral/MistralChatModel.cjs +0 -203
  523. package/model-provider/mistral/MistralChatModel.d.ts +0 -357
  524. package/model-provider/mistral/MistralChatModel.js +0 -199
  525. package/model-provider/mistral/MistralChatModel.test.cjs +0 -58
  526. package/model-provider/mistral/MistralChatModel.test.d.ts +0 -1
  527. package/model-provider/mistral/MistralChatModel.test.js +0 -56
  528. package/model-provider/mistral/MistralChatPromptTemplate.cjs +0 -72
  529. package/model-provider/mistral/MistralChatPromptTemplate.d.ts +0 -16
  530. package/model-provider/mistral/MistralChatPromptTemplate.js +0 -66
  531. package/model-provider/mistral/MistralError.cjs +0 -17
  532. package/model-provider/mistral/MistralError.d.ts +0 -25
  533. package/model-provider/mistral/MistralError.js +0 -14
  534. package/model-provider/mistral/MistralFacade.cjs +0 -22
  535. package/model-provider/mistral/MistralFacade.d.ts +0 -14
  536. package/model-provider/mistral/MistralFacade.js +0 -16
  537. package/model-provider/mistral/MistralTextEmbeddingModel.cjs +0 -106
  538. package/model-provider/mistral/MistralTextEmbeddingModel.d.ts +0 -106
  539. package/model-provider/mistral/MistralTextEmbeddingModel.js +0 -102
  540. package/model-provider/mistral/index.cjs +0 -33
  541. package/model-provider/mistral/index.d.ts +0 -5
  542. package/model-provider/mistral/index.js +0 -4
  543. package/model-provider/ollama/OllamaApiConfiguration.cjs +0 -22
  544. package/model-provider/ollama/OllamaApiConfiguration.d.ts +0 -8
  545. package/model-provider/ollama/OllamaApiConfiguration.js +0 -18
  546. package/model-provider/ollama/OllamaChatModel.cjs +0 -290
  547. package/model-provider/ollama/OllamaChatModel.d.ts +0 -285
  548. package/model-provider/ollama/OllamaChatModel.js +0 -286
  549. package/model-provider/ollama/OllamaChatModel.test.cjs +0 -32
  550. package/model-provider/ollama/OllamaChatModel.test.d.ts +0 -1
  551. package/model-provider/ollama/OllamaChatModel.test.js +0 -30
  552. package/model-provider/ollama/OllamaChatPromptTemplate.cjs +0 -103
  553. package/model-provider/ollama/OllamaChatPromptTemplate.d.ts +0 -20
  554. package/model-provider/ollama/OllamaChatPromptTemplate.js +0 -96
  555. package/model-provider/ollama/OllamaCompletionModel.cjs +0 -296
  556. package/model-provider/ollama/OllamaCompletionModel.d.ts +0 -302
  557. package/model-provider/ollama/OllamaCompletionModel.js +0 -292
  558. package/model-provider/ollama/OllamaCompletionModel.test.cjs +0 -136
  559. package/model-provider/ollama/OllamaCompletionModel.test.d.ts +0 -1
  560. package/model-provider/ollama/OllamaCompletionModel.test.js +0 -134
  561. package/model-provider/ollama/OllamaCompletionPrompt.cjs +0 -91
  562. package/model-provider/ollama/OllamaCompletionPrompt.d.ts +0 -45
  563. package/model-provider/ollama/OllamaCompletionPrompt.js +0 -63
  564. package/model-provider/ollama/OllamaError.cjs +0 -13
  565. package/model-provider/ollama/OllamaError.d.ts +0 -13
  566. package/model-provider/ollama/OllamaError.js +0 -10
  567. package/model-provider/ollama/OllamaFacade.cjs +0 -51
  568. package/model-provider/ollama/OllamaFacade.d.ts +0 -15
  569. package/model-provider/ollama/OllamaFacade.js +0 -21
  570. package/model-provider/ollama/OllamaTextEmbeddingModel.cjs +0 -82
  571. package/model-provider/ollama/OllamaTextEmbeddingModel.d.ts +0 -37
  572. package/model-provider/ollama/OllamaTextEmbeddingModel.js +0 -78
  573. package/model-provider/ollama/OllamaTextGenerationSettings.cjs +0 -2
  574. package/model-provider/ollama/OllamaTextGenerationSettings.d.ts +0 -87
  575. package/model-provider/ollama/OllamaTextGenerationSettings.js +0 -1
  576. package/model-provider/ollama/index.cjs +0 -35
  577. package/model-provider/ollama/index.d.ts +0 -7
  578. package/model-provider/ollama/index.js +0 -6
  579. package/model-provider/openai/AbstractOpenAIChatModel.cjs +0 -302
  580. package/model-provider/openai/AbstractOpenAIChatModel.d.ts +0 -805
  581. package/model-provider/openai/AbstractOpenAIChatModel.js +0 -298
  582. package/model-provider/openai/AbstractOpenAICompletionModel.cjs +0 -180
  583. package/model-provider/openai/AbstractOpenAICompletionModel.d.ts +0 -230
  584. package/model-provider/openai/AbstractOpenAICompletionModel.js +0 -176
  585. package/model-provider/openai/AbstractOpenAITextEmbeddingModel.cjs +0 -83
  586. package/model-provider/openai/AbstractOpenAITextEmbeddingModel.d.ts +0 -92
  587. package/model-provider/openai/AbstractOpenAITextEmbeddingModel.js +0 -79
  588. package/model-provider/openai/AzureOpenAIApiConfiguration.cjs +0 -58
  589. package/model-provider/openai/AzureOpenAIApiConfiguration.d.ts +0 -27
  590. package/model-provider/openai/AzureOpenAIApiConfiguration.js +0 -54
  591. package/model-provider/openai/OpenAIApiConfiguration.cjs +0 -30
  592. package/model-provider/openai/OpenAIApiConfiguration.d.ts +0 -10
  593. package/model-provider/openai/OpenAIApiConfiguration.js +0 -26
  594. package/model-provider/openai/OpenAIChatFunctionCallObjectGenerationModel.cjs +0 -169
  595. package/model-provider/openai/OpenAIChatFunctionCallObjectGenerationModel.d.ts +0 -201
  596. package/model-provider/openai/OpenAIChatFunctionCallObjectGenerationModel.js +0 -162
  597. package/model-provider/openai/OpenAIChatMessage.cjs +0 -79
  598. package/model-provider/openai/OpenAIChatMessage.d.ts +0 -84
  599. package/model-provider/openai/OpenAIChatMessage.js +0 -76
  600. package/model-provider/openai/OpenAIChatModel.cjs +0 -274
  601. package/model-provider/openai/OpenAIChatModel.d.ts +0 -166
  602. package/model-provider/openai/OpenAIChatModel.js +0 -267
  603. package/model-provider/openai/OpenAIChatModel.test.cjs +0 -101
  604. package/model-provider/openai/OpenAIChatModel.test.d.ts +0 -1
  605. package/model-provider/openai/OpenAIChatModel.test.js +0 -99
  606. package/model-provider/openai/OpenAIChatPromptTemplate.cjs +0 -114
  607. package/model-provider/openai/OpenAIChatPromptTemplate.d.ts +0 -20
  608. package/model-provider/openai/OpenAIChatPromptTemplate.js +0 -107
  609. package/model-provider/openai/OpenAICompletionModel.cjs +0 -126
  610. package/model-provider/openai/OpenAICompletionModel.d.ts +0 -65
  611. package/model-provider/openai/OpenAICompletionModel.js +0 -119
  612. package/model-provider/openai/OpenAICompletionModel.test.cjs +0 -59
  613. package/model-provider/openai/OpenAICompletionModel.test.d.ts +0 -1
  614. package/model-provider/openai/OpenAICompletionModel.test.js +0 -57
  615. package/model-provider/openai/OpenAIError.cjs +0 -22
  616. package/model-provider/openai/OpenAIError.d.ts +0 -36
  617. package/model-provider/openai/OpenAIError.js +0 -19
  618. package/model-provider/openai/OpenAIFacade.cjs +0 -173
  619. package/model-provider/openai/OpenAIFacade.d.ts +0 -146
  620. package/model-provider/openai/OpenAIFacade.js +0 -160
  621. package/model-provider/openai/OpenAIImageGenerationModel.cjs +0 -170
  622. package/model-provider/openai/OpenAIImageGenerationModel.d.ts +0 -132
  623. package/model-provider/openai/OpenAIImageGenerationModel.js +0 -165
  624. package/model-provider/openai/OpenAISpeechModel.cjs +0 -93
  625. package/model-provider/openai/OpenAISpeechModel.d.ts +0 -51
  626. package/model-provider/openai/OpenAISpeechModel.js +0 -88
  627. package/model-provider/openai/OpenAITextEmbeddingModel.cjs +0 -97
  628. package/model-provider/openai/OpenAITextEmbeddingModel.d.ts +0 -54
  629. package/model-provider/openai/OpenAITextEmbeddingModel.js +0 -91
  630. package/model-provider/openai/OpenAITranscriptionModel.cjs +0 -171
  631. package/model-provider/openai/OpenAITranscriptionModel.d.ts +0 -232
  632. package/model-provider/openai/OpenAITranscriptionModel.js +0 -166
  633. package/model-provider/openai/TikTokenTokenizer.cjs +0 -85
  634. package/model-provider/openai/TikTokenTokenizer.d.ts +0 -35
  635. package/model-provider/openai/TikTokenTokenizer.js +0 -78
  636. package/model-provider/openai/countOpenAIChatMessageTokens.cjs +0 -47
  637. package/model-provider/openai/countOpenAIChatMessageTokens.d.ts +0 -20
  638. package/model-provider/openai/countOpenAIChatMessageTokens.js +0 -42
  639. package/model-provider/openai/index.cjs +0 -44
  640. package/model-provider/openai/index.d.ts +0 -16
  641. package/model-provider/openai/index.js +0 -15
  642. package/model-provider/openai-compatible/FireworksAIApiConfiguration.cjs +0 -39
  643. package/model-provider/openai-compatible/FireworksAIApiConfiguration.d.ts +0 -15
  644. package/model-provider/openai-compatible/FireworksAIApiConfiguration.js +0 -35
  645. package/model-provider/openai-compatible/OpenAICompatibleApiConfiguration.cjs +0 -2
  646. package/model-provider/openai-compatible/OpenAICompatibleApiConfiguration.d.ts +0 -5
  647. package/model-provider/openai-compatible/OpenAICompatibleApiConfiguration.js +0 -1
  648. package/model-provider/openai-compatible/OpenAICompatibleChatModel.cjs +0 -98
  649. package/model-provider/openai-compatible/OpenAICompatibleChatModel.d.ts +0 -37
  650. package/model-provider/openai-compatible/OpenAICompatibleChatModel.js +0 -94
  651. package/model-provider/openai-compatible/OpenAICompatibleCompletionModel.cjs +0 -84
  652. package/model-provider/openai-compatible/OpenAICompatibleCompletionModel.d.ts +0 -34
  653. package/model-provider/openai-compatible/OpenAICompatibleCompletionModel.js +0 -80
  654. package/model-provider/openai-compatible/OpenAICompatibleFacade.cjs +0 -118
  655. package/model-provider/openai-compatible/OpenAICompatibleFacade.d.ts +0 -104
  656. package/model-provider/openai-compatible/OpenAICompatibleFacade.js +0 -109
  657. package/model-provider/openai-compatible/OpenAICompatibleTextEmbeddingModel.cjs +0 -27
  658. package/model-provider/openai-compatible/OpenAICompatibleTextEmbeddingModel.d.ts +0 -17
  659. package/model-provider/openai-compatible/OpenAICompatibleTextEmbeddingModel.js +0 -23
  660. package/model-provider/openai-compatible/PerplexityApiConfiguration.cjs +0 -39
  661. package/model-provider/openai-compatible/PerplexityApiConfiguration.d.ts +0 -15
  662. package/model-provider/openai-compatible/PerplexityApiConfiguration.js +0 -35
  663. package/model-provider/openai-compatible/TogetherAIApiConfiguration.cjs +0 -39
  664. package/model-provider/openai-compatible/TogetherAIApiConfiguration.d.ts +0 -15
  665. package/model-provider/openai-compatible/TogetherAIApiConfiguration.js +0 -35
  666. package/model-provider/openai-compatible/index.cjs +0 -37
  667. package/model-provider/openai-compatible/index.d.ts +0 -8
  668. package/model-provider/openai-compatible/index.js +0 -8
  669. package/model-provider/stability/StabilityApiConfiguration.cjs +0 -30
  670. package/model-provider/stability/StabilityApiConfiguration.d.ts +0 -10
  671. package/model-provider/stability/StabilityApiConfiguration.js +0 -26
  672. package/model-provider/stability/StabilityError.cjs +0 -13
  673. package/model-provider/stability/StabilityError.d.ts +0 -13
  674. package/model-provider/stability/StabilityError.js +0 -10
  675. package/model-provider/stability/StabilityFacade.cjs +0 -40
  676. package/model-provider/stability/StabilityFacade.d.ts +0 -34
  677. package/model-provider/stability/StabilityFacade.js +0 -35
  678. package/model-provider/stability/StabilityImageGenerationModel.cjs +0 -123
  679. package/model-provider/stability/StabilityImageGenerationModel.d.ts +0 -111
  680. package/model-provider/stability/StabilityImageGenerationModel.js +0 -119
  681. package/model-provider/stability/StabilityImageGenerationPrompt.cjs +0 -12
  682. package/model-provider/stability/StabilityImageGenerationPrompt.d.ts +0 -9
  683. package/model-provider/stability/StabilityImageGenerationPrompt.js +0 -8
  684. package/model-provider/stability/index.cjs +0 -33
  685. package/model-provider/stability/index.d.ts +0 -5
  686. package/model-provider/stability/index.js +0 -4
  687. package/model-provider/whispercpp/WhisperCppApiConfiguration.cjs +0 -22
  688. package/model-provider/whispercpp/WhisperCppApiConfiguration.d.ts +0 -8
  689. package/model-provider/whispercpp/WhisperCppApiConfiguration.js +0 -18
  690. package/model-provider/whispercpp/WhisperCppFacade.cjs +0 -17
  691. package/model-provider/whispercpp/WhisperCppFacade.d.ts +0 -9
  692. package/model-provider/whispercpp/WhisperCppFacade.js +0 -12
  693. package/model-provider/whispercpp/WhisperCppTranscriptionModel.cjs +0 -125
  694. package/model-provider/whispercpp/WhisperCppTranscriptionModel.d.ts +0 -31
  695. package/model-provider/whispercpp/WhisperCppTranscriptionModel.js +0 -121
  696. package/model-provider/whispercpp/index.cjs +0 -32
  697. package/model-provider/whispercpp/index.d.ts +0 -3
  698. package/model-provider/whispercpp/index.js +0 -3
  699. package/observability/helicone/HeliconeOpenAIApiConfiguration.cjs +0 -30
  700. package/observability/helicone/HeliconeOpenAIApiConfiguration.d.ts +0 -14
  701. package/observability/helicone/HeliconeOpenAIApiConfiguration.js +0 -26
  702. package/observability/index.cjs +0 -17
  703. package/observability/index.d.ts +0 -1
  704. package/observability/index.js +0 -1
  705. package/retriever/RetrieveEvent.cjs +0 -2
  706. package/retriever/RetrieveEvent.d.ts +0 -10
  707. package/retriever/RetrieveEvent.js +0 -1
  708. package/retriever/Retriever.cjs +0 -2
  709. package/retriever/Retriever.d.ts +0 -4
  710. package/retriever/Retriever.js +0 -1
  711. package/retriever/index.cjs +0 -18
  712. package/retriever/index.d.ts +0 -2
  713. package/retriever/index.js +0 -2
  714. package/retriever/retrieve.cjs +0 -15
  715. package/retriever/retrieve.d.ts +0 -3
  716. package/retriever/retrieve.js +0 -11
  717. package/test/JsonTestServer.cjs +0 -33
  718. package/test/JsonTestServer.d.ts +0 -7
  719. package/test/JsonTestServer.js +0 -29
  720. package/test/StreamingTestServer.cjs +0 -55
  721. package/test/StreamingTestServer.d.ts +0 -7
  722. package/test/StreamingTestServer.js +0 -51
  723. package/test/arrayFromAsync.cjs +0 -13
  724. package/test/arrayFromAsync.d.ts +0 -1
  725. package/test/arrayFromAsync.js +0 -9
  726. package/text-chunk/TextChunk.cjs +0 -2
  727. package/text-chunk/TextChunk.d.ts +0 -3
  728. package/text-chunk/TextChunk.js +0 -1
  729. package/text-chunk/index.cjs +0 -21
  730. package/text-chunk/index.d.ts +0 -5
  731. package/text-chunk/index.js +0 -5
  732. package/text-chunk/split/SplitFunction.cjs +0 -2
  733. package/text-chunk/split/SplitFunction.d.ts +0 -4
  734. package/text-chunk/split/SplitFunction.js +0 -1
  735. package/text-chunk/split/splitOnSeparator.cjs +0 -10
  736. package/text-chunk/split/splitOnSeparator.d.ts +0 -7
  737. package/text-chunk/split/splitOnSeparator.js +0 -6
  738. package/text-chunk/split/splitRecursively.cjs +0 -41
  739. package/text-chunk/split/splitRecursively.d.ts +0 -18
  740. package/text-chunk/split/splitRecursively.js +0 -36
  741. package/text-chunk/split/splitTextChunks.cjs +0 -16
  742. package/text-chunk/split/splitTextChunks.d.ts +0 -4
  743. package/text-chunk/split/splitTextChunks.js +0 -11
  744. package/tool/NoSuchToolDefinitionError.cjs +0 -41
  745. package/tool/NoSuchToolDefinitionError.d.ts +0 -17
  746. package/tool/NoSuchToolDefinitionError.js +0 -37
  747. package/tool/Tool.cjs +0 -64
  748. package/tool/Tool.d.ts +0 -39
  749. package/tool/Tool.js +0 -60
  750. package/tool/ToolCall.cjs +0 -2
  751. package/tool/ToolCall.d.ts +0 -15
  752. package/tool/ToolCall.js +0 -1
  753. package/tool/ToolCallArgumentsValidationError.cjs +0 -49
  754. package/tool/ToolCallArgumentsValidationError.d.ts +0 -23
  755. package/tool/ToolCallArgumentsValidationError.js +0 -45
  756. package/tool/ToolCallError.cjs +0 -34
  757. package/tool/ToolCallError.d.ts +0 -17
  758. package/tool/ToolCallError.js +0 -30
  759. package/tool/ToolCallGenerationError.cjs +0 -35
  760. package/tool/ToolCallGenerationError.d.ts +0 -15
  761. package/tool/ToolCallGenerationError.js +0 -31
  762. package/tool/ToolCallResult.cjs +0 -2
  763. package/tool/ToolCallResult.d.ts +0 -13
  764. package/tool/ToolCallResult.js +0 -1
  765. package/tool/ToolDefinition.cjs +0 -2
  766. package/tool/ToolDefinition.d.ts +0 -7
  767. package/tool/ToolDefinition.js +0 -1
  768. package/tool/ToolExecutionError.cjs +0 -42
  769. package/tool/ToolExecutionError.d.ts +0 -19
  770. package/tool/ToolExecutionError.js +0 -38
  771. package/tool/WebSearchTool.cjs +0 -56
  772. package/tool/WebSearchTool.d.ts +0 -54
  773. package/tool/WebSearchTool.js +0 -52
  774. package/tool/execute-tool/ExecuteToolEvent.cjs +0 -2
  775. package/tool/execute-tool/ExecuteToolEvent.d.ts +0 -11
  776. package/tool/execute-tool/ExecuteToolEvent.js +0 -1
  777. package/tool/execute-tool/executeTool.cjs +0 -102
  778. package/tool/execute-tool/executeTool.d.ts +0 -30
  779. package/tool/execute-tool/executeTool.js +0 -98
  780. package/tool/execute-tool/index.cjs +0 -18
  781. package/tool/execute-tool/index.d.ts +0 -2
  782. package/tool/execute-tool/index.js +0 -2
  783. package/tool/execute-tool/safeExecuteToolCall.cjs +0 -34
  784. package/tool/execute-tool/safeExecuteToolCall.d.ts +0 -5
  785. package/tool/execute-tool/safeExecuteToolCall.js +0 -30
  786. package/tool/generate-tool-call/TextGenerationToolCallModel.cjs +0 -61
  787. package/tool/generate-tool-call/TextGenerationToolCallModel.d.ts +0 -35
  788. package/tool/generate-tool-call/TextGenerationToolCallModel.js +0 -57
  789. package/tool/generate-tool-call/ToolCallGenerationEvent.cjs +0 -2
  790. package/tool/generate-tool-call/ToolCallGenerationEvent.d.ts +0 -23
  791. package/tool/generate-tool-call/ToolCallGenerationEvent.js +0 -1
  792. package/tool/generate-tool-call/ToolCallGenerationModel.cjs +0 -2
  793. package/tool/generate-tool-call/ToolCallGenerationModel.d.ts +0 -19
  794. package/tool/generate-tool-call/ToolCallGenerationModel.js +0 -1
  795. package/tool/generate-tool-call/ToolCallParseError.cjs +0 -44
  796. package/tool/generate-tool-call/ToolCallParseError.d.ts +0 -18
  797. package/tool/generate-tool-call/ToolCallParseError.js +0 -40
  798. package/tool/generate-tool-call/generateToolCall.cjs +0 -65
  799. package/tool/generate-tool-call/generateToolCall.d.ts +0 -21
  800. package/tool/generate-tool-call/generateToolCall.js +0 -61
  801. package/tool/generate-tool-call/index.cjs +0 -22
  802. package/tool/generate-tool-call/index.d.ts +0 -6
  803. package/tool/generate-tool-call/index.js +0 -6
  804. package/tool/generate-tool-call/jsonToolCallPrompt.cjs +0 -30
  805. package/tool/generate-tool-call/jsonToolCallPrompt.d.ts +0 -5
  806. package/tool/generate-tool-call/jsonToolCallPrompt.js +0 -27
  807. package/tool/generate-tool-calls/TextGenerationToolCallsModel.cjs +0 -62
  808. package/tool/generate-tool-calls/TextGenerationToolCallsModel.d.ts +0 -31
  809. package/tool/generate-tool-calls/TextGenerationToolCallsModel.js +0 -58
  810. package/tool/generate-tool-calls/ToolCallsGenerationEvent.cjs +0 -2
  811. package/tool/generate-tool-calls/ToolCallsGenerationEvent.d.ts +0 -23
  812. package/tool/generate-tool-calls/ToolCallsGenerationEvent.js +0 -1
  813. package/tool/generate-tool-calls/ToolCallsGenerationModel.cjs +0 -2
  814. package/tool/generate-tool-calls/ToolCallsGenerationModel.d.ts +0 -21
  815. package/tool/generate-tool-calls/ToolCallsGenerationModel.js +0 -1
  816. package/tool/generate-tool-calls/ToolCallsParseError.cjs +0 -36
  817. package/tool/generate-tool-calls/ToolCallsParseError.d.ts +0 -15
  818. package/tool/generate-tool-calls/ToolCallsParseError.js +0 -32
  819. package/tool/generate-tool-calls/ToolCallsPromptTemplate.cjs +0 -2
  820. package/tool/generate-tool-calls/ToolCallsPromptTemplate.d.ts +0 -12
  821. package/tool/generate-tool-calls/ToolCallsPromptTemplate.js +0 -1
  822. package/tool/generate-tool-calls/generateToolCalls.cjs +0 -63
  823. package/tool/generate-tool-calls/generateToolCalls.d.ts +0 -39
  824. package/tool/generate-tool-calls/generateToolCalls.js +0 -59
  825. package/tool/generate-tool-calls/index.cjs +0 -22
  826. package/tool/generate-tool-calls/index.d.ts +0 -6
  827. package/tool/generate-tool-calls/index.js +0 -6
  828. package/tool/index.cjs +0 -31
  829. package/tool/index.d.ts +0 -15
  830. package/tool/index.js +0 -15
  831. package/tool/run-tool/RunToolEvent.cjs +0 -2
  832. package/tool/run-tool/RunToolEvent.d.ts +0 -7
  833. package/tool/run-tool/RunToolEvent.js +0 -1
  834. package/tool/run-tool/index.cjs +0 -18
  835. package/tool/run-tool/index.d.ts +0 -2
  836. package/tool/run-tool/index.js +0 -2
  837. package/tool/run-tool/runTool.cjs +0 -30
  838. package/tool/run-tool/runTool.d.ts +0 -20
  839. package/tool/run-tool/runTool.js +0 -26
  840. package/tool/run-tools/RunToolsEvent.cjs +0 -2
  841. package/tool/run-tools/RunToolsEvent.d.ts +0 -7
  842. package/tool/run-tools/RunToolsEvent.js +0 -1
  843. package/tool/run-tools/index.cjs +0 -18
  844. package/tool/run-tools/index.d.ts +0 -2
  845. package/tool/run-tools/index.js +0 -2
  846. package/tool/run-tools/runTools.cjs +0 -54
  847. package/tool/run-tools/runTools.d.ts +0 -22
  848. package/tool/run-tools/runTools.js +0 -50
  849. package/util/AsyncQueue.cjs +0 -121
  850. package/util/AsyncQueue.d.ts +0 -51
  851. package/util/AsyncQueue.js +0 -117
  852. package/util/AsyncQueue.test.cjs +0 -137
  853. package/util/AsyncQueue.test.d.ts +0 -1
  854. package/util/AsyncQueue.test.js +0 -135
  855. package/util/DurationMeasurement.cjs +0 -48
  856. package/util/DurationMeasurement.d.ts +0 -6
  857. package/util/DurationMeasurement.js +0 -44
  858. package/util/ErrorHandler.cjs +0 -2
  859. package/util/ErrorHandler.d.ts +0 -1
  860. package/util/ErrorHandler.js +0 -1
  861. package/util/SafeResult.cjs +0 -2
  862. package/util/SafeResult.d.ts +0 -8
  863. package/util/SafeResult.js +0 -1
  864. package/util/SimpleWebSocket.cjs +0 -48
  865. package/util/SimpleWebSocket.d.ts +0 -12
  866. package/util/SimpleWebSocket.js +0 -21
  867. package/util/audio/AudioMimeType.cjs +0 -2
  868. package/util/audio/AudioMimeType.d.ts +0 -1
  869. package/util/audio/AudioMimeType.js +0 -1
  870. package/util/audio/getAudioFileExtension.cjs +0 -29
  871. package/util/audio/getAudioFileExtension.d.ts +0 -1
  872. package/util/audio/getAudioFileExtension.js +0 -25
  873. package/util/audio/index.cjs +0 -18
  874. package/util/audio/index.d.ts +0 -2
  875. package/util/audio/index.js +0 -2
  876. package/util/cosineSimilarity.cjs +0 -26
  877. package/util/cosineSimilarity.d.ts +0 -11
  878. package/util/cosineSimilarity.js +0 -22
  879. package/util/delay.cjs +0 -7
  880. package/util/delay.d.ts +0 -1
  881. package/util/delay.js +0 -3
  882. package/util/detectRuntime.cjs +0 -21
  883. package/util/detectRuntime.d.ts +0 -1
  884. package/util/detectRuntime.js +0 -17
  885. package/util/fixJson.cjs +0 -334
  886. package/util/fixJson.d.ts +0 -1
  887. package/util/fixJson.js +0 -330
  888. package/util/fixJson.test.cjs +0 -188
  889. package/util/fixJson.test.d.ts +0 -1
  890. package/util/fixJson.test.js +0 -183
  891. package/util/format/DataContent.cjs +0 -27
  892. package/util/format/DataContent.d.ts +0 -7
  893. package/util/format/DataContent.js +0 -22
  894. package/util/format/UInt8Utils.cjs +0 -40
  895. package/util/format/UInt8Utils.d.ts +0 -2
  896. package/util/format/UInt8Utils.js +0 -35
  897. package/util/format/index.cjs +0 -17
  898. package/util/format/index.d.ts +0 -1
  899. package/util/format/index.js +0 -1
  900. package/util/getErrorMessage.cjs +0 -16
  901. package/util/getErrorMessage.d.ts +0 -1
  902. package/util/getErrorMessage.js +0 -12
  903. package/util/index.cjs +0 -22
  904. package/util/index.d.ts +0 -6
  905. package/util/index.js +0 -6
  906. package/util/isDeepEqualData.cjs +0 -53
  907. package/util/isDeepEqualData.d.ts +0 -8
  908. package/util/isDeepEqualData.js +0 -49
  909. package/util/isDeepEqualData.test.cjs +0 -107
  910. package/util/isDeepEqualData.test.d.ts +0 -1
  911. package/util/isDeepEqualData.test.js +0 -102
  912. package/util/never.cjs +0 -6
  913. package/util/never.d.ts +0 -1
  914. package/util/never.js +0 -2
  915. package/util/parsePartialJson.cjs +0 -29
  916. package/util/parsePartialJson.d.ts +0 -1
  917. package/util/parsePartialJson.js +0 -22
  918. package/util/runSafe.cjs +0 -15
  919. package/util/runSafe.d.ts +0 -2
  920. package/util/runSafe.js +0 -11
  921. package/util/runSafe.test.cjs +0 -58
  922. package/util/runSafe.test.d.ts +0 -1
  923. package/util/runSafe.test.js +0 -56
  924. package/util/streaming/EventSourceParserStream.cjs +0 -34
  925. package/util/streaming/EventSourceParserStream.d.ts +0 -15
  926. package/util/streaming/EventSourceParserStream.js +0 -30
  927. package/util/streaming/convertReadableStreamToAsyncIterable.cjs +0 -19
  928. package/util/streaming/convertReadableStreamToAsyncIterable.d.ts +0 -1
  929. package/util/streaming/convertReadableStreamToAsyncIterable.js +0 -15
  930. package/util/streaming/createEventSourceResponseHandler.cjs +0 -9
  931. package/util/streaming/createEventSourceResponseHandler.d.ts +0 -4
  932. package/util/streaming/createEventSourceResponseHandler.js +0 -5
  933. package/util/streaming/createEventSourceStream.cjs +0 -19
  934. package/util/streaming/createEventSourceStream.d.ts +0 -1
  935. package/util/streaming/createEventSourceStream.js +0 -15
  936. package/util/streaming/createJsonStreamResponseHandler.cjs +0 -9
  937. package/util/streaming/createJsonStreamResponseHandler.d.ts +0 -4
  938. package/util/streaming/createJsonStreamResponseHandler.js +0 -5
  939. package/util/streaming/index.cjs +0 -17
  940. package/util/streaming/index.d.ts +0 -1
  941. package/util/streaming/index.js +0 -1
  942. package/util/streaming/parseEventSourceStream.cjs +0 -12
  943. package/util/streaming/parseEventSourceStream.d.ts +0 -4
  944. package/util/streaming/parseEventSourceStream.js +0 -8
  945. package/util/streaming/parseEventSourceStreamAsAsyncIterable.cjs +0 -52
  946. package/util/streaming/parseEventSourceStreamAsAsyncIterable.d.ts +0 -6
  947. package/util/streaming/parseEventSourceStreamAsAsyncIterable.js +0 -48
  948. package/util/streaming/parseJsonStream.cjs +0 -35
  949. package/util/streaming/parseJsonStream.d.ts +0 -7
  950. package/util/streaming/parseJsonStream.js +0 -31
  951. package/util/streaming/parseJsonStreamAsAsyncIterable.cjs +0 -21
  952. package/util/streaming/parseJsonStreamAsAsyncIterable.d.ts +0 -6
  953. package/util/streaming/parseJsonStreamAsAsyncIterable.js +0 -17
  954. package/vector-index/UpsertIntoVectorIndexEvent.cjs +0 -2
  955. package/vector-index/UpsertIntoVectorIndexEvent.d.ts +0 -9
  956. package/vector-index/UpsertIntoVectorIndexEvent.js +0 -1
  957. package/vector-index/VectorIndex.cjs +0 -2
  958. package/vector-index/VectorIndex.d.ts +0 -19
  959. package/vector-index/VectorIndex.js +0 -1
  960. package/vector-index/VectorIndexRetriever.cjs +0 -54
  961. package/vector-index/VectorIndexRetriever.d.ts +0 -20
  962. package/vector-index/VectorIndexRetriever.js +0 -50
  963. package/vector-index/index.cjs +0 -21
  964. package/vector-index/index.d.ts +0 -5
  965. package/vector-index/index.js +0 -5
  966. package/vector-index/memory/MemoryVectorIndex.cjs +0 -69
  967. package/vector-index/memory/MemoryVectorIndex.d.ts +0 -32
  968. package/vector-index/memory/MemoryVectorIndex.js +0 -65
  969. package/vector-index/upsertIntoVectorIndex.cjs +0 -28
  970. package/vector-index/upsertIntoVectorIndex.d.ts +0 -11
  971. package/vector-index/upsertIntoVectorIndex.js +0 -24
@@ -1,166 +0,0 @@
1
- import { FlexibleObjectFromTextPromptTemplate, ObjectFromTextPromptTemplate } from "../../model-function/generate-object/ObjectFromTextPromptTemplate.js";
2
- import { ObjectFromTextStreamingModel } from "../../model-function/generate-object/ObjectFromTextStreamingModel.js";
3
- import { PromptTemplateFullTextModel } from "../../model-function/generate-text/PromptTemplateFullTextModel.js";
4
- import { TextStreamingBaseModel, TextStreamingModel } from "../../model-function/generate-text/TextGenerationModel.js";
5
- import { TextGenerationPromptTemplate } from "../../model-function/generate-text/TextGenerationPromptTemplate.js";
6
- import { ToolCallGenerationModel } from "../../tool/generate-tool-call/ToolCallGenerationModel.js";
7
- import { ToolCallsGenerationModel } from "../../tool/generate-tool-calls/ToolCallsGenerationModel.js";
8
- import { AbstractOpenAIChatModel, AbstractOpenAIChatSettings, OpenAIChatPrompt, OpenAIChatResponse } from "./AbstractOpenAIChatModel.js";
9
- import { OpenAIChatFunctionCallObjectGenerationModel } from "./OpenAIChatFunctionCallObjectGenerationModel.js";
10
- import { TikTokenTokenizer } from "./TikTokenTokenizer.js";
11
- export declare const OPENAI_CHAT_MODELS: {
12
- "gpt-4": {
13
- contextWindowSize: number;
14
- promptTokenCostInMillicents: number;
15
- completionTokenCostInMillicents: number;
16
- };
17
- "gpt-4-0314": {
18
- contextWindowSize: number;
19
- promptTokenCostInMillicents: number;
20
- completionTokenCostInMillicents: number;
21
- };
22
- "gpt-4-0613": {
23
- contextWindowSize: number;
24
- promptTokenCostInMillicents: number;
25
- completionTokenCostInMillicents: number;
26
- fineTunedPromptTokenCostInMillicents: null;
27
- fineTunedCompletionTokenCostInMillicents: null;
28
- };
29
- "gpt-4-turbo-preview": {
30
- contextWindowSize: number;
31
- promptTokenCostInMillicents: number;
32
- completionTokenCostInMillicents: number;
33
- };
34
- "gpt-4-1106-preview": {
35
- contextWindowSize: number;
36
- promptTokenCostInMillicents: number;
37
- completionTokenCostInMillicents: number;
38
- };
39
- "gpt-4-0125-preview": {
40
- contextWindowSize: number;
41
- promptTokenCostInMillicents: number;
42
- completionTokenCostInMillicents: number;
43
- };
44
- "gpt-4-vision-preview": {
45
- contextWindowSize: number;
46
- promptTokenCostInMillicents: number;
47
- completionTokenCostInMillicents: number;
48
- };
49
- "gpt-4-32k": {
50
- contextWindowSize: number;
51
- promptTokenCostInMillicents: number;
52
- completionTokenCostInMillicents: number;
53
- };
54
- "gpt-4-32k-0314": {
55
- contextWindowSize: number;
56
- promptTokenCostInMillicents: number;
57
- completionTokenCostInMillicents: number;
58
- };
59
- "gpt-4-32k-0613": {
60
- contextWindowSize: number;
61
- promptTokenCostInMillicents: number;
62
- completionTokenCostInMillicents: number;
63
- };
64
- "gpt-3.5-turbo": {
65
- contextWindowSize: number;
66
- promptTokenCostInMillicents: number;
67
- completionTokenCostInMillicents: number;
68
- fineTunedPromptTokenCostInMillicents: number;
69
- fineTunedCompletionTokenCostInMillicents: number;
70
- };
71
- "gpt-3.5-turbo-0125": {
72
- contextWindowSize: number;
73
- promptTokenCostInMillicents: number;
74
- completionTokenCostInMillicents: number;
75
- };
76
- "gpt-3.5-turbo-1106": {
77
- contextWindowSize: number;
78
- promptTokenCostInMillicents: number;
79
- completionTokenCostInMillicents: number;
80
- };
81
- "gpt-3.5-turbo-0301": {
82
- contextWindowSize: number;
83
- promptTokenCostInMillicents: number;
84
- completionTokenCostInMillicents: number;
85
- };
86
- "gpt-3.5-turbo-0613": {
87
- contextWindowSize: number;
88
- promptTokenCostInMillicents: number;
89
- completionTokenCostInMillicents: number;
90
- fineTunedPromptTokenCostInMillicents: number;
91
- fineTunedCompletionTokenCostInMillicents: number;
92
- };
93
- "gpt-3.5-turbo-16k": {
94
- contextWindowSize: number;
95
- promptTokenCostInMillicents: number;
96
- completionTokenCostInMillicents: number;
97
- };
98
- "gpt-3.5-turbo-16k-0613": {
99
- contextWindowSize: number;
100
- promptTokenCostInMillicents: number;
101
- completionTokenCostInMillicents: number;
102
- };
103
- };
104
- export declare function getOpenAIChatModelInformation(model: OpenAIChatModelType): {
105
- baseModel: OpenAIChatBaseModelType;
106
- isFineTuned: boolean;
107
- contextWindowSize: number;
108
- promptTokenCostInMillicents: number | null;
109
- completionTokenCostInMillicents: number | null;
110
- };
111
- type FineTuneableOpenAIChatModelType = `gpt-3.5-turbo` | `gpt-3.5-turbo-0613` | `gpt-4-0613`;
112
- type FineTunedOpenAIChatModelType = `ft:${FineTuneableOpenAIChatModelType}:${string}:${string}:${string}`;
113
- export type OpenAIChatBaseModelType = keyof typeof OPENAI_CHAT_MODELS;
114
- export type OpenAIChatModelType = OpenAIChatBaseModelType | FineTunedOpenAIChatModelType;
115
- export declare const isOpenAIChatModel: (model: string) => model is OpenAIChatModelType;
116
- export declare const calculateOpenAIChatCostInMillicents: ({ model, response, }: {
117
- model: OpenAIChatModelType;
118
- response: OpenAIChatResponse;
119
- }) => number | null;
120
- export interface OpenAIChatSettings extends AbstractOpenAIChatSettings {
121
- model: OpenAIChatModelType;
122
- }
123
- /**
124
- * Create a text generation model that calls the OpenAI chat API.
125
- *
126
- * @see https://platform.openai.com/docs/api-reference/chat/create
127
- *
128
- * @example
129
- * const model = new OpenAIChatModel({
130
- * model: "gpt-3.5-turbo",
131
- * temperature: 0.7,
132
- * maxGenerationTokens: 500,
133
- * });
134
- *
135
- * const text = await generateText([
136
- * model,
137
- * openai.ChatMessage.system(
138
- * "Write a short story about a robot learning to love:"
139
- * ),
140
- * ]);
141
- */
142
- export declare class OpenAIChatModel extends AbstractOpenAIChatModel<OpenAIChatSettings> implements TextStreamingBaseModel<OpenAIChatPrompt, OpenAIChatSettings>, ToolCallGenerationModel<OpenAIChatPrompt, OpenAIChatSettings>, ToolCallsGenerationModel<OpenAIChatPrompt, OpenAIChatSettings> {
143
- constructor(settings: OpenAIChatSettings);
144
- readonly provider: "openai";
145
- get modelName(): OpenAIChatModelType;
146
- readonly contextWindowSize: number;
147
- readonly tokenizer: TikTokenTokenizer;
148
- /**
149
- * Counts the prompt tokens required for the messages. This includes the message base tokens
150
- * and the prompt base tokens.
151
- */
152
- countPromptTokens(messages: OpenAIChatPrompt): Promise<number>;
153
- get settingsForEvent(): Partial<OpenAIChatSettings>;
154
- asFunctionCallObjectGenerationModel({ fnName, fnDescription, }: {
155
- fnName: string;
156
- fnDescription?: string;
157
- }): OpenAIChatFunctionCallObjectGenerationModel<TextGenerationPromptTemplate<OpenAIChatPrompt, OpenAIChatPrompt>>;
158
- asObjectGenerationModel<INPUT_PROMPT, OpenAIChatPrompt>(promptTemplate: ObjectFromTextPromptTemplate<INPUT_PROMPT, OpenAIChatPrompt> | FlexibleObjectFromTextPromptTemplate<INPUT_PROMPT, unknown>): ObjectFromTextStreamingModel<INPUT_PROMPT, unknown, TextStreamingModel<unknown, import("../../model-function/generate-text/TextGenerationModel.js").TextGenerationModelSettings>> | ObjectFromTextStreamingModel<INPUT_PROMPT, OpenAIChatPrompt, TextStreamingModel<OpenAIChatPrompt, import("../../model-function/generate-text/TextGenerationModel.js").TextGenerationModelSettings>>;
159
- withTextPrompt(): PromptTemplateFullTextModel<string, OpenAIChatPrompt, OpenAIChatSettings, this>;
160
- withInstructionPrompt(): PromptTemplateFullTextModel<import("../../index.js").InstructionPrompt, OpenAIChatPrompt, OpenAIChatSettings, this>;
161
- withChatPrompt(): PromptTemplateFullTextModel<import("../../index.js").ChatPrompt, OpenAIChatPrompt, OpenAIChatSettings, this>;
162
- withPromptTemplate<INPUT_PROMPT>(promptTemplate: TextGenerationPromptTemplate<INPUT_PROMPT, OpenAIChatPrompt>): PromptTemplateFullTextModel<INPUT_PROMPT, OpenAIChatPrompt, OpenAIChatSettings, this>;
163
- withJsonOutput(): this;
164
- withSettings(additionalSettings: Partial<OpenAIChatSettings>): this;
165
- }
166
- export {};
@@ -1,267 +0,0 @@
1
- import { ObjectFromTextStreamingModel } from "../../model-function/generate-object/ObjectFromTextStreamingModel.js";
2
- import { PromptTemplateFullTextModel } from "../../model-function/generate-text/PromptTemplateFullTextModel.js";
3
- import { textGenerationModelProperties, } from "../../model-function/generate-text/TextGenerationModel.js";
4
- import { AbstractOpenAIChatModel, } from "./AbstractOpenAIChatModel.js";
5
- import { OpenAIChatFunctionCallObjectGenerationModel } from "./OpenAIChatFunctionCallObjectGenerationModel.js";
6
- import { chat, identity, instruction, text, } from "./OpenAIChatPromptTemplate.js";
7
- import { TikTokenTokenizer } from "./TikTokenTokenizer.js";
8
- import { countOpenAIChatPromptTokens } from "./countOpenAIChatMessageTokens.js";
9
- /*
10
- * Available OpenAI chat models, their token limits, and pricing.
11
- *
12
- * @see https://platform.openai.com/docs/models/
13
- * @see https://openai.com/pricing
14
- */
15
- export const OPENAI_CHAT_MODELS = {
16
- "gpt-4": {
17
- contextWindowSize: 8192,
18
- promptTokenCostInMillicents: 3,
19
- completionTokenCostInMillicents: 6,
20
- },
21
- "gpt-4-0314": {
22
- contextWindowSize: 8192,
23
- promptTokenCostInMillicents: 3,
24
- completionTokenCostInMillicents: 6,
25
- },
26
- "gpt-4-0613": {
27
- contextWindowSize: 8192,
28
- promptTokenCostInMillicents: 3,
29
- completionTokenCostInMillicents: 6,
30
- fineTunedPromptTokenCostInMillicents: null,
31
- fineTunedCompletionTokenCostInMillicents: null,
32
- },
33
- "gpt-4-turbo-preview": {
34
- contextWindowSize: 128000,
35
- promptTokenCostInMillicents: 1,
36
- completionTokenCostInMillicents: 3,
37
- },
38
- "gpt-4-1106-preview": {
39
- contextWindowSize: 128000,
40
- promptTokenCostInMillicents: 1,
41
- completionTokenCostInMillicents: 3,
42
- },
43
- "gpt-4-0125-preview": {
44
- contextWindowSize: 128000,
45
- promptTokenCostInMillicents: 1,
46
- completionTokenCostInMillicents: 3,
47
- },
48
- "gpt-4-vision-preview": {
49
- contextWindowSize: 128000,
50
- promptTokenCostInMillicents: 1,
51
- completionTokenCostInMillicents: 3,
52
- },
53
- "gpt-4-32k": {
54
- contextWindowSize: 32768,
55
- promptTokenCostInMillicents: 6,
56
- completionTokenCostInMillicents: 12,
57
- },
58
- "gpt-4-32k-0314": {
59
- contextWindowSize: 32768,
60
- promptTokenCostInMillicents: 6,
61
- completionTokenCostInMillicents: 12,
62
- },
63
- "gpt-4-32k-0613": {
64
- contextWindowSize: 32768,
65
- promptTokenCostInMillicents: 6,
66
- completionTokenCostInMillicents: 12,
67
- },
68
- "gpt-3.5-turbo": {
69
- contextWindowSize: 4096,
70
- promptTokenCostInMillicents: 0.15,
71
- completionTokenCostInMillicents: 0.2,
72
- fineTunedPromptTokenCostInMillicents: 0.3,
73
- fineTunedCompletionTokenCostInMillicents: 0.6,
74
- },
75
- "gpt-3.5-turbo-0125": {
76
- contextWindowSize: 16385,
77
- promptTokenCostInMillicents: 0.05,
78
- completionTokenCostInMillicents: 0.15,
79
- },
80
- "gpt-3.5-turbo-1106": {
81
- contextWindowSize: 16385,
82
- promptTokenCostInMillicents: 0.1,
83
- completionTokenCostInMillicents: 0.2,
84
- },
85
- "gpt-3.5-turbo-0301": {
86
- contextWindowSize: 4096,
87
- promptTokenCostInMillicents: 0.15,
88
- completionTokenCostInMillicents: 0.2,
89
- },
90
- "gpt-3.5-turbo-0613": {
91
- contextWindowSize: 4096,
92
- promptTokenCostInMillicents: 0.15,
93
- completionTokenCostInMillicents: 0.2,
94
- fineTunedPromptTokenCostInMillicents: 1.2,
95
- fineTunedCompletionTokenCostInMillicents: 1.6,
96
- },
97
- "gpt-3.5-turbo-16k": {
98
- contextWindowSize: 16384,
99
- promptTokenCostInMillicents: 0.3,
100
- completionTokenCostInMillicents: 0.4,
101
- },
102
- "gpt-3.5-turbo-16k-0613": {
103
- contextWindowSize: 16384,
104
- promptTokenCostInMillicents: 0.3,
105
- completionTokenCostInMillicents: 0.4,
106
- },
107
- };
108
- export function getOpenAIChatModelInformation(model) {
109
- // Model is already a base model:
110
- if (model in OPENAI_CHAT_MODELS) {
111
- const baseModelInformation = OPENAI_CHAT_MODELS[model];
112
- return {
113
- baseModel: model,
114
- isFineTuned: false,
115
- contextWindowSize: baseModelInformation.contextWindowSize,
116
- promptTokenCostInMillicents: baseModelInformation.promptTokenCostInMillicents,
117
- completionTokenCostInMillicents: baseModelInformation.completionTokenCostInMillicents,
118
- };
119
- }
120
- // Extract the base model from the fine-tuned model:
121
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
122
- const [_, baseModel, ___, ____, _____] = model.split(":");
123
- if (["gpt-3.5-turbo", "gpt-3.5-turbo-0613", "gpt-4-0613"].includes(baseModel)) {
124
- const baseModelInformation = OPENAI_CHAT_MODELS[baseModel];
125
- return {
126
- baseModel: baseModel,
127
- isFineTuned: true,
128
- contextWindowSize: baseModelInformation.contextWindowSize,
129
- promptTokenCostInMillicents: baseModelInformation.fineTunedPromptTokenCostInMillicents,
130
- completionTokenCostInMillicents: baseModelInformation.fineTunedCompletionTokenCostInMillicents,
131
- };
132
- }
133
- throw new Error(`Unknown OpenAI chat base model ${baseModel}.`);
134
- }
135
- export const isOpenAIChatModel = (model) => model in OPENAI_CHAT_MODELS ||
136
- model.startsWith("ft:gpt-3.5-turbo-0613:") ||
137
- model.startsWith("ft:gpt-3.5-turbo:");
138
- export const calculateOpenAIChatCostInMillicents = ({ model, response, }) => {
139
- const { promptTokenCostInMillicents, completionTokenCostInMillicents } = getOpenAIChatModelInformation(model);
140
- // null: when cost is unknown, e.g. for fine-tuned models where the price is not yet known
141
- if (promptTokenCostInMillicents == null ||
142
- completionTokenCostInMillicents == null) {
143
- return null;
144
- }
145
- return (response.usage.prompt_tokens * promptTokenCostInMillicents +
146
- response.usage.completion_tokens * completionTokenCostInMillicents);
147
- };
148
- /**
149
- * Create a text generation model that calls the OpenAI chat API.
150
- *
151
- * @see https://platform.openai.com/docs/api-reference/chat/create
152
- *
153
- * @example
154
- * const model = new OpenAIChatModel({
155
- * model: "gpt-3.5-turbo",
156
- * temperature: 0.7,
157
- * maxGenerationTokens: 500,
158
- * });
159
- *
160
- * const text = await generateText([
161
- * model,
162
- * openai.ChatMessage.system(
163
- * "Write a short story about a robot learning to love:"
164
- * ),
165
- * ]);
166
- */
167
- export class OpenAIChatModel extends AbstractOpenAIChatModel {
168
- constructor(settings) {
169
- super(settings);
170
- Object.defineProperty(this, "provider", {
171
- enumerable: true,
172
- configurable: true,
173
- writable: true,
174
- value: "openai"
175
- });
176
- Object.defineProperty(this, "contextWindowSize", {
177
- enumerable: true,
178
- configurable: true,
179
- writable: true,
180
- value: void 0
181
- });
182
- Object.defineProperty(this, "tokenizer", {
183
- enumerable: true,
184
- configurable: true,
185
- writable: true,
186
- value: void 0
187
- });
188
- const modelInformation = getOpenAIChatModelInformation(this.settings.model);
189
- this.tokenizer = new TikTokenTokenizer({
190
- model: modelInformation.baseModel,
191
- });
192
- this.contextWindowSize = modelInformation.contextWindowSize;
193
- }
194
- get modelName() {
195
- return this.settings.model;
196
- }
197
- /**
198
- * Counts the prompt tokens required for the messages. This includes the message base tokens
199
- * and the prompt base tokens.
200
- */
201
- countPromptTokens(messages) {
202
- return countOpenAIChatPromptTokens({
203
- messages,
204
- model: this.modelName,
205
- });
206
- }
207
- get settingsForEvent() {
208
- const eventSettingProperties = [
209
- ...textGenerationModelProperties,
210
- "functions",
211
- "functionCall",
212
- "temperature",
213
- "topP",
214
- "presencePenalty",
215
- "frequencyPenalty",
216
- "logitBias",
217
- "seed",
218
- "responseFormat",
219
- ];
220
- return Object.fromEntries(Object.entries(this.settings).filter(([key]) => eventSettingProperties.includes(key)));
221
- }
222
- asFunctionCallObjectGenerationModel({ fnName, fnDescription, }) {
223
- return new OpenAIChatFunctionCallObjectGenerationModel({
224
- model: this,
225
- fnName,
226
- fnDescription,
227
- promptTemplate: identity(),
228
- });
229
- }
230
- asObjectGenerationModel(promptTemplate) {
231
- return "adaptModel" in promptTemplate
232
- ? new ObjectFromTextStreamingModel({
233
- model: promptTemplate.adaptModel(this),
234
- template: promptTemplate,
235
- })
236
- : new ObjectFromTextStreamingModel({
237
- model: this,
238
- template: promptTemplate,
239
- });
240
- }
241
- withTextPrompt() {
242
- return this.withPromptTemplate(text());
243
- }
244
- withInstructionPrompt() {
245
- return this.withPromptTemplate(instruction());
246
- }
247
- withChatPrompt() {
248
- return this.withPromptTemplate(chat());
249
- }
250
- withPromptTemplate(promptTemplate) {
251
- return new PromptTemplateFullTextModel({
252
- model: this.withSettings({
253
- stopSequences: [
254
- ...(this.settings.stopSequences ?? []),
255
- ...promptTemplate.stopSequences,
256
- ],
257
- }),
258
- promptTemplate,
259
- });
260
- }
261
- withJsonOutput() {
262
- return this.withSettings({ responseFormat: { type: "json_object" } });
263
- }
264
- withSettings(additionalSettings) {
265
- return new OpenAIChatModel(Object.assign({}, this.settings, additionalSettings));
266
- }
267
- }
@@ -1,101 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const zod_1 = require("zod");
4
- const ZodSchema_js_1 = require("../../core/schema/ZodSchema.cjs");
5
- const streamObject_js_1 = require("../../model-function/generate-object/streamObject.cjs");
6
- const streamText_js_1 = require("../../model-function/generate-text/streamText.cjs");
7
- const StreamingTestServer_js_1 = require("../../test/StreamingTestServer.cjs");
8
- const arrayFromAsync_js_1 = require("../../test/arrayFromAsync.cjs");
9
- const OpenAIApiConfiguration_js_1 = require("./OpenAIApiConfiguration.cjs");
10
- const OpenAIChatModel_js_1 = require("./OpenAIChatModel.cjs");
11
- describe("streamText", () => {
12
- const server = new StreamingTestServer_js_1.StreamingTestServer("https://api.openai.com/v1/chat/completions");
13
- server.setupTestEnvironment();
14
- it("should return only values from the first choice when using streamText", async () => {
15
- server.responseChunks = [
16
- `data: {"id":"chatcmpl-123","object":"chat.completion.chunk","created":1702657020,"model":"gpt-3.5-turbo-0613",` +
17
- `"system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null}]}\n\n`,
18
- `data: {"id":"chatcmpl-123","object":"chat.completion.chunk","created":1702657020,"model":"gpt-3.5-turbo-0613",` +
19
- `"system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"A"},"finish_reason":null}]}\n\n`,
20
- `data: {"id":"chatcmpl-123","object":"chat.completion.chunk","created":1702657020,"model":"gpt-3.5-turbo-0613",` +
21
- `"system_fingerprint":null,"choices":[{"index":1,"delta":{"role":"assistant","content":""},"finish_reason":null}]}\n\n`,
22
- `data: {"id":"chatcmpl-123","object":"chat.completion.chunk","created":1702657020,"model":"gpt-3.5-turbo-0613",` +
23
- `"system_fingerprint":null,"choices":[{"index":1,"delta":{"content":"B"},"finish_reason":null}]}\n\n`,
24
- `data: {"id":"chatcmpl-123","object":"chat.completion.chunk","created":1702657020,"model":"gpt-3.5-turbo-0613",` +
25
- `"system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"stop"}]}\n\n`,
26
- `data: {"id":"chatcmpl-123","object":"chat.completion.chunk","created":1702657020,"model":"gpt-3.5-turbo-0613",` +
27
- `"system_fingerprint":null,"choices":[{"index":1,"delta":{},"finish_reason":"stop"}]}\n\n`,
28
- "data: [DONE]\n\n",
29
- ];
30
- const stream = await (0, streamText_js_1.streamText)({
31
- model: new OpenAIChatModel_js_1.OpenAIChatModel({
32
- api: new OpenAIApiConfiguration_js_1.OpenAIApiConfiguration({ apiKey: "test-key" }),
33
- model: "gpt-3.5-turbo",
34
- numberOfGenerations: 2,
35
- }).withTextPrompt(),
36
- prompt: "test prompt",
37
- });
38
- expect(await (0, arrayFromAsync_js_1.arrayFromAsync)(stream)).toStrictEqual(["A"]);
39
- });
40
- });
41
- describe("streamObject", () => {
42
- const server = new StreamingTestServer_js_1.StreamingTestServer("https://api.openai.com/v1/chat/completions");
43
- server.setupTestEnvironment();
44
- it("should return a text stream", async () => {
45
- server.responseChunks = [
46
- `data: {"id":"chatcmpl-8ZhZtizjTCGmZaPRwyUiuDJ1DYUD0","object":"chat.completion.chunk",` +
47
- `"created":1703519685,"model":"gpt-3.5-turbo-0613","system_fingerprint":null,` +
48
- `"choices":[{"index":0,"delta":{"role":"assistant","content":null,` +
49
- `"function_call":{"name":"generateCharacter","arguments":""}},"logprobs":null,"finish_reason":null}]}\n\n`,
50
- `data: {"id":"chatcmpl-8ZhZtizjTCGmZaPRwyUiuDJ1DYUD0","object":"chat.completion.chunk",` +
51
- `"created":1703519685,"model":"gpt-3.5-turbo-0613","system_fingerprint":null,` +
52
- `"choices":[{"index":0,"delta":{"function_call":{"arguments":"{\\n"}},"logprobs":null,"finish_reason":null}]}\n\n`,
53
- `data: {"id":"chatcmpl-8ZhZtizjTCGmZaPRwyUiuDJ1DYUD0","object":"chat.completion.chunk",` +
54
- `"created":1703519685,"model":"gpt-3.5-turbo-0613","system_fingerprint":null,` +
55
- `"choices":[{"index":0,"delta":{"function_call":{"arguments":" "}},"logprobs":null,"finish_reason":null}]}\n\n`,
56
- `data: {"id":"chatcmpl-8ZhZtizjTCGmZaPRwyUiuDJ1DYUD0","object":"chat.completion.chunk",` +
57
- `"created":1703519685,"model":"gpt-3.5-turbo-0613","system_fingerprint":null,` +
58
- `"choices":[{"index":0,"delta":{"function_call":{"arguments":" \\""}},"logprobs":null,"finish_reason":null}]}\n\n`,
59
- `data: {"id":"chatcmpl-8ZhZtizjTCGmZaPRwyUiuDJ1DYUD0","object":"chat.completion.chunk",` +
60
- `"created":1703519685,"model":"gpt-3.5-turbo-0613","system_fingerprint":null,` +
61
- `"choices":[{"index":0,"delta":{"function_call":{"arguments":"name"}},"logprobs":null,"finish_reason":null}]}\n\n`,
62
- `data: {"id":"chatcmpl-8ZhZtizjTCGmZaPRwyUiuDJ1DYUD0","object":"chat.completion.chunk",` +
63
- `"created":1703519685,"model":"gpt-3.5-turbo-0613","system_fingerprint":null,` +
64
- `"choices":[{"index":0,"delta":{"function_call":{"arguments":"\\":\\""}},"logprobs":null,"finish_reason":null}]}\n\n`,
65
- `data: {"id":"chatcmpl-8ZhZtizjTCGmZaPRwyUiuDJ1DYUD0","object":"chat.completion.chunk",` +
66
- `"created":1703519685,"model":"gpt-3.5-turbo-0613","system_fingerprint":null,` +
67
- `"choices":[{"index":0,"delta":{"function_call":{"arguments":"M"}},"logprobs":null,"finish_reason":null}]}\n\n`,
68
- `data: {"id":"chatcmpl-8ZhZtizjTCGmZaPRwyUiuDJ1DYUD0","object":"chat.completion.chunk",` +
69
- `"created":1703519685,"model":"gpt-3.5-turbo-0613","system_fingerprint":null,` +
70
- `"choices":[{"index":0,"delta":{"function_call":{"arguments":"ike\\"\\n"}},"logprobs":null,"finish_reason":null}]}\n\n`,
71
- `data: {"id":"chatcmpl-8ZhZtizjTCGmZaPRwyUiuDJ1DYUD0","object":"chat.completion.chunk",` +
72
- `"created":1703519685,"model":"gpt-3.5-turbo-0613","system_fingerprint":null,` +
73
- `"choices":[{"index":0,"delta":{"function_call":{"arguments":"}"}},"logprobs":null,"finish_reason":null}]}\n\n`,
74
- `data: {"id":"chatcmpl-8ZhZtizjTCGmZaPRwyUiuDJ1DYUD0","object":"chat.completion.chunk",` +
75
- `"created":1703519685,"model":"gpt-3.5-turbo-0613","system_fingerprint":null,` +
76
- `"choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}]}\n\n`,
77
- `data: [DONE]\n\n`,
78
- ];
79
- const stream = await (0, streamObject_js_1.streamObject)({
80
- model: new OpenAIChatModel_js_1.OpenAIChatModel({
81
- api: new OpenAIApiConfiguration_js_1.OpenAIApiConfiguration({ apiKey: "test-key" }),
82
- model: "gpt-3.5-turbo",
83
- })
84
- .asFunctionCallObjectGenerationModel({
85
- fnName: "generateCharacter",
86
- fnDescription: "Generate character descriptions.",
87
- })
88
- .withTextPrompt(),
89
- schema: (0, ZodSchema_js_1.zodSchema)(zod_1.z.object({ name: zod_1.z.string() })),
90
- prompt: "generate a name",
91
- });
92
- const streamAsArray = await (0, arrayFromAsync_js_1.arrayFromAsync)(stream);
93
- expect(streamAsArray.map((entry) => entry.partialObject)).toStrictEqual([
94
- {},
95
- { name: "" },
96
- { name: "M" },
97
- { name: "Mike" },
98
- { name: "Mike" }, // double occurrence on purpose (stream text)
99
- ]);
100
- });
101
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,99 +0,0 @@
1
- import { z } from "zod";
2
- import { zodSchema } from "../../core/schema/ZodSchema.js";
3
- import { streamObject } from "../../model-function/generate-object/streamObject.js";
4
- import { streamText } from "../../model-function/generate-text/streamText.js";
5
- import { StreamingTestServer } from "../../test/StreamingTestServer.js";
6
- import { arrayFromAsync } from "../../test/arrayFromAsync.js";
7
- import { OpenAIApiConfiguration } from "./OpenAIApiConfiguration.js";
8
- import { OpenAIChatModel } from "./OpenAIChatModel.js";
9
- describe("streamText", () => {
10
- const server = new StreamingTestServer("https://api.openai.com/v1/chat/completions");
11
- server.setupTestEnvironment();
12
- it("should return only values from the first choice when using streamText", async () => {
13
- server.responseChunks = [
14
- `data: {"id":"chatcmpl-123","object":"chat.completion.chunk","created":1702657020,"model":"gpt-3.5-turbo-0613",` +
15
- `"system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null}]}\n\n`,
16
- `data: {"id":"chatcmpl-123","object":"chat.completion.chunk","created":1702657020,"model":"gpt-3.5-turbo-0613",` +
17
- `"system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"A"},"finish_reason":null}]}\n\n`,
18
- `data: {"id":"chatcmpl-123","object":"chat.completion.chunk","created":1702657020,"model":"gpt-3.5-turbo-0613",` +
19
- `"system_fingerprint":null,"choices":[{"index":1,"delta":{"role":"assistant","content":""},"finish_reason":null}]}\n\n`,
20
- `data: {"id":"chatcmpl-123","object":"chat.completion.chunk","created":1702657020,"model":"gpt-3.5-turbo-0613",` +
21
- `"system_fingerprint":null,"choices":[{"index":1,"delta":{"content":"B"},"finish_reason":null}]}\n\n`,
22
- `data: {"id":"chatcmpl-123","object":"chat.completion.chunk","created":1702657020,"model":"gpt-3.5-turbo-0613",` +
23
- `"system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"stop"}]}\n\n`,
24
- `data: {"id":"chatcmpl-123","object":"chat.completion.chunk","created":1702657020,"model":"gpt-3.5-turbo-0613",` +
25
- `"system_fingerprint":null,"choices":[{"index":1,"delta":{},"finish_reason":"stop"}]}\n\n`,
26
- "data: [DONE]\n\n",
27
- ];
28
- const stream = await streamText({
29
- model: new OpenAIChatModel({
30
- api: new OpenAIApiConfiguration({ apiKey: "test-key" }),
31
- model: "gpt-3.5-turbo",
32
- numberOfGenerations: 2,
33
- }).withTextPrompt(),
34
- prompt: "test prompt",
35
- });
36
- expect(await arrayFromAsync(stream)).toStrictEqual(["A"]);
37
- });
38
- });
39
- describe("streamObject", () => {
40
- const server = new StreamingTestServer("https://api.openai.com/v1/chat/completions");
41
- server.setupTestEnvironment();
42
- it("should return a text stream", async () => {
43
- server.responseChunks = [
44
- `data: {"id":"chatcmpl-8ZhZtizjTCGmZaPRwyUiuDJ1DYUD0","object":"chat.completion.chunk",` +
45
- `"created":1703519685,"model":"gpt-3.5-turbo-0613","system_fingerprint":null,` +
46
- `"choices":[{"index":0,"delta":{"role":"assistant","content":null,` +
47
- `"function_call":{"name":"generateCharacter","arguments":""}},"logprobs":null,"finish_reason":null}]}\n\n`,
48
- `data: {"id":"chatcmpl-8ZhZtizjTCGmZaPRwyUiuDJ1DYUD0","object":"chat.completion.chunk",` +
49
- `"created":1703519685,"model":"gpt-3.5-turbo-0613","system_fingerprint":null,` +
50
- `"choices":[{"index":0,"delta":{"function_call":{"arguments":"{\\n"}},"logprobs":null,"finish_reason":null}]}\n\n`,
51
- `data: {"id":"chatcmpl-8ZhZtizjTCGmZaPRwyUiuDJ1DYUD0","object":"chat.completion.chunk",` +
52
- `"created":1703519685,"model":"gpt-3.5-turbo-0613","system_fingerprint":null,` +
53
- `"choices":[{"index":0,"delta":{"function_call":{"arguments":" "}},"logprobs":null,"finish_reason":null}]}\n\n`,
54
- `data: {"id":"chatcmpl-8ZhZtizjTCGmZaPRwyUiuDJ1DYUD0","object":"chat.completion.chunk",` +
55
- `"created":1703519685,"model":"gpt-3.5-turbo-0613","system_fingerprint":null,` +
56
- `"choices":[{"index":0,"delta":{"function_call":{"arguments":" \\""}},"logprobs":null,"finish_reason":null}]}\n\n`,
57
- `data: {"id":"chatcmpl-8ZhZtizjTCGmZaPRwyUiuDJ1DYUD0","object":"chat.completion.chunk",` +
58
- `"created":1703519685,"model":"gpt-3.5-turbo-0613","system_fingerprint":null,` +
59
- `"choices":[{"index":0,"delta":{"function_call":{"arguments":"name"}},"logprobs":null,"finish_reason":null}]}\n\n`,
60
- `data: {"id":"chatcmpl-8ZhZtizjTCGmZaPRwyUiuDJ1DYUD0","object":"chat.completion.chunk",` +
61
- `"created":1703519685,"model":"gpt-3.5-turbo-0613","system_fingerprint":null,` +
62
- `"choices":[{"index":0,"delta":{"function_call":{"arguments":"\\":\\""}},"logprobs":null,"finish_reason":null}]}\n\n`,
63
- `data: {"id":"chatcmpl-8ZhZtizjTCGmZaPRwyUiuDJ1DYUD0","object":"chat.completion.chunk",` +
64
- `"created":1703519685,"model":"gpt-3.5-turbo-0613","system_fingerprint":null,` +
65
- `"choices":[{"index":0,"delta":{"function_call":{"arguments":"M"}},"logprobs":null,"finish_reason":null}]}\n\n`,
66
- `data: {"id":"chatcmpl-8ZhZtizjTCGmZaPRwyUiuDJ1DYUD0","object":"chat.completion.chunk",` +
67
- `"created":1703519685,"model":"gpt-3.5-turbo-0613","system_fingerprint":null,` +
68
- `"choices":[{"index":0,"delta":{"function_call":{"arguments":"ike\\"\\n"}},"logprobs":null,"finish_reason":null}]}\n\n`,
69
- `data: {"id":"chatcmpl-8ZhZtizjTCGmZaPRwyUiuDJ1DYUD0","object":"chat.completion.chunk",` +
70
- `"created":1703519685,"model":"gpt-3.5-turbo-0613","system_fingerprint":null,` +
71
- `"choices":[{"index":0,"delta":{"function_call":{"arguments":"}"}},"logprobs":null,"finish_reason":null}]}\n\n`,
72
- `data: {"id":"chatcmpl-8ZhZtizjTCGmZaPRwyUiuDJ1DYUD0","object":"chat.completion.chunk",` +
73
- `"created":1703519685,"model":"gpt-3.5-turbo-0613","system_fingerprint":null,` +
74
- `"choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}]}\n\n`,
75
- `data: [DONE]\n\n`,
76
- ];
77
- const stream = await streamObject({
78
- model: new OpenAIChatModel({
79
- api: new OpenAIApiConfiguration({ apiKey: "test-key" }),
80
- model: "gpt-3.5-turbo",
81
- })
82
- .asFunctionCallObjectGenerationModel({
83
- fnName: "generateCharacter",
84
- fnDescription: "Generate character descriptions.",
85
- })
86
- .withTextPrompt(),
87
- schema: zodSchema(z.object({ name: z.string() })),
88
- prompt: "generate a name",
89
- });
90
- const streamAsArray = await arrayFromAsync(stream);
91
- expect(streamAsArray.map((entry) => entry.partialObject)).toStrictEqual([
92
- {},
93
- { name: "" },
94
- { name: "M" },
95
- { name: "Mike" },
96
- { name: "Mike" }, // double occurrence on purpose (stream text)
97
- ]);
98
- });
99
- });