@huggingface/inference 3.13.2 → 3.14.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 (600) hide show
  1. package/dist/{src → commonjs}/InferenceClient.d.ts +2 -2
  2. package/dist/commonjs/InferenceClient.d.ts.map +1 -0
  3. package/dist/commonjs/InferenceClient.js +83 -0
  4. package/dist/commonjs/config.js +6 -0
  5. package/dist/commonjs/index.d.ts +7 -0
  6. package/dist/commonjs/index.d.ts.map +1 -0
  7. package/dist/commonjs/index.js +49 -0
  8. package/dist/commonjs/lib/InferenceOutputError.js +10 -0
  9. package/dist/commonjs/lib/getDefaultTask.js +48 -0
  10. package/dist/{src → commonjs}/lib/getInferenceProviderMapping.d.ts +1 -1
  11. package/dist/{src → commonjs}/lib/getInferenceProviderMapping.d.ts.map +1 -1
  12. package/dist/commonjs/lib/getInferenceProviderMapping.js +81 -0
  13. package/dist/{src → commonjs}/lib/getProviderHelper.d.ts +2 -2
  14. package/dist/{src → commonjs}/lib/getProviderHelper.d.ts.map +1 -1
  15. package/dist/commonjs/lib/getProviderHelper.js +168 -0
  16. package/dist/commonjs/lib/isUrl.js +6 -0
  17. package/dist/{src → commonjs}/lib/makeRequestOptions.d.ts +3 -3
  18. package/dist/{src → commonjs}/lib/makeRequestOptions.d.ts.map +1 -1
  19. package/dist/commonjs/lib/makeRequestOptions.js +161 -0
  20. package/dist/commonjs/package.d.ts +3 -0
  21. package/dist/commonjs/package.d.ts.map +1 -0
  22. package/dist/commonjs/package.js +6 -0
  23. package/dist/commonjs/package.json +3 -0
  24. package/dist/{src → commonjs}/providers/black-forest-labs.d.ts +2 -2
  25. package/dist/{src → commonjs}/providers/black-forest-labs.d.ts.map +1 -1
  26. package/dist/commonjs/providers/black-forest-labs.js +82 -0
  27. package/dist/{src → commonjs}/providers/cerebras.d.ts +1 -1
  28. package/dist/{src → commonjs}/providers/cerebras.d.ts.map +1 -1
  29. package/dist/commonjs/providers/cerebras.js +26 -0
  30. package/dist/{src → commonjs}/providers/cohere.d.ts +1 -1
  31. package/dist/{src → commonjs}/providers/cohere.d.ts.map +1 -1
  32. package/dist/commonjs/providers/cohere.js +29 -0
  33. package/dist/{src → commonjs}/providers/consts.d.ts +3 -3
  34. package/dist/commonjs/providers/consts.d.ts.map +1 -0
  35. package/dist/commonjs/providers/consts.js +35 -0
  36. package/dist/{src → commonjs}/providers/fal-ai.d.ts +3 -3
  37. package/dist/{src → commonjs}/providers/fal-ai.d.ts.map +1 -1
  38. package/dist/commonjs/providers/fal-ai.js +216 -0
  39. package/dist/{src → commonjs}/providers/featherless-ai.d.ts +2 -2
  40. package/dist/{src → commonjs}/providers/featherless-ai.d.ts.map +1 -1
  41. package/dist/commonjs/providers/featherless-ai.js +38 -0
  42. package/dist/{src → commonjs}/providers/fireworks-ai.d.ts +1 -1
  43. package/dist/commonjs/providers/fireworks-ai.d.ts.map +1 -0
  44. package/dist/commonjs/providers/fireworks-ai.js +29 -0
  45. package/dist/{src → commonjs}/providers/groq.d.ts +1 -1
  46. package/dist/{src → commonjs}/providers/groq.d.ts.map +1 -1
  47. package/dist/commonjs/providers/groq.js +39 -0
  48. package/dist/{src → commonjs}/providers/hf-inference.d.ts +6 -6
  49. package/dist/{src → commonjs}/providers/hf-inference.d.ts.map +1 -1
  50. package/dist/commonjs/providers/hf-inference.js +432 -0
  51. package/dist/{src → commonjs}/providers/hyperbolic.d.ts +2 -2
  52. package/dist/{src → commonjs}/providers/hyperbolic.d.ts.map +1 -1
  53. package/dist/commonjs/providers/hyperbolic.js +78 -0
  54. package/dist/{src → commonjs}/providers/nebius.d.ts +2 -2
  55. package/dist/{src → commonjs}/providers/nebius.d.ts.map +1 -1
  56. package/dist/commonjs/providers/nebius.js +70 -0
  57. package/dist/{src → commonjs}/providers/novita.d.ts +2 -2
  58. package/dist/{src → commonjs}/providers/novita.d.ts.map +1 -1
  59. package/dist/commonjs/providers/novita.js +73 -0
  60. package/dist/{src → commonjs}/providers/nscale.d.ts +2 -2
  61. package/dist/{src → commonjs}/providers/nscale.d.ts.map +1 -1
  62. package/dist/commonjs/providers/nscale.js +46 -0
  63. package/dist/{src → commonjs}/providers/openai.d.ts +1 -1
  64. package/dist/{src → commonjs}/providers/openai.d.ts.map +1 -1
  65. package/dist/commonjs/providers/openai.js +15 -0
  66. package/dist/{src → commonjs}/providers/ovhcloud.d.ts +2 -2
  67. package/dist/{src → commonjs}/providers/ovhcloud.d.ts.map +1 -1
  68. package/dist/commonjs/providers/ovhcloud.js +60 -0
  69. package/dist/{src → commonjs}/providers/providerHelper.d.ts +4 -4
  70. package/dist/{src → commonjs}/providers/providerHelper.d.ts.map +1 -1
  71. package/dist/commonjs/providers/providerHelper.js +108 -0
  72. package/dist/{src → commonjs}/providers/replicate.d.ts +2 -2
  73. package/dist/{src → commonjs}/providers/replicate.d.ts.map +1 -1
  74. package/dist/commonjs/providers/replicate.js +135 -0
  75. package/dist/{src → commonjs}/providers/sambanova.d.ts +3 -3
  76. package/dist/{src → commonjs}/providers/sambanova.d.ts.map +1 -1
  77. package/dist/commonjs/providers/sambanova.js +49 -0
  78. package/dist/{src → commonjs}/providers/together.d.ts +2 -2
  79. package/dist/{src → commonjs}/providers/together.d.ts.map +1 -1
  80. package/dist/commonjs/providers/together.js +71 -0
  81. package/dist/{src → commonjs}/snippets/getInferenceSnippets.d.ts +2 -2
  82. package/dist/{src → commonjs}/snippets/getInferenceSnippets.d.ts.map +1 -1
  83. package/dist/commonjs/snippets/getInferenceSnippets.js +312 -0
  84. package/dist/commonjs/snippets/index.js +5 -0
  85. package/dist/commonjs/snippets/templates.exported.js +81 -0
  86. package/dist/{src → commonjs}/tasks/audio/audioClassification.d.ts +2 -2
  87. package/dist/{src → commonjs}/tasks/audio/audioClassification.d.ts.map +1 -1
  88. package/dist/commonjs/tasks/audio/audioClassification.js +21 -0
  89. package/dist/{src → commonjs}/tasks/audio/audioToAudio.d.ts +2 -2
  90. package/dist/commonjs/tasks/audio/audioToAudio.d.ts.map +1 -0
  91. package/dist/commonjs/tasks/audio/audioToAudio.js +22 -0
  92. package/dist/{src → commonjs}/tasks/audio/automaticSpeechRecognition.d.ts +2 -2
  93. package/dist/commonjs/tasks/audio/automaticSpeechRecognition.d.ts.map +1 -0
  94. package/dist/commonjs/tasks/audio/automaticSpeechRecognition.js +25 -0
  95. package/dist/{src → commonjs}/tasks/audio/textToSpeech.d.ts +1 -1
  96. package/dist/commonjs/tasks/audio/textToSpeech.d.ts.map +1 -0
  97. package/dist/commonjs/tasks/audio/textToSpeech.js +19 -0
  98. package/dist/{src → commonjs}/tasks/audio/utils.d.ts +1 -1
  99. package/dist/commonjs/tasks/audio/utils.d.ts.map +1 -0
  100. package/dist/commonjs/tasks/audio/utils.js +12 -0
  101. package/dist/{src → commonjs}/tasks/custom/request.d.ts +1 -1
  102. package/dist/commonjs/tasks/custom/request.d.ts.map +1 -0
  103. package/dist/commonjs/tasks/custom/request.js +17 -0
  104. package/dist/{src → commonjs}/tasks/custom/streamingRequest.d.ts +1 -1
  105. package/dist/commonjs/tasks/custom/streamingRequest.d.ts.map +1 -0
  106. package/dist/commonjs/tasks/custom/streamingRequest.js +16 -0
  107. package/dist/{src → commonjs}/tasks/cv/imageClassification.d.ts +2 -2
  108. package/dist/commonjs/tasks/cv/imageClassification.d.ts.map +1 -0
  109. package/dist/commonjs/tasks/cv/imageClassification.js +21 -0
  110. package/dist/{src → commonjs}/tasks/cv/imageSegmentation.d.ts +2 -2
  111. package/dist/commonjs/tasks/cv/imageSegmentation.d.ts.map +1 -0
  112. package/dist/commonjs/tasks/cv/imageSegmentation.js +21 -0
  113. package/dist/{src → commonjs}/tasks/cv/imageToImage.d.ts +1 -1
  114. package/dist/commonjs/tasks/cv/imageToImage.d.ts.map +1 -0
  115. package/dist/commonjs/tasks/cv/imageToImage.js +20 -0
  116. package/dist/{src → commonjs}/tasks/cv/imageToText.d.ts +2 -2
  117. package/dist/commonjs/tasks/cv/imageToText.d.ts.map +1 -0
  118. package/dist/commonjs/tasks/cv/imageToText.js +20 -0
  119. package/dist/{src → commonjs}/tasks/cv/objectDetection.d.ts +2 -2
  120. package/dist/commonjs/tasks/cv/objectDetection.d.ts.map +1 -0
  121. package/dist/commonjs/tasks/cv/objectDetection.js +21 -0
  122. package/dist/{src → commonjs}/tasks/cv/textToImage.d.ts +1 -1
  123. package/dist/commonjs/tasks/cv/textToImage.d.ts.map +1 -0
  124. package/dist/commonjs/tasks/cv/textToImage.js +17 -0
  125. package/dist/{src → commonjs}/tasks/cv/textToVideo.d.ts +1 -1
  126. package/dist/commonjs/tasks/cv/textToVideo.d.ts.map +1 -0
  127. package/dist/commonjs/tasks/cv/textToVideo.js +17 -0
  128. package/dist/{src → commonjs}/tasks/cv/utils.d.ts +1 -1
  129. package/dist/commonjs/tasks/cv/utils.d.ts.map +1 -0
  130. package/dist/commonjs/tasks/cv/utils.js +7 -0
  131. package/dist/{src → commonjs}/tasks/cv/zeroShotImageClassification.d.ts +1 -1
  132. package/dist/commonjs/tasks/cv/zeroShotImageClassification.d.ts.map +1 -0
  133. package/dist/commonjs/tasks/cv/zeroShotImageClassification.js +39 -0
  134. package/dist/commonjs/tasks/index.d.ts +33 -0
  135. package/dist/commonjs/tasks/index.d.ts.map +1 -0
  136. package/dist/commonjs/tasks/index.js +54 -0
  137. package/dist/{src → commonjs}/tasks/multimodal/documentQuestionAnswering.d.ts +1 -1
  138. package/dist/commonjs/tasks/multimodal/documentQuestionAnswering.d.ts.map +1 -0
  139. package/dist/commonjs/tasks/multimodal/documentQuestionAnswering.js +27 -0
  140. package/dist/{src → commonjs}/tasks/multimodal/visualQuestionAnswering.d.ts +1 -1
  141. package/dist/commonjs/tasks/multimodal/visualQuestionAnswering.d.ts.map +1 -0
  142. package/dist/commonjs/tasks/multimodal/visualQuestionAnswering.js +27 -0
  143. package/dist/{src → commonjs}/tasks/nlp/chatCompletion.d.ts +1 -1
  144. package/dist/{src → commonjs}/tasks/nlp/chatCompletion.d.ts.map +1 -1
  145. package/dist/commonjs/tasks/nlp/chatCompletion.js +18 -0
  146. package/dist/{src → commonjs}/tasks/nlp/chatCompletionStream.d.ts +1 -1
  147. package/dist/{src → commonjs}/tasks/nlp/chatCompletionStream.d.ts.map +1 -1
  148. package/dist/commonjs/tasks/nlp/chatCompletionStream.js +17 -0
  149. package/dist/{src → commonjs}/tasks/nlp/featureExtraction.d.ts +1 -1
  150. package/dist/commonjs/tasks/nlp/featureExtraction.d.ts.map +1 -0
  151. package/dist/commonjs/tasks/nlp/featureExtraction.js +18 -0
  152. package/dist/{src → commonjs}/tasks/nlp/fillMask.d.ts +1 -1
  153. package/dist/commonjs/tasks/nlp/fillMask.d.ts.map +1 -0
  154. package/dist/commonjs/tasks/nlp/fillMask.js +18 -0
  155. package/dist/{src → commonjs}/tasks/nlp/questionAnswering.d.ts +1 -1
  156. package/dist/commonjs/tasks/nlp/questionAnswering.d.ts.map +1 -0
  157. package/dist/commonjs/tasks/nlp/questionAnswering.js +18 -0
  158. package/dist/{src → commonjs}/tasks/nlp/sentenceSimilarity.d.ts +1 -1
  159. package/dist/commonjs/tasks/nlp/sentenceSimilarity.d.ts.map +1 -0
  160. package/dist/commonjs/tasks/nlp/sentenceSimilarity.js +18 -0
  161. package/dist/{src → commonjs}/tasks/nlp/summarization.d.ts +1 -1
  162. package/dist/commonjs/tasks/nlp/summarization.d.ts.map +1 -0
  163. package/dist/commonjs/tasks/nlp/summarization.js +18 -0
  164. package/dist/{src → commonjs}/tasks/nlp/tableQuestionAnswering.d.ts +1 -1
  165. package/dist/{src → commonjs}/tasks/nlp/tableQuestionAnswering.d.ts.map +1 -1
  166. package/dist/commonjs/tasks/nlp/tableQuestionAnswering.js +18 -0
  167. package/dist/{src → commonjs}/tasks/nlp/textClassification.d.ts +1 -1
  168. package/dist/commonjs/tasks/nlp/textClassification.d.ts.map +1 -0
  169. package/dist/commonjs/tasks/nlp/textClassification.js +18 -0
  170. package/dist/{src → commonjs}/tasks/nlp/textGeneration.d.ts +1 -1
  171. package/dist/commonjs/tasks/nlp/textGeneration.d.ts.map +1 -0
  172. package/dist/commonjs/tasks/nlp/textGeneration.js +18 -0
  173. package/dist/{src → commonjs}/tasks/nlp/textGenerationStream.d.ts +1 -1
  174. package/dist/commonjs/tasks/nlp/textGenerationStream.d.ts.map +1 -0
  175. package/dist/commonjs/tasks/nlp/textGenerationStream.js +17 -0
  176. package/dist/{src → commonjs}/tasks/nlp/tokenClassification.d.ts +1 -1
  177. package/dist/{src → commonjs}/tasks/nlp/tokenClassification.d.ts.map +1 -1
  178. package/dist/commonjs/tasks/nlp/tokenClassification.js +18 -0
  179. package/dist/{src → commonjs}/tasks/nlp/translation.d.ts +1 -1
  180. package/dist/commonjs/tasks/nlp/translation.d.ts.map +1 -0
  181. package/dist/commonjs/tasks/nlp/translation.js +18 -0
  182. package/dist/{src → commonjs}/tasks/nlp/zeroShotClassification.d.ts +1 -1
  183. package/dist/{src → commonjs}/tasks/nlp/zeroShotClassification.d.ts.map +1 -1
  184. package/dist/commonjs/tasks/nlp/zeroShotClassification.js +18 -0
  185. package/dist/{src → commonjs}/tasks/tabular/tabularClassification.d.ts +1 -1
  186. package/dist/commonjs/tasks/tabular/tabularClassification.d.ts.map +1 -0
  187. package/dist/commonjs/tasks/tabular/tabularClassification.js +20 -0
  188. package/dist/{src → commonjs}/tasks/tabular/tabularRegression.d.ts +1 -1
  189. package/dist/commonjs/tasks/tabular/tabularRegression.d.ts.map +1 -0
  190. package/dist/commonjs/tasks/tabular/tabularRegression.js +20 -0
  191. package/dist/{src → commonjs}/types.d.ts +1 -1
  192. package/dist/{src → commonjs}/types.d.ts.map +1 -1
  193. package/dist/commonjs/types.js +23 -0
  194. package/dist/commonjs/utils/base64FromBytes.js +15 -0
  195. package/dist/commonjs/utils/delay.js +8 -0
  196. package/dist/commonjs/utils/distributive-omit.js +7 -0
  197. package/dist/commonjs/utils/isBackend.js +6 -0
  198. package/dist/commonjs/utils/isFrontend.js +5 -0
  199. package/dist/commonjs/utils/omit.js +13 -0
  200. package/dist/commonjs/utils/pick.js +13 -0
  201. package/dist/{src → commonjs}/utils/request.d.ts +2 -2
  202. package/dist/{src → commonjs}/utils/request.d.ts.map +1 -1
  203. package/dist/commonjs/utils/request.js +116 -0
  204. package/dist/commonjs/utils/toArray.js +9 -0
  205. package/dist/commonjs/utils/typedEntries.js +6 -0
  206. package/dist/commonjs/utils/typedInclude.js +6 -0
  207. package/dist/commonjs/vendor/fetch-event-source/parse.d.ts.map +1 -0
  208. package/dist/commonjs/vendor/fetch-event-source/parse.js +185 -0
  209. package/dist/commonjs/vendor/fetch-event-source/parse.spec.js +370 -0
  210. package/dist/esm/InferenceClient.d.ts +32 -0
  211. package/dist/esm/InferenceClient.d.ts.map +1 -0
  212. package/dist/esm/InferenceClient.js +44 -0
  213. package/dist/esm/config.d.ts +4 -0
  214. package/dist/esm/config.d.ts.map +1 -0
  215. package/dist/esm/config.js +3 -0
  216. package/dist/esm/index.d.ts +7 -0
  217. package/dist/esm/index.d.ts.map +1 -0
  218. package/dist/{src/index.d.ts → esm/index.js} +4 -5
  219. package/dist/esm/lib/InferenceOutputError.d.ts +4 -0
  220. package/dist/esm/lib/InferenceOutputError.d.ts.map +1 -0
  221. package/dist/esm/lib/InferenceOutputError.js +6 -0
  222. package/dist/esm/lib/getDefaultTask.d.ts +11 -0
  223. package/dist/esm/lib/getDefaultTask.d.ts.map +1 -0
  224. package/dist/esm/lib/getDefaultTask.js +45 -0
  225. package/dist/esm/lib/getInferenceProviderMapping.d.ts +25 -0
  226. package/dist/esm/lib/getInferenceProviderMapping.d.ts.map +1 -0
  227. package/dist/esm/lib/getInferenceProviderMapping.js +75 -0
  228. package/dist/esm/lib/getProviderHelper.d.ts +37 -0
  229. package/dist/esm/lib/getProviderHelper.d.ts.map +1 -0
  230. package/dist/esm/lib/getProviderHelper.js +131 -0
  231. package/dist/esm/lib/isUrl.d.ts +2 -0
  232. package/dist/esm/lib/isUrl.d.ts.map +1 -0
  233. package/dist/esm/lib/isUrl.js +3 -0
  234. package/dist/esm/lib/makeRequestOptions.d.ts +31 -0
  235. package/dist/esm/lib/makeRequestOptions.d.ts.map +1 -0
  236. package/dist/esm/lib/makeRequestOptions.js +157 -0
  237. package/dist/esm/package.d.ts +3 -0
  238. package/dist/esm/package.d.ts.map +1 -0
  239. package/dist/esm/package.js +3 -0
  240. package/dist/esm/package.json +3 -0
  241. package/dist/esm/providers/black-forest-labs.d.ts +15 -0
  242. package/dist/esm/providers/black-forest-labs.d.ts.map +1 -0
  243. package/dist/esm/providers/black-forest-labs.js +78 -0
  244. package/dist/esm/providers/cerebras.d.ts +21 -0
  245. package/dist/esm/providers/cerebras.d.ts.map +1 -0
  246. package/dist/esm/providers/cerebras.js +22 -0
  247. package/dist/esm/providers/cohere.d.ts +22 -0
  248. package/dist/esm/providers/cohere.d.ts.map +1 -0
  249. package/dist/esm/providers/cohere.js +25 -0
  250. package/dist/esm/providers/consts.d.ts +12 -0
  251. package/dist/esm/providers/consts.d.ts.map +1 -0
  252. package/dist/esm/providers/consts.js +32 -0
  253. package/dist/esm/providers/fal-ai.d.ts +42 -0
  254. package/dist/esm/providers/fal-ai.d.ts.map +1 -0
  255. package/dist/esm/providers/fal-ai.js +209 -0
  256. package/dist/esm/providers/featherless-ai.d.ts +22 -0
  257. package/dist/esm/providers/featherless-ai.d.ts.map +1 -0
  258. package/dist/esm/providers/featherless-ai.js +33 -0
  259. package/dist/esm/providers/fireworks-ai.d.ts +22 -0
  260. package/dist/esm/providers/fireworks-ai.d.ts.map +1 -0
  261. package/dist/esm/providers/fireworks-ai.js +25 -0
  262. package/dist/esm/providers/groq.d.ts +10 -0
  263. package/dist/esm/providers/groq.d.ts.map +1 -0
  264. package/dist/esm/providers/groq.js +34 -0
  265. package/dist/esm/providers/hf-inference.d.ts +131 -0
  266. package/dist/esm/providers/hf-inference.d.ts.map +1 -0
  267. package/dist/esm/providers/hf-inference.js +400 -0
  268. package/dist/esm/providers/hyperbolic.d.ts +48 -0
  269. package/dist/esm/providers/hyperbolic.d.ts.map +1 -0
  270. package/dist/esm/providers/hyperbolic.js +72 -0
  271. package/dist/esm/providers/nebius.d.ts +49 -0
  272. package/dist/esm/providers/nebius.d.ts.map +1 -0
  273. package/dist/esm/providers/nebius.js +63 -0
  274. package/dist/esm/providers/novita.d.ts +22 -0
  275. package/dist/esm/providers/novita.d.ts.map +1 -0
  276. package/dist/esm/providers/novita.js +67 -0
  277. package/dist/esm/providers/nscale.d.ts +35 -0
  278. package/dist/esm/providers/nscale.d.ts.map +1 -0
  279. package/dist/esm/providers/nscale.js +41 -0
  280. package/dist/esm/providers/openai.d.ts +8 -0
  281. package/dist/esm/providers/openai.d.ts.map +1 -0
  282. package/dist/esm/providers/openai.js +11 -0
  283. package/dist/esm/providers/ovhcloud.d.ts +38 -0
  284. package/dist/esm/providers/ovhcloud.d.ts.map +1 -0
  285. package/dist/esm/providers/ovhcloud.js +55 -0
  286. package/dist/esm/providers/providerHelper.d.ts +186 -0
  287. package/dist/esm/providers/providerHelper.d.ts.map +1 -0
  288. package/dist/esm/providers/providerHelper.js +102 -0
  289. package/dist/esm/providers/replicate.d.ts +25 -0
  290. package/dist/esm/providers/replicate.d.ts.map +1 -0
  291. package/dist/esm/providers/replicate.js +129 -0
  292. package/dist/esm/providers/sambanova.d.ts +14 -0
  293. package/dist/esm/providers/sambanova.d.ts.map +1 -0
  294. package/dist/esm/providers/sambanova.js +44 -0
  295. package/dist/esm/providers/together.d.ts +49 -0
  296. package/dist/esm/providers/together.d.ts.map +1 -0
  297. package/dist/esm/providers/together.js +65 -0
  298. package/dist/esm/snippets/getInferenceSnippets.d.ts +9 -0
  299. package/dist/esm/snippets/getInferenceSnippets.d.ts.map +1 -0
  300. package/dist/esm/snippets/getInferenceSnippets.js +309 -0
  301. package/dist/esm/snippets/index.d.ts +2 -0
  302. package/dist/esm/snippets/index.d.ts.map +1 -0
  303. package/dist/esm/snippets/index.js +1 -0
  304. package/dist/esm/snippets/templates.exported.d.ts +2 -0
  305. package/dist/esm/snippets/templates.exported.d.ts.map +1 -0
  306. package/dist/esm/snippets/templates.exported.js +78 -0
  307. package/dist/esm/tasks/audio/audioClassification.d.ts +10 -0
  308. package/dist/esm/tasks/audio/audioClassification.d.ts.map +1 -0
  309. package/dist/esm/tasks/audio/audioClassification.js +18 -0
  310. package/dist/esm/tasks/audio/audioToAudio.d.ts +29 -0
  311. package/dist/esm/tasks/audio/audioToAudio.d.ts.map +1 -0
  312. package/dist/esm/tasks/audio/audioToAudio.js +19 -0
  313. package/dist/esm/tasks/audio/automaticSpeechRecognition.d.ts +10 -0
  314. package/dist/esm/tasks/audio/automaticSpeechRecognition.d.ts.map +1 -0
  315. package/dist/esm/tasks/audio/automaticSpeechRecognition.js +22 -0
  316. package/dist/esm/tasks/audio/textToSpeech.d.ts +10 -0
  317. package/dist/esm/tasks/audio/textToSpeech.d.ts.map +1 -0
  318. package/dist/esm/tasks/audio/textToSpeech.js +16 -0
  319. package/dist/esm/tasks/audio/utils.d.ts +12 -0
  320. package/dist/esm/tasks/audio/utils.d.ts.map +1 -0
  321. package/dist/esm/tasks/audio/utils.js +9 -0
  322. package/dist/esm/tasks/custom/request.d.ts +10 -0
  323. package/dist/esm/tasks/custom/request.d.ts.map +1 -0
  324. package/dist/esm/tasks/custom/request.js +14 -0
  325. package/dist/esm/tasks/custom/streamingRequest.d.ts +10 -0
  326. package/dist/esm/tasks/custom/streamingRequest.d.ts.map +1 -0
  327. package/dist/esm/tasks/custom/streamingRequest.js +13 -0
  328. package/dist/esm/tasks/cv/imageClassification.d.ts +10 -0
  329. package/dist/esm/tasks/cv/imageClassification.d.ts.map +1 -0
  330. package/dist/esm/tasks/cv/imageClassification.js +18 -0
  331. package/dist/esm/tasks/cv/imageSegmentation.d.ts +10 -0
  332. package/dist/esm/tasks/cv/imageSegmentation.d.ts.map +1 -0
  333. package/dist/esm/tasks/cv/imageSegmentation.js +18 -0
  334. package/dist/esm/tasks/cv/imageToImage.d.ts +9 -0
  335. package/dist/esm/tasks/cv/imageToImage.d.ts.map +1 -0
  336. package/dist/esm/tasks/cv/imageToImage.js +17 -0
  337. package/dist/esm/tasks/cv/imageToText.d.ts +9 -0
  338. package/dist/esm/tasks/cv/imageToText.d.ts.map +1 -0
  339. package/dist/esm/tasks/cv/imageToText.js +17 -0
  340. package/dist/esm/tasks/cv/objectDetection.d.ts +10 -0
  341. package/dist/esm/tasks/cv/objectDetection.d.ts.map +1 -0
  342. package/dist/esm/tasks/cv/objectDetection.js +18 -0
  343. package/dist/esm/tasks/cv/textToImage.d.ts +18 -0
  344. package/dist/esm/tasks/cv/textToImage.d.ts.map +1 -0
  345. package/dist/esm/tasks/cv/textToImage.js +14 -0
  346. package/dist/esm/tasks/cv/textToVideo.d.ts +6 -0
  347. package/dist/esm/tasks/cv/textToVideo.d.ts.map +1 -0
  348. package/dist/esm/tasks/cv/textToVideo.js +14 -0
  349. package/dist/esm/tasks/cv/utils.d.ts +11 -0
  350. package/dist/esm/tasks/cv/utils.d.ts.map +1 -0
  351. package/dist/esm/tasks/cv/utils.js +4 -0
  352. package/dist/esm/tasks/cv/zeroShotImageClassification.d.ts +18 -0
  353. package/dist/esm/tasks/cv/zeroShotImageClassification.d.ts.map +1 -0
  354. package/dist/esm/tasks/cv/zeroShotImageClassification.js +36 -0
  355. package/dist/esm/tasks/index.d.ts +33 -0
  356. package/dist/esm/tasks/index.d.ts.map +1 -0
  357. package/dist/esm/tasks/index.js +38 -0
  358. package/dist/esm/tasks/multimodal/documentQuestionAnswering.d.ts +12 -0
  359. package/dist/esm/tasks/multimodal/documentQuestionAnswering.d.ts.map +1 -0
  360. package/dist/esm/tasks/multimodal/documentQuestionAnswering.js +24 -0
  361. package/dist/esm/tasks/multimodal/visualQuestionAnswering.d.ts +12 -0
  362. package/dist/esm/tasks/multimodal/visualQuestionAnswering.d.ts.map +1 -0
  363. package/dist/esm/tasks/multimodal/visualQuestionAnswering.js +24 -0
  364. package/dist/esm/tasks/nlp/chatCompletion.d.ts +7 -0
  365. package/dist/esm/tasks/nlp/chatCompletion.d.ts.map +1 -0
  366. package/dist/esm/tasks/nlp/chatCompletion.js +15 -0
  367. package/dist/esm/tasks/nlp/chatCompletionStream.d.ts +7 -0
  368. package/dist/esm/tasks/nlp/chatCompletionStream.d.ts.map +1 -0
  369. package/dist/esm/tasks/nlp/chatCompletionStream.js +14 -0
  370. package/dist/esm/tasks/nlp/featureExtraction.d.ts +17 -0
  371. package/dist/esm/tasks/nlp/featureExtraction.d.ts.map +1 -0
  372. package/dist/esm/tasks/nlp/featureExtraction.js +15 -0
  373. package/dist/esm/tasks/nlp/fillMask.d.ts +8 -0
  374. package/dist/esm/tasks/nlp/fillMask.d.ts.map +1 -0
  375. package/dist/esm/tasks/nlp/fillMask.js +15 -0
  376. package/dist/esm/tasks/nlp/questionAnswering.d.ts +8 -0
  377. package/dist/esm/tasks/nlp/questionAnswering.d.ts.map +1 -0
  378. package/dist/esm/tasks/nlp/questionAnswering.js +15 -0
  379. package/dist/esm/tasks/nlp/sentenceSimilarity.d.ts +8 -0
  380. package/dist/esm/tasks/nlp/sentenceSimilarity.d.ts.map +1 -0
  381. package/dist/esm/tasks/nlp/sentenceSimilarity.js +15 -0
  382. package/dist/esm/tasks/nlp/summarization.d.ts +8 -0
  383. package/dist/esm/tasks/nlp/summarization.d.ts.map +1 -0
  384. package/dist/esm/tasks/nlp/summarization.js +15 -0
  385. package/dist/esm/tasks/nlp/tableQuestionAnswering.d.ts +8 -0
  386. package/dist/esm/tasks/nlp/tableQuestionAnswering.d.ts.map +1 -0
  387. package/dist/esm/tasks/nlp/tableQuestionAnswering.js +15 -0
  388. package/dist/esm/tasks/nlp/textClassification.d.ts +8 -0
  389. package/dist/esm/tasks/nlp/textClassification.d.ts.map +1 -0
  390. package/dist/esm/tasks/nlp/textClassification.js +15 -0
  391. package/dist/esm/tasks/nlp/textGeneration.d.ts +8 -0
  392. package/dist/esm/tasks/nlp/textGeneration.d.ts.map +1 -0
  393. package/dist/esm/tasks/nlp/textGeneration.js +15 -0
  394. package/dist/esm/tasks/nlp/textGenerationStream.d.ts +81 -0
  395. package/dist/esm/tasks/nlp/textGenerationStream.d.ts.map +1 -0
  396. package/dist/esm/tasks/nlp/textGenerationStream.js +14 -0
  397. package/dist/esm/tasks/nlp/tokenClassification.d.ts +8 -0
  398. package/dist/esm/tasks/nlp/tokenClassification.d.ts.map +1 -0
  399. package/dist/esm/tasks/nlp/tokenClassification.js +15 -0
  400. package/dist/esm/tasks/nlp/translation.d.ts +8 -0
  401. package/dist/esm/tasks/nlp/translation.d.ts.map +1 -0
  402. package/dist/esm/tasks/nlp/translation.js +15 -0
  403. package/dist/esm/tasks/nlp/zeroShotClassification.d.ts +8 -0
  404. package/dist/esm/tasks/nlp/zeroShotClassification.d.ts.map +1 -0
  405. package/dist/esm/tasks/nlp/zeroShotClassification.js +15 -0
  406. package/dist/esm/tasks/tabular/tabularClassification.d.ts +20 -0
  407. package/dist/esm/tasks/tabular/tabularClassification.d.ts.map +1 -0
  408. package/dist/esm/tasks/tabular/tabularClassification.js +17 -0
  409. package/dist/esm/tasks/tabular/tabularRegression.d.ts +20 -0
  410. package/dist/esm/tasks/tabular/tabularRegression.d.ts.map +1 -0
  411. package/dist/esm/tasks/tabular/tabularRegression.js +17 -0
  412. package/dist/esm/types.d.ts +97 -0
  413. package/dist/esm/types.d.ts.map +1 -0
  414. package/dist/esm/types.js +20 -0
  415. package/dist/esm/utils/base64FromBytes.d.ts +2 -0
  416. package/dist/esm/utils/base64FromBytes.d.ts.map +1 -0
  417. package/dist/esm/utils/base64FromBytes.js +12 -0
  418. package/dist/esm/utils/delay.d.ts +2 -0
  419. package/dist/esm/utils/delay.d.ts.map +1 -0
  420. package/dist/esm/utils/delay.js +5 -0
  421. package/dist/esm/utils/distributive-omit.d.ts +9 -0
  422. package/dist/esm/utils/distributive-omit.d.ts.map +1 -0
  423. package/dist/esm/utils/distributive-omit.js +6 -0
  424. package/dist/esm/utils/isBackend.d.ts +2 -0
  425. package/dist/esm/utils/isBackend.d.ts.map +1 -0
  426. package/dist/esm/utils/isBackend.js +3 -0
  427. package/dist/esm/utils/isFrontend.d.ts +2 -0
  428. package/dist/esm/utils/isFrontend.d.ts.map +1 -0
  429. package/dist/esm/utils/isFrontend.js +2 -0
  430. package/dist/esm/utils/omit.d.ts +5 -0
  431. package/dist/esm/utils/omit.d.ts.map +1 -0
  432. package/dist/esm/utils/omit.js +10 -0
  433. package/dist/esm/utils/pick.d.ts +5 -0
  434. package/dist/esm/utils/pick.d.ts.map +1 -0
  435. package/dist/esm/utils/pick.js +10 -0
  436. package/dist/esm/utils/request.d.ts +28 -0
  437. package/dist/esm/utils/request.d.ts.map +1 -0
  438. package/dist/esm/utils/request.js +112 -0
  439. package/dist/esm/utils/toArray.d.ts +2 -0
  440. package/dist/esm/utils/toArray.d.ts.map +1 -0
  441. package/dist/esm/utils/toArray.js +6 -0
  442. package/dist/esm/utils/typedEntries.d.ts +4 -0
  443. package/dist/esm/utils/typedEntries.d.ts.map +1 -0
  444. package/dist/esm/utils/typedEntries.js +3 -0
  445. package/dist/esm/utils/typedInclude.d.ts +2 -0
  446. package/dist/esm/utils/typedInclude.d.ts.map +1 -0
  447. package/dist/esm/utils/typedInclude.js +3 -0
  448. package/dist/esm/vendor/fetch-event-source/parse.d.ts +69 -0
  449. package/dist/esm/vendor/fetch-event-source/parse.d.ts.map +1 -0
  450. package/dist/esm/vendor/fetch-event-source/parse.js +180 -0
  451. package/dist/esm/vendor/fetch-event-source/parse.spec.d.ts +2 -0
  452. package/dist/esm/vendor/fetch-event-source/parse.spec.d.ts.map +1 -0
  453. package/dist/esm/vendor/fetch-event-source/parse.spec.js +335 -0
  454. package/package.json +26 -12
  455. package/src/InferenceClient.ts +4 -4
  456. package/src/index.ts +4 -4
  457. package/src/lib/getDefaultTask.ts +2 -2
  458. package/src/lib/getInferenceProviderMapping.ts +5 -5
  459. package/src/lib/getProviderHelper.ts +19 -19
  460. package/src/lib/makeRequestOptions.ts +8 -8
  461. package/src/package.ts +3 -0
  462. package/src/providers/black-forest-labs.ts +5 -5
  463. package/src/providers/cerebras.ts +1 -1
  464. package/src/providers/cohere.ts +1 -1
  465. package/src/providers/consts.ts +3 -3
  466. package/src/providers/fal-ai.ts +9 -9
  467. package/src/providers/featherless-ai.ts +3 -3
  468. package/src/providers/fireworks-ai.ts +1 -1
  469. package/src/providers/groq.ts +1 -1
  470. package/src/providers/hf-inference.ts +11 -11
  471. package/src/providers/hyperbolic.ts +4 -4
  472. package/src/providers/nebius.ts +4 -4
  473. package/src/providers/novita.ts +5 -5
  474. package/src/providers/nscale.ts +4 -4
  475. package/src/providers/openai.ts +1 -1
  476. package/src/providers/ovhcloud.ts +4 -4
  477. package/src/providers/providerHelper.ts +7 -7
  478. package/src/providers/replicate.ts +5 -5
  479. package/src/providers/sambanova.ts +4 -4
  480. package/src/providers/together.ts +4 -4
  481. package/src/snippets/getInferenceSnippets.ts +7 -7
  482. package/src/tasks/audio/audioClassification.ts +6 -6
  483. package/src/tasks/audio/audioToAudio.ts +6 -6
  484. package/src/tasks/audio/automaticSpeechRecognition.ts +6 -6
  485. package/src/tasks/audio/textToSpeech.ts +4 -4
  486. package/src/tasks/audio/utils.ts +2 -2
  487. package/src/tasks/custom/request.ts +4 -4
  488. package/src/tasks/custom/streamingRequest.ts +4 -4
  489. package/src/tasks/cv/imageClassification.ts +5 -5
  490. package/src/tasks/cv/imageSegmentation.ts +5 -5
  491. package/src/tasks/cv/imageToImage.ts +4 -4
  492. package/src/tasks/cv/imageToText.ts +6 -6
  493. package/src/tasks/cv/objectDetection.ts +5 -5
  494. package/src/tasks/cv/textToImage.ts +5 -5
  495. package/src/tasks/cv/textToVideo.ts +8 -8
  496. package/src/tasks/cv/utils.ts +2 -2
  497. package/src/tasks/cv/zeroShotImageClassification.ts +5 -5
  498. package/src/tasks/index.ts +32 -32
  499. package/src/tasks/multimodal/documentQuestionAnswering.ts +5 -5
  500. package/src/tasks/multimodal/visualQuestionAnswering.ts +5 -5
  501. package/src/tasks/nlp/chatCompletion.ts +4 -4
  502. package/src/tasks/nlp/chatCompletionStream.ts +4 -4
  503. package/src/tasks/nlp/featureExtraction.ts +4 -4
  504. package/src/tasks/nlp/fillMask.ts +4 -4
  505. package/src/tasks/nlp/questionAnswering.ts +4 -4
  506. package/src/tasks/nlp/sentenceSimilarity.ts +4 -4
  507. package/src/tasks/nlp/summarization.ts +4 -4
  508. package/src/tasks/nlp/tableQuestionAnswering.ts +4 -4
  509. package/src/tasks/nlp/textClassification.ts +4 -4
  510. package/src/tasks/nlp/textGeneration.ts +5 -5
  511. package/src/tasks/nlp/textGenerationStream.ts +4 -4
  512. package/src/tasks/nlp/tokenClassification.ts +4 -4
  513. package/src/tasks/nlp/translation.ts +4 -4
  514. package/src/tasks/nlp/zeroShotClassification.ts +4 -4
  515. package/src/tasks/tabular/tabularClassification.ts +4 -4
  516. package/src/tasks/tabular/tabularRegression.ts +4 -4
  517. package/src/types.ts +1 -1
  518. package/src/utils/isFrontend.ts +1 -1
  519. package/src/utils/omit.ts +2 -2
  520. package/src/utils/request.ts +5 -5
  521. package/src/vendor/fetch-event-source/parse.spec.ts +1 -1
  522. package/src/vendor/fetch-event-source/parse.ts +6 -5
  523. package/dist/index.cjs +0 -2868
  524. package/dist/index.js +0 -2812
  525. package/dist/src/InferenceClient.d.ts.map +0 -1
  526. package/dist/src/index.d.ts.map +0 -1
  527. package/dist/src/providers/consts.d.ts.map +0 -1
  528. package/dist/src/providers/fireworks-ai.d.ts.map +0 -1
  529. package/dist/src/tasks/audio/audioToAudio.d.ts.map +0 -1
  530. package/dist/src/tasks/audio/automaticSpeechRecognition.d.ts.map +0 -1
  531. package/dist/src/tasks/audio/textToSpeech.d.ts.map +0 -1
  532. package/dist/src/tasks/audio/utils.d.ts.map +0 -1
  533. package/dist/src/tasks/custom/request.d.ts.map +0 -1
  534. package/dist/src/tasks/custom/streamingRequest.d.ts.map +0 -1
  535. package/dist/src/tasks/cv/imageClassification.d.ts.map +0 -1
  536. package/dist/src/tasks/cv/imageSegmentation.d.ts.map +0 -1
  537. package/dist/src/tasks/cv/imageToImage.d.ts.map +0 -1
  538. package/dist/src/tasks/cv/imageToText.d.ts.map +0 -1
  539. package/dist/src/tasks/cv/objectDetection.d.ts.map +0 -1
  540. package/dist/src/tasks/cv/textToImage.d.ts.map +0 -1
  541. package/dist/src/tasks/cv/textToVideo.d.ts.map +0 -1
  542. package/dist/src/tasks/cv/utils.d.ts.map +0 -1
  543. package/dist/src/tasks/cv/zeroShotImageClassification.d.ts.map +0 -1
  544. package/dist/src/tasks/index.d.ts +0 -33
  545. package/dist/src/tasks/index.d.ts.map +0 -1
  546. package/dist/src/tasks/multimodal/documentQuestionAnswering.d.ts.map +0 -1
  547. package/dist/src/tasks/multimodal/visualQuestionAnswering.d.ts.map +0 -1
  548. package/dist/src/tasks/nlp/featureExtraction.d.ts.map +0 -1
  549. package/dist/src/tasks/nlp/fillMask.d.ts.map +0 -1
  550. package/dist/src/tasks/nlp/questionAnswering.d.ts.map +0 -1
  551. package/dist/src/tasks/nlp/sentenceSimilarity.d.ts.map +0 -1
  552. package/dist/src/tasks/nlp/summarization.d.ts.map +0 -1
  553. package/dist/src/tasks/nlp/textClassification.d.ts.map +0 -1
  554. package/dist/src/tasks/nlp/textGeneration.d.ts.map +0 -1
  555. package/dist/src/tasks/nlp/textGenerationStream.d.ts.map +0 -1
  556. package/dist/src/tasks/nlp/translation.d.ts.map +0 -1
  557. package/dist/src/tasks/tabular/tabularClassification.d.ts.map +0 -1
  558. package/dist/src/tasks/tabular/tabularRegression.d.ts.map +0 -1
  559. package/dist/src/vendor/fetch-event-source/parse.d.ts.map +0 -1
  560. package/dist/test/InferenceClient.spec.d.ts +0 -2
  561. package/dist/test/InferenceClient.spec.d.ts.map +0 -1
  562. package/dist/test/expect-closeto.d.ts +0 -2
  563. package/dist/test/expect-closeto.d.ts.map +0 -1
  564. package/dist/test/test-files.d.ts +0 -2
  565. package/dist/test/test-files.d.ts.map +0 -1
  566. /package/dist/{src → commonjs}/config.d.ts +0 -0
  567. /package/dist/{src → commonjs}/config.d.ts.map +0 -0
  568. /package/dist/{src → commonjs}/lib/InferenceOutputError.d.ts +0 -0
  569. /package/dist/{src → commonjs}/lib/InferenceOutputError.d.ts.map +0 -0
  570. /package/dist/{src → commonjs}/lib/getDefaultTask.d.ts +0 -0
  571. /package/dist/{src → commonjs}/lib/getDefaultTask.d.ts.map +0 -0
  572. /package/dist/{src → commonjs}/lib/isUrl.d.ts +0 -0
  573. /package/dist/{src → commonjs}/lib/isUrl.d.ts.map +0 -0
  574. /package/dist/{src → commonjs}/snippets/index.d.ts +0 -0
  575. /package/dist/{src → commonjs}/snippets/index.d.ts.map +0 -0
  576. /package/dist/{src → commonjs}/snippets/templates.exported.d.ts +0 -0
  577. /package/dist/{src → commonjs}/snippets/templates.exported.d.ts.map +0 -0
  578. /package/dist/{src → commonjs}/utils/base64FromBytes.d.ts +0 -0
  579. /package/dist/{src → commonjs}/utils/base64FromBytes.d.ts.map +0 -0
  580. /package/dist/{src → commonjs}/utils/delay.d.ts +0 -0
  581. /package/dist/{src → commonjs}/utils/delay.d.ts.map +0 -0
  582. /package/dist/{src → commonjs}/utils/distributive-omit.d.ts +0 -0
  583. /package/dist/{src → commonjs}/utils/distributive-omit.d.ts.map +0 -0
  584. /package/dist/{src → commonjs}/utils/isBackend.d.ts +0 -0
  585. /package/dist/{src → commonjs}/utils/isBackend.d.ts.map +0 -0
  586. /package/dist/{src → commonjs}/utils/isFrontend.d.ts +0 -0
  587. /package/dist/{src → commonjs}/utils/isFrontend.d.ts.map +0 -0
  588. /package/dist/{src → commonjs}/utils/omit.d.ts +0 -0
  589. /package/dist/{src → commonjs}/utils/omit.d.ts.map +0 -0
  590. /package/dist/{src → commonjs}/utils/pick.d.ts +0 -0
  591. /package/dist/{src → commonjs}/utils/pick.d.ts.map +0 -0
  592. /package/dist/{src → commonjs}/utils/toArray.d.ts +0 -0
  593. /package/dist/{src → commonjs}/utils/toArray.d.ts.map +0 -0
  594. /package/dist/{src → commonjs}/utils/typedEntries.d.ts +0 -0
  595. /package/dist/{src → commonjs}/utils/typedEntries.d.ts.map +0 -0
  596. /package/dist/{src → commonjs}/utils/typedInclude.d.ts +0 -0
  597. /package/dist/{src → commonjs}/utils/typedInclude.d.ts.map +0 -0
  598. /package/dist/{src → commonjs}/vendor/fetch-event-source/parse.d.ts +0 -0
  599. /package/dist/{src → commonjs}/vendor/fetch-event-source/parse.spec.d.ts +0 -0
  600. /package/dist/{src → commonjs}/vendor/fetch-event-source/parse.spec.d.ts.map +0 -0
@@ -1,9 +1,9 @@
1
1
  import type { ObjectDetectionInput, ObjectDetectionOutput } from "@huggingface/tasks";
2
- import { resolveProvider } from "../../lib/getInferenceProviderMapping";
3
- import { getProviderHelper } from "../../lib/getProviderHelper";
4
- import type { BaseArgs, Options } from "../../types";
5
- import { innerRequest } from "../../utils/request";
6
- import { preparePayload, type LegacyImageInput } from "./utils";
2
+ import { resolveProvider } from "../../lib/getInferenceProviderMapping.js";
3
+ import { getProviderHelper } from "../../lib/getProviderHelper.js";
4
+ import type { BaseArgs, Options } from "../../types.js";
5
+ import { innerRequest } from "../../utils/request.js";
6
+ import { preparePayload, type LegacyImageInput } from "./utils.js";
7
7
 
8
8
  export type ObjectDetectionArgs = BaseArgs & (ObjectDetectionInput | LegacyImageInput);
9
9
 
@@ -1,9 +1,9 @@
1
1
  import type { TextToImageInput } from "@huggingface/tasks";
2
- import { resolveProvider } from "../../lib/getInferenceProviderMapping";
3
- import { getProviderHelper } from "../../lib/getProviderHelper";
4
- import { makeRequestOptions } from "../../lib/makeRequestOptions";
5
- import type { BaseArgs, Options } from "../../types";
6
- import { innerRequest } from "../../utils/request";
2
+ import { resolveProvider } from "../../lib/getInferenceProviderMapping.js";
3
+ import { getProviderHelper } from "../../lib/getProviderHelper.js";
4
+ import { makeRequestOptions } from "../../lib/makeRequestOptions.js";
5
+ import type { BaseArgs, Options } from "../../types.js";
6
+ import { innerRequest } from "../../utils/request.js";
7
7
 
8
8
  export type TextToImageArgs = BaseArgs & TextToImageInput;
9
9
 
@@ -1,12 +1,12 @@
1
1
  import type { TextToVideoInput } from "@huggingface/tasks";
2
- import { resolveProvider } from "../../lib/getInferenceProviderMapping";
3
- import { getProviderHelper } from "../../lib/getProviderHelper";
4
- import { makeRequestOptions } from "../../lib/makeRequestOptions";
5
- import type { FalAiQueueOutput } from "../../providers/fal-ai";
6
- import type { NovitaOutput } from "../../providers/novita";
7
- import type { ReplicateOutput } from "../../providers/replicate";
8
- import type { BaseArgs, Options } from "../../types";
9
- import { innerRequest } from "../../utils/request";
2
+ import { resolveProvider } from "../../lib/getInferenceProviderMapping.js";
3
+ import { getProviderHelper } from "../../lib/getProviderHelper.js";
4
+ import { makeRequestOptions } from "../../lib/makeRequestOptions.js";
5
+ import type { FalAiQueueOutput } from "../../providers/fal-ai.js";
6
+ import type { NovitaOutput } from "../../providers/novita.js";
7
+ import type { ReplicateOutput } from "../../providers/replicate.js";
8
+ import type { BaseArgs, Options } from "../../types.js";
9
+ import { innerRequest } from "../../utils/request.js";
10
10
 
11
11
  export type TextToVideoArgs = BaseArgs & TextToVideoInput;
12
12
 
@@ -1,5 +1,5 @@
1
- import type { BaseArgs, RequestArgs } from "../../types";
2
- import { omit } from "../../utils/omit";
1
+ import type { BaseArgs, RequestArgs } from "../../types.js";
2
+ import { omit } from "../../utils/omit.js";
3
3
 
4
4
  /**
5
5
  * @deprecated
@@ -1,9 +1,9 @@
1
1
  import type { ZeroShotImageClassificationInput, ZeroShotImageClassificationOutput } from "@huggingface/tasks";
2
- import { resolveProvider } from "../../lib/getInferenceProviderMapping";
3
- import { getProviderHelper } from "../../lib/getProviderHelper";
4
- import type { BaseArgs, Options, RequestArgs } from "../../types";
5
- import { base64FromBytes } from "../../utils/base64FromBytes";
6
- import { innerRequest } from "../../utils/request";
2
+ import { resolveProvider } from "../../lib/getInferenceProviderMapping.js";
3
+ import { getProviderHelper } from "../../lib/getProviderHelper.js";
4
+ import type { BaseArgs, Options, RequestArgs } from "../../types.js";
5
+ import { base64FromBytes } from "../../utils/base64FromBytes.js";
6
+ import { innerRequest } from "../../utils/request.js";
7
7
 
8
8
  /**
9
9
  * @deprecated
@@ -1,43 +1,43 @@
1
1
  // Custom tasks with arbitrary inputs and outputs
2
- export * from "./custom/request";
3
- export * from "./custom/streamingRequest";
2
+ export * from "./custom/request.js";
3
+ export * from "./custom/streamingRequest.js";
4
4
 
5
5
  // Audio tasks
6
- export * from "./audio/audioClassification";
7
- export * from "./audio/audioToAudio";
8
- export * from "./audio/automaticSpeechRecognition";
9
- export * from "./audio/textToSpeech";
6
+ export * from "./audio/audioClassification.js";
7
+ export * from "./audio/audioToAudio.js";
8
+ export * from "./audio/automaticSpeechRecognition.js";
9
+ export * from "./audio/textToSpeech.js";
10
10
 
11
11
  // Computer Vision tasks
12
- export * from "./cv/imageClassification";
13
- export * from "./cv/imageSegmentation";
14
- export * from "./cv/imageToImage";
15
- export * from "./cv/imageToText";
16
- export * from "./cv/objectDetection";
17
- export * from "./cv/textToImage";
18
- export * from "./cv/textToVideo";
19
- export * from "./cv/zeroShotImageClassification";
12
+ export * from "./cv/imageClassification.js";
13
+ export * from "./cv/imageSegmentation.js";
14
+ export * from "./cv/imageToImage.js";
15
+ export * from "./cv/imageToText.js";
16
+ export * from "./cv/objectDetection.js";
17
+ export * from "./cv/textToImage.js";
18
+ export * from "./cv/textToVideo.js";
19
+ export * from "./cv/zeroShotImageClassification.js";
20
20
 
21
21
  // Natural Language Processing tasks
22
- export * from "./nlp/chatCompletion";
23
- export * from "./nlp/chatCompletionStream";
24
- export * from "./nlp/featureExtraction";
25
- export * from "./nlp/fillMask";
26
- export * from "./nlp/questionAnswering";
27
- export * from "./nlp/sentenceSimilarity";
28
- export * from "./nlp/summarization";
29
- export * from "./nlp/tableQuestionAnswering";
30
- export * from "./nlp/textClassification";
31
- export * from "./nlp/textGeneration";
32
- export * from "./nlp/textGenerationStream";
33
- export * from "./nlp/tokenClassification";
34
- export * from "./nlp/translation";
35
- export * from "./nlp/zeroShotClassification";
22
+ export * from "./nlp/chatCompletion.js";
23
+ export * from "./nlp/chatCompletionStream.js";
24
+ export * from "./nlp/featureExtraction.js";
25
+ export * from "./nlp/fillMask.js";
26
+ export * from "./nlp/questionAnswering.js";
27
+ export * from "./nlp/sentenceSimilarity.js";
28
+ export * from "./nlp/summarization.js";
29
+ export * from "./nlp/tableQuestionAnswering.js";
30
+ export * from "./nlp/textClassification.js";
31
+ export * from "./nlp/textGeneration.js";
32
+ export * from "./nlp/textGenerationStream.js";
33
+ export * from "./nlp/tokenClassification.js";
34
+ export * from "./nlp/translation.js";
35
+ export * from "./nlp/zeroShotClassification.js";
36
36
 
37
37
  // Multimodal tasks
38
- export * from "./multimodal/documentQuestionAnswering";
39
- export * from "./multimodal/visualQuestionAnswering";
38
+ export * from "./multimodal/documentQuestionAnswering.js";
39
+ export * from "./multimodal/visualQuestionAnswering.js";
40
40
 
41
41
  // Tabular tasks
42
- export * from "./tabular/tabularClassification";
43
- export * from "./tabular/tabularRegression";
42
+ export * from "./tabular/tabularClassification.js";
43
+ export * from "./tabular/tabularRegression.js";
@@ -3,11 +3,11 @@ import type {
3
3
  DocumentQuestionAnsweringInputData,
4
4
  DocumentQuestionAnsweringOutput,
5
5
  } from "@huggingface/tasks";
6
- import { resolveProvider } from "../../lib/getInferenceProviderMapping";
7
- import { getProviderHelper } from "../../lib/getProviderHelper";
8
- import type { BaseArgs, Options, RequestArgs } from "../../types";
9
- import { base64FromBytes } from "../../utils/base64FromBytes";
10
- import { innerRequest } from "../../utils/request";
6
+ import { resolveProvider } from "../../lib/getInferenceProviderMapping.js";
7
+ import { getProviderHelper } from "../../lib/getProviderHelper.js";
8
+ import type { BaseArgs, Options, RequestArgs } from "../../types.js";
9
+ import { base64FromBytes } from "../../utils/base64FromBytes.js";
10
+ import { innerRequest } from "../../utils/request.js";
11
11
 
12
12
  /// Override the type to properly set inputs.image as Blob
13
13
  export type DocumentQuestionAnsweringArgs = BaseArgs &
@@ -3,11 +3,11 @@ import type {
3
3
  VisualQuestionAnsweringInputData,
4
4
  VisualQuestionAnsweringOutput,
5
5
  } from "@huggingface/tasks";
6
- import { resolveProvider } from "../../lib/getInferenceProviderMapping";
7
- import { getProviderHelper } from "../../lib/getProviderHelper";
8
- import type { BaseArgs, Options, RequestArgs } from "../../types";
9
- import { base64FromBytes } from "../../utils/base64FromBytes";
10
- import { innerRequest } from "../../utils/request";
6
+ import { resolveProvider } from "../../lib/getInferenceProviderMapping.js";
7
+ import { getProviderHelper } from "../../lib/getProviderHelper.js";
8
+ import type { BaseArgs, Options, RequestArgs } from "../../types.js";
9
+ import { base64FromBytes } from "../../utils/base64FromBytes.js";
10
+ import { innerRequest } from "../../utils/request.js";
11
11
 
12
12
  /// Override the type to properly set inputs.image as Blob
13
13
  export type VisualQuestionAnsweringArgs = BaseArgs &
@@ -1,8 +1,8 @@
1
1
  import type { ChatCompletionInput, ChatCompletionOutput } from "@huggingface/tasks";
2
- import { resolveProvider } from "../../lib/getInferenceProviderMapping";
3
- import { getProviderHelper } from "../../lib/getProviderHelper";
4
- import type { BaseArgs, Options } from "../../types";
5
- import { innerRequest } from "../../utils/request";
2
+ import { resolveProvider } from "../../lib/getInferenceProviderMapping.js";
3
+ import { getProviderHelper } from "../../lib/getProviderHelper.js";
4
+ import type { BaseArgs, Options } from "../../types.js";
5
+ import { innerRequest } from "../../utils/request.js";
6
6
 
7
7
  /**
8
8
  * Use the chat completion endpoint to generate a response to a prompt, using OpenAI message completion API no stream
@@ -1,8 +1,8 @@
1
1
  import type { ChatCompletionInput, ChatCompletionStreamOutput } from "@huggingface/tasks";
2
- import { resolveProvider } from "../../lib/getInferenceProviderMapping";
3
- import { getProviderHelper } from "../../lib/getProviderHelper";
4
- import type { BaseArgs, Options } from "../../types";
5
- import { innerStreamingRequest } from "../../utils/request";
2
+ import { resolveProvider } from "../../lib/getInferenceProviderMapping.js";
3
+ import { getProviderHelper } from "../../lib/getProviderHelper.js";
4
+ import type { BaseArgs, Options } from "../../types.js";
5
+ import { innerStreamingRequest } from "../../utils/request.js";
6
6
 
7
7
  /**
8
8
  * Use to continue text from a prompt. Same as `textGeneration` but returns generator that can be read one token at a time
@@ -1,8 +1,8 @@
1
1
  import type { FeatureExtractionInput } from "@huggingface/tasks";
2
- import { resolveProvider } from "../../lib/getInferenceProviderMapping";
3
- import { getProviderHelper } from "../../lib/getProviderHelper";
4
- import type { BaseArgs, Options } from "../../types";
5
- import { innerRequest } from "../../utils/request";
2
+ import { resolveProvider } from "../../lib/getInferenceProviderMapping.js";
3
+ import { getProviderHelper } from "../../lib/getProviderHelper.js";
4
+ import type { BaseArgs, Options } from "../../types.js";
5
+ import { innerRequest } from "../../utils/request.js";
6
6
 
7
7
  interface FeatureExtractionOAICompatInput {
8
8
  encoding_format?: "float" | "base64";
@@ -1,8 +1,8 @@
1
1
  import type { FillMaskInput, FillMaskOutput } from "@huggingface/tasks";
2
- import { resolveProvider } from "../../lib/getInferenceProviderMapping";
3
- import { getProviderHelper } from "../../lib/getProviderHelper";
4
- import type { BaseArgs, Options } from "../../types";
5
- import { innerRequest } from "../../utils/request";
2
+ import { resolveProvider } from "../../lib/getInferenceProviderMapping.js";
3
+ import { getProviderHelper } from "../../lib/getProviderHelper.js";
4
+ import type { BaseArgs, Options } from "../../types.js";
5
+ import { innerRequest } from "../../utils/request.js";
6
6
 
7
7
  export type FillMaskArgs = BaseArgs & FillMaskInput;
8
8
 
@@ -1,9 +1,9 @@
1
1
  import type { QuestionAnsweringInput, QuestionAnsweringOutput } from "@huggingface/tasks";
2
2
 
3
- import { resolveProvider } from "../../lib/getInferenceProviderMapping";
4
- import { getProviderHelper } from "../../lib/getProviderHelper";
5
- import type { BaseArgs, Options } from "../../types";
6
- import { innerRequest } from "../../utils/request";
3
+ import { resolveProvider } from "../../lib/getInferenceProviderMapping.js";
4
+ import { getProviderHelper } from "../../lib/getProviderHelper.js";
5
+ import type { BaseArgs, Options } from "../../types.js";
6
+ import { innerRequest } from "../../utils/request.js";
7
7
 
8
8
  export type QuestionAnsweringArgs = BaseArgs & QuestionAnsweringInput;
9
9
 
@@ -1,8 +1,8 @@
1
1
  import type { SentenceSimilarityInput, SentenceSimilarityOutput } from "@huggingface/tasks";
2
- import { resolveProvider } from "../../lib/getInferenceProviderMapping";
3
- import { getProviderHelper } from "../../lib/getProviderHelper";
4
- import type { BaseArgs, Options } from "../../types";
5
- import { innerRequest } from "../../utils/request";
2
+ import { resolveProvider } from "../../lib/getInferenceProviderMapping.js";
3
+ import { getProviderHelper } from "../../lib/getProviderHelper.js";
4
+ import type { BaseArgs, Options } from "../../types.js";
5
+ import { innerRequest } from "../../utils/request.js";
6
6
 
7
7
  export type SentenceSimilarityArgs = BaseArgs & SentenceSimilarityInput;
8
8
 
@@ -1,8 +1,8 @@
1
1
  import type { SummarizationInput, SummarizationOutput } from "@huggingface/tasks";
2
- import { resolveProvider } from "../../lib/getInferenceProviderMapping";
3
- import { getProviderHelper } from "../../lib/getProviderHelper";
4
- import type { BaseArgs, Options } from "../../types";
5
- import { innerRequest } from "../../utils/request";
2
+ import { resolveProvider } from "../../lib/getInferenceProviderMapping.js";
3
+ import { getProviderHelper } from "../../lib/getProviderHelper.js";
4
+ import type { BaseArgs, Options } from "../../types.js";
5
+ import { innerRequest } from "../../utils/request.js";
6
6
 
7
7
  export type SummarizationArgs = BaseArgs & SummarizationInput;
8
8
 
@@ -1,8 +1,8 @@
1
1
  import type { TableQuestionAnsweringInput, TableQuestionAnsweringOutput } from "@huggingface/tasks";
2
- import { resolveProvider } from "../../lib/getInferenceProviderMapping";
3
- import { getProviderHelper } from "../../lib/getProviderHelper";
4
- import type { BaseArgs, Options } from "../../types";
5
- import { innerRequest } from "../../utils/request";
2
+ import { resolveProvider } from "../../lib/getInferenceProviderMapping.js";
3
+ import { getProviderHelper } from "../../lib/getProviderHelper.js";
4
+ import type { BaseArgs, Options } from "../../types.js";
5
+ import { innerRequest } from "../../utils/request.js";
6
6
 
7
7
  export type TableQuestionAnsweringArgs = BaseArgs & TableQuestionAnsweringInput;
8
8
 
@@ -1,8 +1,8 @@
1
1
  import type { TextClassificationInput, TextClassificationOutput } from "@huggingface/tasks";
2
- import { resolveProvider } from "../../lib/getInferenceProviderMapping";
3
- import { getProviderHelper } from "../../lib/getProviderHelper";
4
- import type { BaseArgs, Options } from "../../types";
5
- import { innerRequest } from "../../utils/request";
2
+ import { resolveProvider } from "../../lib/getInferenceProviderMapping.js";
3
+ import { getProviderHelper } from "../../lib/getProviderHelper.js";
4
+ import type { BaseArgs, Options } from "../../types.js";
5
+ import { innerRequest } from "../../utils/request.js";
6
6
 
7
7
  export type TextClassificationArgs = BaseArgs & TextClassificationInput;
8
8
 
@@ -1,9 +1,9 @@
1
1
  import type { TextGenerationInput, TextGenerationOutput } from "@huggingface/tasks";
2
- import { resolveProvider } from "../../lib/getInferenceProviderMapping";
3
- import { getProviderHelper } from "../../lib/getProviderHelper";
4
- import type { HyperbolicTextCompletionOutput } from "../../providers/hyperbolic";
5
- import type { BaseArgs, Options } from "../../types";
6
- import { innerRequest } from "../../utils/request";
2
+ import { resolveProvider } from "../../lib/getInferenceProviderMapping.js";
3
+ import { getProviderHelper } from "../../lib/getProviderHelper.js";
4
+ import type { HyperbolicTextCompletionOutput } from "../../providers/hyperbolic.js";
5
+ import type { BaseArgs, Options } from "../../types.js";
6
+ import { innerRequest } from "../../utils/request.js";
7
7
 
8
8
  export type { TextGenerationInput, TextGenerationOutput };
9
9
 
@@ -1,8 +1,8 @@
1
1
  import type { TextGenerationInput } from "@huggingface/tasks";
2
- import { resolveProvider } from "../../lib/getInferenceProviderMapping";
3
- import { getProviderHelper } from "../../lib/getProviderHelper";
4
- import type { BaseArgs, Options } from "../../types";
5
- import { innerStreamingRequest } from "../../utils/request";
2
+ import { resolveProvider } from "../../lib/getInferenceProviderMapping.js";
3
+ import { getProviderHelper } from "../../lib/getProviderHelper.js";
4
+ import type { BaseArgs, Options } from "../../types.js";
5
+ import { innerStreamingRequest } from "../../utils/request.js";
6
6
 
7
7
  export interface TextGenerationStreamToken {
8
8
  /** Token ID from the model tokenizer */
@@ -1,8 +1,8 @@
1
1
  import type { TokenClassificationInput, TokenClassificationOutput } from "@huggingface/tasks";
2
- import { resolveProvider } from "../../lib/getInferenceProviderMapping";
3
- import { getProviderHelper } from "../../lib/getProviderHelper";
4
- import type { BaseArgs, Options } from "../../types";
5
- import { innerRequest } from "../../utils/request";
2
+ import { resolveProvider } from "../../lib/getInferenceProviderMapping.js";
3
+ import { getProviderHelper } from "../../lib/getProviderHelper.js";
4
+ import type { BaseArgs, Options } from "../../types.js";
5
+ import { innerRequest } from "../../utils/request.js";
6
6
 
7
7
  export type TokenClassificationArgs = BaseArgs & TokenClassificationInput;
8
8
 
@@ -1,8 +1,8 @@
1
1
  import type { TranslationInput, TranslationOutput } from "@huggingface/tasks";
2
- import { resolveProvider } from "../../lib/getInferenceProviderMapping";
3
- import { getProviderHelper } from "../../lib/getProviderHelper";
4
- import type { BaseArgs, Options } from "../../types";
5
- import { innerRequest } from "../../utils/request";
2
+ import { resolveProvider } from "../../lib/getInferenceProviderMapping.js";
3
+ import { getProviderHelper } from "../../lib/getProviderHelper.js";
4
+ import type { BaseArgs, Options } from "../../types.js";
5
+ import { innerRequest } from "../../utils/request.js";
6
6
 
7
7
  export type TranslationArgs = BaseArgs & TranslationInput;
8
8
  /**
@@ -1,8 +1,8 @@
1
1
  import type { ZeroShotClassificationInput, ZeroShotClassificationOutput } from "@huggingface/tasks";
2
- import { resolveProvider } from "../../lib/getInferenceProviderMapping";
3
- import { getProviderHelper } from "../../lib/getProviderHelper";
4
- import type { BaseArgs, Options } from "../../types";
5
- import { innerRequest } from "../../utils/request";
2
+ import { resolveProvider } from "../../lib/getInferenceProviderMapping.js";
3
+ import { getProviderHelper } from "../../lib/getProviderHelper.js";
4
+ import type { BaseArgs, Options } from "../../types.js";
5
+ import { innerRequest } from "../../utils/request.js";
6
6
 
7
7
  export type ZeroShotClassificationArgs = BaseArgs & ZeroShotClassificationInput;
8
8
 
@@ -1,7 +1,7 @@
1
- import { resolveProvider } from "../../lib/getInferenceProviderMapping";
2
- import { getProviderHelper } from "../../lib/getProviderHelper";
3
- import type { BaseArgs, Options } from "../../types";
4
- import { innerRequest } from "../../utils/request";
1
+ import { resolveProvider } from "../../lib/getInferenceProviderMapping.js";
2
+ import { getProviderHelper } from "../../lib/getProviderHelper.js";
3
+ import type { BaseArgs, Options } from "../../types.js";
4
+ import { innerRequest } from "../../utils/request.js";
5
5
 
6
6
  export type TabularClassificationArgs = BaseArgs & {
7
7
  inputs: {
@@ -1,7 +1,7 @@
1
- import { resolveProvider } from "../../lib/getInferenceProviderMapping";
2
- import { getProviderHelper } from "../../lib/getProviderHelper";
3
- import type { BaseArgs, Options } from "../../types";
4
- import { innerRequest } from "../../utils/request";
1
+ import { resolveProvider } from "../../lib/getInferenceProviderMapping.js";
2
+ import { getProviderHelper } from "../../lib/getProviderHelper.js";
3
+ import type { BaseArgs, Options } from "../../types.js";
4
+ import { innerRequest } from "../../utils/request.js";
5
5
 
6
6
  export type TabularRegressionArgs = BaseArgs & {
7
7
  inputs: {
package/src/types.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { ChatCompletionInput, PipelineType } from "@huggingface/tasks";
2
- import type { InferenceProviderModelMapping } from "./lib/getInferenceProviderMapping";
2
+ import type { InferenceProviderModelMapping } from "./lib/getInferenceProviderMapping.js";
3
3
 
4
4
  /**
5
5
  * HF model id, like "meta-llama/Llama-3.3-70B-Instruct"
@@ -1,3 +1,3 @@
1
- import { isBackend } from "./isBackend";
1
+ import { isBackend } from "./isBackend.js";
2
2
 
3
3
  export const isFrontend = !isBackend;
package/src/utils/omit.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { pick } from "./pick";
2
- import { typedInclude } from "./typedInclude";
1
+ import { pick } from "./pick.js";
2
+ import { typedInclude } from "./typedInclude.js";
3
3
 
4
4
  /**
5
5
  * Return copy of object, omitting blocklisted array of props
@@ -1,8 +1,8 @@
1
- import type { getProviderHelper } from "../lib/getProviderHelper";
2
- import { makeRequestOptions } from "../lib/makeRequestOptions";
3
- import type { InferenceTask, Options, RequestArgs } from "../types";
4
- import type { EventSourceMessage } from "../vendor/fetch-event-source/parse";
5
- import { getLines, getMessages } from "../vendor/fetch-event-source/parse";
1
+ import type { getProviderHelper } from "../lib/getProviderHelper.js";
2
+ import { makeRequestOptions } from "../lib/makeRequestOptions.js";
3
+ import type { InferenceTask, Options, RequestArgs } from "../types.js";
4
+ import type { EventSourceMessage } from "../vendor/fetch-event-source/parse.js";
5
+ import { getLines, getMessages } from "../vendor/fetch-event-source/parse.js";
6
6
 
7
7
  export interface ResponseWrapper<T> {
8
8
  data: T;
@@ -34,7 +34,7 @@ const fail = (msg: string) => { throw new Error(msg) };
34
34
 
35
35
  */
36
36
 
37
- import * as parse from './parse';
37
+ import * as parse from './parse.js';
38
38
 
39
39
  describe('parse', () => {
40
40
  const encoder = new TextEncoder();
@@ -52,7 +52,7 @@ export interface EventSourceMessage {
52
52
  * @param onChunk A function that will be called on each new byte chunk in the stream.
53
53
  * @returns {Promise<void>} A promise that will be resolved when the stream closes.
54
54
  */
55
- export async function getBytes(stream: ReadableStream<Uint8Array>, onChunk: (arr: Uint8Array) => void) {
55
+ export async function getBytes(stream: ReadableStream<Uint8Array>, onChunk: (arr: Uint8Array) => void): Promise<void> {
56
56
  const reader = stream.getReader();
57
57
  let result: ReadableStreamReadResult<Uint8Array>;
58
58
  while (!(result = await reader.read()).done) {
@@ -73,7 +73,7 @@ const enum ControlChars {
73
73
  * @param onLine A function that will be called on each new EventSource line.
74
74
  * @returns A function that should be called for each incoming byte chunk.
75
75
  */
76
- export function getLines(onLine: (line: Uint8Array, fieldLength: number) => void) {
76
+ export function getLines(onLine: (line: Uint8Array, fieldLength: number) => void): (arr: Uint8Array) => void {
77
77
  let buffer: Uint8Array | undefined;
78
78
  let position: number; // current read position
79
79
  let fieldLength: number; // length of the `field` portion of the line
@@ -110,9 +110,9 @@ export function getLines(onLine: (line: Uint8Array, fieldLength: number) => void
110
110
  fieldLength = position - lineStart;
111
111
  }
112
112
  break;
113
- // @ts-ignore:7029 \r case below should fallthrough to \n:
114
113
  case ControlChars.CarriageReturn:
115
114
  discardTrailingNewline = true;
115
+ // eslint-disable-next-line no-fallthrough
116
116
  case ControlChars.NewLine:
117
117
  lineEnd = position;
118
118
  break;
@@ -153,7 +153,7 @@ export function getMessages(
153
153
  onId: (id: string) => void,
154
154
  onRetry: (retry: number) => void,
155
155
  onMessage?: (msg: EventSourceMessage) => void
156
- ) {
156
+ ): (line: Uint8Array, fieldLength: number) => void {
157
157
  let message = newMessage();
158
158
  const decoder = new TextDecoder();
159
159
 
@@ -184,12 +184,13 @@ export function getMessages(
184
184
  case 'id':
185
185
  onId(message.id = value);
186
186
  break;
187
- case 'retry':
187
+ case 'retry': {
188
188
  const retry = parseInt(value, 10);
189
189
  if (!isNaN(retry)) { // per spec, ignore non-integers
190
190
  onRetry(message.retry = retry);
191
191
  }
192
192
  break;
193
+ }
193
194
  }
194
195
  }
195
196
  }