together-ai 0.20.0 → 0.21.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 (681) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/README.md +112 -46
  3. package/api-promise.d.mts +2 -0
  4. package/api-promise.d.mts.map +1 -0
  5. package/api-promise.d.ts +2 -0
  6. package/api-promise.d.ts.map +1 -0
  7. package/api-promise.js +6 -0
  8. package/api-promise.js.map +1 -0
  9. package/api-promise.mjs +2 -0
  10. package/api-promise.mjs.map +1 -0
  11. package/bin/cli +53 -0
  12. package/bin/migration-config.json +6 -0
  13. package/client.d.mts +237 -0
  14. package/client.d.mts.map +1 -0
  15. package/client.d.ts +237 -0
  16. package/client.d.ts.map +1 -0
  17. package/client.js +517 -0
  18. package/client.js.map +1 -0
  19. package/client.mjs +513 -0
  20. package/client.mjs.map +1 -0
  21. package/core/api-promise.d.mts +46 -0
  22. package/core/api-promise.d.mts.map +1 -0
  23. package/core/api-promise.d.ts +46 -0
  24. package/core/api-promise.d.ts.map +1 -0
  25. package/core/api-promise.js +74 -0
  26. package/core/api-promise.js.map +1 -0
  27. package/core/api-promise.mjs +70 -0
  28. package/core/api-promise.mjs.map +1 -0
  29. package/core/error.d.mts +46 -0
  30. package/core/error.d.mts.map +1 -0
  31. package/core/error.d.ts +46 -0
  32. package/core/error.d.ts.map +1 -0
  33. package/core/error.js +113 -0
  34. package/core/error.js.map +1 -0
  35. package/core/error.mjs +97 -0
  36. package/core/error.mjs.map +1 -0
  37. package/core/resource.d.mts +6 -0
  38. package/core/resource.d.mts.map +1 -0
  39. package/core/resource.d.ts +6 -0
  40. package/core/resource.d.ts.map +1 -0
  41. package/core/resource.js +11 -0
  42. package/core/resource.js.map +1 -0
  43. package/core/resource.mjs +7 -0
  44. package/core/resource.mjs.map +1 -0
  45. package/core/streaming.d.mts +33 -0
  46. package/core/streaming.d.mts.map +1 -0
  47. package/core/streaming.d.ts +33 -0
  48. package/core/streaming.d.ts.map +1 -0
  49. package/core/streaming.js +277 -0
  50. package/core/streaming.js.map +1 -0
  51. package/core/streaming.mjs +272 -0
  52. package/core/streaming.mjs.map +1 -0
  53. package/core/uploads.d.mts +3 -0
  54. package/core/uploads.d.mts.map +1 -0
  55. package/core/uploads.d.ts +3 -0
  56. package/core/uploads.d.ts.map +1 -0
  57. package/core/uploads.js +6 -0
  58. package/core/uploads.js.map +1 -0
  59. package/core/uploads.mjs +2 -0
  60. package/core/uploads.mjs.map +1 -0
  61. package/error.d.mts +2 -0
  62. package/error.d.mts.map +1 -0
  63. package/error.d.ts +1 -46
  64. package/error.d.ts.map +1 -1
  65. package/error.js +3 -110
  66. package/error.js.map +1 -1
  67. package/error.mjs +1 -96
  68. package/error.mjs.map +1 -1
  69. package/index.d.mts +6 -170
  70. package/index.d.mts.map +1 -0
  71. package/index.d.ts +5 -169
  72. package/index.d.ts.map +1 -1
  73. package/index.js +12 -164
  74. package/index.js.map +1 -1
  75. package/index.mjs +5 -137
  76. package/index.mjs.map +1 -1
  77. package/internal/builtin-types.d.mts +73 -0
  78. package/internal/builtin-types.d.mts.map +1 -0
  79. package/internal/builtin-types.d.ts +73 -0
  80. package/internal/builtin-types.d.ts.map +1 -0
  81. package/internal/builtin-types.js +4 -0
  82. package/internal/builtin-types.js.map +1 -0
  83. package/internal/builtin-types.mjs +3 -0
  84. package/internal/builtin-types.mjs.map +1 -0
  85. package/internal/decoders/line.d.mts +17 -0
  86. package/internal/decoders/line.d.mts.map +1 -0
  87. package/internal/decoders/line.d.ts +1 -5
  88. package/internal/decoders/line.d.ts.map +1 -1
  89. package/internal/decoders/line.js +24 -61
  90. package/internal/decoders/line.js.map +1 -1
  91. package/internal/decoders/line.mjs +14 -51
  92. package/internal/decoders/line.mjs.map +1 -1
  93. package/internal/detect-platform.d.mts +15 -0
  94. package/internal/detect-platform.d.mts.map +1 -0
  95. package/internal/detect-platform.d.ts +15 -0
  96. package/internal/detect-platform.d.ts.map +1 -0
  97. package/internal/detect-platform.js +162 -0
  98. package/internal/detect-platform.js.map +1 -0
  99. package/internal/detect-platform.mjs +157 -0
  100. package/internal/detect-platform.mjs.map +1 -0
  101. package/internal/errors.d.mts +3 -0
  102. package/internal/errors.d.mts.map +1 -0
  103. package/internal/errors.d.ts +3 -0
  104. package/internal/errors.d.ts.map +1 -0
  105. package/internal/errors.js +41 -0
  106. package/internal/errors.js.map +1 -0
  107. package/internal/errors.mjs +36 -0
  108. package/internal/errors.mjs.map +1 -0
  109. package/internal/headers.d.mts +20 -0
  110. package/internal/headers.d.mts.map +1 -0
  111. package/internal/headers.d.ts +20 -0
  112. package/internal/headers.d.ts.map +1 -0
  113. package/internal/headers.js +79 -0
  114. package/internal/headers.js.map +1 -0
  115. package/internal/headers.mjs +74 -0
  116. package/internal/headers.mjs.map +1 -0
  117. package/internal/parse.d.mts +12 -0
  118. package/internal/parse.d.mts.map +1 -0
  119. package/internal/parse.d.ts +12 -0
  120. package/internal/parse.d.ts.map +1 -0
  121. package/internal/parse.js +45 -0
  122. package/internal/parse.js.map +1 -0
  123. package/internal/parse.mjs +42 -0
  124. package/internal/parse.mjs.map +1 -0
  125. package/internal/request-options.d.mts +77 -0
  126. package/internal/request-options.d.mts.map +1 -0
  127. package/internal/request-options.d.ts +77 -0
  128. package/internal/request-options.d.ts.map +1 -0
  129. package/internal/request-options.js +14 -0
  130. package/internal/request-options.js.map +1 -0
  131. package/internal/request-options.mjs +10 -0
  132. package/internal/request-options.mjs.map +1 -0
  133. package/internal/shim-types.d.mts +17 -0
  134. package/internal/shim-types.d.mts.map +1 -0
  135. package/internal/shim-types.d.ts +17 -0
  136. package/internal/shim-types.d.ts.map +1 -0
  137. package/internal/shim-types.js +4 -0
  138. package/internal/shim-types.js.map +1 -0
  139. package/internal/shim-types.mjs +3 -0
  140. package/internal/shim-types.mjs.map +1 -0
  141. package/internal/shims.d.mts +20 -0
  142. package/internal/shims.d.mts.map +1 -0
  143. package/internal/shims.d.ts +20 -0
  144. package/internal/shims.d.ts.map +1 -0
  145. package/internal/shims.js +92 -0
  146. package/internal/shims.js.map +1 -0
  147. package/internal/shims.mjs +85 -0
  148. package/internal/shims.mjs.map +1 -0
  149. package/internal/to-file.d.mts +45 -0
  150. package/internal/to-file.d.mts.map +1 -0
  151. package/internal/to-file.d.ts +45 -0
  152. package/internal/to-file.d.ts.map +1 -0
  153. package/internal/to-file.js +91 -0
  154. package/internal/to-file.js.map +1 -0
  155. package/internal/to-file.mjs +88 -0
  156. package/internal/to-file.mjs.map +1 -0
  157. package/internal/tslib.js +85 -0
  158. package/internal/tslib.mjs +17 -0
  159. package/internal/types.d.mts +69 -0
  160. package/internal/types.d.mts.map +1 -0
  161. package/internal/types.d.ts +69 -0
  162. package/internal/types.d.ts.map +1 -0
  163. package/internal/types.js +4 -0
  164. package/internal/types.js.map +1 -0
  165. package/internal/types.mjs +3 -0
  166. package/internal/types.mjs.map +1 -0
  167. package/internal/uploads.d.mts +42 -0
  168. package/internal/uploads.d.mts.map +1 -0
  169. package/internal/uploads.d.ts +42 -0
  170. package/internal/uploads.d.ts.map +1 -0
  171. package/internal/uploads.js +141 -0
  172. package/internal/uploads.js.map +1 -0
  173. package/internal/uploads.mjs +131 -0
  174. package/internal/uploads.mjs.map +1 -0
  175. package/internal/utils/base64.d.mts +3 -0
  176. package/internal/utils/base64.d.mts.map +1 -0
  177. package/internal/utils/base64.d.ts +3 -0
  178. package/internal/utils/base64.d.ts.map +1 -0
  179. package/internal/utils/base64.js +38 -0
  180. package/internal/utils/base64.js.map +1 -0
  181. package/internal/utils/base64.mjs +33 -0
  182. package/internal/utils/base64.mjs.map +1 -0
  183. package/internal/utils/bytes.d.mts +4 -0
  184. package/internal/utils/bytes.d.mts.map +1 -0
  185. package/internal/utils/bytes.d.ts +4 -0
  186. package/internal/utils/bytes.d.ts.map +1 -0
  187. package/internal/utils/bytes.js +31 -0
  188. package/internal/utils/bytes.js.map +1 -0
  189. package/internal/utils/bytes.mjs +26 -0
  190. package/internal/utils/bytes.mjs.map +1 -0
  191. package/internal/utils/env.d.mts +9 -0
  192. package/internal/utils/env.d.mts.map +1 -0
  193. package/internal/utils/env.d.ts +9 -0
  194. package/internal/utils/env.d.ts.map +1 -0
  195. package/internal/utils/env.js +22 -0
  196. package/internal/utils/env.js.map +1 -0
  197. package/internal/utils/env.mjs +18 -0
  198. package/internal/utils/env.mjs.map +1 -0
  199. package/internal/utils/log.d.mts +37 -0
  200. package/internal/utils/log.d.mts.map +1 -0
  201. package/internal/utils/log.d.ts +37 -0
  202. package/internal/utils/log.d.ts.map +1 -0
  203. package/internal/utils/log.js +85 -0
  204. package/internal/utils/log.js.map +1 -0
  205. package/internal/utils/log.mjs +79 -0
  206. package/internal/utils/log.mjs.map +1 -0
  207. package/internal/utils/path.d.mts +15 -0
  208. package/internal/utils/path.d.mts.map +1 -0
  209. package/internal/utils/path.d.ts +15 -0
  210. package/internal/utils/path.d.ts.map +1 -0
  211. package/internal/utils/path.js +79 -0
  212. package/internal/utils/path.js.map +1 -0
  213. package/internal/utils/path.mjs +74 -0
  214. package/internal/utils/path.mjs.map +1 -0
  215. package/internal/utils/sleep.d.mts +2 -0
  216. package/internal/utils/sleep.d.mts.map +1 -0
  217. package/internal/utils/sleep.d.ts +2 -0
  218. package/internal/utils/sleep.d.ts.map +1 -0
  219. package/internal/utils/sleep.js +7 -0
  220. package/internal/utils/sleep.js.map +1 -0
  221. package/internal/utils/sleep.mjs +3 -0
  222. package/internal/utils/sleep.mjs.map +1 -0
  223. package/internal/utils/uuid.d.mts +5 -0
  224. package/internal/utils/uuid.d.mts.map +1 -0
  225. package/internal/utils/uuid.d.ts +5 -0
  226. package/internal/utils/uuid.d.ts.map +1 -0
  227. package/internal/utils/uuid.js +19 -0
  228. package/internal/utils/uuid.js.map +1 -0
  229. package/internal/utils/uuid.mjs +15 -0
  230. package/internal/utils/uuid.mjs.map +1 -0
  231. package/internal/utils/values.d.mts +18 -0
  232. package/internal/utils/values.d.mts.map +1 -0
  233. package/internal/utils/values.d.ts +18 -0
  234. package/internal/utils/values.d.ts.map +1 -0
  235. package/internal/utils/values.js +112 -0
  236. package/internal/utils/values.js.map +1 -0
  237. package/internal/utils/values.mjs +94 -0
  238. package/internal/utils/values.mjs.map +1 -0
  239. package/internal/utils.d.mts +7 -0
  240. package/internal/utils.d.mts.map +1 -0
  241. package/internal/utils.d.ts +7 -0
  242. package/internal/utils.d.ts.map +1 -0
  243. package/internal/utils.js +11 -0
  244. package/internal/utils.js.map +1 -0
  245. package/internal/utils.mjs +8 -0
  246. package/internal/utils.mjs.map +1 -0
  247. package/lib/AbstractChatCompletionRunner.d.mts +113 -0
  248. package/lib/AbstractChatCompletionRunner.d.mts.map +1 -0
  249. package/lib/AbstractChatCompletionRunner.d.ts +7 -8
  250. package/lib/AbstractChatCompletionRunner.d.ts.map +1 -1
  251. package/lib/AbstractChatCompletionRunner.js +48 -58
  252. package/lib/AbstractChatCompletionRunner.js.map +1 -1
  253. package/lib/AbstractChatCompletionRunner.mjs +2 -12
  254. package/lib/AbstractChatCompletionRunner.mjs.map +1 -1
  255. package/lib/ChatCompletionRunner.d.mts +19 -0
  256. package/lib/ChatCompletionRunner.d.mts.map +1 -0
  257. package/lib/ChatCompletionRunner.d.ts +1 -1
  258. package/lib/ChatCompletionRunner.d.ts.map +1 -1
  259. package/lib/ChatCompletionRunner.js.map +1 -1
  260. package/lib/ChatCompletionRunner.mjs.map +1 -1
  261. package/lib/ChatCompletionStream.d.mts +149 -0
  262. package/lib/ChatCompletionStream.d.mts.map +1 -0
  263. package/lib/ChatCompletionStream.d.ts +6 -7
  264. package/lib/ChatCompletionStream.d.ts.map +1 -1
  265. package/lib/ChatCompletionStream.js +17 -27
  266. package/lib/ChatCompletionStream.js.map +1 -1
  267. package/lib/ChatCompletionStream.mjs +3 -13
  268. package/lib/ChatCompletionStream.mjs.map +1 -1
  269. package/lib/ChatCompletionStreamingRunner.d.mts +21 -0
  270. package/lib/ChatCompletionStreamingRunner.d.mts.map +1 -0
  271. package/lib/ChatCompletionStreamingRunner.d.ts +1 -2
  272. package/lib/ChatCompletionStreamingRunner.d.ts.map +1 -1
  273. package/lib/ChatCompletionStreamingRunner.js.map +1 -1
  274. package/lib/ChatCompletionStreamingRunner.mjs.map +1 -1
  275. package/lib/RunnableFunction.d.mts +95 -0
  276. package/lib/RunnableFunction.d.mts.map +1 -0
  277. package/lib/RunnableFunction.d.ts.map +1 -1
  278. package/lib/RunnableFunction.js +2 -2
  279. package/lib/RunnableFunction.js.map +1 -1
  280. package/lib/chatCompletionUtils.d.mts +6 -0
  281. package/lib/chatCompletionUtils.d.mts.map +1 -0
  282. package/lib/chatCompletionUtils.d.ts +1 -1
  283. package/lib/chatCompletionUtils.d.ts.map +1 -1
  284. package/lib/chatCompletionUtils.js +2 -2
  285. package/lib/chatCompletionUtils.js.map +1 -1
  286. package/lib/jsonschema.d.mts +106 -0
  287. package/lib/jsonschema.d.mts.map +1 -0
  288. package/lib/upload.d.mts +22 -0
  289. package/lib/upload.d.mts.map +1 -0
  290. package/lib/upload.d.ts.map +1 -1
  291. package/lib/upload.js +19 -50
  292. package/lib/upload.js.map +1 -1
  293. package/lib/upload.mjs +7 -12
  294. package/lib/upload.mjs.map +1 -1
  295. package/package.json +123 -66
  296. package/resource.d.mts +2 -0
  297. package/resource.d.mts.map +1 -0
  298. package/resource.d.ts +1 -5
  299. package/resource.d.ts.map +1 -1
  300. package/resource.js +3 -8
  301. package/resource.js.map +1 -1
  302. package/resource.mjs +1 -6
  303. package/resource.mjs.map +1 -1
  304. package/resources/audio/audio.d.mts +114 -0
  305. package/resources/audio/audio.d.mts.map +1 -0
  306. package/resources/audio/audio.d.ts +7 -8
  307. package/resources/audio/audio.d.ts.map +1 -1
  308. package/resources/audio/audio.js +6 -27
  309. package/resources/audio/audio.js.map +1 -1
  310. package/resources/audio/audio.mjs +3 -2
  311. package/resources/audio/audio.mjs.map +1 -1
  312. package/resources/audio/index.d.mts +4 -0
  313. package/resources/audio/index.d.mts.map +1 -0
  314. package/resources/audio/index.d.ts.map +1 -1
  315. package/resources/audio/transcriptions.d.mts +124 -0
  316. package/resources/audio/transcriptions.d.mts.map +1 -0
  317. package/resources/audio/transcriptions.d.ts +9 -6
  318. package/resources/audio/transcriptions.d.ts.map +1 -1
  319. package/resources/audio/transcriptions.js +3 -26
  320. package/resources/audio/transcriptions.js.map +1 -1
  321. package/resources/audio/transcriptions.mjs +3 -3
  322. package/resources/audio/transcriptions.mjs.map +1 -1
  323. package/resources/audio/translations.d.mts +123 -0
  324. package/resources/audio/translations.d.mts.map +1 -0
  325. package/resources/audio/translations.d.ts +9 -6
  326. package/resources/audio/translations.d.ts.map +1 -1
  327. package/resources/audio/translations.js +3 -26
  328. package/resources/audio/translations.js.map +1 -1
  329. package/resources/audio/translations.mjs +3 -3
  330. package/resources/audio/translations.mjs.map +1 -1
  331. package/resources/audio.d.mts +2 -0
  332. package/resources/audio.d.mts.map +1 -0
  333. package/resources/audio.d.ts.map +1 -1
  334. package/resources/audio.js +2 -15
  335. package/resources/audio.js.map +1 -1
  336. package/resources/batches.d.mts +156 -0
  337. package/resources/batches.d.mts.map +1 -0
  338. package/resources/batches.d.ts +6 -5
  339. package/resources/batches.d.ts.map +1 -1
  340. package/resources/batches.js +3 -2
  341. package/resources/batches.js.map +1 -1
  342. package/resources/batches.mjs +3 -2
  343. package/resources/batches.mjs.map +1 -1
  344. package/resources/chat/chat.d.mts +10 -0
  345. package/resources/chat/chat.d.mts.map +1 -0
  346. package/resources/chat/chat.d.ts +3 -3
  347. package/resources/chat/chat.d.ts.map +1 -1
  348. package/resources/chat/chat.js +3 -25
  349. package/resources/chat/chat.js.map +1 -1
  350. package/resources/chat/chat.mjs +1 -1
  351. package/resources/chat/completions.d.mts +440 -0
  352. package/resources/chat/completions.d.mts.map +1 -0
  353. package/resources/chat/completions.d.ts +18 -10
  354. package/resources/chat/completions.d.ts.map +1 -1
  355. package/resources/chat/completions.js +2 -2
  356. package/resources/chat/completions.js.map +1 -1
  357. package/resources/chat/completions.mjs +2 -2
  358. package/resources/chat/completions.mjs.map +1 -1
  359. package/resources/chat/index.d.mts +3 -0
  360. package/resources/chat/index.d.mts.map +1 -0
  361. package/resources/chat/index.d.ts +1 -1
  362. package/resources/chat/index.d.ts.map +1 -1
  363. package/resources/chat/index.js.map +1 -1
  364. package/resources/chat/index.mjs.map +1 -1
  365. package/resources/chat.d.mts +2 -0
  366. package/resources/chat.d.mts.map +1 -0
  367. package/resources/chat.d.ts.map +1 -1
  368. package/resources/chat.js +2 -15
  369. package/resources/chat.js.map +1 -1
  370. package/resources/code-interpreter/code-interpreter.d.mts +140 -0
  371. package/resources/code-interpreter/code-interpreter.d.mts.map +1 -0
  372. package/resources/code-interpreter/code-interpreter.d.ts +4 -3
  373. package/resources/code-interpreter/code-interpreter.d.ts.map +1 -1
  374. package/resources/code-interpreter/code-interpreter.js +3 -25
  375. package/resources/code-interpreter/code-interpreter.js.map +1 -1
  376. package/resources/code-interpreter/code-interpreter.mjs +1 -1
  377. package/resources/code-interpreter/code-interpreter.mjs.map +1 -1
  378. package/resources/code-interpreter/index.d.mts +3 -0
  379. package/resources/code-interpreter/index.d.mts.map +1 -0
  380. package/resources/code-interpreter/index.d.ts.map +1 -1
  381. package/resources/code-interpreter/sessions.d.mts +42 -0
  382. package/resources/code-interpreter/sessions.d.mts.map +1 -0
  383. package/resources/code-interpreter/sessions.d.ts +4 -3
  384. package/resources/code-interpreter/sessions.d.ts.map +1 -1
  385. package/resources/code-interpreter/sessions.js +1 -1
  386. package/resources/code-interpreter/sessions.js.map +1 -1
  387. package/resources/code-interpreter/sessions.mjs +1 -1
  388. package/resources/code-interpreter/sessions.mjs.map +1 -1
  389. package/resources/code-interpreter.d.mts +2 -0
  390. package/resources/code-interpreter.d.mts.map +1 -0
  391. package/resources/code-interpreter.d.ts.map +1 -1
  392. package/resources/code-interpreter.js +2 -15
  393. package/resources/code-interpreter.js.map +1 -1
  394. package/resources/completions.d.mts +256 -0
  395. package/resources/completions.d.mts.map +1 -0
  396. package/resources/completions.d.ts +7 -7
  397. package/resources/completions.d.ts.map +1 -1
  398. package/resources/completions.js +1 -1
  399. package/resources/completions.js.map +1 -1
  400. package/resources/completions.mjs +1 -1
  401. package/resources/completions.mjs.map +1 -1
  402. package/resources/embeddings.d.mts +46 -0
  403. package/resources/embeddings.d.mts.map +1 -0
  404. package/resources/embeddings.d.ts +4 -3
  405. package/resources/embeddings.d.ts.map +1 -1
  406. package/resources/embeddings.js +1 -1
  407. package/resources/embeddings.js.map +1 -1
  408. package/resources/embeddings.mjs +1 -1
  409. package/resources/embeddings.mjs.map +1 -1
  410. package/resources/endpoints.d.mts +333 -0
  411. package/resources/endpoints.d.mts.map +1 -0
  412. package/resources/endpoints.d.ts +8 -8
  413. package/resources/endpoints.d.ts.map +1 -1
  414. package/resources/endpoints.js +19 -12
  415. package/resources/endpoints.js.map +1 -1
  416. package/resources/endpoints.mjs +19 -12
  417. package/resources/endpoints.mjs.map +1 -1
  418. package/resources/files.d.mts +146 -0
  419. package/resources/files.d.mts.map +1 -0
  420. package/resources/files.d.ts +9 -8
  421. package/resources/files.d.ts.map +1 -1
  422. package/resources/files.js +7 -5
  423. package/resources/files.js.map +1 -1
  424. package/resources/files.mjs +7 -5
  425. package/resources/files.mjs.map +1 -1
  426. package/resources/fine-tune.d.mts +666 -0
  427. package/resources/fine-tune.d.mts.map +1 -0
  428. package/resources/fine-tune.d.ts +10 -9
  429. package/resources/fine-tune.d.ts.map +1 -1
  430. package/resources/fine-tune.js +6 -5
  431. package/resources/fine-tune.js.map +1 -1
  432. package/resources/fine-tune.mjs +6 -5
  433. package/resources/fine-tune.mjs.map +1 -1
  434. package/resources/hardware.d.mts +95 -0
  435. package/resources/hardware.d.mts.map +1 -0
  436. package/resources/hardware.d.ts +4 -4
  437. package/resources/hardware.d.ts.map +1 -1
  438. package/resources/hardware.js +6 -5
  439. package/resources/hardware.js.map +1 -1
  440. package/resources/hardware.mjs +6 -5
  441. package/resources/hardware.mjs.map +1 -1
  442. package/resources/images.d.mts +114 -0
  443. package/resources/images.d.mts.map +1 -0
  444. package/resources/images.d.ts +4 -3
  445. package/resources/images.d.ts.map +1 -1
  446. package/resources/images.js +1 -1
  447. package/resources/images.js.map +1 -1
  448. package/resources/images.mjs +1 -1
  449. package/resources/images.mjs.map +1 -1
  450. package/resources/index.d.mts +15 -0
  451. package/resources/index.d.mts.map +1 -0
  452. package/resources/index.d.ts.map +1 -1
  453. package/resources/jobs.d.mts +76 -0
  454. package/resources/jobs.d.mts.map +1 -0
  455. package/resources/jobs.d.ts +5 -4
  456. package/resources/jobs.d.ts.map +1 -1
  457. package/resources/jobs.js +4 -3
  458. package/resources/jobs.js.map +1 -1
  459. package/resources/jobs.mjs +4 -3
  460. package/resources/jobs.mjs.map +1 -1
  461. package/resources/models.d.mts +98 -0
  462. package/resources/models.d.mts.map +1 -0
  463. package/resources/models.d.ts +5 -4
  464. package/resources/models.d.ts.map +1 -1
  465. package/resources/models.js +1 -1
  466. package/resources/models.js.map +1 -1
  467. package/resources/models.mjs +1 -1
  468. package/resources/models.mjs.map +1 -1
  469. package/resources/top-level.d.mts +64 -0
  470. package/resources/top-level.d.mts.map +1 -0
  471. package/resources/top-level.d.ts.map +1 -1
  472. package/resources.d.mts +2 -0
  473. package/resources.d.mts.map +1 -0
  474. package/resources.d.ts.map +1 -1
  475. package/resources.js +2 -15
  476. package/resources.js.map +1 -1
  477. package/src/api-promise.ts +2 -0
  478. package/src/client.ts +964 -0
  479. package/src/core/README.md +3 -0
  480. package/src/core/api-promise.ts +92 -0
  481. package/src/core/error.ts +130 -0
  482. package/src/core/resource.ts +11 -0
  483. package/src/core/streaming.ts +334 -0
  484. package/src/core/uploads.ts +2 -0
  485. package/src/error.ts +2 -130
  486. package/src/index.ts +5 -421
  487. package/src/internal/README.md +3 -0
  488. package/src/internal/builtin-types.ts +93 -0
  489. package/src/internal/decoders/line.ts +12 -53
  490. package/src/internal/detect-platform.ts +196 -0
  491. package/src/internal/errors.ts +33 -0
  492. package/src/internal/headers.ts +97 -0
  493. package/src/internal/parse.ts +64 -0
  494. package/src/internal/request-options.ts +93 -0
  495. package/src/internal/shim-types.ts +26 -0
  496. package/src/internal/shims.ts +107 -0
  497. package/src/internal/to-file.ts +154 -0
  498. package/src/internal/types.ts +95 -0
  499. package/src/internal/uploads.ts +187 -0
  500. package/src/internal/utils/base64.ts +40 -0
  501. package/src/internal/utils/bytes.ts +32 -0
  502. package/src/internal/utils/env.ts +18 -0
  503. package/src/internal/utils/log.ts +126 -0
  504. package/src/internal/utils/path.ts +88 -0
  505. package/src/internal/utils/sleep.ts +3 -0
  506. package/src/internal/utils/uuid.ts +17 -0
  507. package/src/internal/utils/values.ts +105 -0
  508. package/src/internal/utils.ts +8 -0
  509. package/src/lib/AbstractChatCompletionRunner.ts +7 -7
  510. package/src/lib/ChatCompletionRunner.ts +1 -1
  511. package/src/lib/ChatCompletionStream.ts +8 -9
  512. package/src/lib/ChatCompletionStreamingRunner.ts +1 -2
  513. package/src/lib/chatCompletionUtils.ts +1 -1
  514. package/src/lib/upload.ts +7 -12
  515. package/src/resource.ts +2 -11
  516. package/src/resources/audio/audio.ts +10 -10
  517. package/src/resources/audio/transcriptions.ts +14 -10
  518. package/src/resources/audio/translations.ts +14 -10
  519. package/src/resources/batches.ts +8 -6
  520. package/src/resources/chat/chat.ts +3 -3
  521. package/src/resources/chat/completions.ts +23 -11
  522. package/src/resources/chat/index.ts +1 -0
  523. package/src/resources/code-interpreter/code-interpreter.ts +4 -6
  524. package/src/resources/code-interpreter/sessions.ts +4 -3
  525. package/src/resources/completions.ts +8 -8
  526. package/src/resources/embeddings.ts +4 -3
  527. package/src/resources/endpoints.ts +18 -21
  528. package/src/resources/files.ts +15 -12
  529. package/src/resources/fine-tune.ts +15 -19
  530. package/src/resources/hardware.ts +6 -11
  531. package/src/resources/images.ts +4 -3
  532. package/src/resources/jobs.ts +7 -5
  533. package/src/resources/models.ts +5 -4
  534. package/src/streaming.ts +2 -311
  535. package/src/tsconfig.json +2 -2
  536. package/src/uploads.ts +2 -255
  537. package/src/version.ts +1 -1
  538. package/streaming.d.mts +2 -0
  539. package/streaming.d.mts.map +1 -0
  540. package/streaming.d.ts +1 -31
  541. package/streaming.d.ts.map +1 -1
  542. package/streaming.js +3 -264
  543. package/streaming.js.map +1 -1
  544. package/streaming.mjs +1 -261
  545. package/streaming.mjs.map +1 -1
  546. package/uploads.d.mts +2 -0
  547. package/uploads.d.mts.map +1 -0
  548. package/uploads.d.ts +1 -74
  549. package/uploads.d.ts.map +1 -1
  550. package/uploads.js +3 -168
  551. package/uploads.js.map +1 -1
  552. package/uploads.mjs +1 -157
  553. package/uploads.mjs.map +1 -1
  554. package/version.d.mts +2 -0
  555. package/version.d.mts.map +1 -0
  556. package/version.d.ts +1 -1
  557. package/version.js +1 -1
  558. package/version.mjs +1 -1
  559. package/_shims/MultipartBody.d.ts +0 -9
  560. package/_shims/MultipartBody.d.ts.map +0 -1
  561. package/_shims/MultipartBody.js +0 -16
  562. package/_shims/MultipartBody.js.map +0 -1
  563. package/_shims/MultipartBody.mjs +0 -12
  564. package/_shims/MultipartBody.mjs.map +0 -1
  565. package/_shims/README.md +0 -46
  566. package/_shims/auto/runtime-bun.d.ts +0 -5
  567. package/_shims/auto/runtime-bun.d.ts.map +0 -1
  568. package/_shims/auto/runtime-bun.js +0 -21
  569. package/_shims/auto/runtime-bun.js.map +0 -1
  570. package/_shims/auto/runtime-bun.mjs +0 -2
  571. package/_shims/auto/runtime-bun.mjs.map +0 -1
  572. package/_shims/auto/runtime-node.d.ts +0 -5
  573. package/_shims/auto/runtime-node.d.ts.map +0 -1
  574. package/_shims/auto/runtime-node.js +0 -21
  575. package/_shims/auto/runtime-node.js.map +0 -1
  576. package/_shims/auto/runtime-node.mjs +0 -2
  577. package/_shims/auto/runtime-node.mjs.map +0 -1
  578. package/_shims/auto/runtime.d.ts +0 -5
  579. package/_shims/auto/runtime.d.ts.map +0 -1
  580. package/_shims/auto/runtime.js +0 -21
  581. package/_shims/auto/runtime.js.map +0 -1
  582. package/_shims/auto/runtime.mjs +0 -2
  583. package/_shims/auto/runtime.mjs.map +0 -1
  584. package/_shims/auto/types-node.d.ts +0 -5
  585. package/_shims/auto/types-node.d.ts.map +0 -1
  586. package/_shims/auto/types-node.js +0 -21
  587. package/_shims/auto/types-node.js.map +0 -1
  588. package/_shims/auto/types-node.mjs +0 -2
  589. package/_shims/auto/types-node.mjs.map +0 -1
  590. package/_shims/auto/types.d.ts +0 -101
  591. package/_shims/auto/types.js +0 -3
  592. package/_shims/auto/types.mjs +0 -3
  593. package/_shims/bun-runtime.d.ts +0 -6
  594. package/_shims/bun-runtime.d.ts.map +0 -1
  595. package/_shims/bun-runtime.js +0 -14
  596. package/_shims/bun-runtime.js.map +0 -1
  597. package/_shims/bun-runtime.mjs +0 -10
  598. package/_shims/bun-runtime.mjs.map +0 -1
  599. package/_shims/index.d.ts +0 -83
  600. package/_shims/index.js +0 -17
  601. package/_shims/index.mjs +0 -11
  602. package/_shims/manual-types.d.ts +0 -12
  603. package/_shims/manual-types.js +0 -3
  604. package/_shims/manual-types.mjs +0 -3
  605. package/_shims/node-runtime.d.ts +0 -3
  606. package/_shims/node-runtime.d.ts.map +0 -1
  607. package/_shims/node-runtime.js +0 -89
  608. package/_shims/node-runtime.js.map +0 -1
  609. package/_shims/node-runtime.mjs +0 -56
  610. package/_shims/node-runtime.mjs.map +0 -1
  611. package/_shims/node-types.d.ts +0 -42
  612. package/_shims/node-types.js +0 -3
  613. package/_shims/node-types.mjs +0 -3
  614. package/_shims/registry.d.ts +0 -37
  615. package/_shims/registry.d.ts.map +0 -1
  616. package/_shims/registry.js +0 -41
  617. package/_shims/registry.js.map +0 -1
  618. package/_shims/registry.mjs +0 -37
  619. package/_shims/registry.mjs.map +0 -1
  620. package/_shims/web-runtime.d.ts +0 -5
  621. package/_shims/web-runtime.d.ts.map +0 -1
  622. package/_shims/web-runtime.js +0 -78
  623. package/_shims/web-runtime.js.map +0 -1
  624. package/_shims/web-runtime.mjs +0 -71
  625. package/_shims/web-runtime.mjs.map +0 -1
  626. package/_shims/web-types.d.ts +0 -83
  627. package/_shims/web-types.js +0 -3
  628. package/_shims/web-types.mjs +0 -3
  629. package/core.d.ts +0 -257
  630. package/core.d.ts.map +0 -1
  631. package/core.js +0 -935
  632. package/core.js.map +0 -1
  633. package/core.mjs +0 -903
  634. package/core.mjs.map +0 -1
  635. package/internal/stream-utils.d.ts +0 -8
  636. package/internal/stream-utils.d.ts.map +0 -1
  637. package/internal/stream-utils.js +0 -39
  638. package/internal/stream-utils.js.map +0 -1
  639. package/internal/stream-utils.mjs +0 -35
  640. package/internal/stream-utils.mjs.map +0 -1
  641. package/shims/node.d.ts +0 -30
  642. package/shims/node.d.ts.map +0 -1
  643. package/shims/node.js +0 -31
  644. package/shims/node.js.map +0 -1
  645. package/shims/node.mjs +0 -5
  646. package/shims/node.mjs.map +0 -1
  647. package/shims/web.d.ts +0 -26
  648. package/shims/web.d.ts.map +0 -1
  649. package/shims/web.js +0 -31
  650. package/shims/web.js.map +0 -1
  651. package/shims/web.mjs +0 -5
  652. package/shims/web.mjs.map +0 -1
  653. package/src/_shims/MultipartBody.ts +0 -9
  654. package/src/_shims/README.md +0 -46
  655. package/src/_shims/auto/runtime-bun.ts +0 -4
  656. package/src/_shims/auto/runtime-node.ts +0 -4
  657. package/src/_shims/auto/runtime.ts +0 -4
  658. package/src/_shims/auto/types-node.ts +0 -4
  659. package/src/_shims/auto/types.d.ts +0 -101
  660. package/src/_shims/auto/types.js +0 -3
  661. package/src/_shims/auto/types.mjs +0 -3
  662. package/src/_shims/bun-runtime.ts +0 -14
  663. package/src/_shims/index.d.ts +0 -83
  664. package/src/_shims/index.js +0 -17
  665. package/src/_shims/index.mjs +0 -11
  666. package/src/_shims/manual-types.d.ts +0 -12
  667. package/src/_shims/manual-types.js +0 -3
  668. package/src/_shims/manual-types.mjs +0 -3
  669. package/src/_shims/node-runtime.ts +0 -81
  670. package/src/_shims/node-types.d.ts +0 -42
  671. package/src/_shims/node-types.js +0 -3
  672. package/src/_shims/node-types.mjs +0 -3
  673. package/src/_shims/registry.ts +0 -67
  674. package/src/_shims/web-runtime.ts +0 -103
  675. package/src/_shims/web-types.d.ts +0 -83
  676. package/src/_shims/web-types.js +0 -3
  677. package/src/_shims/web-types.mjs +0 -3
  678. package/src/core.ts +0 -1252
  679. package/src/internal/stream-utils.ts +0 -32
  680. package/src/shims/node.ts +0 -50
  681. package/src/shims/web.ts +0 -50
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.21.0 (2025-07-24)
4
+
5
+ Full Changelog: [v0.20.0...v0.21.0](https://github.com/togethercomputer/together-typescript/compare/v0.20.0...v0.21.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** api update ([628189f](https://github.com/togethercomputer/together-typescript/commit/628189f9e751e0ec8eeae733aecd210dbd901793))
10
+ * **api:** api update ([ef03895](https://github.com/togethercomputer/together-typescript/commit/ef03895d2f6f299939c8bec0bb0c6da0543fb8f2))
11
+ * **api:** api update ([35c3a4e](https://github.com/togethercomputer/together-typescript/commit/35c3a4e77ed9bab9708465a3d2da22519814fbc0))
12
+ * **api:** api update ([03aed33](https://github.com/togethercomputer/together-typescript/commit/03aed3300c951b08ef446b099406ab2a5299ea6b))
13
+ * **api:** manual updates ([96dff27](https://github.com/togethercomputer/together-typescript/commit/96dff2779d938435fed7ff05c10ceb585a9d7a97))
14
+ * **api:** manual updates ([bdf705c](https://github.com/togethercomputer/together-typescript/commit/bdf705c5ee169120e7f44f7e5f18b2be38edf8c3))
15
+ * **api:** Update stainless sdk ([9fb6846](https://github.com/togethercomputer/together-typescript/commit/9fb68467529945ccbc40c66a477815ac5a09545c))
16
+ * **api:** Upgrade Stainless sdk ([8c6dc1c](https://github.com/togethercomputer/together-typescript/commit/8c6dc1c700964cb299da982b07e4b8ee7fbe1abb))
17
+
3
18
  ## 0.20.0 (2025-07-10)
4
19
 
5
20
  Full Changelog: [v0.19.0...v0.20.0](https://github.com/togethercomputer/together-typescript/compare/v0.19.0...v0.20.0)
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # Together Node API Library
1
+ # Together TypeScript API Library
2
2
 
3
- [![NPM version](https://img.shields.io/npm/v/together-ai.svg)](https://npmjs.org/package/together-ai) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/together-ai)
3
+ [![NPM version](<https://img.shields.io/npm/v/together-ai.svg?label=npm%20(stable)>)](https://npmjs.org/package/together-ai) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/together-ai)
4
4
 
5
5
  This library provides convenient access to the Together REST API from server-side TypeScript or JavaScript.
6
6
 
@@ -88,7 +88,6 @@ Request parameters that correspond to file uploads can be passed in many differe
88
88
 
89
89
  ```ts
90
90
  import fs from 'fs';
91
- import fetch from 'node-fetch';
92
91
  import Together, { toFile } from 'together-ai';
93
92
 
94
93
  const client = new Together();
@@ -211,8 +210,10 @@ Note that requests which time out will be [retried twice by default](#retries).
211
210
  ### Accessing raw Response data (e.g., headers)
212
211
 
213
212
  The "raw" `Response` returned by `fetch()` can be accessed through the `.asResponse()` method on the `APIPromise` type that all methods return.
213
+ This method returns as soon as the headers for a successful response are received and does not consume the response body, so you are free to write custom parsing or streaming logic.
214
214
 
215
215
  You can also use the `.withResponse()` method to get the raw `Response` along with the parsed data.
216
+ Unlike `.asResponse()` this method consumes the body, returning once it is parsed.
216
217
 
217
218
  <!-- prettier-ignore -->
218
219
  ```ts
@@ -237,6 +238,59 @@ console.log(raw.headers.get('X-My-Header'));
237
238
  console.log(chatCompletion.choices);
238
239
  ```
239
240
 
241
+ ### Logging
242
+
243
+ > [!IMPORTANT]
244
+ > All log messages are intended for debugging only. The format and content of log messages
245
+ > may change between releases.
246
+
247
+ #### Log levels
248
+
249
+ The log level can be configured in two ways:
250
+
251
+ 1. Via the `TOGETHER_LOG` environment variable
252
+ 2. Using the `logLevel` client option (overrides the environment variable if set)
253
+
254
+ ```ts
255
+ import Together from 'together-ai';
256
+
257
+ const client = new Together({
258
+ logLevel: 'debug', // Show all log messages
259
+ });
260
+ ```
261
+
262
+ Available log levels, from most to least verbose:
263
+
264
+ - `'debug'` - Show debug messages, info, warnings, and errors
265
+ - `'info'` - Show info messages, warnings, and errors
266
+ - `'warn'` - Show warnings and errors (default)
267
+ - `'error'` - Show only errors
268
+ - `'off'` - Disable all logging
269
+
270
+ At the `'debug'` level, all HTTP requests and responses are logged, including headers and bodies.
271
+ Some authentication-related headers are redacted, but sensitive data in request and response bodies
272
+ may still be visible.
273
+
274
+ #### Custom logger
275
+
276
+ By default, this library logs to `globalThis.console`. You can also provide a custom logger.
277
+ Most logging libraries are supported, including [pino](https://www.npmjs.com/package/pino), [winston](https://www.npmjs.com/package/winston), [bunyan](https://www.npmjs.com/package/bunyan), [consola](https://www.npmjs.com/package/consola), [signale](https://www.npmjs.com/package/signale), and [@std/log](https://jsr.io/@std/log). If your logger doesn't work, please open an issue.
278
+
279
+ When providing a custom logger, the `logLevel` option still controls which messages are emitted, messages
280
+ below the configured level will not be sent to your logger.
281
+
282
+ ```ts
283
+ import Together from 'together-ai';
284
+ import pino from 'pino';
285
+
286
+ const logger = pino();
287
+
288
+ const client = new Together({
289
+ logger: logger.child({ name: 'Together' }),
290
+ logLevel: 'debug', // Send all messages to pino, allowing it to filter
291
+ });
292
+ ```
293
+
240
294
  ### Making custom/undocumented requests
241
295
 
242
296
  This library is typed for convenient access to the documented API. If you need to access undocumented
@@ -261,9 +315,8 @@ parameter. This library doesn't validate at runtime that the request matches the
261
315
  send will be sent as-is.
262
316
 
263
317
  ```ts
264
- client.foo.create({
265
- foo: 'my_param',
266
- bar: 12,
318
+ client.chat.completions.create({
319
+ // ...
267
320
  // @ts-expect-error baz is not yet public
268
321
  baz: 'undocumented option',
269
322
  });
@@ -283,72 +336,85 @@ validate or strip extra properties from the response from the API.
283
336
 
284
337
  ### Customizing the fetch client
285
338
 
286
- By default, this library uses `node-fetch` in Node, and expects a global `fetch` function in other environments.
339
+ By default, this library expects a global `fetch` function is defined.
287
340
 
288
- If you would prefer to use a global, web-standards-compliant `fetch` function even in a Node environment,
289
- (for example, if you are running Node with `--experimental-fetch` or using NextJS which polyfills with `undici`),
290
- add the following import before your first import `from "Together"`:
341
+ If you want to use a different `fetch` function, you can either polyfill the global:
291
342
 
292
343
  ```ts
293
- // Tell TypeScript and the package to use the global web fetch instead of node-fetch.
294
- // Note, despite the name, this does not add any polyfills, but expects them to be provided if needed.
295
- import 'together-ai/shims/web';
296
- import Together from 'together-ai';
344
+ import fetch from 'my-fetch';
345
+
346
+ globalThis.fetch = fetch;
297
347
  ```
298
348
 
299
- To do the inverse, add `import "together-ai/shims/node"` (which does import polyfills).
300
- This can also be useful if you are getting the wrong TypeScript types for `Response` ([more details](https://github.com/togethercomputer/together-typescript/tree/main/src/_shims#readme)).
349
+ Or pass it to the client:
301
350
 
302
- ### Logging and middleware
351
+ ```ts
352
+ import Together from 'together-ai';
353
+ import fetch from 'my-fetch';
354
+
355
+ const client = new Together({ fetch });
356
+ ```
303
357
 
304
- You may also provide a custom `fetch` function when instantiating the client,
305
- which can be used to inspect or alter the `Request` or `Response` before/after each request:
358
+ ### Fetch options
359
+
360
+ If you want to set custom `fetch` options without overriding the `fetch` function, you can provide a `fetchOptions` object when instantiating the client or making a request. (Request-specific options override client options.)
306
361
 
307
362
  ```ts
308
- import { fetch } from 'undici'; // as one example
309
363
  import Together from 'together-ai';
310
364
 
311
365
  const client = new Together({
312
- fetch: async (url: RequestInfo, init?: RequestInit): Promise<Response> => {
313
- console.log('About to make a request', url, init);
314
- const response = await fetch(url, init);
315
- console.log('Got response', response);
316
- return response;
366
+ fetchOptions: {
367
+ // `RequestInit` options
317
368
  },
318
369
  });
319
370
  ```
320
371
 
321
- Note that if given a `DEBUG=true` environment variable, this library will log all requests and responses automatically.
322
- This is intended for debugging purposes only and may change in the future without notice.
323
-
324
- ### Configuring an HTTP(S) Agent (e.g., for proxies)
372
+ #### Configuring proxies
325
373
 
326
- By default, this library uses a stable agent for all http/https requests to reuse TCP connections, eliminating many TCP & TLS handshakes and shaving around 100ms off most requests.
374
+ To modify proxy behavior, you can provide custom `fetchOptions` that add runtime-specific proxy
375
+ options to requests:
327
376
 
328
- If you would like to disable or customize this behavior, for example to use the API behind a proxy, you can pass an `httpAgent` which is used for all requests (be they http or https), for example:
377
+ <img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/node.svg" align="top" width="18" height="21"> **Node** <sup>[[docs](https://github.com/nodejs/undici/blob/main/docs/docs/api/ProxyAgent.md#example---proxyagent-with-fetch)]</sup>
329
378
 
330
- <!-- prettier-ignore -->
331
379
  ```ts
332
- import http from 'http';
333
- import { HttpsProxyAgent } from 'https-proxy-agent';
380
+ import Together from 'together-ai';
381
+ import * as undici from 'undici';
334
382
 
335
- // Configure the default for all requests:
383
+ const proxyAgent = new undici.ProxyAgent('http://localhost:8888');
336
384
  const client = new Together({
337
- httpAgent: new HttpsProxyAgent(process.env.PROXY_URL),
385
+ fetchOptions: {
386
+ dispatcher: proxyAgent,
387
+ },
338
388
  });
389
+ ```
339
390
 
340
- // Override per-request:
341
- await client.chat.completions.create(
342
- {
343
- messages: [{ role: 'user', content: 'Say this is a test' }],
344
- model: 'mistralai/Mixtral-8x7B-Instruct-v0.1',
391
+ <img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/bun.svg" align="top" width="18" height="21"> **Bun** <sup>[[docs](https://bun.sh/guides/http/proxy)]</sup>
392
+
393
+ ```ts
394
+ import Together from 'together-ai';
395
+
396
+ const client = new Together({
397
+ fetchOptions: {
398
+ proxy: 'http://localhost:8888',
345
399
  },
346
- {
347
- httpAgent: new http.Agent({ keepAlive: false }),
400
+ });
401
+ ```
402
+
403
+ <img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/deno.svg" align="top" width="18" height="21"> **Deno** <sup>[[docs](https://docs.deno.com/api/deno/~/Deno.createHttpClient)]</sup>
404
+
405
+ ```ts
406
+ import Together from 'npm:together-ai';
407
+
408
+ const httpClient = Deno.createHttpClient({ proxy: { url: 'http://localhost:8888' } });
409
+ const client = new Together({
410
+ fetchOptions: {
411
+ client: httpClient,
348
412
  },
349
- );
413
+ });
350
414
  ```
351
415
 
416
+ ## Frequently Asked Questions
417
+
352
418
  ## Semantic versioning
353
419
 
354
420
  This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:
@@ -363,12 +429,12 @@ We are keen for your feedback; please open an [issue](https://www.github.com/tog
363
429
 
364
430
  ## Requirements
365
431
 
366
- TypeScript >= 4.5 is supported.
432
+ TypeScript >= 4.9 is supported.
367
433
 
368
434
  The following runtimes are supported:
369
435
 
370
436
  - Web browsers (Up-to-date Chrome, Firefox, Safari, Edge, and more)
371
- - Node.js 18 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions.
437
+ - Node.js 20 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions.
372
438
  - Deno v1.28.0 or higher.
373
439
  - Bun 1.0 or later.
374
440
  - Cloudflare Workers.
@@ -0,0 +1,2 @@
1
+ export * from "./core/api-promise.mjs";
2
+ //# sourceMappingURL=api-promise.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-promise.d.mts","sourceRoot":"","sources":["src/api-promise.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export * from "./core/api-promise.js";
2
+ //# sourceMappingURL=api-promise.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-promise.d.ts","sourceRoot":"","sources":["src/api-promise.ts"],"names":[],"mappings":""}
package/api-promise.js ADDED
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("./internal/tslib.js");
4
+ /** @deprecated Import from ./core/api-promise instead */
5
+ tslib_1.__exportStar(require("./core/api-promise.js"), exports);
6
+ //# sourceMappingURL=api-promise.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-promise.js","sourceRoot":"","sources":["src/api-promise.ts"],"names":[],"mappings":";;;AAAA,yDAAyD;AACzD,gEAAmC"}
@@ -0,0 +1,2 @@
1
+ export * from "./core/api-promise.mjs";
2
+ //# sourceMappingURL=api-promise.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-promise.mjs","sourceRoot":"","sources":["src/api-promise.ts"],"names":[],"mappings":""}
package/bin/cli ADDED
@@ -0,0 +1,53 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { spawnSync } = require('child_process');
4
+
5
+ const commands = {
6
+ migrate: {
7
+ description:
8
+ 'Run migrations to update your code using together-ai@0.20.0 to be compatible with together-ai@0.21.0',
9
+ fn: () => {
10
+ const result = spawnSync(
11
+ 'npx',
12
+ [
13
+ '-y',
14
+ 'https://github.com/stainless-api/migrate-ts/releases/download/0.0.2/stainless-api-migrate-0.0.2-6.tgz',
15
+ '--migrationConfig',
16
+ require.resolve('./migration-config.json'),
17
+ ...process.argv.slice(3),
18
+ ],
19
+ { stdio: 'inherit' },
20
+ );
21
+ if (result.status !== 0) {
22
+ process.exit(result.status);
23
+ }
24
+ },
25
+ },
26
+ };
27
+
28
+ function exitWithHelp() {
29
+ console.log(`Usage: together-ai <subcommand>`);
30
+ console.log();
31
+ console.log('Subcommands:');
32
+
33
+ for (const [name, info] of Object.entries(commands)) {
34
+ console.log(` ${name} ${info.description}`);
35
+ }
36
+
37
+ console.log();
38
+ process.exit(1);
39
+ }
40
+
41
+ if (process.argv.length < 3) {
42
+ exitWithHelp();
43
+ }
44
+
45
+ const commandName = process.argv[2];
46
+
47
+ const command = commands[commandName];
48
+ if (!command) {
49
+ console.log(`Unknown subcommand ${commandName}.`);
50
+ exitWithHelp();
51
+ }
52
+
53
+ command.fn();
@@ -0,0 +1,6 @@
1
+ {
2
+ "pkg": "together-ai",
3
+ "githubRepo": "https://github.com/togethercomputer/together-typescript",
4
+ "clientClass": "Together",
5
+ "methods": []
6
+ }
package/client.d.mts ADDED
@@ -0,0 +1,237 @@
1
+ import type { RequestInit, RequestInfo } from "./internal/builtin-types.mjs";
2
+ import type { PromiseOrValue, MergedRequestInit, FinalizedRequestInit } from "./internal/types.mjs";
3
+ export type { Logger, LogLevel } from "./internal/utils/log.mjs";
4
+ import * as Opts from "./internal/request-options.mjs";
5
+ import * as Errors from "./core/error.mjs";
6
+ import * as Uploads from "./core/uploads.mjs";
7
+ import * as API from "./resources/index.mjs";
8
+ import * as TopLevelAPI from "./resources/top-level.mjs";
9
+ import { RerankParams, RerankResponse } from "./resources/top-level.mjs";
10
+ import { APIPromise } from "./core/api-promise.mjs";
11
+ import { BatchCreateParams, BatchCreateResponse, BatchListResponse, BatchRetrieveResponse, Batches } from "./resources/batches.mjs";
12
+ import { Completion, CompletionChunk, CompletionCreateParams, CompletionCreateParamsNonStreaming, CompletionCreateParamsStreaming, Completions, LogProbs, ToolChoice, Tools } from "./resources/completions.mjs";
13
+ import { Embedding, EmbeddingCreateParams, Embeddings } from "./resources/embeddings.mjs";
14
+ import { Autoscaling, EndpointCreateParams, EndpointCreateResponse, EndpointListParams, EndpointListResponse, EndpointRetrieveResponse, EndpointUpdateParams, EndpointUpdateResponse, Endpoints } from "./resources/endpoints.mjs";
15
+ import { FileDeleteResponse, FileListResponse, FileObject, FilePurpose, FileRetrieveResponse, FileType, FileUploadParams, FileUploadResponse, Files } from "./resources/files.mjs";
16
+ import { CosineLrSchedulerArgs, FineTune, FineTuneCancelResponse, FineTuneCreateParams, FineTuneCreateResponse, FineTuneDownloadParams, FineTuneDownloadResponse, FineTuneEvent, FineTuneListEventsResponse, FineTuneListResponse, FineTuneResource, FineTuneRetrieveCheckpointsResponse, FullTrainingType, LinearLrSchedulerArgs, LoRaTrainingType, LrScheduler, TrainingMethodDpo, TrainingMethodSft } from "./resources/fine-tune.mjs";
17
+ import { Hardware, HardwareListParams, HardwareListResponse } from "./resources/hardware.mjs";
18
+ import { ImageCreateParams, ImageDataB64, ImageDataURL, ImageFile, Images } from "./resources/images.mjs";
19
+ import { JobListResponse, JobRetrieveResponse, Jobs } from "./resources/jobs.mjs";
20
+ import { ModelListResponse, ModelUploadParams, ModelUploadResponse, Models } from "./resources/models.mjs";
21
+ import { Audio, AudioCreateParams, AudioCreateParamsNonStreaming, AudioCreateParamsStreaming, AudioFile, AudioSpeechStreamChunk } from "./resources/audio/audio.mjs";
22
+ import { Chat } from "./resources/chat/chat.mjs";
23
+ import { CodeInterpreter, CodeInterpreterExecuteParams, ExecuteResponse } from "./resources/code-interpreter/code-interpreter.mjs";
24
+ import { type Fetch } from "./internal/builtin-types.mjs";
25
+ import { HeadersLike, NullableHeaders } from "./internal/headers.mjs";
26
+ import { FinalRequestOptions, RequestOptions } from "./internal/request-options.mjs";
27
+ import { type LogLevel, type Logger } from "./internal/utils/log.mjs";
28
+ export interface ClientOptions {
29
+ /**
30
+ * Defaults to process.env['TOGETHER_API_KEY'].
31
+ */
32
+ apiKey?: string | undefined;
33
+ /**
34
+ * Override the default base URL for the API, e.g., "https://api.example.com/v2/"
35
+ *
36
+ * Defaults to process.env['TOGETHER_BASE_URL'].
37
+ */
38
+ baseURL?: string | null | undefined;
39
+ /**
40
+ * The maximum amount of time (in milliseconds) that the client should wait for a response
41
+ * from the server before timing out a single request.
42
+ *
43
+ * Note that request timeouts are retried by default, so in a worst-case scenario you may wait
44
+ * much longer than this timeout before the promise succeeds or fails.
45
+ *
46
+ * @unit milliseconds
47
+ */
48
+ timeout?: number | undefined;
49
+ /**
50
+ * Additional `RequestInit` options to be passed to `fetch` calls.
51
+ * Properties will be overridden by per-request `fetchOptions`.
52
+ */
53
+ fetchOptions?: MergedRequestInit | undefined;
54
+ /**
55
+ * Specify a custom `fetch` function implementation.
56
+ *
57
+ * If not provided, we expect that `fetch` is defined globally.
58
+ */
59
+ fetch?: Fetch | undefined;
60
+ /**
61
+ * The maximum number of times that the client will retry a request in case of a
62
+ * temporary failure, like a network error or a 5XX error from the server.
63
+ *
64
+ * @default 5
65
+ */
66
+ maxRetries?: number | undefined;
67
+ /**
68
+ * Default headers to include with every request to the API.
69
+ *
70
+ * These can be removed in individual requests by explicitly setting the
71
+ * header to `null` in request options.
72
+ */
73
+ defaultHeaders?: HeadersLike | undefined;
74
+ /**
75
+ * Default query parameters to include with every request to the API.
76
+ *
77
+ * These can be removed in individual requests by explicitly setting the
78
+ * param to `undefined` in request options.
79
+ */
80
+ defaultQuery?: Record<string, string | undefined> | undefined;
81
+ /**
82
+ * Set the log level.
83
+ *
84
+ * Defaults to process.env['TOGETHER_LOG'] or 'warn' if it isn't set.
85
+ */
86
+ logLevel?: LogLevel | undefined;
87
+ /**
88
+ * Set the logger.
89
+ *
90
+ * Defaults to globalThis.console.
91
+ */
92
+ logger?: Logger | undefined;
93
+ }
94
+ /**
95
+ * API Client for interfacing with the Together API.
96
+ */
97
+ export declare class Together {
98
+ #private;
99
+ apiKey: string;
100
+ baseURL: string;
101
+ maxRetries: number;
102
+ timeout: number;
103
+ logger: Logger | undefined;
104
+ logLevel: LogLevel | undefined;
105
+ fetchOptions: MergedRequestInit | undefined;
106
+ private fetch;
107
+ protected idempotencyHeader?: string;
108
+ private _options;
109
+ /**
110
+ * API Client for interfacing with the Together API.
111
+ *
112
+ * @param {string | undefined} [opts.apiKey=process.env['TOGETHER_API_KEY'] ?? undefined]
113
+ * @param {string} [opts.baseURL=process.env['TOGETHER_BASE_URL'] ?? https://api.together.xyz/v1] - Override the default base URL for the API.
114
+ * @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
115
+ * @param {MergedRequestInit} [opts.fetchOptions] - Additional `RequestInit` options to be passed to `fetch` calls.
116
+ * @param {Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
117
+ * @param {number} [opts.maxRetries=5] - The maximum number of times the client will retry a request.
118
+ * @param {HeadersLike} opts.defaultHeaders - Default headers to include with every request to the API.
119
+ * @param {Record<string, string | undefined>} opts.defaultQuery - Default query parameters to include with every request to the API.
120
+ */
121
+ constructor({ baseURL, apiKey, ...opts }?: ClientOptions);
122
+ /**
123
+ * Create a new client instance re-using the same options given to the current client with optional overriding.
124
+ */
125
+ withOptions(options: Partial<ClientOptions>): this;
126
+ /**
127
+ * Query a reranker model
128
+ *
129
+ * @example
130
+ * ```ts
131
+ * const response = await client.rerank({
132
+ * documents: [
133
+ * { title: 'bar', text: 'bar' },
134
+ * { title: 'bar', text: 'bar' },
135
+ * { title: 'bar', text: 'bar' },
136
+ * { title: 'bar', text: 'bar' },
137
+ * ],
138
+ * model: 'Salesforce/Llama-Rank-V1',
139
+ * query: 'What animals can I find near Peru?',
140
+ * });
141
+ * ```
142
+ */
143
+ rerank(body: TopLevelAPI.RerankParams, options?: RequestOptions): APIPromise<TopLevelAPI.RerankResponse>;
144
+ protected defaultQuery(): Record<string, string | undefined> | undefined;
145
+ protected validateHeaders({ values, nulls }: NullableHeaders): void;
146
+ protected authHeaders(opts: FinalRequestOptions): Promise<NullableHeaders | undefined>;
147
+ /**
148
+ * Basic re-implementation of `qs.stringify` for primitive types.
149
+ */
150
+ protected stringifyQuery(query: Record<string, unknown>): string;
151
+ private getUserAgent;
152
+ protected defaultIdempotencyKey(): string;
153
+ protected makeStatusError(status: number, error: Object, message: string | undefined, headers: Headers): Errors.APIError;
154
+ buildURL(path: string, query: Record<string, unknown> | null | undefined, defaultBaseURL?: string | undefined): string;
155
+ /**
156
+ * Used as a callback for mutating the given `FinalRequestOptions` object.
157
+ */
158
+ protected prepareOptions(options: FinalRequestOptions): Promise<void>;
159
+ /**
160
+ * Used as a callback for mutating the given `RequestInit` object.
161
+ *
162
+ * This is useful for cases where you want to add certain headers based off of
163
+ * the request properties, e.g. `method` or `url`.
164
+ */
165
+ protected prepareRequest(request: RequestInit, { url, options }: {
166
+ url: string;
167
+ options: FinalRequestOptions;
168
+ }): Promise<void>;
169
+ get<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp>;
170
+ post<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp>;
171
+ patch<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp>;
172
+ put<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp>;
173
+ delete<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp>;
174
+ private methodRequest;
175
+ request<Rsp>(options: PromiseOrValue<FinalRequestOptions>, remainingRetries?: number | null): APIPromise<Rsp>;
176
+ private makeRequest;
177
+ fetchWithTimeout(url: RequestInfo, init: RequestInit | undefined, ms: number, controller: AbortController): Promise<Response>;
178
+ private shouldRetry;
179
+ private retryRequest;
180
+ private calculateDefaultRetryTimeoutMillis;
181
+ buildRequest(inputOptions: FinalRequestOptions, { retryCount }?: {
182
+ retryCount?: number;
183
+ }): Promise<{
184
+ req: FinalizedRequestInit;
185
+ url: string;
186
+ timeout: number;
187
+ }>;
188
+ private buildHeaders;
189
+ private buildBody;
190
+ static Together: typeof Together;
191
+ static DEFAULT_TIMEOUT: number;
192
+ static TogetherError: typeof Errors.TogetherError;
193
+ static APIError: typeof Errors.APIError;
194
+ static APIConnectionError: typeof Errors.APIConnectionError;
195
+ static APIConnectionTimeoutError: typeof Errors.APIConnectionTimeoutError;
196
+ static APIUserAbortError: typeof Errors.APIUserAbortError;
197
+ static NotFoundError: typeof Errors.NotFoundError;
198
+ static ConflictError: typeof Errors.ConflictError;
199
+ static RateLimitError: typeof Errors.RateLimitError;
200
+ static BadRequestError: typeof Errors.BadRequestError;
201
+ static AuthenticationError: typeof Errors.AuthenticationError;
202
+ static InternalServerError: typeof Errors.InternalServerError;
203
+ static PermissionDeniedError: typeof Errors.PermissionDeniedError;
204
+ static UnprocessableEntityError: typeof Errors.UnprocessableEntityError;
205
+ static toFile: typeof Uploads.toFile;
206
+ chat: API.Chat;
207
+ completions: API.Completions;
208
+ embeddings: API.Embeddings;
209
+ files: API.Files;
210
+ fineTune: API.FineTuneResource;
211
+ codeInterpreter: API.CodeInterpreter;
212
+ images: API.Images;
213
+ audio: API.Audio;
214
+ models: API.Models;
215
+ jobs: API.Jobs;
216
+ endpoints: API.Endpoints;
217
+ hardware: API.Hardware;
218
+ batches: API.Batches;
219
+ }
220
+ export declare namespace Together {
221
+ export type RequestOptions = Opts.RequestOptions;
222
+ export { type RerankResponse as RerankResponse, type RerankParams as RerankParams };
223
+ export { Chat as Chat };
224
+ export { Completions as Completions, type Completion as Completion, type CompletionChunk as CompletionChunk, type LogProbs as LogProbs, type ToolChoice as ToolChoice, type Tools as Tools, type CompletionCreateParams as CompletionCreateParams, type CompletionCreateParamsNonStreaming as CompletionCreateParamsNonStreaming, type CompletionCreateParamsStreaming as CompletionCreateParamsStreaming, };
225
+ export { Embeddings as Embeddings, type Embedding as Embedding, type EmbeddingCreateParams as EmbeddingCreateParams, };
226
+ export { Files as Files, type FileObject as FileObject, type FilePurpose as FilePurpose, type FileType as FileType, type FileRetrieveResponse as FileRetrieveResponse, type FileListResponse as FileListResponse, type FileDeleteResponse as FileDeleteResponse, type FileUploadResponse as FileUploadResponse, type FileUploadParams as FileUploadParams, };
227
+ export { FineTuneResource as FineTuneResource, type CosineLrSchedulerArgs as CosineLrSchedulerArgs, type FineTune as FineTune, type FineTuneEvent as FineTuneEvent, type FullTrainingType as FullTrainingType, type LinearLrSchedulerArgs as LinearLrSchedulerArgs, type LoRaTrainingType as LoRaTrainingType, type LrScheduler as LrScheduler, type TrainingMethodDpo as TrainingMethodDpo, type TrainingMethodSft as TrainingMethodSft, type FineTuneCreateResponse as FineTuneCreateResponse, type FineTuneListResponse as FineTuneListResponse, type FineTuneCancelResponse as FineTuneCancelResponse, type FineTuneDownloadResponse as FineTuneDownloadResponse, type FineTuneListEventsResponse as FineTuneListEventsResponse, type FineTuneRetrieveCheckpointsResponse as FineTuneRetrieveCheckpointsResponse, type FineTuneCreateParams as FineTuneCreateParams, type FineTuneDownloadParams as FineTuneDownloadParams, };
228
+ export { CodeInterpreter as CodeInterpreter, type ExecuteResponse as ExecuteResponse, type CodeInterpreterExecuteParams as CodeInterpreterExecuteParams, };
229
+ export { Images as Images, type ImageDataB64 as ImageDataB64, type ImageDataURL as ImageDataURL, type ImageFile as ImageFile, type ImageCreateParams as ImageCreateParams, };
230
+ export { Audio as Audio, type AudioFile as AudioFile, type AudioSpeechStreamChunk as AudioSpeechStreamChunk, type AudioCreateParams as AudioCreateParams, type AudioCreateParamsNonStreaming as AudioCreateParamsNonStreaming, type AudioCreateParamsStreaming as AudioCreateParamsStreaming, };
231
+ export { Models as Models, type ModelListResponse as ModelListResponse, type ModelUploadResponse as ModelUploadResponse, type ModelUploadParams as ModelUploadParams, };
232
+ export { Jobs as Jobs, type JobRetrieveResponse as JobRetrieveResponse, type JobListResponse as JobListResponse, };
233
+ export { Endpoints as Endpoints, type Autoscaling as Autoscaling, type EndpointCreateResponse as EndpointCreateResponse, type EndpointRetrieveResponse as EndpointRetrieveResponse, type EndpointUpdateResponse as EndpointUpdateResponse, type EndpointListResponse as EndpointListResponse, type EndpointCreateParams as EndpointCreateParams, type EndpointUpdateParams as EndpointUpdateParams, type EndpointListParams as EndpointListParams, };
234
+ export { Hardware as Hardware, type HardwareListResponse as HardwareListResponse, type HardwareListParams as HardwareListParams, };
235
+ export { Batches as Batches, type BatchCreateResponse as BatchCreateResponse, type BatchRetrieveResponse as BatchRetrieveResponse, type BatchListResponse as BatchListResponse, type BatchCreateParams as BatchCreateParams, };
236
+ }
237
+ //# sourceMappingURL=client.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.mts","sourceRoot":"","sources":["src/client.ts"],"names":[],"mappings":"OAEO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAY;OAC3C,KAAK,EAAc,cAAc,EAAE,iBAAiB,EAAE,oBAAoB,EAAE;YAIvE,EAAE,MAAM,EAAE,QAAQ,EAAE;OAKzB,KAAK,IAAI;OAET,KAAK,MAAM;OACX,KAAK,OAAO;OACZ,KAAK,GAAG;OACR,KAAK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