llama-stack-client 0.0.35 → 0.1.2

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 +44 -19
  6. package/core.js.map +1 -1
  7. package/core.mjs +41 -17
  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 +106 -120
  16. package/index.d.ts +106 -120
  17. package/index.d.ts.map +1 -1
  18. package/index.js +100 -45
  19. package/index.js.map +1 -1
  20. package/index.mjs +84 -44
  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 +31 -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 +31 -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 +199 -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 +23 -56
  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 +34 -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 +62 -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 +286 -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 +47 -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 +406 -14
  216. package/resources/shared.d.ts.map +1 -1
  217. package/resources/shields.d.ts +21 -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 +12 -22
  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 +84 -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 +30 -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 +51 -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 +49 -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 +46 -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 +57 -27
  278. package/src/error.ts +25 -41
  279. package/src/index.ts +457 -153
  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 +81 -299
  291. package/src/resources/agents/index.ts +24 -27
  292. package/src/resources/agents/session.ts +76 -0
  293. package/src/resources/agents/steps.ts +14 -40
  294. package/src/resources/agents/turn.ts +322 -0
  295. package/src/resources/batch-inference.ts +33 -84
  296. package/src/resources/datasetio.ts +53 -0
  297. package/src/resources/datasets.ts +70 -82
  298. package/src/resources/eval/eval.ts +107 -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 +395 -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 +96 -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 +530 -14
  315. package/src/resources/shields.ts +40 -64
  316. package/src/resources/synthetic-data-generation.ts +17 -37
  317. package/src/resources/telemetry.ts +211 -65
  318. package/src/resources/tool-runtime/index.ts +10 -0
  319. package/src/resources/tool-runtime/rag-tool.ts +48 -0
  320. package/src/resources/tool-runtime/tool-runtime.ts +109 -0
  321. package/src/resources/toolgroups.ts +80 -0
  322. package/src/resources/tools.ts +81 -0
  323. package/src/resources/vector-dbs.ts +105 -0
  324. package/src/resources/vector-io.ts +74 -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
package/index.mjs CHANGED
@@ -1,13 +1,33 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
  var _a;
3
+ import * as qs from "./internal/qs/index.mjs";
4
+ import * as Core from "./core.mjs";
3
5
  import * as Errors from "./error.mjs";
4
6
  import * as Uploads from "./uploads.mjs";
5
- import * as Core from "./core.mjs";
6
7
  import * as API from "./resources/index.mjs";
7
- const environments = {
8
- production: 'http://any-hosted-llama-stack-client.com',
9
- sandbox: 'https://example.com',
10
- };
8
+ import { BatchInference, } from "./resources/batch-inference.mjs";
9
+ import { Datasetio, } from "./resources/datasetio.mjs";
10
+ import { Datasets, } from "./resources/datasets.mjs";
11
+ import { EvalTasks, } from "./resources/eval-tasks.mjs";
12
+ import { Inference, } from "./resources/inference.mjs";
13
+ import { Inspect } from "./resources/inspect.mjs";
14
+ import { Models, } from "./resources/models.mjs";
15
+ import { Providers } from "./resources/providers.mjs";
16
+ import { Routes } from "./resources/routes.mjs";
17
+ import { Safety } from "./resources/safety.mjs";
18
+ import { Scoring, } from "./resources/scoring.mjs";
19
+ import { ScoringFunctions, } from "./resources/scoring-functions.mjs";
20
+ import { Shields, } from "./resources/shields.mjs";
21
+ import { SyntheticDataGeneration, } from "./resources/synthetic-data-generation.mjs";
22
+ import { Telemetry, } from "./resources/telemetry.mjs";
23
+ import { Toolgroups, } from "./resources/toolgroups.mjs";
24
+ import { Tools } from "./resources/tools.mjs";
25
+ import { VectorDBs, } from "./resources/vector-dbs.mjs";
26
+ import { VectorIo, } from "./resources/vector-io.mjs";
27
+ import { Agents, } from "./resources/agents/agents.mjs";
28
+ import { Eval, } from "./resources/eval/eval.mjs";
29
+ import { PostTraining, } from "./resources/post-training/post-training.mjs";
30
+ import { ToolRuntime, } from "./resources/tool-runtime/tool-runtime.mjs";
11
31
  /**
12
32
  * API Client for interfacing with the Llama Stack Client API.
13
33
  */
@@ -15,8 +35,8 @@ export class LlamaStackClient extends Core.APIClient {
15
35
  /**
16
36
  * API Client for interfacing with the Llama Stack Client API.
17
37
  *
18
- * @param {Environment} [opts.environment=production] - Specifies the environment URL to use for the API.
19
- * @param {string} [opts.baseURL=process.env['LLAMA_STACK_CLIENT_BASE_URL'] ?? http://any-hosted-llama-stack-client.com] - Override the default base URL for the API.
38
+ * @param {string | null | undefined} [opts.apiKey=process.env['LLAMA_STACK_CLIENT_API_KEY'] ?? null]
39
+ * @param {string} [opts.baseURL=process.env['LLAMA_STACK_CLIENT_BASE_URL'] ?? http://any-hosted-llama-stack.com] - Override the default base URL for the API.
20
40
  * @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
21
41
  * @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
22
42
  * @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
@@ -24,38 +44,44 @@ export class LlamaStackClient extends Core.APIClient {
24
44
  * @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API.
25
45
  * @param {Core.DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API.
26
46
  */
27
- constructor({ baseURL = Core.readEnv('LLAMA_STACK_CLIENT_BASE_URL'), ...opts } = {}) {
47
+ constructor({ baseURL = Core.readEnv('LLAMA_STACK_CLIENT_BASE_URL'), apiKey = Core.readEnv('LLAMA_STACK_CLIENT_API_KEY') ?? null, ...opts } = {}) {
28
48
  const options = {
49
+ apiKey,
29
50
  ...opts,
30
- baseURL,
31
- environment: opts.environment ?? 'production',
51
+ baseURL: baseURL || `http://any-hosted-llama-stack.com`,
32
52
  };
33
- if (baseURL && opts.environment) {
34
- throw new Errors.LlamaStackClientError('Ambiguous URL; The `baseURL` option (or LLAMA_STACK_CLIENT_BASE_URL env var) and the `environment` option are given. If you want to use the environment you must pass baseURL: null');
35
- }
36
53
  super({
37
- baseURL: options.baseURL || environments[options.environment || 'production'],
54
+ baseURL: options.baseURL,
38
55
  timeout: options.timeout ?? 60000 /* 1 minute */,
39
56
  httpAgent: options.httpAgent,
40
57
  maxRetries: options.maxRetries,
41
58
  fetch: options.fetch,
42
59
  });
43
- this.telemetry = new API.Telemetry(this);
60
+ this.toolgroups = new API.Toolgroups(this);
61
+ this.tools = new API.Tools(this);
62
+ this.toolRuntime = new API.ToolRuntime(this);
44
63
  this.agents = new API.Agents(this);
64
+ this.batchInference = new API.BatchInference(this);
45
65
  this.datasets = new API.Datasets(this);
46
- this.evaluate = new API.Evaluate(this);
47
- this.evaluations = new API.Evaluations(this);
66
+ this.eval = new API.Eval(this);
67
+ this.inspect = new API.Inspect(this);
48
68
  this.inference = new API.Inference(this);
49
- this.safety = new API.Safety(this);
50
- this.memory = new API.Memory(this);
51
- this.postTraining = new API.PostTraining(this);
52
- this.rewardScoring = new API.RewardScoringResource(this);
53
- this.syntheticDataGeneration = new API.SyntheticDataGenerationResource(this);
54
- this.batchInference = new API.BatchInference(this);
69
+ this.vectorIo = new API.VectorIo(this);
70
+ this.vectorDBs = new API.VectorDBs(this);
55
71
  this.models = new API.Models(this);
56
- this.memoryBanks = new API.MemoryBanks(this);
72
+ this.postTraining = new API.PostTraining(this);
73
+ this.providers = new API.Providers(this);
74
+ this.routes = new API.Routes(this);
75
+ this.safety = new API.Safety(this);
57
76
  this.shields = new API.Shields(this);
77
+ this.syntheticDataGeneration = new API.SyntheticDataGeneration(this);
78
+ this.telemetry = new API.Telemetry(this);
79
+ this.datasetio = new API.Datasetio(this);
80
+ this.scoring = new API.Scoring(this);
81
+ this.scoringFunctions = new API.ScoringFunctions(this);
82
+ this.evalTasks = new API.EvalTasks(this);
58
83
  this._options = options;
84
+ this.apiKey = apiKey;
59
85
  }
60
86
  defaultQuery() {
61
87
  return this._options.defaultQuery;
@@ -66,6 +92,15 @@ export class LlamaStackClient extends Core.APIClient {
66
92
  ...this._options.defaultHeaders,
67
93
  };
68
94
  }
95
+ authHeaders(opts) {
96
+ if (this.apiKey == null) {
97
+ return {};
98
+ }
99
+ return { Authorization: `Bearer ${this.apiKey}` };
100
+ }
101
+ stringifyQuery(query) {
102
+ return qs.stringify(query, { arrayFormat: 'comma' });
103
+ }
69
104
  }
70
105
  _a = LlamaStackClient;
71
106
  LlamaStackClient.LlamaStackClient = _a;
@@ -85,25 +120,30 @@ LlamaStackClient.PermissionDeniedError = Errors.PermissionDeniedError;
85
120
  LlamaStackClient.UnprocessableEntityError = Errors.UnprocessableEntityError;
86
121
  LlamaStackClient.toFile = Uploads.toFile;
87
122
  LlamaStackClient.fileFromPath = Uploads.fileFromPath;
88
- export const { LlamaStackClientError, APIError, APIConnectionError, APIConnectionTimeoutError, APIUserAbortError, NotFoundError, ConflictError, RateLimitError, BadRequestError, AuthenticationError, InternalServerError, PermissionDeniedError, UnprocessableEntityError, } = Errors;
89
- export var toFile = Uploads.toFile;
90
- export var fileFromPath = Uploads.fileFromPath;
91
- (function (LlamaStackClient) {
92
- LlamaStackClient.Telemetry = API.Telemetry;
93
- LlamaStackClient.Agents = API.Agents;
94
- LlamaStackClient.Datasets = API.Datasets;
95
- LlamaStackClient.Evaluate = API.Evaluate;
96
- LlamaStackClient.Evaluations = API.Evaluations;
97
- LlamaStackClient.Inference = API.Inference;
98
- LlamaStackClient.Safety = API.Safety;
99
- LlamaStackClient.Memory = API.Memory;
100
- LlamaStackClient.PostTraining = API.PostTraining;
101
- LlamaStackClient.RewardScoringResource = API.RewardScoringResource;
102
- LlamaStackClient.SyntheticDataGenerationResource = API.SyntheticDataGenerationResource;
103
- LlamaStackClient.BatchInference = API.BatchInference;
104
- LlamaStackClient.Models = API.Models;
105
- LlamaStackClient.MemoryBanks = API.MemoryBanks;
106
- LlamaStackClient.Shields = API.Shields;
107
- })(LlamaStackClient || (LlamaStackClient = {}));
123
+ LlamaStackClient.Toolgroups = Toolgroups;
124
+ LlamaStackClient.Tools = Tools;
125
+ LlamaStackClient.ToolRuntime = ToolRuntime;
126
+ LlamaStackClient.Agents = Agents;
127
+ LlamaStackClient.BatchInference = BatchInference;
128
+ LlamaStackClient.Datasets = Datasets;
129
+ LlamaStackClient.Eval = Eval;
130
+ LlamaStackClient.Inspect = Inspect;
131
+ LlamaStackClient.Inference = Inference;
132
+ LlamaStackClient.VectorIo = VectorIo;
133
+ LlamaStackClient.VectorDBs = VectorDBs;
134
+ LlamaStackClient.Models = Models;
135
+ LlamaStackClient.PostTraining = PostTraining;
136
+ LlamaStackClient.Providers = Providers;
137
+ LlamaStackClient.Routes = Routes;
138
+ LlamaStackClient.Safety = Safety;
139
+ LlamaStackClient.Shields = Shields;
140
+ LlamaStackClient.SyntheticDataGeneration = SyntheticDataGeneration;
141
+ LlamaStackClient.Telemetry = Telemetry;
142
+ LlamaStackClient.Datasetio = Datasetio;
143
+ LlamaStackClient.Scoring = Scoring;
144
+ LlamaStackClient.ScoringFunctions = ScoringFunctions;
145
+ LlamaStackClient.EvalTasks = EvalTasks;
146
+ export { toFile, fileFromPath } from "./uploads.mjs";
147
+ export { LlamaStackClientError, APIError, APIConnectionError, APIConnectionTimeoutError, APIUserAbortError, NotFoundError, ConflictError, RateLimitError, BadRequestError, AuthenticationError, InternalServerError, PermissionDeniedError, UnprocessableEntityError, } from "./error.mjs";
108
148
  export default LlamaStackClient;
109
149
  //# sourceMappingURL=index.mjs.map
package/index.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;;OAE/E,KAAK,MAAM;OACX,KAAK,OAAO;OAEZ,KAAK,IAAI;OACT,KAAK,GAAG;AAEf,MAAM,YAAY,GAAG;IACnB,UAAU,EAAE,0CAA0C;IACtD,OAAO,EAAE,qBAAqB;CAC/B,CAAC;AAsEF;;GAEG;AACH,MAAM,OAAO,gBAAiB,SAAQ,IAAI,CAAC,SAAS;IAGlD;;;;;;;;;;;OAWG;IACH,YAAY,EAAE,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,6BAA6B,CAAC,EAAE,GAAG,IAAI,KAAoB,EAAE;QAChG,MAAM,OAAO,GAAkB;YAC7B,GAAG,IAAI;YACP,OAAO;YACP,WAAW,EAAE,IAAI,CAAC,WAAW,IAAI,YAAY;SAC9C,CAAC;QAEF,IAAI,OAAO,IAAI,IAAI,CAAC,WAAW,EAAE;YAC/B,MAAM,IAAI,MAAM,CAAC,qBAAqB,CACpC,qLAAqL,CACtL,CAAC;SACH;QAED,KAAK,CAAC;YACJ,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,YAAY,CAAC,OAAO,CAAC,WAAW,IAAI,YAAY,CAAC;YAC7E,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,KAAK,CAAC,cAAc;YAChD,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,UAAU,EAAE,OAAO,CAAC,UAAU;YAC9B,KAAK,EAAE,OAAO,CAAC,KAAK;SACrB,CAAC,CAAC;QAKL,cAAS,GAAkB,IAAI,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QACnD,WAAM,GAAe,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI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B,GACzB;AAED,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,12 @@
1
+
2
+ import { type Response } from "../../_shims/index.js";
3
+ import { type Bytes } from "./line.js";
4
+ export declare class JSONLDecoder<T> {
5
+ private iterator;
6
+ controller: AbortController;
7
+ constructor(iterator: AsyncIterableIterator<Bytes>, controller: AbortController);
8
+ private decoder;
9
+ [Symbol.asyncIterator](): AsyncIterator<T>;
10
+ static fromResponse<T>(response: Response, controller: AbortController): JSONLDecoder<T>;
11
+ }
12
+ //# sourceMappingURL=jsonl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsonl.d.ts","sourceRoot":"","sources":["../../src/internal/decoders/jsonl.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAe,KAAK,KAAK,EAAE,MAAM,QAAQ,CAAC;AAEjD,qBAAa,YAAY,CAAC,CAAC;IAIvB,OAAO,CAAC,QAAQ;IAHlB,UAAU,EAAE,eAAe,CAAC;gBAGlB,QAAQ,EAAE,qBAAqB,CAAC,KAAK,CAAC,EAC9C,UAAU,EAAE,eAAe;YAKd,OAAO;IAatB,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,aAAa,CAAC,CAAC,CAAC;IAI1C,MAAM,CAAC,YAAY,CAAC,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,eAAe,GAAG,YAAY,CAAC,CAAC,CAAC;CAQzF"}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.JSONLDecoder = void 0;
4
+ const error_1 = require("../../error.js");
5
+ const stream_utils_1 = require("../stream-utils.js");
6
+ const line_1 = require("./line.js");
7
+ class JSONLDecoder {
8
+ constructor(iterator, controller) {
9
+ this.iterator = iterator;
10
+ this.controller = controller;
11
+ }
12
+ async *decoder() {
13
+ const lineDecoder = new line_1.LineDecoder();
14
+ for await (const chunk of this.iterator) {
15
+ for (const line of lineDecoder.decode(chunk)) {
16
+ yield JSON.parse(line);
17
+ }
18
+ }
19
+ for (const line of lineDecoder.flush()) {
20
+ yield JSON.parse(line);
21
+ }
22
+ }
23
+ [Symbol.asyncIterator]() {
24
+ return this.decoder();
25
+ }
26
+ static fromResponse(response, controller) {
27
+ if (!response.body) {
28
+ controller.abort();
29
+ throw new error_1.LlamaStackClientError(`Attempted to iterate over a response with no body`);
30
+ }
31
+ return new JSONLDecoder((0, stream_utils_1.ReadableStreamToAsyncIterable)(response.body), controller);
32
+ }
33
+ }
34
+ exports.JSONLDecoder = JSONLDecoder;
35
+ //# sourceMappingURL=jsonl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsonl.js","sourceRoot":"","sources":["../../src/internal/decoders/jsonl.ts"],"names":[],"mappings":";;;AAAA,0CAAoD;AACpD,qDAAgE;AAEhE,oCAAiD;AAEjD,MAAa,YAAY;IAGvB,YACU,QAAsC,EAC9C,UAA2B;QADnB,aAAQ,GAAR,QAAQ,CAA8B;QAG9C,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;IAEO,KAAK,CAAC,CAAC,OAAO;QACpB,MAAM,WAAW,GAAG,IAAI,kBAAW,EAAE,CAAC;QACtC,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,IAAI,CAAC,QAAQ,EAAE;YACvC,KAAK,MAAM,IAAI,IAAI,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;gBAC5C,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;aACxB;SACF;QAED,KAAK,MAAM,IAAI,IAAI,WAAW,CAAC,KAAK,EAAE,EAAE;YACtC,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;SACxB;IACH,CAAC;IAED,CAAC,MAAM,CAAC,aAAa,CAAC;QACpB,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC;IACxB,CAAC;IAED,MAAM,CAAC,YAAY,CAAI,QAAkB,EAAE,UAA2B;QACpE,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE;YAClB,UAAU,CAAC,KAAK,EAAE,CAAC;YACnB,MAAM,IAAI,6BAAqB,CAAC,mDAAmD,CAAC,CAAC;SACtF;QAED,OAAO,IAAI,YAAY,CAAC,IAAA,4CAA6B,EAAQ,QAAQ,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC,CAAC;IAC3F,CAAC;CACF;AAnCD,oCAmCC"}
@@ -0,0 +1,31 @@
1
+ import { LlamaStackClientError } from "../../error.mjs";
2
+ import { ReadableStreamToAsyncIterable } from "../stream-utils.mjs";
3
+ import { LineDecoder } from "./line.mjs";
4
+ export class JSONLDecoder {
5
+ constructor(iterator, controller) {
6
+ this.iterator = iterator;
7
+ this.controller = controller;
8
+ }
9
+ async *decoder() {
10
+ const lineDecoder = new LineDecoder();
11
+ for await (const chunk of this.iterator) {
12
+ for (const line of lineDecoder.decode(chunk)) {
13
+ yield JSON.parse(line);
14
+ }
15
+ }
16
+ for (const line of lineDecoder.flush()) {
17
+ yield JSON.parse(line);
18
+ }
19
+ }
20
+ [Symbol.asyncIterator]() {
21
+ return this.decoder();
22
+ }
23
+ static fromResponse(response, controller) {
24
+ if (!response.body) {
25
+ controller.abort();
26
+ throw new LlamaStackClientError(`Attempted to iterate over a response with no body`);
27
+ }
28
+ return new JSONLDecoder(ReadableStreamToAsyncIterable(response.body), controller);
29
+ }
30
+ }
31
+ //# sourceMappingURL=jsonl.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsonl.mjs","sourceRoot":"","sources":["../../src/internal/decoders/jsonl.ts"],"names":[],"mappings":"OAAO,EAAE,qBAAqB,EAAE;OACzB,EAAE,6BAA6B,EAAE;OAEjC,EAAE,WAAW,EAAc;AAElC,MAAM,OAAO,YAAY;IAGvB,YACU,QAAsC,EAC9C,UAA2B;QADnB,aAAQ,GAAR,QAAQ,CAA8B;QAG9C,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;IAEO,KAAK,CAAC,CAAC,OAAO;QACpB,MAAM,WAAW,GAAG,IAAI,WAAW,EAAE,CAAC;QACtC,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,IAAI,CAAC,QAAQ,EAAE;YACvC,KAAK,MAAM,IAAI,IAAI,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;gBAC5C,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;aACxB;SACF;QAED,KAAK,MAAM,IAAI,IAAI,WAAW,CAAC,KAAK,EAAE,EAAE;YACtC,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;SACxB;IACH,CAAC;IAED,CAAC,MAAM,CAAC,aAAa,CAAC;QACpB,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC;IACxB,CAAC;IAED,MAAM,CAAC,YAAY,CAAI,QAAkB,EAAE,UAA2B;QACpE,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE;YAClB,UAAU,CAAC,KAAK,EAAE,CAAC;YACnB,MAAM,IAAI,qBAAqB,CAAC,mDAAmD,CAAC,CAAC;SACtF;QAED,OAAO,IAAI,YAAY,CAAC,6BAA6B,CAAQ,QAAQ,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC,CAAC;IAC3F,CAAC;CACF"}
@@ -0,0 +1,20 @@
1
+
2
+ export type Bytes = string | ArrayBuffer | Uint8Array | Buffer | null | undefined;
3
+ /**
4
+ * A re-implementation of httpx's `LineDecoder` in Python that handles incrementally
5
+ * reading lines from text.
6
+ *
7
+ * https://github.com/encode/httpx/blob/920333ea98118e9cf617f246905d7b202510941c/httpx/_decoders.py#L258
8
+ */
9
+ export declare class LineDecoder {
10
+ static NEWLINE_CHARS: Set<string>;
11
+ static NEWLINE_REGEXP: RegExp;
12
+ buffer: string[];
13
+ trailingCR: boolean;
14
+ textDecoder: any;
15
+ constructor();
16
+ decode(chunk: Bytes): string[];
17
+ decodeText(bytes: Bytes): string;
18
+ flush(): string[];
19
+ }
20
+ //# sourceMappingURL=line.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"line.d.ts","sourceRoot":"","sources":["../../src/internal/decoders/line.ts"],"names":[],"mappings":";AAEA,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG,WAAW,GAAG,UAAU,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;AAElF;;;;;GAKG;AACH,qBAAa,WAAW;IAEtB,MAAM,CAAC,aAAa,cAAyB;IAC7C,MAAM,CAAC,cAAc,SAAkB;IAEvC,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,GAAG,CAAC;;IAOjB,MAAM,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,EAAE;IA0C9B,UAAU,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM;IAqChC,KAAK,IAAI,MAAM,EAAE;CAUlB"}
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LineDecoder = void 0;
4
+ const error_1 = require("../../error.js");
5
+ /**
6
+ * A re-implementation of httpx's `LineDecoder` in Python that handles incrementally
7
+ * reading lines from text.
8
+ *
9
+ * https://github.com/encode/httpx/blob/920333ea98118e9cf617f246905d7b202510941c/httpx/_decoders.py#L258
10
+ */
11
+ class LineDecoder {
12
+ constructor() {
13
+ this.buffer = [];
14
+ this.trailingCR = false;
15
+ }
16
+ decode(chunk) {
17
+ let text = this.decodeText(chunk);
18
+ if (this.trailingCR) {
19
+ text = '\r' + text;
20
+ this.trailingCR = false;
21
+ }
22
+ if (text.endsWith('\r')) {
23
+ this.trailingCR = true;
24
+ text = text.slice(0, -1);
25
+ }
26
+ if (!text) {
27
+ return [];
28
+ }
29
+ const trailingNewline = LineDecoder.NEWLINE_CHARS.has(text[text.length - 1] || '');
30
+ let lines = text.split(LineDecoder.NEWLINE_REGEXP);
31
+ // if there is a trailing new line then the last entry will be an empty
32
+ // string which we don't care about
33
+ if (trailingNewline) {
34
+ lines.pop();
35
+ }
36
+ if (lines.length === 1 && !trailingNewline) {
37
+ this.buffer.push(lines[0]);
38
+ return [];
39
+ }
40
+ if (this.buffer.length > 0) {
41
+ lines = [this.buffer.join('') + lines[0], ...lines.slice(1)];
42
+ this.buffer = [];
43
+ }
44
+ if (!trailingNewline) {
45
+ this.buffer = [lines.pop() || ''];
46
+ }
47
+ return lines;
48
+ }
49
+ decodeText(bytes) {
50
+ if (bytes == null)
51
+ return '';
52
+ if (typeof bytes === 'string')
53
+ return bytes;
54
+ // Node:
55
+ if (typeof Buffer !== 'undefined') {
56
+ if (bytes instanceof Buffer) {
57
+ return bytes.toString();
58
+ }
59
+ if (bytes instanceof Uint8Array) {
60
+ return Buffer.from(bytes).toString();
61
+ }
62
+ throw new error_1.LlamaStackClientError(`Unexpected: received non-Uint8Array (${bytes.constructor.name}) stream chunk in an environment with a global "Buffer" defined, which this library assumes to be Node. Please report this error.`);
63
+ }
64
+ // Browser
65
+ if (typeof TextDecoder !== 'undefined') {
66
+ if (bytes instanceof Uint8Array || bytes instanceof ArrayBuffer) {
67
+ this.textDecoder ?? (this.textDecoder = new TextDecoder('utf8'));
68
+ return this.textDecoder.decode(bytes);
69
+ }
70
+ throw new error_1.LlamaStackClientError(`Unexpected: received non-Uint8Array/ArrayBuffer (${bytes.constructor.name}) in a web platform. Please report this error.`);
71
+ }
72
+ throw new error_1.LlamaStackClientError(`Unexpected: neither Buffer nor TextDecoder are available as globals. Please report this error.`);
73
+ }
74
+ flush() {
75
+ if (!this.buffer.length && !this.trailingCR) {
76
+ return [];
77
+ }
78
+ const lines = [this.buffer.join('')];
79
+ this.buffer = [];
80
+ this.trailingCR = false;
81
+ return lines;
82
+ }
83
+ }
84
+ exports.LineDecoder = LineDecoder;
85
+ // prettier-ignore
86
+ LineDecoder.NEWLINE_CHARS = new Set(['\n', '\r']);
87
+ LineDecoder.NEWLINE_REGEXP = /\r\n|[\n\r]/g;
88
+ //# sourceMappingURL=line.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"line.js","sourceRoot":"","sources":["../../src/internal/decoders/line.ts"],"names":[],"mappings":";;;AAAA,0CAAoD;AAIpD;;;;;GAKG;AACH,MAAa,WAAW;IAStB;QACE,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QACjB,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;IAC1B,CAAC;IAED,MAAM,CAAC,KAAY;QACjB,IAAI,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QAElC,IAAI,IAAI,CAAC,UAAU,EAAE;YACnB,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;YACnB,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;SACzB;QACD,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;YACvB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;YACvB,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;SAC1B;QAED,IAAI,CAAC,IAAI,EAAE;YACT,OAAO,EAAE,CAAC;SACX;QAED,MAAM,eAAe,GAAG,WAAW,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;QACnF,IAAI,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;QAEnD,uEAAuE;QACvE,mCAAmC;QACnC,IAAI,eAAe,EAAE;YACnB,KAAK,CAAC,GAAG,EAAE,CAAC;SACb;QAED,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,eAAe,EAAE;YAC1C,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAE,CAAC,CAAC;YAC5B,OAAO,EAAE,CAAC;SACX;QAED,IAAI,IAAI,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C,WAAW,CAAC,IAC7B,gDAAgD,CACjD,CAAC;SACH;QAED,MAAM,IAAI,6BAAqB,CAC7B,gGAAgG,CACjG,CAAC;IACJ,CAAC;IAED,KAAK;QACH,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;YAC3C,OAAO,EAAE,CAAC;SACX;QAED,MAAM,KAAK,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;QACrC,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QACjB,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QACxB,OAAO,KAAK,CAAC;IACf,CAAC;;AAtGH,kCAuGC;AAtGC,kBAAkB;AACX,yBAAa,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;AACtC,0BAAc,GAAG,cAAc,CAAC"}
@@ -0,0 +1,84 @@
1
+ import { LlamaStackClientError } from "../../error.mjs";
2
+ /**
3
+ * A re-implementation of httpx's `LineDecoder` in Python that handles incrementally
4
+ * reading lines from text.
5
+ *
6
+ * https://github.com/encode/httpx/blob/920333ea98118e9cf617f246905d7b202510941c/httpx/_decoders.py#L258
7
+ */
8
+ export class LineDecoder {
9
+ constructor() {
10
+ this.buffer = [];
11
+ this.trailingCR = false;
12
+ }
13
+ decode(chunk) {
14
+ let text = this.decodeText(chunk);
15
+ if (this.trailingCR) {
16
+ text = '\r' + text;
17
+ this.trailingCR = false;
18
+ }
19
+ if (text.endsWith('\r')) {
20
+ this.trailingCR = true;
21
+ text = text.slice(0, -1);
22
+ }
23
+ if (!text) {
24
+ return [];
25
+ }
26
+ const trailingNewline = LineDecoder.NEWLINE_CHARS.has(text[text.length - 1] || '');
27
+ let lines = text.split(LineDecoder.NEWLINE_REGEXP);
28
+ // if there is a trailing new line then the last entry will be an empty
29
+ // string which we don't care about
30
+ if (trailingNewline) {
31
+ lines.pop();
32
+ }
33
+ if (lines.length === 1 && !trailingNewline) {
34
+ this.buffer.push(lines[0]);
35
+ return [];
36
+ }
37
+ if (this.buffer.length > 0) {
38
+ lines = [this.buffer.join('') + lines[0], ...lines.slice(1)];
39
+ this.buffer = [];
40
+ }
41
+ if (!trailingNewline) {
42
+ this.buffer = [lines.pop() || ''];
43
+ }
44
+ return lines;
45
+ }
46
+ decodeText(bytes) {
47
+ if (bytes == null)
48
+ return '';
49
+ if (typeof bytes === 'string')
50
+ return bytes;
51
+ // Node:
52
+ if (typeof Buffer !== 'undefined') {
53
+ if (bytes instanceof Buffer) {
54
+ return bytes.toString();
55
+ }
56
+ if (bytes instanceof Uint8Array) {
57
+ return Buffer.from(bytes).toString();
58
+ }
59
+ throw new LlamaStackClientError(`Unexpected: received non-Uint8Array (${bytes.constructor.name}) stream chunk in an environment with a global "Buffer" defined, which this library assumes to be Node. Please report this error.`);
60
+ }
61
+ // Browser
62
+ if (typeof TextDecoder !== 'undefined') {
63
+ if (bytes instanceof Uint8Array || bytes instanceof ArrayBuffer) {
64
+ this.textDecoder ?? (this.textDecoder = new TextDecoder('utf8'));
65
+ return this.textDecoder.decode(bytes);
66
+ }
67
+ throw new LlamaStackClientError(`Unexpected: received non-Uint8Array/ArrayBuffer (${bytes.constructor.name}) in a web platform. Please report this error.`);
68
+ }
69
+ throw new LlamaStackClientError(`Unexpected: neither Buffer nor TextDecoder are available as globals. Please report this error.`);
70
+ }
71
+ flush() {
72
+ if (!this.buffer.length && !this.trailingCR) {
73
+ return [];
74
+ }
75
+ const lines = [this.buffer.join('')];
76
+ this.buffer = [];
77
+ this.trailingCR = false;
78
+ return lines;
79
+ }
80
+ }
81
+ // prettier-ignore
82
+ LineDecoder.NEWLINE_CHARS = new Set(['\n', '\r']);
83
+ LineDecoder.NEWLINE_REGEXP = /\r\n|[\n\r]/g;
84
+ //# sourceMappingURL=line.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"line.mjs","sourceRoot":"","sources":["../../src/intern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G,CACjG,CAAC;IACJ,CAAC;IAED,KAAK;QACH,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;YAC3C,OAAO,EAAE,CAAC;SACX;QAED,MAAM,KAAK,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;QACrC,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QACjB,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QACxB,OAAO,KAAK,CAAC;IACf,CAAC;;AArGD,kBAAkB;AACX,yBAAa,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;AACtC,0BAAc,GAAG,cAAc,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { Format } from "./types.js";
2
+ export declare const default_format: Format;
3
+ export declare const formatters: Record<Format, (str: PropertyKey) => string>;
4
+ export declare const RFC1738 = "RFC1738";
5
+ export declare const RFC3986 = "RFC3986";
6
+ //# sourceMappingURL=formats.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formats.d.ts","sourceRoot":"","sources":["../../src/internal/qs/formats.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEtC,eAAO,MAAM,cAAc,EAAE,MAAkB,CAAC;AAChD,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,WAAW,KAAK,MAAM,CAGnE,CAAC;AACF,eAAO,MAAM,OAAO,YAAY,CAAC;AACjC,eAAO,MAAM,OAAO,YAAY,CAAC"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RFC3986 = exports.RFC1738 = exports.formatters = exports.default_format = void 0;
4
+ exports.default_format = 'RFC3986';
5
+ exports.formatters = {
6
+ RFC1738: (v) => String(v).replace(/%20/g, '+'),
7
+ RFC3986: (v) => String(v),
8
+ };
9
+ exports.RFC1738 = 'RFC1738';
10
+ exports.RFC3986 = 'RFC3986';
11
+ //# sourceMappingURL=formats.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formats.js","sourceRoot":"","sources":["../../src/internal/qs/formats.ts"],"names":[],"mappings":";;;AAEa,QAAA,cAAc,GAAW,SAAS,CAAC;AACnC,QAAA,UAAU,GAAiD;IACtE,OAAO,EAAE,CAAC,CAAc,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;IAC3D,OAAO,EAAE,CAAC,CAAc,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;CACvC,CAAC;AACW,QAAA,OAAO,GAAG,SAAS,CAAC;AACpB,QAAA,OAAO,GAAG,SAAS,CAAC"}
@@ -0,0 +1,8 @@
1
+ export const default_format = 'RFC3986';
2
+ export const formatters = {
3
+ RFC1738: (v) => String(v).replace(/%20/g, '+'),
4
+ RFC3986: (v) => String(v),
5
+ };
6
+ export const RFC1738 = 'RFC1738';
7
+ export const RFC3986 = 'RFC3986';
8
+ //# sourceMappingURL=formats.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formats.mjs","sourceRoot":"","sources":["../../src/internal/qs/formats.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,cAAc,GAAW,SAAS,CAAC;AAChD,MAAM,CAAC,MAAM,UAAU,GAAiD;IACtE,OAAO,EAAE,CAAC,CAAc,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;IAC3D,OAAO,EAAE,CAAC,CAAc,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;CACvC,CAAC;AACF,MAAM,CAAC,MAAM,OAAO,GAAG,SAAS,CAAC;AACjC,MAAM,CAAC,MAAM,OAAO,GAAG,SAAS,CAAC"}
@@ -0,0 +1,10 @@
1
+ declare const formats: {
2
+ formatters: Record<import("./types").Format, (str: PropertyKey) => string>;
3
+ RFC1738: string;
4
+ RFC3986: string;
5
+ default: import("./types").Format;
6
+ };
7
+ export { stringify } from "./stringify.js";
8
+ export { formats };
9
+ export type { DefaultDecoder, DefaultEncoder, Format, ParseOptions, StringifyOptions } from "./types.js";
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/internal/qs/index.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,OAAO;;;;;CAKZ,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,CAAC;AAEnB,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.formats = exports.stringify = void 0;
4
+ const formats_1 = require("./formats.js");
5
+ const formats = {
6
+ formatters: formats_1.formatters,
7
+ RFC1738: formats_1.RFC1738,
8
+ RFC3986: formats_1.RFC3986,
9
+ default: formats_1.default_format,
10
+ };
11
+ exports.formats = formats;
12
+ var stringify_1 = require("./stringify.js");
13
+ Object.defineProperty(exports, "stringify", { enumerable: true, get: function () { return stringify_1.stringify; } });
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/internal/qs/index.ts"],"names":[],"mappings":";;;AAAA,0CAAyE;AAEzE,MAAM,OAAO,GAAG;IACd,UAAU,EAAV,oBAAU;IACV,OAAO,EAAP,iBAAO;IACP,OAAO,EAAP,iBAAO;IACP,OAAO,EAAE,wBAAc;CACxB,CAAC;AAGO,0BAAO;AADhB,4CAAwC;AAA/B,sGAAA,SAAS,OAAA"}
@@ -0,0 +1,10 @@
1
+ import { default_format, formatters, RFC1738, RFC3986 } from "./formats.mjs";
2
+ const formats = {
3
+ formatters,
4
+ RFC1738,
5
+ RFC3986,
6
+ default: default_format,
7
+ };
8
+ export { stringify } from "./stringify.mjs";
9
+ export { formats };
10
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/internal/qs/index.ts"],"names":[],"mappings":"OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE;AAEvD,MAAM,OAAO,GAAG;IACd,UAAU;IACV,OAAO;IACP,OAAO;IACP,OAAO,EAAE,cAAc;CACxB,CAAC;OAEK,EAAE,SAAS,EAAE;AACpB,OAAO,EAAE,OAAO,EAAE,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { StringifyOptions } from "./types.js";
2
+ export declare function stringify(object: any, opts?: StringifyOptions): string;
3
+ //# sourceMappingURL=stringify.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stringify.d.ts","sourceRoot":"","sources":["../../src/internal/qs/stringify.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAyB,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAkTvE,wBAAgB,SAAS,CAAC,MAAM,EAAE,GAAG,EAAE,IAAI,GAAE,gBAAqB,UA+EjE"}