llama-stack-client 0.0.1-alpha.0 → 0.1.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 (490) hide show
  1. package/LICENSE +22 -201
  2. package/README.md +60 -26
  3. package/core.d.ts +7 -7
  4. package/core.d.ts.map +1 -1
  5. package/core.js +35 -16
  6. package/core.js.map +1 -1
  7. package/core.mjs +32 -14
  8. package/core.mjs.map +1 -1
  9. package/error.d.ts +18 -24
  10. package/error.d.ts.map +1 -1
  11. package/error.js +1 -31
  12. package/error.js.map +1 -1
  13. package/error.mjs +1 -31
  14. package/error.mjs.map +1 -1
  15. package/index.d.mts +100 -121
  16. package/index.d.ts +100 -121
  17. package/index.d.ts.map +1 -1
  18. package/index.js +90 -44
  19. package/index.js.map +1 -1
  20. package/index.mjs +74 -43
  21. package/index.mjs.map +1 -1
  22. package/internal/decoders/jsonl.d.ts +12 -0
  23. package/internal/decoders/jsonl.d.ts.map +1 -0
  24. package/internal/decoders/jsonl.js +35 -0
  25. package/internal/decoders/jsonl.js.map +1 -0
  26. package/internal/decoders/jsonl.mjs +31 -0
  27. package/internal/decoders/jsonl.mjs.map +1 -0
  28. package/internal/decoders/line.d.ts +20 -0
  29. package/internal/decoders/line.d.ts.map +1 -0
  30. package/internal/decoders/line.js +88 -0
  31. package/internal/decoders/line.js.map +1 -0
  32. package/internal/decoders/line.mjs +84 -0
  33. package/internal/decoders/line.mjs.map +1 -0
  34. package/internal/qs/formats.d.ts +6 -0
  35. package/internal/qs/formats.d.ts.map +1 -0
  36. package/internal/qs/formats.js +11 -0
  37. package/internal/qs/formats.js.map +1 -0
  38. package/internal/qs/formats.mjs +8 -0
  39. package/internal/qs/formats.mjs.map +1 -0
  40. package/internal/qs/index.d.ts +10 -0
  41. package/internal/qs/index.d.ts.map +1 -0
  42. package/internal/qs/index.js +14 -0
  43. package/internal/qs/index.js.map +1 -0
  44. package/internal/qs/index.mjs +10 -0
  45. package/internal/qs/index.mjs.map +1 -0
  46. package/internal/qs/stringify.d.ts +3 -0
  47. package/internal/qs/stringify.d.ts.map +1 -0
  48. package/internal/qs/stringify.js +280 -0
  49. package/internal/qs/stringify.js.map +1 -0
  50. package/internal/qs/stringify.mjs +276 -0
  51. package/internal/qs/stringify.mjs.map +1 -0
  52. package/internal/qs/types.d.ts +57 -0
  53. package/internal/qs/types.d.ts.map +1 -0
  54. package/internal/qs/types.js +3 -0
  55. package/internal/qs/types.js.map +1 -0
  56. package/internal/qs/types.mjs +2 -0
  57. package/internal/qs/types.mjs.map +1 -0
  58. package/internal/qs/utils.d.ts +14 -0
  59. package/internal/qs/utils.d.ts.map +1 -0
  60. package/internal/qs/utils.js +229 -0
  61. package/internal/qs/utils.js.map +1 -0
  62. package/internal/qs/utils.mjs +217 -0
  63. package/internal/qs/utils.mjs.map +1 -0
  64. package/internal/stream-utils.d.ts +8 -0
  65. package/internal/stream-utils.d.ts.map +1 -0
  66. package/internal/stream-utils.js +39 -0
  67. package/internal/stream-utils.js.map +1 -0
  68. package/internal/stream-utils.mjs +35 -0
  69. package/internal/stream-utils.mjs.map +1 -0
  70. package/package.json +8 -6
  71. package/resources/agents/agents.d.ts +22 -187
  72. package/resources/agents/agents.d.ts.map +1 -1
  73. package/resources/agents/agents.js +15 -32
  74. package/resources/agents/agents.js.map +1 -1
  75. package/resources/agents/agents.mjs +15 -32
  76. package/resources/agents/agents.mjs.map +1 -1
  77. package/resources/agents/index.d.ts +4 -4
  78. package/resources/agents/index.d.ts.map +1 -1
  79. package/resources/agents/index.js +7 -7
  80. package/resources/agents/index.js.map +1 -1
  81. package/resources/agents/index.mjs +3 -3
  82. package/resources/agents/index.mjs.map +1 -1
  83. package/resources/agents/session.d.ts +28 -0
  84. package/resources/agents/session.d.ts.map +1 -0
  85. package/resources/agents/session.js +25 -0
  86. package/resources/agents/session.js.map +1 -0
  87. package/resources/agents/session.mjs +21 -0
  88. package/resources/agents/session.mjs.map +1 -0
  89. package/resources/agents/steps.d.ts +3 -24
  90. package/resources/agents/steps.d.ts.map +1 -1
  91. package/resources/agents/steps.js +2 -14
  92. package/resources/agents/steps.js.map +1 -1
  93. package/resources/agents/steps.mjs +2 -14
  94. package/resources/agents/steps.mjs.map +1 -1
  95. package/resources/agents/turn.d.ts +169 -0
  96. package/resources/agents/turn.d.ts.map +1 -0
  97. package/resources/agents/turn.js +19 -0
  98. package/resources/agents/turn.js.map +1 -0
  99. package/resources/agents/turn.mjs +15 -0
  100. package/resources/agents/turn.mjs.map +1 -0
  101. package/resources/batch-inference.d.ts +17 -64
  102. package/resources/batch-inference.d.ts.map +1 -1
  103. package/resources/batch-inference.js +4 -26
  104. package/resources/batch-inference.js.map +1 -1
  105. package/resources/batch-inference.mjs +4 -26
  106. package/resources/batch-inference.mjs.map +1 -1
  107. package/resources/datasetio.d.ts +25 -0
  108. package/resources/datasetio.d.ts.map +1 -0
  109. package/resources/datasetio.js +19 -0
  110. package/resources/datasetio.js.map +1 -0
  111. package/resources/datasetio.mjs +15 -0
  112. package/resources/datasetio.mjs.map +1 -0
  113. package/resources/datasets.d.ts +45 -46
  114. package/resources/datasets.d.ts.map +1 -1
  115. package/resources/datasets.js +11 -35
  116. package/resources/datasets.js.map +1 -1
  117. package/resources/datasets.mjs +11 -35
  118. package/resources/datasets.mjs.map +1 -1
  119. package/resources/eval/eval.d.ts +59 -0
  120. package/resources/eval/eval.d.ts.map +1 -0
  121. package/resources/{inference/embeddings.js → eval/eval.js} +16 -20
  122. package/resources/eval/eval.js.map +1 -0
  123. package/resources/eval/eval.mjs +18 -0
  124. package/resources/eval/eval.mjs.map +1 -0
  125. package/resources/eval/index.d.ts +3 -0
  126. package/resources/eval/index.d.ts.map +1 -0
  127. package/resources/eval/index.js +9 -0
  128. package/resources/eval/index.js.map +1 -0
  129. package/resources/eval/index.mjs +4 -0
  130. package/resources/eval/index.mjs.map +1 -0
  131. package/resources/eval/jobs.d.ts +13 -0
  132. package/resources/eval/jobs.d.ts.map +1 -0
  133. package/resources/eval/jobs.js +21 -0
  134. package/resources/eval/jobs.js.map +1 -0
  135. package/resources/eval/jobs.mjs +17 -0
  136. package/resources/eval/jobs.mjs.map +1 -0
  137. package/resources/eval-tasks.d.ts +32 -0
  138. package/resources/eval-tasks.d.ts.map +1 -0
  139. package/resources/eval-tasks.js +22 -0
  140. package/resources/eval-tasks.js.map +1 -0
  141. package/resources/eval-tasks.mjs +18 -0
  142. package/resources/eval-tasks.mjs.map +1 -0
  143. package/resources/index.d.ts +23 -15
  144. package/resources/index.d.ts.map +1 -1
  145. package/resources/index.js +33 -17
  146. package/resources/index.js.map +1 -1
  147. package/resources/index.mjs +19 -11
  148. package/resources/index.mjs.map +1 -1
  149. package/resources/inference.d.ts +241 -0
  150. package/resources/inference.d.ts.map +1 -0
  151. package/resources/inference.js +29 -0
  152. package/resources/inference.js.map +1 -0
  153. package/resources/inference.mjs +25 -0
  154. package/resources/inference.mjs.map +1 -0
  155. package/resources/inspect.d.ts +26 -0
  156. package/resources/inspect.d.ts.map +1 -0
  157. package/resources/inspect.js +15 -0
  158. package/resources/inspect.js.map +1 -0
  159. package/resources/inspect.mjs +11 -0
  160. package/resources/inspect.mjs.map +1 -0
  161. package/resources/models.d.ts +21 -36
  162. package/resources/models.d.ts.map +1 -1
  163. package/resources/models.js +11 -27
  164. package/resources/models.js.map +1 -1
  165. package/resources/models.mjs +11 -27
  166. package/resources/models.mjs.map +1 -1
  167. package/resources/post-training/index.d.ts +2 -2
  168. package/resources/post-training/index.d.ts.map +1 -1
  169. package/resources/post-training/index.js +3 -3
  170. package/resources/post-training/index.js.map +1 -1
  171. package/resources/post-training/index.mjs +1 -1
  172. package/resources/post-training/index.mjs.map +1 -1
  173. package/resources/post-training/job.d.ts +40 -0
  174. package/resources/post-training/job.d.ts.map +1 -0
  175. package/resources/post-training/job.js +25 -0
  176. package/resources/post-training/job.js.map +1 -0
  177. package/resources/post-training/job.mjs +21 -0
  178. package/resources/post-training/job.mjs.map +1 -0
  179. package/resources/post-training/post-training.d.ts +95 -142
  180. package/resources/post-training/post-training.d.ts.map +1 -1
  181. package/resources/post-training/post-training.js +8 -29
  182. package/resources/post-training/post-training.js.map +1 -1
  183. package/resources/post-training/post-training.mjs +8 -29
  184. package/resources/post-training/post-training.mjs.map +1 -1
  185. package/resources/providers.d.ts +14 -0
  186. package/resources/providers.d.ts.map +1 -0
  187. package/resources/providers.js +12 -0
  188. package/resources/providers.js.map +1 -0
  189. package/resources/providers.mjs +8 -0
  190. package/resources/providers.mjs.map +1 -0
  191. package/resources/routes.d.ts +14 -0
  192. package/resources/routes.d.ts.map +1 -0
  193. package/resources/routes.js +12 -0
  194. package/resources/routes.js.map +1 -0
  195. package/resources/routes.mjs +8 -0
  196. package/resources/routes.mjs.map +1 -0
  197. package/resources/safety.d.ts +6 -29
  198. package/resources/safety.d.ts.map +1 -1
  199. package/resources/safety.js +2 -14
  200. package/resources/safety.js.map +1 -1
  201. package/resources/safety.mjs +2 -14
  202. package/resources/safety.mjs.map +1 -1
  203. package/resources/scoring-functions.d.ts +53 -0
  204. package/resources/scoring-functions.d.ts.map +1 -0
  205. package/resources/scoring-functions.js +22 -0
  206. package/resources/scoring-functions.js.map +1 -0
  207. package/resources/scoring-functions.mjs +18 -0
  208. package/resources/scoring-functions.mjs.map +1 -0
  209. package/resources/scoring.d.ts +28 -0
  210. package/resources/scoring.d.ts.map +1 -0
  211. package/resources/scoring.js +15 -0
  212. package/resources/scoring.js.map +1 -0
  213. package/resources/scoring.mjs +11 -0
  214. package/resources/scoring.mjs.map +1 -0
  215. package/resources/shared.d.ts +338 -14
  216. package/resources/shared.d.ts.map +1 -1
  217. package/resources/shields.d.ts +18 -32
  218. package/resources/shields.d.ts.map +1 -1
  219. package/resources/shields.js +7 -29
  220. package/resources/shields.js.map +1 -1
  221. package/resources/shields.mjs +7 -29
  222. package/resources/shields.mjs.map +1 -1
  223. package/resources/synthetic-data-generation.d.ts +7 -24
  224. package/resources/synthetic-data-generation.d.ts.map +1 -1
  225. package/resources/synthetic-data-generation.js +5 -17
  226. package/resources/synthetic-data-generation.js.map +1 -1
  227. package/resources/synthetic-data-generation.mjs +3 -15
  228. package/resources/synthetic-data-generation.mjs.map +1 -1
  229. package/resources/telemetry.d.ts +95 -35
  230. package/resources/telemetry.d.ts.map +1 -1
  231. package/resources/telemetry.js +29 -22
  232. package/resources/telemetry.js.map +1 -1
  233. package/resources/telemetry.mjs +29 -22
  234. package/resources/telemetry.mjs.map +1 -1
  235. package/resources/tool-runtime/index.d.ts +3 -0
  236. package/resources/tool-runtime/index.d.ts.map +1 -0
  237. package/resources/tool-runtime/index.js +9 -0
  238. package/resources/tool-runtime/index.js.map +1 -0
  239. package/resources/tool-runtime/index.mjs +4 -0
  240. package/resources/tool-runtime/index.mjs.map +1 -0
  241. package/resources/tool-runtime/rag-tool.d.ts +27 -0
  242. package/resources/tool-runtime/rag-tool.d.ts.map +1 -0
  243. package/resources/tool-runtime/rag-tool.js +25 -0
  244. package/resources/tool-runtime/rag-tool.js.map +1 -0
  245. package/resources/tool-runtime/rag-tool.mjs +21 -0
  246. package/resources/tool-runtime/rag-tool.mjs.map +1 -0
  247. package/resources/tool-runtime/tool-runtime.d.ts +48 -0
  248. package/resources/tool-runtime/tool-runtime.d.ts.map +1 -0
  249. package/resources/{evaluate/evaluate.js → tool-runtime/tool-runtime.js} +29 -18
  250. package/resources/tool-runtime/tool-runtime.js.map +1 -0
  251. package/resources/tool-runtime/tool-runtime.mjs +33 -0
  252. package/resources/tool-runtime/tool-runtime.mjs.map +1 -0
  253. package/resources/toolgroups.d.ts +40 -0
  254. package/resources/toolgroups.d.ts.map +1 -0
  255. package/resources/toolgroups.js +37 -0
  256. package/resources/toolgroups.js.map +1 -0
  257. package/resources/toolgroups.mjs +33 -0
  258. package/resources/toolgroups.mjs.map +1 -0
  259. package/resources/tools.d.ts +41 -0
  260. package/resources/tools.d.ts.map +1 -0
  261. package/resources/tools.js +19 -0
  262. package/resources/tools.js.map +1 -0
  263. package/resources/tools.mjs +15 -0
  264. package/resources/tools.mjs.map +1 -0
  265. package/resources/vector-dbs.d.ts +59 -0
  266. package/resources/vector-dbs.d.ts.map +1 -0
  267. package/resources/vector-dbs.js +24 -0
  268. package/resources/vector-dbs.js.map +1 -0
  269. package/resources/vector-dbs.mjs +20 -0
  270. package/resources/vector-dbs.mjs.map +1 -0
  271. package/resources/vector-io.d.ts +37 -0
  272. package/resources/vector-io.d.ts.map +1 -0
  273. package/resources/vector-io.js +19 -0
  274. package/resources/vector-io.js.map +1 -0
  275. package/resources/vector-io.mjs +15 -0
  276. package/resources/vector-io.mjs.map +1 -0
  277. package/src/core.ts +46 -24
  278. package/src/error.ts +25 -41
  279. package/src/index.ts +437 -155
  280. package/src/internal/decoders/jsonl.ts +41 -0
  281. package/src/internal/decoders/line.ts +114 -0
  282. package/src/internal/qs/LICENSE.md +13 -0
  283. package/src/internal/qs/README.md +3 -0
  284. package/src/internal/qs/formats.ts +9 -0
  285. package/src/internal/qs/index.ts +13 -0
  286. package/src/internal/qs/stringify.ts +388 -0
  287. package/src/internal/qs/types.ts +71 -0
  288. package/src/internal/qs/utils.ts +265 -0
  289. package/src/internal/stream-utils.ts +32 -0
  290. package/src/resources/agents/agents.ts +72 -299
  291. package/src/resources/agents/index.ts +24 -27
  292. package/src/resources/agents/session.ts +73 -0
  293. package/src/resources/agents/steps.ts +14 -40
  294. package/src/resources/agents/turn.ts +292 -0
  295. package/src/resources/batch-inference.ts +30 -95
  296. package/src/resources/datasetio.ts +53 -0
  297. package/src/resources/datasets.ts +87 -81
  298. package/src/resources/eval/eval.ts +104 -0
  299. package/src/resources/eval/index.ts +12 -0
  300. package/src/resources/eval/jobs.ts +36 -0
  301. package/src/resources/eval-tasks.ts +69 -0
  302. package/src/resources/index.ts +141 -65
  303. package/src/resources/inference.ts +346 -0
  304. package/src/resources/inspect.ts +47 -0
  305. package/src/resources/models.ts +46 -66
  306. package/src/resources/post-training/index.ts +14 -14
  307. package/src/resources/post-training/job.ts +84 -0
  308. package/src/resources/post-training/post-training.ts +151 -182
  309. package/src/resources/providers.ts +26 -0
  310. package/src/resources/routes.ts +23 -0
  311. package/src/resources/safety.ts +8 -47
  312. package/src/resources/scoring-functions.ts +108 -0
  313. package/src/resources/scoring.ts +52 -0
  314. package/src/resources/shared.ts +462 -14
  315. package/src/resources/shields.ts +37 -64
  316. package/src/resources/synthetic-data-generation.ts +13 -40
  317. package/src/resources/telemetry.ts +229 -65
  318. package/src/resources/tool-runtime/index.ts +10 -0
  319. package/src/resources/tool-runtime/rag-tool.ts +45 -0
  320. package/src/resources/tool-runtime/tool-runtime.ts +106 -0
  321. package/src/resources/toolgroups.ts +80 -0
  322. package/src/resources/tools.ts +81 -0
  323. package/src/resources/vector-dbs.ts +121 -0
  324. package/src/resources/vector-io.ts +65 -0
  325. package/src/streaming.ts +6 -148
  326. package/src/version.ts +1 -1
  327. package/streaming.d.ts +0 -7
  328. package/streaming.d.ts.map +1 -1
  329. package/streaming.js +8 -123
  330. package/streaming.js.map +1 -1
  331. package/streaming.mjs +4 -118
  332. package/streaming.mjs.map +1 -1
  333. package/version.d.ts +1 -1
  334. package/version.d.ts.map +1 -1
  335. package/version.js +1 -1
  336. package/version.js.map +1 -1
  337. package/version.mjs +1 -1
  338. package/version.mjs.map +1 -1
  339. package/resources/agents/sessions.d.ts +0 -76
  340. package/resources/agents/sessions.d.ts.map +0 -1
  341. package/resources/agents/sessions.js +0 -52
  342. package/resources/agents/sessions.js.map +0 -1
  343. package/resources/agents/sessions.mjs +0 -48
  344. package/resources/agents/sessions.mjs.map +0 -1
  345. package/resources/agents/turns.d.ts +0 -133
  346. package/resources/agents/turns.d.ts.map +0 -1
  347. package/resources/agents/turns.js +0 -38
  348. package/resources/agents/turns.js.map +0 -1
  349. package/resources/agents/turns.mjs +0 -34
  350. package/resources/agents/turns.mjs.map +0 -1
  351. package/resources/evaluate/evaluate.d.ts +0 -29
  352. package/resources/evaluate/evaluate.d.ts.map +0 -1
  353. package/resources/evaluate/evaluate.js.map +0 -1
  354. package/resources/evaluate/evaluate.mjs +0 -22
  355. package/resources/evaluate/evaluate.mjs.map +0 -1
  356. package/resources/evaluate/index.d.ts +0 -6
  357. package/resources/evaluate/index.d.ts.map +0 -1
  358. package/resources/evaluate/index.js +0 -15
  359. package/resources/evaluate/index.js.map +0 -1
  360. package/resources/evaluate/index.mjs +0 -7
  361. package/resources/evaluate/index.mjs.map +0 -1
  362. package/resources/evaluate/jobs/artifacts.d.ts +0 -22
  363. package/resources/evaluate/jobs/artifacts.d.ts.map +0 -1
  364. package/resources/evaluate/jobs/artifacts.js +0 -24
  365. package/resources/evaluate/jobs/artifacts.js.map +0 -1
  366. package/resources/evaluate/jobs/artifacts.mjs +0 -20
  367. package/resources/evaluate/jobs/artifacts.mjs.map +0 -1
  368. package/resources/evaluate/jobs/index.d.ts +0 -5
  369. package/resources/evaluate/jobs/index.d.ts.map +0 -1
  370. package/resources/evaluate/jobs/index.js +0 -13
  371. package/resources/evaluate/jobs/index.js.map +0 -1
  372. package/resources/evaluate/jobs/index.mjs +0 -6
  373. package/resources/evaluate/jobs/index.mjs.map +0 -1
  374. package/resources/evaluate/jobs/jobs.d.ts +0 -56
  375. package/resources/evaluate/jobs/jobs.d.ts.map +0 -1
  376. package/resources/evaluate/jobs/jobs.js +0 -76
  377. package/resources/evaluate/jobs/jobs.js.map +0 -1
  378. package/resources/evaluate/jobs/jobs.mjs +0 -49
  379. package/resources/evaluate/jobs/jobs.mjs.map +0 -1
  380. package/resources/evaluate/jobs/logs.d.ts +0 -22
  381. package/resources/evaluate/jobs/logs.d.ts.map +0 -1
  382. package/resources/evaluate/jobs/logs.js +0 -24
  383. package/resources/evaluate/jobs/logs.js.map +0 -1
  384. package/resources/evaluate/jobs/logs.mjs +0 -20
  385. package/resources/evaluate/jobs/logs.mjs.map +0 -1
  386. package/resources/evaluate/jobs/status.d.ts +0 -22
  387. package/resources/evaluate/jobs/status.d.ts.map +0 -1
  388. package/resources/evaluate/jobs/status.js +0 -24
  389. package/resources/evaluate/jobs/status.js.map +0 -1
  390. package/resources/evaluate/jobs/status.mjs +0 -20
  391. package/resources/evaluate/jobs/status.mjs.map +0 -1
  392. package/resources/evaluate/question-answering.d.ts +0 -22
  393. package/resources/evaluate/question-answering.d.ts.map +0 -1
  394. package/resources/evaluate/question-answering.js +0 -24
  395. package/resources/evaluate/question-answering.js.map +0 -1
  396. package/resources/evaluate/question-answering.mjs +0 -20
  397. package/resources/evaluate/question-answering.mjs.map +0 -1
  398. package/resources/evaluate/summarization.d.ts +0 -4
  399. package/resources/evaluate/summarization.d.ts.map +0 -1
  400. package/resources/evaluate/summarization.js +0 -9
  401. package/resources/evaluate/summarization.js.map +0 -1
  402. package/resources/evaluate/summarization.mjs +0 -5
  403. package/resources/evaluate/summarization.mjs.map +0 -1
  404. package/resources/evaluate/text-generation.d.ts +0 -4
  405. package/resources/evaluate/text-generation.d.ts.map +0 -1
  406. package/resources/evaluate/text-generation.js +0 -9
  407. package/resources/evaluate/text-generation.js.map +0 -1
  408. package/resources/evaluate/text-generation.mjs +0 -5
  409. package/resources/evaluate/text-generation.mjs.map +0 -1
  410. package/resources/evaluations.d.ts +0 -35
  411. package/resources/evaluations.d.ts.map +0 -1
  412. package/resources/evaluations.js +0 -37
  413. package/resources/evaluations.js.map +0 -1
  414. package/resources/evaluations.mjs +0 -33
  415. package/resources/evaluations.mjs.map +0 -1
  416. package/resources/inference/embeddings.d.ts +0 -29
  417. package/resources/inference/embeddings.d.ts.map +0 -1
  418. package/resources/inference/embeddings.js.map +0 -1
  419. package/resources/inference/embeddings.mjs +0 -22
  420. package/resources/inference/embeddings.mjs.map +0 -1
  421. package/resources/inference/index.d.ts +0 -3
  422. package/resources/inference/index.d.ts.map +0 -1
  423. package/resources/inference/index.js +0 -9
  424. package/resources/inference/index.js.map +0 -1
  425. package/resources/inference/index.mjs +0 -4
  426. package/resources/inference/index.mjs.map +0 -1
  427. package/resources/inference/inference.d.ts +0 -172
  428. package/resources/inference/inference.d.ts.map +0 -1
  429. package/resources/inference/inference.js +0 -67
  430. package/resources/inference/inference.js.map +0 -1
  431. package/resources/inference/inference.mjs +0 -40
  432. package/resources/inference/inference.mjs.map +0 -1
  433. package/resources/memory/documents.d.ts +0 -49
  434. package/resources/memory/documents.d.ts.map +0 -1
  435. package/resources/memory/documents.js +0 -39
  436. package/resources/memory/documents.js.map +0 -1
  437. package/resources/memory/documents.mjs +0 -35
  438. package/resources/memory/documents.mjs.map +0 -1
  439. package/resources/memory/index.d.ts +0 -3
  440. package/resources/memory/index.d.ts.map +0 -1
  441. package/resources/memory/index.js +0 -9
  442. package/resources/memory/index.js.map +0 -1
  443. package/resources/memory/index.mjs +0 -4
  444. package/resources/memory/index.mjs.map +0 -1
  445. package/resources/memory/memory.d.ts +0 -158
  446. package/resources/memory/memory.d.ts.map +0 -1
  447. package/resources/memory/memory.js +0 -137
  448. package/resources/memory/memory.js.map +0 -1
  449. package/resources/memory/memory.mjs +0 -110
  450. package/resources/memory/memory.mjs.map +0 -1
  451. package/resources/memory-banks.d.ts +0 -42
  452. package/resources/memory-banks.d.ts.map +0 -1
  453. package/resources/memory-banks.js +0 -40
  454. package/resources/memory-banks.js.map +0 -1
  455. package/resources/memory-banks.mjs +0 -36
  456. package/resources/memory-banks.mjs.map +0 -1
  457. package/resources/post-training/jobs.d.ts +0 -91
  458. package/resources/post-training/jobs.d.ts.map +0 -1
  459. package/resources/post-training/jobs.js +0 -80
  460. package/resources/post-training/jobs.js.map +0 -1
  461. package/resources/post-training/jobs.mjs +0 -76
  462. package/resources/post-training/jobs.mjs.map +0 -1
  463. package/resources/reward-scoring.d.ts +0 -47
  464. package/resources/reward-scoring.d.ts.map +0 -1
  465. package/resources/reward-scoring.js +0 -24
  466. package/resources/reward-scoring.js.map +0 -1
  467. package/resources/reward-scoring.mjs +0 -20
  468. package/resources/reward-scoring.mjs.map +0 -1
  469. package/src/resources/agents/sessions.ts +0 -135
  470. package/src/resources/agents/turns.ts +0 -231
  471. package/src/resources/evaluate/evaluate.ts +0 -35
  472. package/src/resources/evaluate/index.ts +0 -14
  473. package/src/resources/evaluate/jobs/artifacts.ts +0 -42
  474. package/src/resources/evaluate/jobs/index.ts +0 -13
  475. package/src/resources/evaluate/jobs/jobs.ts +0 -99
  476. package/src/resources/evaluate/jobs/logs.ts +0 -42
  477. package/src/resources/evaluate/jobs/status.ts +0 -42
  478. package/src/resources/evaluate/question-answering.ts +0 -42
  479. package/src/resources/evaluate/summarization.ts +0 -5
  480. package/src/resources/evaluate/text-generation.ts +0 -5
  481. package/src/resources/evaluations.ts +0 -73
  482. package/src/resources/inference/embeddings.ts +0 -48
  483. package/src/resources/inference/index.ts +0 -15
  484. package/src/resources/inference/inference.ts +0 -268
  485. package/src/resources/memory/documents.ts +0 -92
  486. package/src/resources/memory/index.ts +0 -23
  487. package/src/resources/memory/memory.ts +0 -297
  488. package/src/resources/memory-banks.ts +0 -84
  489. package/src/resources/post-training/jobs.ts +0 -192
  490. package/src/resources/reward-scoring.ts +0 -82
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-runtime.js","sourceRoot":"","sources":["../../src/resources/tool-runtime/tool-runtime.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtF,gDAA6C;AAC7C,wCAA8C;AAG9C,0DAAyC;AACzC,4CAA8E;AAC9E,4DAA6D;AAE7D,MAAa,WAAY,SAAQ,sBAAW;IAA5C;;QACE,YAAO,GAAuB,IAAI,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAiCrE,CAAC;IA/BC;;OAEG;IACH,UAAU,CACR,IAAiC,EACjC,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,yBAAyB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5E,CAAC;IAOD,SAAS,CACP,QAA0D,EAAE,EAC5D,OAA6B;QAE7B,IAAI,IAAA,uBAAgB,EAAC,KAAK,CAAC,EAAE;YAC3B,OAAO,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;SAClC;QACD,OAAO,IAAI,CAAC,OAAO;aAChB,GAAG,CAAC,6BAA6B,EAAE;YAClC,KAAK;YACL,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,MAAM,EAAE,mBAAmB,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;YAC7D,gBAAgB,EAAE,IAAI;SACvB,CAAC;aACD,WAAW,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,oBAAY,CAAC,YAAY,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;IAC5F,CAAC;CACF;AAlCD,kCAkCC;AA8CD,WAAW,CAAC,OAAO,GAAG,kBAAO,CAAC"}
@@ -0,0 +1,33 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../../resource.mjs";
3
+ import { isRequestOptions } from "../../core.mjs";
4
+ import * as RagToolAPI from "./rag-tool.mjs";
5
+ import { RagTool } from "./rag-tool.mjs";
6
+ import { JSONLDecoder } from "../../internal/decoders/jsonl.mjs";
7
+ export class ToolRuntime extends APIResource {
8
+ constructor() {
9
+ super(...arguments);
10
+ this.ragTool = new RagToolAPI.RagTool(this._client);
11
+ }
12
+ /**
13
+ * Run a tool with the given arguments
14
+ */
15
+ invokeTool(body, options) {
16
+ return this._client.post('/v1/tool-runtime/invoke', { body, ...options });
17
+ }
18
+ listTools(query = {}, options) {
19
+ if (isRequestOptions(query)) {
20
+ return this.listTools({}, query);
21
+ }
22
+ return this._client
23
+ .get('/v1/tool-runtime/list-tools', {
24
+ query,
25
+ ...options,
26
+ headers: { Accept: 'application/jsonl', ...options?.headers },
27
+ __binaryResponse: true,
28
+ })
29
+ ._thenUnwrap((_, props) => JSONLDecoder.fromResponse(props.response, props.controller));
30
+ }
31
+ }
32
+ ToolRuntime.RagTool = RagTool;
33
+ //# sourceMappingURL=tool-runtime.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-runtime.mjs","sourceRoot":"","sources":["../../src/resources/tool-runtime/tool-runtime.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,EAAE,gBAAgB,EAAE;OAGpB,KAAK,UAAU;OACf,EAAE,OAAO,EAA2C;OACpD,EAAE,YAAY,EAAE;AAEvB,MAAM,OAAO,WAAY,SAAQ,WAAW;IAA5C;;QACE,YAAO,GAAuB,IAAI,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAiCrE,CAAC;IA/BC;;OAEG;IACH,UAAU,CACR,IAAiC,EACjC,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,yBAAyB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5E,CAAC;IAOD,SAAS,CACP,QAA0D,EAAE,EAC5D,OAA6B;QAE7B,IAAI,gBAAgB,CAAC,KAAK,CAAC,EAAE;YAC3B,OAAO,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;SAClC;QACD,OAAO,IAAI,CAAC,OAAO;aAChB,GAAG,CAAC,6BAA6B,EAAE;YAClC,KAAK;YACL,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,MAAM,EAAE,mBAAmB,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;YAC7D,gBAAgB,EAAE,IAAI;SACvB,CAAC;aACD,WAAW,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,YAAY,CAAC,YAAY,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;IAC5F,CAAC;CACF;AA8CD,WAAW,CAAC,OAAO,GAAG,OAAO,CAAC"}
@@ -0,0 +1,40 @@
1
+ import { APIResource } from "../resource.js";
2
+ import * as Core from "../core.js";
3
+ import * as Shared from "./shared.js";
4
+ export declare class Toolgroups extends APIResource {
5
+ /**
6
+ * List tool groups with optional provider
7
+ */
8
+ list(options?: Core.RequestOptions): Core.APIPromise<ToolgroupListResponse>;
9
+ get(toolgroupId: string, options?: Core.RequestOptions): Core.APIPromise<ToolGroup>;
10
+ /**
11
+ * Register a tool group
12
+ */
13
+ register(body: ToolgroupRegisterParams, options?: Core.RequestOptions): Core.APIPromise<void>;
14
+ /**
15
+ * Unregister a tool group
16
+ */
17
+ unregister(toolgroupId: string, options?: Core.RequestOptions): Core.APIPromise<void>;
18
+ }
19
+ export interface ListToolGroupsResponse {
20
+ data: Array<ToolGroup>;
21
+ }
22
+ export interface ToolGroup {
23
+ identifier: string;
24
+ provider_id: string;
25
+ provider_resource_id: string;
26
+ type: 'tool_group';
27
+ args?: Record<string, boolean | number | string | Array<unknown> | unknown | null>;
28
+ mcp_endpoint?: Shared.URL;
29
+ }
30
+ export type ToolgroupListResponse = Array<ToolGroup>;
31
+ export interface ToolgroupRegisterParams {
32
+ provider_id: string;
33
+ toolgroup_id: string;
34
+ args?: Record<string, boolean | number | string | Array<unknown> | unknown | null>;
35
+ mcp_endpoint?: Shared.URL;
36
+ }
37
+ export declare namespace Toolgroups {
38
+ export { type ListToolGroupsResponse as ListToolGroupsResponse, type ToolGroup as ToolGroup, type ToolgroupListResponse as ToolgroupListResponse, type ToolgroupRegisterParams as ToolgroupRegisterParams, };
39
+ }
40
+ //# sourceMappingURL=toolgroups.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toolgroups.d.ts","sourceRoot":"","sources":["../src/resources/toolgroups.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,IAAI,MAAM,SAAS,CAAC;AAChC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AAEnC,qBAAa,UAAW,SAAQ,WAAW;IACzC;;OAEG;IACH,IAAI,CAAC,O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M,CAAC,GAAG,CAAC;CAC3B;AAED,MAAM,CAAC,OAAO,WAAW,UAAU,CAAC;IAClC,OAAO,EACL,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,SAAS,IAAI,SAAS,EAC3B,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,uBAAuB,IAAI,uBAAuB,GACxD,CAAC;CACH"}
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Toolgroups = void 0;
5
+ const resource_1 = require("../resource.js");
6
+ class Toolgroups extends resource_1.APIResource {
7
+ /**
8
+ * List tool groups with optional provider
9
+ */
10
+ list(options) {
11
+ return this._client.get('/v1/toolgroups', options)._thenUnwrap((obj) => obj.data);
12
+ }
13
+ get(toolgroupId, options) {
14
+ return this._client.get(`/v1/toolgroups/${toolgroupId}`, options);
15
+ }
16
+ /**
17
+ * Register a tool group
18
+ */
19
+ register(body, options) {
20
+ return this._client.post('/v1/toolgroups', {
21
+ body,
22
+ ...options,
23
+ headers: { Accept: '*/*', ...options?.headers },
24
+ });
25
+ }
26
+ /**
27
+ * Unregister a tool group
28
+ */
29
+ unregister(toolgroupId, options) {
30
+ return this._client.delete(`/v1/toolgroups/${toolgroupId}`, {
31
+ ...options,
32
+ headers: { Accept: '*/*', ...options?.headers },
33
+ });
34
+ }
35
+ }
36
+ exports.Toolgroups = Toolgroups;
37
+ //# sourceMappingURL=toolgroups.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toolgroups.js","sourceRoot":"","sources":["../src/resources/toolgroups.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,6CAA0C;AAI1C,MAAa,UAAW,SAAQ,sBAAW;IACzC;;OAEG;IACH,IAAI,CAAC,OAA6B;QAChC,OACE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,OAAO,CAC3C,CAAC,WAAW,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IAED,GAAG,CAAC,WAAmB,EAAE,OAA6B;QACpD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,WAAW,EAAE,EAAE,OAAO,CAAC,CAAC;IACpE,CAAC;IAED;;OAEG;IACH,QAAQ,CAAC,IAA6B,EAAE,OAA6B;QACnE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE;YACzC,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SAChD,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,UAAU,CAAC,WAAmB,EAAE,OAA6B;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,kBAAkB,WAAW,EAAE,EAAE;YAC1D,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SAChD,CAAC,CAAC;IACL,CAAC;CACF;AAlCD,gCAkCC"}
@@ -0,0 +1,33 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../resource.mjs";
3
+ export class Toolgroups extends APIResource {
4
+ /**
5
+ * List tool groups with optional provider
6
+ */
7
+ list(options) {
8
+ return this._client.get('/v1/toolgroups', options)._thenUnwrap((obj) => obj.data);
9
+ }
10
+ get(toolgroupId, options) {
11
+ return this._client.get(`/v1/toolgroups/${toolgroupId}`, options);
12
+ }
13
+ /**
14
+ * Register a tool group
15
+ */
16
+ register(body, options) {
17
+ return this._client.post('/v1/toolgroups', {
18
+ body,
19
+ ...options,
20
+ headers: { Accept: '*/*', ...options?.headers },
21
+ });
22
+ }
23
+ /**
24
+ * Unregister a tool group
25
+ */
26
+ unregister(toolgroupId, options) {
27
+ return this._client.delete(`/v1/toolgroups/${toolgroupId}`, {
28
+ ...options,
29
+ headers: { Accept: '*/*', ...options?.headers },
30
+ });
31
+ }
32
+ }
33
+ //# sourceMappingURL=toolgroups.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toolgroups.mjs","sourceRoot":"","sources":["../src/resources/toolgroups.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAItB,MAAM,OAAO,UAAW,SAAQ,WAAW;IACzC;;OAEG;IACH,IAAI,CAAC,OAA6B;QAChC,OACE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,OAAO,CAC3C,CAAC,WAAW,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IAED,GAAG,CAAC,WAAmB,EAAE,OAA6B;QACpD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,WAAW,EAAE,EAAE,OAAO,CAAC,CAAC;IACpE,CAAC;IAED;;OAEG;IACH,QAAQ,CAAC,IAA6B,EAAE,OAA6B;QACnE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE;YACzC,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SAChD,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,UAAU,CAAC,WAAmB,EAAE,OAA6B;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,kBAAkB,WAAW,EAAE,EAAE;YAC1D,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SAChD,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -0,0 +1,41 @@
1
+ import { APIResource } from "../resource.js";
2
+ import * as Core from "../core.js";
3
+ export declare class Tools extends APIResource {
4
+ /**
5
+ * List tools with optional tool group
6
+ */
7
+ list(query?: ToolListParams, options?: Core.RequestOptions): Core.APIPromise<ToolListResponse>;
8
+ list(options?: Core.RequestOptions): Core.APIPromise<ToolListResponse>;
9
+ get(toolName: string, options?: Core.RequestOptions): Core.APIPromise<Tool>;
10
+ }
11
+ export interface ListToolsResponse {
12
+ data: Array<Tool>;
13
+ }
14
+ export interface Tool {
15
+ description: string;
16
+ identifier: string;
17
+ parameters: Array<Tool.Parameter>;
18
+ provider_id: string;
19
+ provider_resource_id: string;
20
+ tool_host: 'distribution' | 'client' | 'model_context_protocol';
21
+ toolgroup_id: string;
22
+ type: 'tool';
23
+ metadata?: Record<string, boolean | number | string | Array<unknown> | unknown | null>;
24
+ }
25
+ export declare namespace Tool {
26
+ interface Parameter {
27
+ description: string;
28
+ name: string;
29
+ parameter_type: string;
30
+ required: boolean;
31
+ default?: boolean | number | string | Array<unknown> | unknown | null;
32
+ }
33
+ }
34
+ export type ToolListResponse = Array<Tool>;
35
+ export interface ToolListParams {
36
+ toolgroup_id?: string;
37
+ }
38
+ export declare namespace Tools {
39
+ export { type ListToolsResponse as ListToolsResponse, type Tool as Tool, type ToolListResponse as ToolListResponse, type ToolListParams as ToolListParams, };
40
+ }
41
+ //# sourceMappingURL=tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/resources/tools.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,KAAK,IAAI,MAAM,SAAS,CAAC;AAEhC,qBAAa,KAAM,SAAQ,WAAW;IACpC;;OAEG;IACH,IAAI,CAAC,KAAK,CAAC,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC;IAC9F,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IA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AiB,EAC3C,KAAK,IAAI,IAAI,IAAI,EACjB,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,cAAc,IAAI,cAAc,GACtC,CAAC;CACH"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Tools = void 0;
5
+ const resource_1 = require("../resource.js");
6
+ const core_1 = require("../core.js");
7
+ class Tools extends resource_1.APIResource {
8
+ list(query = {}, options) {
9
+ if ((0, core_1.isRequestOptions)(query)) {
10
+ return this.list({}, query);
11
+ }
12
+ return this._client.get('/v1/tools', { query, ...options })._thenUnwrap((obj) => obj.data);
13
+ }
14
+ get(toolName, options) {
15
+ return this._client.get(`/v1/tools/${toolName}`, options);
16
+ }
17
+ }
18
+ exports.Tools = Tools;
19
+ //# sourceMappingURL=tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools.js","sourceRoot":"","sources":["../src/resources/tools.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,6CAA0C;AAC1C,qCAA2C;AAG3C,MAAa,KAAM,SAAQ,sBAAW;IAMpC,IAAI,CACF,QAA8C,EAAE,EAChD,OAA6B;QAE7B,IAAI,IAAA,uBAAgB,EAAC,KAAK,CAAC,EAAE;YAC3B,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;SAC7B;QACD,OACE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CACpD,CAAC,WAAW,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IAED,GAAG,CAAC,QAAgB,EAAE,OAA6B;QACjD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,QAAQ,EAAE,EAAE,OAAO,CAAC,CAAC;IAC5D,CAAC;CACF;AArBD,sBAqBC"}
@@ -0,0 +1,15 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../resource.mjs";
3
+ import { isRequestOptions } from "../core.mjs";
4
+ export class Tools extends APIResource {
5
+ list(query = {}, options) {
6
+ if (isRequestOptions(query)) {
7
+ return this.list({}, query);
8
+ }
9
+ return this._client.get('/v1/tools', { query, ...options })._thenUnwrap((obj) => obj.data);
10
+ }
11
+ get(toolName, options) {
12
+ return this._client.get(`/v1/tools/${toolName}`, options);
13
+ }
14
+ }
15
+ //# sourceMappingURL=tools.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools.mjs","sourceRoot":"","sources":["../src/resources/tools.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,EAAE,gBAAgB,EAAE;AAG3B,MAAM,OAAO,KAAM,SAAQ,WAAW;IAMpC,IAAI,CACF,QAA8C,EAAE,EAChD,OAA6B;QAE7B,IAAI,gBAAgB,CAAC,KAAK,CAAC,EAAE;YAC3B,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;SAC7B;QACD,OACE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CACpD,CAAC,WAAW,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IAED,GAAG,CAAC,QAAgB,EAAE,OAA6B;QACjD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,QAAQ,EAAE,EAAE,OAAO,CAAC,CAAC;IAC5D,CAAC;CACF"}
@@ -0,0 +1,59 @@
1
+ import { APIResource } from "../resource.js";
2
+ import * as Core from "../core.js";
3
+ export declare class VectorDBs extends APIResource {
4
+ retrieve(vectorDBId: string, options?: Core.RequestOptions): Core.APIPromise<VectorDBRetrieveResponse | null>;
5
+ list(options?: Core.RequestOptions): Core.APIPromise<VectorDBListResponse>;
6
+ register(body: VectorDBRegisterParams, options?: Core.RequestOptions): Core.APIPromise<VectorDBRegisterResponse>;
7
+ unregister(vectorDBId: string, options?: Core.RequestOptions): Core.APIPromise<void>;
8
+ }
9
+ export interface ListVectorDBsResponse {
10
+ data: Array<ListVectorDBsResponse.Data>;
11
+ }
12
+ export declare namespace ListVectorDBsResponse {
13
+ interface Data {
14
+ embedding_dimension: number;
15
+ embedding_model: string;
16
+ identifier: string;
17
+ provider_id: string;
18
+ provider_resource_id: string;
19
+ type: 'vector_db';
20
+ }
21
+ }
22
+ export interface VectorDBRetrieveResponse {
23
+ embedding_dimension: number;
24
+ embedding_model: string;
25
+ identifier: string;
26
+ provider_id: string;
27
+ provider_resource_id: string;
28
+ type: 'vector_db';
29
+ }
30
+ export type VectorDBListResponse = Array<VectorDBListResponse.VectorDBListResponseItem>;
31
+ export declare namespace VectorDBListResponse {
32
+ interface VectorDBListResponseItem {
33
+ embedding_dimension: number;
34
+ embedding_model: string;
35
+ identifier: string;
36
+ provider_id: string;
37
+ provider_resource_id: string;
38
+ type: 'vector_db';
39
+ }
40
+ }
41
+ export interface VectorDBRegisterResponse {
42
+ embedding_dimension: number;
43
+ embedding_model: string;
44
+ identifier: string;
45
+ provider_id: string;
46
+ provider_resource_id: string;
47
+ type: 'vector_db';
48
+ }
49
+ export interface VectorDBRegisterParams {
50
+ embedding_model: string;
51
+ vector_db_id: string;
52
+ embedding_dimension?: number;
53
+ provider_id?: string;
54
+ provider_vector_db_id?: string;
55
+ }
56
+ export declare namespace VectorDBs {
57
+ export { type ListVectorDBsResponse as ListVectorDBsResponse, type VectorDBRetrieveResponse as VectorDBRetrieveResponse, type VectorDBListResponse as VectorDBListResponse, type VectorDBRegisterResponse as VectorDBRegisterResponse, type VectorDBRegisterParams as VectorDBRegisterParams, };
58
+ }
59
+ //# sourceMappingURL=vector-dbs.d.ts.map
@@ -0,0 +1 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B,IAAI,EAAE,WAAW,CAAC;CACnB;AAED,MAAM,MAAM,oBAAoB,GAAG,KAAK,CAAC,oBAAoB,CAAC,wBAAwB,CAAC,CAAC;AAExF,yBAAiB,oBAAoB,CAAC;IACpC,UAAiB,wBAAwB;QACvC,mBAAmB,EAAE,MAAM,CAAC;QAE5B,eAAe,EAAE,MAAM,CAAC;QAExB,UAAU,EAAE,MAAM,CAAC;QAEnB,WAAW,EAAE,MAAM,CAAC;QAEpB,oBAAoB,EAAE,MAAM,CAAC;QAE7B,IAAI,EAAE,WAAW,CAAC;KACnB;CACF;AAED,MAAM,WAAW,wBAAwB;IACvC,mBAAmB,EAAE,MAAM,CAAC;IAE5B,eAAe,EAAE,MAAM,CAAC;IAExB,UAAU,EAAE,MAAM,CAAC;IAEnB,WAAW,EAAE,MAAM,CAAC;IAEpB,oBAAoB,EAAE,MAAM,CAAC;IAE7B,IAAI,EAAE,WAAW,CAAC;CACnB;AAED,MAAM,WAAW,sBAAsB;IACrC,eAAe,EAAE,MAAM,CAAC;IAExB,YAAY,EAAE,MAAM,CAAC;IAErB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAE7B,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC;AAED,MAAM,CAAC,OAAO,WAAW,SAAS,CAAC;IACjC,OAAO,EACL,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;CACH"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.VectorDBs = void 0;
5
+ const resource_1 = require("../resource.js");
6
+ class VectorDBs extends resource_1.APIResource {
7
+ retrieve(vectorDBId, options) {
8
+ return this._client.get(`/v1/vector-dbs/${vectorDBId}`, options);
9
+ }
10
+ list(options) {
11
+ return this._client.get('/v1/vector-dbs', options)._thenUnwrap((obj) => obj.data);
12
+ }
13
+ register(body, options) {
14
+ return this._client.post('/v1/vector-dbs', { body, ...options });
15
+ }
16
+ unregister(vectorDBId, options) {
17
+ return this._client.delete(`/v1/vector-dbs/${vectorDBId}`, {
18
+ ...options,
19
+ headers: { Accept: '*/*', ...options?.headers },
20
+ });
21
+ }
22
+ }
23
+ exports.VectorDBs = VectorDBs;
24
+ //# sourceMappingURL=vector-dbs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vector-dbs.js","sourceRoot":"","sources":["../src/resources/vector-dbs.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,6CAA0C;AAG1C,MAAa,SAAU,SAAQ,sBAAW;IACxC,QAAQ,CACN,UAAkB,EAClB,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,UAAU,EAAE,EAAE,OAAO,CAAC,CAAC;IACnE,CAAC;IAED,IAAI,CAAC,OAA6B;QAChC,OACE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,OAAO,CAC3C,CAAC,WAAW,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IAED,QAAQ,CACN,IAA4B,EAC5B,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACnE,CAAC;IAED,UAAU,CAAC,UAAkB,EAAE,OAA6B;QAC1D,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,kBAAkB,UAAU,EAAE,EAAE;YACzD,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SAChD,CAAC,CAAC;IACL,CAAC;CACF;AA3BD,8BA2BC"}
@@ -0,0 +1,20 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../resource.mjs";
3
+ export class VectorDBs extends APIResource {
4
+ retrieve(vectorDBId, options) {
5
+ return this._client.get(`/v1/vector-dbs/${vectorDBId}`, options);
6
+ }
7
+ list(options) {
8
+ return this._client.get('/v1/vector-dbs', options)._thenUnwrap((obj) => obj.data);
9
+ }
10
+ register(body, options) {
11
+ return this._client.post('/v1/vector-dbs', { body, ...options });
12
+ }
13
+ unregister(vectorDBId, options) {
14
+ return this._client.delete(`/v1/vector-dbs/${vectorDBId}`, {
15
+ ...options,
16
+ headers: { Accept: '*/*', ...options?.headers },
17
+ });
18
+ }
19
+ }
20
+ //# sourceMappingURL=vector-dbs.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vector-dbs.mjs","sourceRoot":"","sources":["../src/resources/vector-dbs.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAGtB,MAAM,OAAO,SAAU,SAAQ,WAAW;IACxC,QAAQ,CACN,UAAkB,EAClB,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,UAAU,EAAE,EAAE,OAAO,CAAC,CAAC;IACnE,CAAC;IAED,IAAI,CAAC,OAA6B;QAChC,OACE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,OAAO,CAC3C,CAAC,WAAW,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IAED,QAAQ,CACN,IAA4B,EAC5B,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACnE,CAAC;IAED,UAAU,CAAC,UAAkB,EAAE,OAA6B;QAC1D,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,kBAAkB,UAAU,EAAE,EAAE;YACzD,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SAChD,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -0,0 +1,37 @@
1
+ import { APIResource } from "../resource.js";
2
+ import * as Core from "../core.js";
3
+ import * as Shared from "./shared.js";
4
+ export declare class VectorIo extends APIResource {
5
+ insert(body: VectorIoInsertParams, options?: Core.RequestOptions): Core.APIPromise<void>;
6
+ query(body: VectorIoQueryParams, options?: Core.RequestOptions): Core.APIPromise<QueryChunksResponse>;
7
+ }
8
+ export interface QueryChunksResponse {
9
+ chunks: Array<QueryChunksResponse.Chunk>;
10
+ scores: Array<number>;
11
+ }
12
+ export declare namespace QueryChunksResponse {
13
+ interface Chunk {
14
+ content: Shared.InterleavedContent;
15
+ metadata: Record<string, boolean | number | string | Array<unknown> | unknown | null>;
16
+ }
17
+ }
18
+ export interface VectorIoInsertParams {
19
+ chunks: Array<VectorIoInsertParams.Chunk>;
20
+ vector_db_id: string;
21
+ ttl_seconds?: number;
22
+ }
23
+ export declare namespace VectorIoInsertParams {
24
+ interface Chunk {
25
+ content: Shared.InterleavedContent;
26
+ metadata: Record<string, boolean | number | string | Array<unknown> | unknown | null>;
27
+ }
28
+ }
29
+ export interface VectorIoQueryParams {
30
+ query: Shared.InterleavedContent;
31
+ vector_db_id: string;
32
+ params?: Record<string, boolean | number | string | Array<unknown> | unknown | null>;
33
+ }
34
+ export declare namespace VectorIo {
35
+ export { type QueryChunksResponse as QueryChunksResponse, type VectorIoInsertParams as VectorIoInsertParams, type VectorIoQueryParams as VectorIoQueryParams, };
36
+ }
37
+ //# sourceMappingURL=vector-io.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vector-io.d.ts","sourceRoot":"","sources":["../src/resources/vector-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F;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC,kBAAkB,CAAC;IAEjC,YAAY,EAAE,MAAM,CAAC;IAErB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,OAAO,GAAG,IAAI,CAAC,CAAC;CACtF;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EACL,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;CACH"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.VectorIo = void 0;
5
+ const resource_1 = require("../resource.js");
6
+ class VectorIo extends resource_1.APIResource {
7
+ insert(body, options) {
8
+ return this._client.post('/v1/vector-io/insert', {
9
+ body,
10
+ ...options,
11
+ headers: { Accept: '*/*', ...options?.headers },
12
+ });
13
+ }
14
+ query(body, options) {
15
+ return this._client.post('/v1/vector-io/query', { body, ...options });
16
+ }
17
+ }
18
+ exports.VectorIo = VectorIo;
19
+ //# sourceMappingURL=vector-io.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vector-io.js","sourceRoot":"","sources":["../src/resources/vector-io.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,6CAA0C;AAI1C,MAAa,QAAS,SAAQ,sBAAW;IACvC,MAAM,CAAC,IAA0B,EAAE,OAA6B;QAC9D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,sBAAsB,EAAE;YAC/C,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SAChD,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,IAAyB,EAAE,OAA6B;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,qBAAqB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACxE,CAAC;CACF;AAZD,4BAYC"}
@@ -0,0 +1,15 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../resource.mjs";
3
+ export class VectorIo extends APIResource {
4
+ insert(body, options) {
5
+ return this._client.post('/v1/vector-io/insert', {
6
+ body,
7
+ ...options,
8
+ headers: { Accept: '*/*', ...options?.headers },
9
+ });
10
+ }
11
+ query(body, options) {
12
+ return this._client.post('/v1/vector-io/query', { body, ...options });
13
+ }
14
+ }
15
+ //# sourceMappingURL=vector-io.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vector-io.mjs","sourceRoot":"","sources":["../src/resources/vector-io.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAItB,MAAM,OAAO,QAAS,SAAQ,WAAW;IACvC,MAAM,CAAC,IAA0B,EAAE,OAA6B;QAC9D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,sBAAsB,EAAE;YAC/C,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SAChD,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,IAAyB,EAAE,OAA6B;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,qBAAqB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACxE,CAAC;CACF"}
package/src/core.ts CHANGED
@@ -98,8 +98,10 @@ export class APIPromise<T> extends Promise<T> {
98
98
  });
99
99
  }
100
100
 
101
- _thenUnwrap<U>(transform: (data: T) => U): APIPromise<U> {
102
- return new APIPromise(this.responsePromise, async (props) => transform(await this.parseResponse(props)));
101
+ _thenUnwrap<U>(transform: (data: T, props: APIResponseProps) => U): APIPromise<U> {
102
+ return new APIPromise(this.responsePromise, async (props) =>
103
+ transform(await this.parseResponse(props), props),
104
+ );
103
105
  }
104
106
 
105
107
  /**
@@ -175,7 +177,7 @@ export abstract class APIClient {
175
177
  maxRetries = 2,
176
178
  timeout = 60000, // 1 minute
177
179
  httpAgent,
178
- fetch: overridenFetch,
180
+ fetch: overriddenFetch,
179
181
  }: {
180
182
  baseURL: string;
181
183
  maxRetries?: number | undefined;
@@ -188,7 +190,7 @@ export abstract class APIClient {
188
190
  this.timeout = validatePositiveInteger('timeout', timeout);
189
191
  this.httpAgent = httpAgent;
190
192
 
191
- this.fetch = overridenFetch ?? fetch;
193
+ this.fetch = overriddenFetch ?? fetch;
192
194
  }
193
195
 
194
196
  protected authHeaders(opts: FinalRequestOptions): Headers {
@@ -363,7 +365,15 @@ export abstract class APIClient {
363
365
  delete reqHeaders['content-type'];
364
366
  }
365
367
 
366
- reqHeaders['x-stainless-retry-count'] = String(retryCount);
368
+ // Don't set the retry count header if it was already set or removed through default headers or by the
369
+ // caller. We check `defaultHeaders` and `headers`, which can contain nulls, instead of `reqHeaders` to
370
+ // account for the removal case.
371
+ if (
372
+ getHeader(defaultHeaders, 'x-stainless-retry-count') === undefined &&
373
+ getHeader(headers, 'x-stainless-retry-count') === undefined
374
+ ) {
375
+ reqHeaders['x-stainless-retry-count'] = String(retryCount);
376
+ }
367
377
 
368
378
  this.validateHeaders(reqHeaders, headers);
369
379
 
@@ -400,7 +410,7 @@ export abstract class APIClient {
400
410
  error: Object | undefined,
401
411
  message: string | undefined,
402
412
  headers: Headers | undefined,
403
- ) {
413
+ ): APIError {
404
414
  return APIError.generate(status, error, message, headers);
405
415
  }
406
416
 
@@ -526,20 +536,24 @@ export abstract class APIClient {
526
536
 
527
537
  const timeout = setTimeout(() => controller.abort(), ms);
528
538
 
539
+ const fetchOptions = {
540
+ signal: controller.signal as any,
541
+ ...options,
542
+ };
543
+ if (fetchOptions.method) {
544
+ // Custom methods like 'patch' need to be uppercased
545
+ // See https://github.com/nodejs/undici/issues/2294
546
+ fetchOptions.method = fetchOptions.method.toUpperCase();
547
+ }
548
+
529
549
  return (
530
- this.getRequestClient()
531
- // use undefined this binding; fetch errors if bound to something else in browser/cloudflare
532
- .fetch.call(undefined, url, { signal: controller.signal as any, ...options })
533
- .finally(() => {
534
- clearTimeout(timeout);
535
- })
550
+ // use undefined this binding; fetch errors if bound to something else in browser/cloudflare
551
+ this.fetch.call(undefined, url, fetchOptions).finally(() => {
552
+ clearTimeout(timeout);
553
+ })
536
554
  );
537
555
  }
538
556
 
539
- protected getRequestClient(): RequestClient {
540
- return { fetch: this.fetch };
541
- }
542
-
543
557
  private shouldRetry(response: Response): boolean {
544
558
  // Note this is not a standard header.
545
559
  const shouldRetryHeader = response.headers.get('x-should-retry');
@@ -672,9 +686,9 @@ export abstract class AbstractPage<Item> implements AsyncIterable<Item> {
672
686
  return await this.#client.requestAPIList(this.constructor as any, nextOptions);
673
687
  }
674
688
 
675
- async *iterPages() {
689
+ async *iterPages(): AsyncGenerator<this> {
676
690
  // eslint-disable-next-line @typescript-eslint/no-this-alias
677
- let page: AbstractPage<Item> = this;
691
+ let page: this = this;
678
692
  yield page;
679
693
  while (page.hasNextPage()) {
680
694
  page = await page.getNextPage();
@@ -682,7 +696,7 @@ export abstract class AbstractPage<Item> implements AsyncIterable<Item> {
682
696
  }
683
697
  }
684
698
 
685
- async *[Symbol.asyncIterator]() {
699
+ async *[Symbol.asyncIterator](): AsyncGenerator<Item> {
686
700
  for await (const page of this.iterPages()) {
687
701
  for (const item of page.getPaginatedItems()) {
688
702
  yield item;
@@ -725,7 +739,7 @@ export class PagePromise<
725
739
  * console.log(item)
726
740
  * }
727
741
  */
728
- async *[Symbol.asyncIterator]() {
742
+ async *[Symbol.asyncIterator](): AsyncGenerator<Item> {
729
743
  const page = await this;
730
744
  for await (const item of page) {
731
745
  yield item;
@@ -982,8 +996,8 @@ export const safeJSON = (text: string) => {
982
996
  }
983
997
  };
984
998
 
985
- // https://stackoverflow.com/a/19709846
986
- const startsWithSchemeRegexp = new RegExp('^(?:[a-z]+:)?//', 'i');
999
+ // https://url.spec.whatwg.org/#url-scheme-string
1000
+ const startsWithSchemeRegexp = /^[a-z][a-z0-9+.-]*:/i;
987
1001
  const isAbsoluteURL = (url: string): boolean => {
988
1002
  return startsWithSchemeRegexp.test(url);
989
1003
  };
@@ -1145,7 +1159,15 @@ export const isHeadersProtocol = (headers: any): headers is HeadersProtocol => {
1145
1159
  return typeof headers?.get === 'function';
1146
1160
  };
1147
1161
 
1148
- export const getRequiredHeader = (headers: HeadersLike, header: string): string => {
1162
+ export const getRequiredHeader = (headers: HeadersLike | Headers, header: string): string => {
1163
+ const foundHeader = getHeader(headers, header);
1164
+ if (foundHeader === undefined) {
1165
+ throw new Error(`Could not find ${header} header`);
1166
+ }
1167
+ return foundHeader;
1168
+ };
1169
+
1170
+ export const getHeader = (headers: HeadersLike | Headers, header: string): string | undefined => {
1149
1171
  const lowerCasedHeader = header.toLowerCase();
1150
1172
  if (isHeadersProtocol(headers)) {
1151
1173
  // to deal with the case where the header looks like Stainless-Event-Id
@@ -1171,7 +1193,7 @@ export const getRequiredHeader = (headers: HeadersLike, header: string): string
1171
1193
  }
1172
1194
  }
1173
1195
 
1174
- throw new Error(`Could not find ${header} header`);
1196
+ return undefined;
1175
1197
  };
1176
1198
 
1177
1199
  /**