@huggingface/inference 3.13.2 → 3.15.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 (602) hide show
  1. package/README.md +2 -1
  2. package/dist/{src → commonjs}/InferenceClient.d.ts +2 -2
  3. package/dist/commonjs/InferenceClient.d.ts.map +1 -0
  4. package/dist/commonjs/InferenceClient.js +83 -0
  5. package/dist/commonjs/config.js +6 -0
  6. package/dist/commonjs/index.d.ts +7 -0
  7. package/dist/commonjs/index.d.ts.map +1 -0
  8. package/dist/commonjs/index.js +49 -0
  9. package/dist/commonjs/lib/InferenceOutputError.js +10 -0
  10. package/dist/commonjs/lib/getDefaultTask.js +48 -0
  11. package/dist/{src → commonjs}/lib/getInferenceProviderMapping.d.ts +1 -1
  12. package/dist/{src → commonjs}/lib/getInferenceProviderMapping.d.ts.map +1 -1
  13. package/dist/commonjs/lib/getInferenceProviderMapping.js +81 -0
  14. package/dist/{src → commonjs}/lib/getProviderHelper.d.ts +2 -2
  15. package/dist/{src → commonjs}/lib/getProviderHelper.d.ts.map +1 -1
  16. package/dist/commonjs/lib/getProviderHelper.js +169 -0
  17. package/dist/commonjs/lib/isUrl.js +6 -0
  18. package/dist/{src → commonjs}/lib/makeRequestOptions.d.ts +3 -3
  19. package/dist/{src → commonjs}/lib/makeRequestOptions.d.ts.map +1 -1
  20. package/dist/commonjs/lib/makeRequestOptions.js +161 -0
  21. package/dist/commonjs/package.d.ts +3 -0
  22. package/dist/commonjs/package.d.ts.map +1 -0
  23. package/dist/commonjs/package.js +6 -0
  24. package/dist/commonjs/package.json +3 -0
  25. package/dist/{src → commonjs}/providers/black-forest-labs.d.ts +2 -2
  26. package/dist/{src → commonjs}/providers/black-forest-labs.d.ts.map +1 -1
  27. package/dist/commonjs/providers/black-forest-labs.js +82 -0
  28. package/dist/{src → commonjs}/providers/cerebras.d.ts +1 -1
  29. package/dist/{src → commonjs}/providers/cerebras.d.ts.map +1 -1
  30. package/dist/commonjs/providers/cerebras.js +26 -0
  31. package/dist/{src → commonjs}/providers/cohere.d.ts +1 -1
  32. package/dist/{src → commonjs}/providers/cohere.d.ts.map +1 -1
  33. package/dist/commonjs/providers/cohere.js +29 -0
  34. package/dist/{src → commonjs}/providers/consts.d.ts +3 -3
  35. package/dist/commonjs/providers/consts.d.ts.map +1 -0
  36. package/dist/commonjs/providers/consts.js +35 -0
  37. package/dist/{src → commonjs}/providers/fal-ai.d.ts +3 -3
  38. package/dist/{src → commonjs}/providers/fal-ai.d.ts.map +1 -1
  39. package/dist/commonjs/providers/fal-ai.js +216 -0
  40. package/dist/{src → commonjs}/providers/featherless-ai.d.ts +2 -2
  41. package/dist/{src → commonjs}/providers/featherless-ai.d.ts.map +1 -1
  42. package/dist/commonjs/providers/featherless-ai.js +44 -0
  43. package/dist/{src → commonjs}/providers/fireworks-ai.d.ts +1 -1
  44. package/dist/commonjs/providers/fireworks-ai.d.ts.map +1 -0
  45. package/dist/commonjs/providers/fireworks-ai.js +29 -0
  46. package/dist/{src → commonjs}/providers/groq.d.ts +1 -1
  47. package/dist/{src → commonjs}/providers/groq.d.ts.map +1 -1
  48. package/dist/commonjs/providers/groq.js +39 -0
  49. package/dist/{src → commonjs}/providers/hf-inference.d.ts +6 -6
  50. package/dist/{src → commonjs}/providers/hf-inference.d.ts.map +1 -1
  51. package/dist/commonjs/providers/hf-inference.js +432 -0
  52. package/dist/{src → commonjs}/providers/hyperbolic.d.ts +2 -2
  53. package/dist/{src → commonjs}/providers/hyperbolic.d.ts.map +1 -1
  54. package/dist/commonjs/providers/hyperbolic.js +78 -0
  55. package/dist/{src → commonjs}/providers/nebius.d.ts +2 -2
  56. package/dist/{src → commonjs}/providers/nebius.d.ts.map +1 -1
  57. package/dist/commonjs/providers/nebius.js +70 -0
  58. package/dist/{src → commonjs}/providers/novita.d.ts +7 -8
  59. package/dist/commonjs/providers/novita.d.ts.map +1 -0
  60. package/dist/commonjs/providers/novita.js +119 -0
  61. package/dist/{src → commonjs}/providers/nscale.d.ts +2 -2
  62. package/dist/{src → commonjs}/providers/nscale.d.ts.map +1 -1
  63. package/dist/commonjs/providers/nscale.js +46 -0
  64. package/dist/{src → commonjs}/providers/openai.d.ts +1 -1
  65. package/dist/{src → commonjs}/providers/openai.d.ts.map +1 -1
  66. package/dist/commonjs/providers/openai.js +15 -0
  67. package/dist/{src → commonjs}/providers/ovhcloud.d.ts +2 -2
  68. package/dist/{src → commonjs}/providers/ovhcloud.d.ts.map +1 -1
  69. package/dist/commonjs/providers/ovhcloud.js +60 -0
  70. package/dist/{src → commonjs}/providers/providerHelper.d.ts +4 -4
  71. package/dist/{src → commonjs}/providers/providerHelper.d.ts.map +1 -1
  72. package/dist/commonjs/providers/providerHelper.js +108 -0
  73. package/dist/{src → commonjs}/providers/replicate.d.ts +2 -2
  74. package/dist/{src → commonjs}/providers/replicate.d.ts.map +1 -1
  75. package/dist/commonjs/providers/replicate.js +135 -0
  76. package/dist/{src → commonjs}/providers/sambanova.d.ts +3 -3
  77. package/dist/{src → commonjs}/providers/sambanova.d.ts.map +1 -1
  78. package/dist/commonjs/providers/sambanova.js +49 -0
  79. package/dist/{src → commonjs}/providers/together.d.ts +2 -2
  80. package/dist/{src → commonjs}/providers/together.d.ts.map +1 -1
  81. package/dist/commonjs/providers/together.js +71 -0
  82. package/dist/{src → commonjs}/snippets/getInferenceSnippets.d.ts +2 -2
  83. package/dist/{src → commonjs}/snippets/getInferenceSnippets.d.ts.map +1 -1
  84. package/dist/commonjs/snippets/getInferenceSnippets.js +312 -0
  85. package/dist/commonjs/snippets/index.js +5 -0
  86. package/dist/commonjs/snippets/templates.exported.js +81 -0
  87. package/dist/{src → commonjs}/tasks/audio/audioClassification.d.ts +2 -2
  88. package/dist/{src → commonjs}/tasks/audio/audioClassification.d.ts.map +1 -1
  89. package/dist/commonjs/tasks/audio/audioClassification.js +21 -0
  90. package/dist/{src → commonjs}/tasks/audio/audioToAudio.d.ts +2 -2
  91. package/dist/commonjs/tasks/audio/audioToAudio.d.ts.map +1 -0
  92. package/dist/commonjs/tasks/audio/audioToAudio.js +22 -0
  93. package/dist/{src → commonjs}/tasks/audio/automaticSpeechRecognition.d.ts +2 -2
  94. package/dist/commonjs/tasks/audio/automaticSpeechRecognition.d.ts.map +1 -0
  95. package/dist/commonjs/tasks/audio/automaticSpeechRecognition.js +25 -0
  96. package/dist/{src → commonjs}/tasks/audio/textToSpeech.d.ts +1 -1
  97. package/dist/commonjs/tasks/audio/textToSpeech.d.ts.map +1 -0
  98. package/dist/commonjs/tasks/audio/textToSpeech.js +19 -0
  99. package/dist/{src → commonjs}/tasks/audio/utils.d.ts +1 -1
  100. package/dist/commonjs/tasks/audio/utils.d.ts.map +1 -0
  101. package/dist/commonjs/tasks/audio/utils.js +12 -0
  102. package/dist/{src → commonjs}/tasks/custom/request.d.ts +1 -1
  103. package/dist/commonjs/tasks/custom/request.d.ts.map +1 -0
  104. package/dist/commonjs/tasks/custom/request.js +17 -0
  105. package/dist/{src → commonjs}/tasks/custom/streamingRequest.d.ts +1 -1
  106. package/dist/commonjs/tasks/custom/streamingRequest.d.ts.map +1 -0
  107. package/dist/commonjs/tasks/custom/streamingRequest.js +16 -0
  108. package/dist/{src → commonjs}/tasks/cv/imageClassification.d.ts +2 -2
  109. package/dist/commonjs/tasks/cv/imageClassification.d.ts.map +1 -0
  110. package/dist/commonjs/tasks/cv/imageClassification.js +21 -0
  111. package/dist/{src → commonjs}/tasks/cv/imageSegmentation.d.ts +2 -2
  112. package/dist/commonjs/tasks/cv/imageSegmentation.d.ts.map +1 -0
  113. package/dist/commonjs/tasks/cv/imageSegmentation.js +21 -0
  114. package/dist/{src → commonjs}/tasks/cv/imageToImage.d.ts +1 -1
  115. package/dist/commonjs/tasks/cv/imageToImage.d.ts.map +1 -0
  116. package/dist/commonjs/tasks/cv/imageToImage.js +20 -0
  117. package/dist/{src → commonjs}/tasks/cv/imageToText.d.ts +2 -2
  118. package/dist/commonjs/tasks/cv/imageToText.d.ts.map +1 -0
  119. package/dist/commonjs/tasks/cv/imageToText.js +20 -0
  120. package/dist/{src → commonjs}/tasks/cv/objectDetection.d.ts +2 -2
  121. package/dist/commonjs/tasks/cv/objectDetection.d.ts.map +1 -0
  122. package/dist/commonjs/tasks/cv/objectDetection.js +21 -0
  123. package/dist/{src → commonjs}/tasks/cv/textToImage.d.ts +1 -1
  124. package/dist/commonjs/tasks/cv/textToImage.d.ts.map +1 -0
  125. package/dist/commonjs/tasks/cv/textToImage.js +17 -0
  126. package/dist/{src → commonjs}/tasks/cv/textToVideo.d.ts +1 -1
  127. package/dist/commonjs/tasks/cv/textToVideo.d.ts.map +1 -0
  128. package/dist/commonjs/tasks/cv/textToVideo.js +17 -0
  129. package/dist/{src → commonjs}/tasks/cv/utils.d.ts +1 -1
  130. package/dist/commonjs/tasks/cv/utils.d.ts.map +1 -0
  131. package/dist/commonjs/tasks/cv/utils.js +7 -0
  132. package/dist/{src → commonjs}/tasks/cv/zeroShotImageClassification.d.ts +1 -1
  133. package/dist/commonjs/tasks/cv/zeroShotImageClassification.d.ts.map +1 -0
  134. package/dist/commonjs/tasks/cv/zeroShotImageClassification.js +39 -0
  135. package/dist/commonjs/tasks/index.d.ts +33 -0
  136. package/dist/commonjs/tasks/index.d.ts.map +1 -0
  137. package/dist/commonjs/tasks/index.js +54 -0
  138. package/dist/{src → commonjs}/tasks/multimodal/documentQuestionAnswering.d.ts +1 -1
  139. package/dist/commonjs/tasks/multimodal/documentQuestionAnswering.d.ts.map +1 -0
  140. package/dist/commonjs/tasks/multimodal/documentQuestionAnswering.js +27 -0
  141. package/dist/{src → commonjs}/tasks/multimodal/visualQuestionAnswering.d.ts +1 -1
  142. package/dist/commonjs/tasks/multimodal/visualQuestionAnswering.d.ts.map +1 -0
  143. package/dist/commonjs/tasks/multimodal/visualQuestionAnswering.js +27 -0
  144. package/dist/{src → commonjs}/tasks/nlp/chatCompletion.d.ts +1 -1
  145. package/dist/{src → commonjs}/tasks/nlp/chatCompletion.d.ts.map +1 -1
  146. package/dist/commonjs/tasks/nlp/chatCompletion.js +18 -0
  147. package/dist/{src → commonjs}/tasks/nlp/chatCompletionStream.d.ts +1 -1
  148. package/dist/{src → commonjs}/tasks/nlp/chatCompletionStream.d.ts.map +1 -1
  149. package/dist/commonjs/tasks/nlp/chatCompletionStream.js +17 -0
  150. package/dist/{src → commonjs}/tasks/nlp/featureExtraction.d.ts +1 -1
  151. package/dist/commonjs/tasks/nlp/featureExtraction.d.ts.map +1 -0
  152. package/dist/commonjs/tasks/nlp/featureExtraction.js +18 -0
  153. package/dist/{src → commonjs}/tasks/nlp/fillMask.d.ts +1 -1
  154. package/dist/commonjs/tasks/nlp/fillMask.d.ts.map +1 -0
  155. package/dist/commonjs/tasks/nlp/fillMask.js +18 -0
  156. package/dist/{src → commonjs}/tasks/nlp/questionAnswering.d.ts +1 -1
  157. package/dist/commonjs/tasks/nlp/questionAnswering.d.ts.map +1 -0
  158. package/dist/commonjs/tasks/nlp/questionAnswering.js +18 -0
  159. package/dist/{src → commonjs}/tasks/nlp/sentenceSimilarity.d.ts +1 -1
  160. package/dist/commonjs/tasks/nlp/sentenceSimilarity.d.ts.map +1 -0
  161. package/dist/commonjs/tasks/nlp/sentenceSimilarity.js +18 -0
  162. package/dist/{src → commonjs}/tasks/nlp/summarization.d.ts +1 -1
  163. package/dist/commonjs/tasks/nlp/summarization.d.ts.map +1 -0
  164. package/dist/commonjs/tasks/nlp/summarization.js +18 -0
  165. package/dist/{src → commonjs}/tasks/nlp/tableQuestionAnswering.d.ts +1 -1
  166. package/dist/{src → commonjs}/tasks/nlp/tableQuestionAnswering.d.ts.map +1 -1
  167. package/dist/commonjs/tasks/nlp/tableQuestionAnswering.js +18 -0
  168. package/dist/{src → commonjs}/tasks/nlp/textClassification.d.ts +1 -1
  169. package/dist/commonjs/tasks/nlp/textClassification.d.ts.map +1 -0
  170. package/dist/commonjs/tasks/nlp/textClassification.js +18 -0
  171. package/dist/{src → commonjs}/tasks/nlp/textGeneration.d.ts +1 -1
  172. package/dist/commonjs/tasks/nlp/textGeneration.d.ts.map +1 -0
  173. package/dist/commonjs/tasks/nlp/textGeneration.js +18 -0
  174. package/dist/{src → commonjs}/tasks/nlp/textGenerationStream.d.ts +1 -1
  175. package/dist/commonjs/tasks/nlp/textGenerationStream.d.ts.map +1 -0
  176. package/dist/commonjs/tasks/nlp/textGenerationStream.js +17 -0
  177. package/dist/{src → commonjs}/tasks/nlp/tokenClassification.d.ts +1 -1
  178. package/dist/{src → commonjs}/tasks/nlp/tokenClassification.d.ts.map +1 -1
  179. package/dist/commonjs/tasks/nlp/tokenClassification.js +18 -0
  180. package/dist/{src → commonjs}/tasks/nlp/translation.d.ts +1 -1
  181. package/dist/commonjs/tasks/nlp/translation.d.ts.map +1 -0
  182. package/dist/commonjs/tasks/nlp/translation.js +18 -0
  183. package/dist/{src → commonjs}/tasks/nlp/zeroShotClassification.d.ts +1 -1
  184. package/dist/{src → commonjs}/tasks/nlp/zeroShotClassification.d.ts.map +1 -1
  185. package/dist/commonjs/tasks/nlp/zeroShotClassification.js +18 -0
  186. package/dist/{src → commonjs}/tasks/tabular/tabularClassification.d.ts +1 -1
  187. package/dist/commonjs/tasks/tabular/tabularClassification.d.ts.map +1 -0
  188. package/dist/commonjs/tasks/tabular/tabularClassification.js +20 -0
  189. package/dist/{src → commonjs}/tasks/tabular/tabularRegression.d.ts +1 -1
  190. package/dist/commonjs/tasks/tabular/tabularRegression.d.ts.map +1 -0
  191. package/dist/commonjs/tasks/tabular/tabularRegression.js +20 -0
  192. package/dist/{src → commonjs}/types.d.ts +1 -1
  193. package/dist/{src → commonjs}/types.d.ts.map +1 -1
  194. package/dist/commonjs/types.js +23 -0
  195. package/dist/commonjs/utils/base64FromBytes.js +15 -0
  196. package/dist/commonjs/utils/delay.js +8 -0
  197. package/dist/commonjs/utils/distributive-omit.js +7 -0
  198. package/dist/commonjs/utils/isBackend.js +6 -0
  199. package/dist/commonjs/utils/isFrontend.js +5 -0
  200. package/dist/commonjs/utils/omit.js +13 -0
  201. package/dist/commonjs/utils/pick.js +13 -0
  202. package/dist/{src → commonjs}/utils/request.d.ts +2 -2
  203. package/dist/{src → commonjs}/utils/request.d.ts.map +1 -1
  204. package/dist/commonjs/utils/request.js +116 -0
  205. package/dist/commonjs/utils/toArray.js +9 -0
  206. package/dist/commonjs/utils/typedEntries.js +6 -0
  207. package/dist/commonjs/utils/typedInclude.js +6 -0
  208. package/dist/commonjs/vendor/fetch-event-source/parse.d.ts.map +1 -0
  209. package/dist/commonjs/vendor/fetch-event-source/parse.js +185 -0
  210. package/dist/commonjs/vendor/fetch-event-source/parse.spec.js +370 -0
  211. package/dist/esm/InferenceClient.d.ts +32 -0
  212. package/dist/esm/InferenceClient.d.ts.map +1 -0
  213. package/dist/esm/InferenceClient.js +44 -0
  214. package/dist/esm/config.d.ts +4 -0
  215. package/dist/esm/config.d.ts.map +1 -0
  216. package/dist/esm/config.js +3 -0
  217. package/dist/esm/index.d.ts +7 -0
  218. package/dist/esm/index.d.ts.map +1 -0
  219. package/dist/{src/index.d.ts → esm/index.js} +4 -5
  220. package/dist/esm/lib/InferenceOutputError.d.ts +4 -0
  221. package/dist/esm/lib/InferenceOutputError.d.ts.map +1 -0
  222. package/dist/esm/lib/InferenceOutputError.js +6 -0
  223. package/dist/esm/lib/getDefaultTask.d.ts +11 -0
  224. package/dist/esm/lib/getDefaultTask.d.ts.map +1 -0
  225. package/dist/esm/lib/getDefaultTask.js +45 -0
  226. package/dist/esm/lib/getInferenceProviderMapping.d.ts +25 -0
  227. package/dist/esm/lib/getInferenceProviderMapping.d.ts.map +1 -0
  228. package/dist/esm/lib/getInferenceProviderMapping.js +75 -0
  229. package/dist/esm/lib/getProviderHelper.d.ts +37 -0
  230. package/dist/esm/lib/getProviderHelper.d.ts.map +1 -0
  231. package/dist/esm/lib/getProviderHelper.js +132 -0
  232. package/dist/esm/lib/isUrl.d.ts +2 -0
  233. package/dist/esm/lib/isUrl.d.ts.map +1 -0
  234. package/dist/esm/lib/isUrl.js +3 -0
  235. package/dist/esm/lib/makeRequestOptions.d.ts +31 -0
  236. package/dist/esm/lib/makeRequestOptions.d.ts.map +1 -0
  237. package/dist/esm/lib/makeRequestOptions.js +157 -0
  238. package/dist/esm/package.d.ts +3 -0
  239. package/dist/esm/package.d.ts.map +1 -0
  240. package/dist/esm/package.js +3 -0
  241. package/dist/esm/package.json +3 -0
  242. package/dist/esm/providers/black-forest-labs.d.ts +15 -0
  243. package/dist/esm/providers/black-forest-labs.d.ts.map +1 -0
  244. package/dist/esm/providers/black-forest-labs.js +78 -0
  245. package/dist/esm/providers/cerebras.d.ts +21 -0
  246. package/dist/esm/providers/cerebras.d.ts.map +1 -0
  247. package/dist/esm/providers/cerebras.js +22 -0
  248. package/dist/esm/providers/cohere.d.ts +22 -0
  249. package/dist/esm/providers/cohere.d.ts.map +1 -0
  250. package/dist/esm/providers/cohere.js +25 -0
  251. package/dist/esm/providers/consts.d.ts +12 -0
  252. package/dist/esm/providers/consts.d.ts.map +1 -0
  253. package/dist/esm/providers/consts.js +32 -0
  254. package/dist/esm/providers/fal-ai.d.ts +42 -0
  255. package/dist/esm/providers/fal-ai.d.ts.map +1 -0
  256. package/dist/esm/providers/fal-ai.js +209 -0
  257. package/dist/esm/providers/featherless-ai.d.ts +22 -0
  258. package/dist/esm/providers/featherless-ai.d.ts.map +1 -0
  259. package/dist/esm/providers/featherless-ai.js +39 -0
  260. package/dist/esm/providers/fireworks-ai.d.ts +22 -0
  261. package/dist/esm/providers/fireworks-ai.d.ts.map +1 -0
  262. package/dist/esm/providers/fireworks-ai.js +25 -0
  263. package/dist/esm/providers/groq.d.ts +10 -0
  264. package/dist/esm/providers/groq.d.ts.map +1 -0
  265. package/dist/esm/providers/groq.js +34 -0
  266. package/dist/esm/providers/hf-inference.d.ts +131 -0
  267. package/dist/esm/providers/hf-inference.d.ts.map +1 -0
  268. package/dist/esm/providers/hf-inference.js +400 -0
  269. package/dist/esm/providers/hyperbolic.d.ts +48 -0
  270. package/dist/esm/providers/hyperbolic.d.ts.map +1 -0
  271. package/dist/esm/providers/hyperbolic.js +72 -0
  272. package/dist/esm/providers/nebius.d.ts +49 -0
  273. package/dist/esm/providers/nebius.d.ts.map +1 -0
  274. package/dist/esm/providers/nebius.js +63 -0
  275. package/dist/esm/providers/novita.d.ts +21 -0
  276. package/dist/esm/providers/novita.d.ts.map +1 -0
  277. package/dist/esm/providers/novita.js +113 -0
  278. package/dist/esm/providers/nscale.d.ts +35 -0
  279. package/dist/esm/providers/nscale.d.ts.map +1 -0
  280. package/dist/esm/providers/nscale.js +41 -0
  281. package/dist/esm/providers/openai.d.ts +8 -0
  282. package/dist/esm/providers/openai.d.ts.map +1 -0
  283. package/dist/esm/providers/openai.js +11 -0
  284. package/dist/esm/providers/ovhcloud.d.ts +38 -0
  285. package/dist/esm/providers/ovhcloud.d.ts.map +1 -0
  286. package/dist/esm/providers/ovhcloud.js +55 -0
  287. package/dist/esm/providers/providerHelper.d.ts +186 -0
  288. package/dist/esm/providers/providerHelper.d.ts.map +1 -0
  289. package/dist/esm/providers/providerHelper.js +102 -0
  290. package/dist/esm/providers/replicate.d.ts +25 -0
  291. package/dist/esm/providers/replicate.d.ts.map +1 -0
  292. package/dist/esm/providers/replicate.js +129 -0
  293. package/dist/esm/providers/sambanova.d.ts +14 -0
  294. package/dist/esm/providers/sambanova.d.ts.map +1 -0
  295. package/dist/esm/providers/sambanova.js +44 -0
  296. package/dist/esm/providers/together.d.ts +49 -0
  297. package/dist/esm/providers/together.d.ts.map +1 -0
  298. package/dist/esm/providers/together.js +65 -0
  299. package/dist/esm/snippets/getInferenceSnippets.d.ts +9 -0
  300. package/dist/esm/snippets/getInferenceSnippets.d.ts.map +1 -0
  301. package/dist/esm/snippets/getInferenceSnippets.js +309 -0
  302. package/dist/esm/snippets/index.d.ts +2 -0
  303. package/dist/esm/snippets/index.d.ts.map +1 -0
  304. package/dist/esm/snippets/index.js +1 -0
  305. package/dist/esm/snippets/templates.exported.d.ts +2 -0
  306. package/dist/esm/snippets/templates.exported.d.ts.map +1 -0
  307. package/dist/esm/snippets/templates.exported.js +78 -0
  308. package/dist/esm/tasks/audio/audioClassification.d.ts +10 -0
  309. package/dist/esm/tasks/audio/audioClassification.d.ts.map +1 -0
  310. package/dist/esm/tasks/audio/audioClassification.js +18 -0
  311. package/dist/esm/tasks/audio/audioToAudio.d.ts +29 -0
  312. package/dist/esm/tasks/audio/audioToAudio.d.ts.map +1 -0
  313. package/dist/esm/tasks/audio/audioToAudio.js +19 -0
  314. package/dist/esm/tasks/audio/automaticSpeechRecognition.d.ts +10 -0
  315. package/dist/esm/tasks/audio/automaticSpeechRecognition.d.ts.map +1 -0
  316. package/dist/esm/tasks/audio/automaticSpeechRecognition.js +22 -0
  317. package/dist/esm/tasks/audio/textToSpeech.d.ts +10 -0
  318. package/dist/esm/tasks/audio/textToSpeech.d.ts.map +1 -0
  319. package/dist/esm/tasks/audio/textToSpeech.js +16 -0
  320. package/dist/esm/tasks/audio/utils.d.ts +12 -0
  321. package/dist/esm/tasks/audio/utils.d.ts.map +1 -0
  322. package/dist/esm/tasks/audio/utils.js +9 -0
  323. package/dist/esm/tasks/custom/request.d.ts +10 -0
  324. package/dist/esm/tasks/custom/request.d.ts.map +1 -0
  325. package/dist/esm/tasks/custom/request.js +14 -0
  326. package/dist/esm/tasks/custom/streamingRequest.d.ts +10 -0
  327. package/dist/esm/tasks/custom/streamingRequest.d.ts.map +1 -0
  328. package/dist/esm/tasks/custom/streamingRequest.js +13 -0
  329. package/dist/esm/tasks/cv/imageClassification.d.ts +10 -0
  330. package/dist/esm/tasks/cv/imageClassification.d.ts.map +1 -0
  331. package/dist/esm/tasks/cv/imageClassification.js +18 -0
  332. package/dist/esm/tasks/cv/imageSegmentation.d.ts +10 -0
  333. package/dist/esm/tasks/cv/imageSegmentation.d.ts.map +1 -0
  334. package/dist/esm/tasks/cv/imageSegmentation.js +18 -0
  335. package/dist/esm/tasks/cv/imageToImage.d.ts +9 -0
  336. package/dist/esm/tasks/cv/imageToImage.d.ts.map +1 -0
  337. package/dist/esm/tasks/cv/imageToImage.js +17 -0
  338. package/dist/esm/tasks/cv/imageToText.d.ts +9 -0
  339. package/dist/esm/tasks/cv/imageToText.d.ts.map +1 -0
  340. package/dist/esm/tasks/cv/imageToText.js +17 -0
  341. package/dist/esm/tasks/cv/objectDetection.d.ts +10 -0
  342. package/dist/esm/tasks/cv/objectDetection.d.ts.map +1 -0
  343. package/dist/esm/tasks/cv/objectDetection.js +18 -0
  344. package/dist/esm/tasks/cv/textToImage.d.ts +18 -0
  345. package/dist/esm/tasks/cv/textToImage.d.ts.map +1 -0
  346. package/dist/esm/tasks/cv/textToImage.js +14 -0
  347. package/dist/esm/tasks/cv/textToVideo.d.ts +6 -0
  348. package/dist/esm/tasks/cv/textToVideo.d.ts.map +1 -0
  349. package/dist/esm/tasks/cv/textToVideo.js +14 -0
  350. package/dist/esm/tasks/cv/utils.d.ts +11 -0
  351. package/dist/esm/tasks/cv/utils.d.ts.map +1 -0
  352. package/dist/esm/tasks/cv/utils.js +4 -0
  353. package/dist/esm/tasks/cv/zeroShotImageClassification.d.ts +18 -0
  354. package/dist/esm/tasks/cv/zeroShotImageClassification.d.ts.map +1 -0
  355. package/dist/esm/tasks/cv/zeroShotImageClassification.js +36 -0
  356. package/dist/esm/tasks/index.d.ts +33 -0
  357. package/dist/esm/tasks/index.d.ts.map +1 -0
  358. package/dist/esm/tasks/index.js +38 -0
  359. package/dist/esm/tasks/multimodal/documentQuestionAnswering.d.ts +12 -0
  360. package/dist/esm/tasks/multimodal/documentQuestionAnswering.d.ts.map +1 -0
  361. package/dist/esm/tasks/multimodal/documentQuestionAnswering.js +24 -0
  362. package/dist/esm/tasks/multimodal/visualQuestionAnswering.d.ts +12 -0
  363. package/dist/esm/tasks/multimodal/visualQuestionAnswering.d.ts.map +1 -0
  364. package/dist/esm/tasks/multimodal/visualQuestionAnswering.js +24 -0
  365. package/dist/esm/tasks/nlp/chatCompletion.d.ts +7 -0
  366. package/dist/esm/tasks/nlp/chatCompletion.d.ts.map +1 -0
  367. package/dist/esm/tasks/nlp/chatCompletion.js +15 -0
  368. package/dist/esm/tasks/nlp/chatCompletionStream.d.ts +7 -0
  369. package/dist/esm/tasks/nlp/chatCompletionStream.d.ts.map +1 -0
  370. package/dist/esm/tasks/nlp/chatCompletionStream.js +14 -0
  371. package/dist/esm/tasks/nlp/featureExtraction.d.ts +17 -0
  372. package/dist/esm/tasks/nlp/featureExtraction.d.ts.map +1 -0
  373. package/dist/esm/tasks/nlp/featureExtraction.js +15 -0
  374. package/dist/esm/tasks/nlp/fillMask.d.ts +8 -0
  375. package/dist/esm/tasks/nlp/fillMask.d.ts.map +1 -0
  376. package/dist/esm/tasks/nlp/fillMask.js +15 -0
  377. package/dist/esm/tasks/nlp/questionAnswering.d.ts +8 -0
  378. package/dist/esm/tasks/nlp/questionAnswering.d.ts.map +1 -0
  379. package/dist/esm/tasks/nlp/questionAnswering.js +15 -0
  380. package/dist/esm/tasks/nlp/sentenceSimilarity.d.ts +8 -0
  381. package/dist/esm/tasks/nlp/sentenceSimilarity.d.ts.map +1 -0
  382. package/dist/esm/tasks/nlp/sentenceSimilarity.js +15 -0
  383. package/dist/esm/tasks/nlp/summarization.d.ts +8 -0
  384. package/dist/esm/tasks/nlp/summarization.d.ts.map +1 -0
  385. package/dist/esm/tasks/nlp/summarization.js +15 -0
  386. package/dist/esm/tasks/nlp/tableQuestionAnswering.d.ts +8 -0
  387. package/dist/esm/tasks/nlp/tableQuestionAnswering.d.ts.map +1 -0
  388. package/dist/esm/tasks/nlp/tableQuestionAnswering.js +15 -0
  389. package/dist/esm/tasks/nlp/textClassification.d.ts +8 -0
  390. package/dist/esm/tasks/nlp/textClassification.d.ts.map +1 -0
  391. package/dist/esm/tasks/nlp/textClassification.js +15 -0
  392. package/dist/esm/tasks/nlp/textGeneration.d.ts +8 -0
  393. package/dist/esm/tasks/nlp/textGeneration.d.ts.map +1 -0
  394. package/dist/esm/tasks/nlp/textGeneration.js +15 -0
  395. package/dist/esm/tasks/nlp/textGenerationStream.d.ts +81 -0
  396. package/dist/esm/tasks/nlp/textGenerationStream.d.ts.map +1 -0
  397. package/dist/esm/tasks/nlp/textGenerationStream.js +14 -0
  398. package/dist/esm/tasks/nlp/tokenClassification.d.ts +8 -0
  399. package/dist/esm/tasks/nlp/tokenClassification.d.ts.map +1 -0
  400. package/dist/esm/tasks/nlp/tokenClassification.js +15 -0
  401. package/dist/esm/tasks/nlp/translation.d.ts +8 -0
  402. package/dist/esm/tasks/nlp/translation.d.ts.map +1 -0
  403. package/dist/esm/tasks/nlp/translation.js +15 -0
  404. package/dist/esm/tasks/nlp/zeroShotClassification.d.ts +8 -0
  405. package/dist/esm/tasks/nlp/zeroShotClassification.d.ts.map +1 -0
  406. package/dist/esm/tasks/nlp/zeroShotClassification.js +15 -0
  407. package/dist/esm/tasks/tabular/tabularClassification.d.ts +20 -0
  408. package/dist/esm/tasks/tabular/tabularClassification.d.ts.map +1 -0
  409. package/dist/esm/tasks/tabular/tabularClassification.js +17 -0
  410. package/dist/esm/tasks/tabular/tabularRegression.d.ts +20 -0
  411. package/dist/esm/tasks/tabular/tabularRegression.d.ts.map +1 -0
  412. package/dist/esm/tasks/tabular/tabularRegression.js +17 -0
  413. package/dist/esm/types.d.ts +97 -0
  414. package/dist/esm/types.d.ts.map +1 -0
  415. package/dist/esm/types.js +20 -0
  416. package/dist/esm/utils/base64FromBytes.d.ts +2 -0
  417. package/dist/esm/utils/base64FromBytes.d.ts.map +1 -0
  418. package/dist/esm/utils/base64FromBytes.js +12 -0
  419. package/dist/esm/utils/delay.d.ts +2 -0
  420. package/dist/esm/utils/delay.d.ts.map +1 -0
  421. package/dist/esm/utils/delay.js +5 -0
  422. package/dist/esm/utils/distributive-omit.d.ts +9 -0
  423. package/dist/esm/utils/distributive-omit.d.ts.map +1 -0
  424. package/dist/esm/utils/distributive-omit.js +6 -0
  425. package/dist/esm/utils/isBackend.d.ts +2 -0
  426. package/dist/esm/utils/isBackend.d.ts.map +1 -0
  427. package/dist/esm/utils/isBackend.js +3 -0
  428. package/dist/esm/utils/isFrontend.d.ts +2 -0
  429. package/dist/esm/utils/isFrontend.d.ts.map +1 -0
  430. package/dist/esm/utils/isFrontend.js +2 -0
  431. package/dist/esm/utils/omit.d.ts +5 -0
  432. package/dist/esm/utils/omit.d.ts.map +1 -0
  433. package/dist/esm/utils/omit.js +10 -0
  434. package/dist/esm/utils/pick.d.ts +5 -0
  435. package/dist/esm/utils/pick.d.ts.map +1 -0
  436. package/dist/esm/utils/pick.js +10 -0
  437. package/dist/esm/utils/request.d.ts +28 -0
  438. package/dist/esm/utils/request.d.ts.map +1 -0
  439. package/dist/esm/utils/request.js +112 -0
  440. package/dist/esm/utils/toArray.d.ts +2 -0
  441. package/dist/esm/utils/toArray.d.ts.map +1 -0
  442. package/dist/esm/utils/toArray.js +6 -0
  443. package/dist/esm/utils/typedEntries.d.ts +4 -0
  444. package/dist/esm/utils/typedEntries.d.ts.map +1 -0
  445. package/dist/esm/utils/typedEntries.js +3 -0
  446. package/dist/esm/utils/typedInclude.d.ts +2 -0
  447. package/dist/esm/utils/typedInclude.d.ts.map +1 -0
  448. package/dist/esm/utils/typedInclude.js +3 -0
  449. package/dist/esm/vendor/fetch-event-source/parse.d.ts +69 -0
  450. package/dist/esm/vendor/fetch-event-source/parse.d.ts.map +1 -0
  451. package/dist/esm/vendor/fetch-event-source/parse.js +180 -0
  452. package/dist/esm/vendor/fetch-event-source/parse.spec.d.ts +2 -0
  453. package/dist/esm/vendor/fetch-event-source/parse.spec.d.ts.map +1 -0
  454. package/dist/esm/vendor/fetch-event-source/parse.spec.js +335 -0
  455. package/package.json +26 -12
  456. package/src/InferenceClient.ts +4 -4
  457. package/src/index.ts +4 -4
  458. package/src/lib/getDefaultTask.ts +2 -2
  459. package/src/lib/getInferenceProviderMapping.ts +5 -5
  460. package/src/lib/getProviderHelper.ts +20 -19
  461. package/src/lib/makeRequestOptions.ts +8 -8
  462. package/src/package.ts +3 -0
  463. package/src/providers/black-forest-labs.ts +5 -5
  464. package/src/providers/cerebras.ts +1 -1
  465. package/src/providers/cohere.ts +1 -1
  466. package/src/providers/consts.ts +3 -3
  467. package/src/providers/fal-ai.ts +9 -9
  468. package/src/providers/featherless-ai.ts +11 -5
  469. package/src/providers/fireworks-ai.ts +1 -1
  470. package/src/providers/groq.ts +1 -1
  471. package/src/providers/hf-inference.ts +11 -11
  472. package/src/providers/hyperbolic.ts +4 -4
  473. package/src/providers/nebius.ts +4 -4
  474. package/src/providers/novita.ts +85 -27
  475. package/src/providers/nscale.ts +4 -4
  476. package/src/providers/openai.ts +1 -1
  477. package/src/providers/ovhcloud.ts +4 -4
  478. package/src/providers/providerHelper.ts +7 -7
  479. package/src/providers/replicate.ts +5 -5
  480. package/src/providers/sambanova.ts +4 -4
  481. package/src/providers/together.ts +4 -4
  482. package/src/snippets/getInferenceSnippets.ts +7 -7
  483. package/src/tasks/audio/audioClassification.ts +6 -6
  484. package/src/tasks/audio/audioToAudio.ts +6 -6
  485. package/src/tasks/audio/automaticSpeechRecognition.ts +6 -6
  486. package/src/tasks/audio/textToSpeech.ts +4 -4
  487. package/src/tasks/audio/utils.ts +2 -2
  488. package/src/tasks/custom/request.ts +4 -4
  489. package/src/tasks/custom/streamingRequest.ts +4 -4
  490. package/src/tasks/cv/imageClassification.ts +5 -5
  491. package/src/tasks/cv/imageSegmentation.ts +5 -5
  492. package/src/tasks/cv/imageToImage.ts +4 -4
  493. package/src/tasks/cv/imageToText.ts +6 -6
  494. package/src/tasks/cv/objectDetection.ts +5 -5
  495. package/src/tasks/cv/textToImage.ts +5 -5
  496. package/src/tasks/cv/textToVideo.ts +9 -9
  497. package/src/tasks/cv/utils.ts +2 -2
  498. package/src/tasks/cv/zeroShotImageClassification.ts +5 -5
  499. package/src/tasks/index.ts +32 -32
  500. package/src/tasks/multimodal/documentQuestionAnswering.ts +5 -5
  501. package/src/tasks/multimodal/visualQuestionAnswering.ts +5 -5
  502. package/src/tasks/nlp/chatCompletion.ts +4 -4
  503. package/src/tasks/nlp/chatCompletionStream.ts +4 -4
  504. package/src/tasks/nlp/featureExtraction.ts +4 -4
  505. package/src/tasks/nlp/fillMask.ts +4 -4
  506. package/src/tasks/nlp/questionAnswering.ts +4 -4
  507. package/src/tasks/nlp/sentenceSimilarity.ts +4 -4
  508. package/src/tasks/nlp/summarization.ts +4 -4
  509. package/src/tasks/nlp/tableQuestionAnswering.ts +4 -4
  510. package/src/tasks/nlp/textClassification.ts +4 -4
  511. package/src/tasks/nlp/textGeneration.ts +5 -5
  512. package/src/tasks/nlp/textGenerationStream.ts +4 -4
  513. package/src/tasks/nlp/tokenClassification.ts +4 -4
  514. package/src/tasks/nlp/translation.ts +4 -4
  515. package/src/tasks/nlp/zeroShotClassification.ts +4 -4
  516. package/src/tasks/tabular/tabularClassification.ts +4 -4
  517. package/src/tasks/tabular/tabularRegression.ts +4 -4
  518. package/src/types.ts +1 -1
  519. package/src/utils/isFrontend.ts +1 -1
  520. package/src/utils/omit.ts +2 -2
  521. package/src/utils/request.ts +5 -5
  522. package/src/vendor/fetch-event-source/parse.spec.ts +1 -1
  523. package/src/vendor/fetch-event-source/parse.ts +6 -5
  524. package/dist/index.cjs +0 -2868
  525. package/dist/index.js +0 -2812
  526. package/dist/src/InferenceClient.d.ts.map +0 -1
  527. package/dist/src/index.d.ts.map +0 -1
  528. package/dist/src/providers/consts.d.ts.map +0 -1
  529. package/dist/src/providers/fireworks-ai.d.ts.map +0 -1
  530. package/dist/src/providers/novita.d.ts.map +0 -1
  531. package/dist/src/tasks/audio/audioToAudio.d.ts.map +0 -1
  532. package/dist/src/tasks/audio/automaticSpeechRecognition.d.ts.map +0 -1
  533. package/dist/src/tasks/audio/textToSpeech.d.ts.map +0 -1
  534. package/dist/src/tasks/audio/utils.d.ts.map +0 -1
  535. package/dist/src/tasks/custom/request.d.ts.map +0 -1
  536. package/dist/src/tasks/custom/streamingRequest.d.ts.map +0 -1
  537. package/dist/src/tasks/cv/imageClassification.d.ts.map +0 -1
  538. package/dist/src/tasks/cv/imageSegmentation.d.ts.map +0 -1
  539. package/dist/src/tasks/cv/imageToImage.d.ts.map +0 -1
  540. package/dist/src/tasks/cv/imageToText.d.ts.map +0 -1
  541. package/dist/src/tasks/cv/objectDetection.d.ts.map +0 -1
  542. package/dist/src/tasks/cv/textToImage.d.ts.map +0 -1
  543. package/dist/src/tasks/cv/textToVideo.d.ts.map +0 -1
  544. package/dist/src/tasks/cv/utils.d.ts.map +0 -1
  545. package/dist/src/tasks/cv/zeroShotImageClassification.d.ts.map +0 -1
  546. package/dist/src/tasks/index.d.ts +0 -33
  547. package/dist/src/tasks/index.d.ts.map +0 -1
  548. package/dist/src/tasks/multimodal/documentQuestionAnswering.d.ts.map +0 -1
  549. package/dist/src/tasks/multimodal/visualQuestionAnswering.d.ts.map +0 -1
  550. package/dist/src/tasks/nlp/featureExtraction.d.ts.map +0 -1
  551. package/dist/src/tasks/nlp/fillMask.d.ts.map +0 -1
  552. package/dist/src/tasks/nlp/questionAnswering.d.ts.map +0 -1
  553. package/dist/src/tasks/nlp/sentenceSimilarity.d.ts.map +0 -1
  554. package/dist/src/tasks/nlp/summarization.d.ts.map +0 -1
  555. package/dist/src/tasks/nlp/textClassification.d.ts.map +0 -1
  556. package/dist/src/tasks/nlp/textGeneration.d.ts.map +0 -1
  557. package/dist/src/tasks/nlp/textGenerationStream.d.ts.map +0 -1
  558. package/dist/src/tasks/nlp/translation.d.ts.map +0 -1
  559. package/dist/src/tasks/tabular/tabularClassification.d.ts.map +0 -1
  560. package/dist/src/tasks/tabular/tabularRegression.d.ts.map +0 -1
  561. package/dist/src/vendor/fetch-event-source/parse.d.ts.map +0 -1
  562. package/dist/test/InferenceClient.spec.d.ts +0 -2
  563. package/dist/test/InferenceClient.spec.d.ts.map +0 -1
  564. package/dist/test/expect-closeto.d.ts +0 -2
  565. package/dist/test/expect-closeto.d.ts.map +0 -1
  566. package/dist/test/test-files.d.ts +0 -2
  567. package/dist/test/test-files.d.ts.map +0 -1
  568. /package/dist/{src → commonjs}/config.d.ts +0 -0
  569. /package/dist/{src → commonjs}/config.d.ts.map +0 -0
  570. /package/dist/{src → commonjs}/lib/InferenceOutputError.d.ts +0 -0
  571. /package/dist/{src → commonjs}/lib/InferenceOutputError.d.ts.map +0 -0
  572. /package/dist/{src → commonjs}/lib/getDefaultTask.d.ts +0 -0
  573. /package/dist/{src → commonjs}/lib/getDefaultTask.d.ts.map +0 -0
  574. /package/dist/{src → commonjs}/lib/isUrl.d.ts +0 -0
  575. /package/dist/{src → commonjs}/lib/isUrl.d.ts.map +0 -0
  576. /package/dist/{src → commonjs}/snippets/index.d.ts +0 -0
  577. /package/dist/{src → commonjs}/snippets/index.d.ts.map +0 -0
  578. /package/dist/{src → commonjs}/snippets/templates.exported.d.ts +0 -0
  579. /package/dist/{src → commonjs}/snippets/templates.exported.d.ts.map +0 -0
  580. /package/dist/{src → commonjs}/utils/base64FromBytes.d.ts +0 -0
  581. /package/dist/{src → commonjs}/utils/base64FromBytes.d.ts.map +0 -0
  582. /package/dist/{src → commonjs}/utils/delay.d.ts +0 -0
  583. /package/dist/{src → commonjs}/utils/delay.d.ts.map +0 -0
  584. /package/dist/{src → commonjs}/utils/distributive-omit.d.ts +0 -0
  585. /package/dist/{src → commonjs}/utils/distributive-omit.d.ts.map +0 -0
  586. /package/dist/{src → commonjs}/utils/isBackend.d.ts +0 -0
  587. /package/dist/{src → commonjs}/utils/isBackend.d.ts.map +0 -0
  588. /package/dist/{src → commonjs}/utils/isFrontend.d.ts +0 -0
  589. /package/dist/{src → commonjs}/utils/isFrontend.d.ts.map +0 -0
  590. /package/dist/{src → commonjs}/utils/omit.d.ts +0 -0
  591. /package/dist/{src → commonjs}/utils/omit.d.ts.map +0 -0
  592. /package/dist/{src → commonjs}/utils/pick.d.ts +0 -0
  593. /package/dist/{src → commonjs}/utils/pick.d.ts.map +0 -0
  594. /package/dist/{src → commonjs}/utils/toArray.d.ts +0 -0
  595. /package/dist/{src → commonjs}/utils/toArray.d.ts.map +0 -0
  596. /package/dist/{src → commonjs}/utils/typedEntries.d.ts +0 -0
  597. /package/dist/{src → commonjs}/utils/typedEntries.d.ts.map +0 -0
  598. /package/dist/{src → commonjs}/utils/typedInclude.d.ts +0 -0
  599. /package/dist/{src → commonjs}/utils/typedInclude.d.ts.map +0 -0
  600. /package/dist/{src → commonjs}/vendor/fetch-event-source/parse.d.ts +0 -0
  601. /package/dist/{src → commonjs}/vendor/fetch-event-source/parse.spec.d.ts +0 -0
  602. /package/dist/{src → commonjs}/vendor/fetch-event-source/parse.spec.d.ts.map +0 -0
@@ -1,10 +1,10 @@
1
1
  import type { AutomaticSpeechRecognitionInput, AutomaticSpeechRecognitionOutput } from "@huggingface/tasks";
2
- import { resolveProvider } from "../../lib/getInferenceProviderMapping";
3
- import { getProviderHelper } from "../../lib/getProviderHelper";
4
- import { InferenceOutputError } from "../../lib/InferenceOutputError";
5
- import type { BaseArgs, Options } from "../../types";
6
- import { innerRequest } from "../../utils/request";
7
- import type { LegacyAudioInput } from "./utils";
2
+ import { resolveProvider } from "../../lib/getInferenceProviderMapping.js";
3
+ import { getProviderHelper } from "../../lib/getProviderHelper.js";
4
+ import { InferenceOutputError } from "../../lib/InferenceOutputError.js";
5
+ import type { BaseArgs, Options } from "../../types.js";
6
+ import { innerRequest } from "../../utils/request.js";
7
+ import type { LegacyAudioInput } from "./utils.js";
8
8
 
9
9
  export type AutomaticSpeechRecognitionArgs = BaseArgs & (AutomaticSpeechRecognitionInput | LegacyAudioInput);
10
10
  /**
@@ -1,8 +1,8 @@
1
1
  import type { TextToSpeechInput } 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
  type TextToSpeechArgs = BaseArgs & TextToSpeechInput;
7
7
 
8
8
  interface OutputUrlTextToSpeechGeneration {
@@ -1,5 +1,5 @@
1
- import type { BaseArgs, InferenceProvider, RequestArgs } from "../../types";
2
- import { omit } from "../../utils/omit";
1
+ import type { BaseArgs, InferenceProvider, RequestArgs } from "../../types.js";
2
+ import { omit } from "../../utils/omit.js";
3
3
 
4
4
  /**
5
5
  * @deprecated
@@ -1,7 +1,7 @@
1
- import { resolveProvider } from "../../lib/getInferenceProviderMapping";
2
- import { getProviderHelper } from "../../lib/getProviderHelper";
3
- import type { InferenceTask, Options, RequestArgs } 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 { InferenceTask, Options, RequestArgs } from "../../types.js";
4
+ import { innerRequest } from "../../utils/request.js";
5
5
 
6
6
  /**
7
7
  * Primitive to make custom calls to the inference provider
@@ -1,7 +1,7 @@
1
- import { resolveProvider } from "../../lib/getInferenceProviderMapping";
2
- import { getProviderHelper } from "../../lib/getProviderHelper";
3
- import type { InferenceTask, Options, RequestArgs } from "../../types";
4
- import { innerStreamingRequest } from "../../utils/request";
1
+ import { resolveProvider } from "../../lib/getInferenceProviderMapping.js";
2
+ import { getProviderHelper } from "../../lib/getProviderHelper.js";
3
+ import type { InferenceTask, Options, RequestArgs } from "../../types.js";
4
+ import { innerStreamingRequest } from "../../utils/request.js";
5
5
 
6
6
  /**
7
7
  * Primitive to make custom inference calls that expect server-sent events, and returns the response through a generator
@@ -1,9 +1,9 @@
1
1
  import type { ImageClassificationInput, ImageClassificationOutput } 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 ImageClassificationArgs = BaseArgs & (ImageClassificationInput | LegacyImageInput);
9
9
 
@@ -1,9 +1,9 @@
1
1
  import type { ImageSegmentationInput, ImageSegmentationOutput } 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 ImageSegmentationArgs = BaseArgs & (ImageSegmentationInput | LegacyImageInput);
9
9
 
@@ -1,8 +1,8 @@
1
1
  import type { ImageToImageInput } 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 ImageToImageArgs = BaseArgs & ImageToImageInput;
8
8
 
@@ -1,10 +1,10 @@
1
1
  import type { ImageToTextInput, ImageToTextOutput } 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 type { LegacyImageInput } from "./utils";
7
- import { preparePayload } 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 type { LegacyImageInput } from "./utils.js";
7
+ import { preparePayload } from "./utils.js";
8
8
 
9
9
  export type ImageToTextArgs = BaseArgs & (ImageToTextInput | LegacyImageInput);
10
10
  /**
@@ -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 { NovitaAsyncAPIOutput } 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
 
@@ -15,7 +15,7 @@ export type TextToVideoOutput = Blob;
15
15
  export async function textToVideo(args: TextToVideoArgs, options?: Options): Promise<TextToVideoOutput> {
16
16
  const provider = await resolveProvider(args.provider, args.model, args.endpointUrl);
17
17
  const providerHelper = getProviderHelper(provider, "text-to-video");
18
- const { data: response } = await innerRequest<FalAiQueueOutput | ReplicateOutput | NovitaOutput>(
18
+ const { data: response } = await innerRequest<FalAiQueueOutput | ReplicateOutput | NovitaAsyncAPIOutput>(
19
19
  args,
20
20
  providerHelper,
21
21
  {
@@ -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;