llama-stack-client 0.6.1 → 0.7.1

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 (332) hide show
  1. package/.github/workflows/ci.yml +16 -10
  2. package/.gitignore +1 -0
  3. package/.release-please-manifest.json +1 -1
  4. package/.stats.yml +4 -4
  5. package/CHANGELOG.md +80 -0
  6. package/CONTRIBUTING.md +2 -2
  7. package/README.md +22 -0
  8. package/api.md +1 -71
  9. package/dist/CHANGELOG.md +80 -0
  10. package/dist/README.md +22 -0
  11. package/dist/core.d.ts +1 -1
  12. package/dist/core.d.ts.map +1 -1
  13. package/dist/core.js +8 -17
  14. package/dist/core.js.map +1 -1
  15. package/dist/core.mjs +8 -17
  16. package/dist/core.mjs.map +1 -1
  17. package/dist/index.d.mts +51 -12
  18. package/dist/index.d.ts +51 -12
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js +50 -11
  21. package/dist/index.js.map +1 -1
  22. package/dist/index.mjs +50 -11
  23. package/dist/index.mjs.map +1 -1
  24. package/dist/internal/utils/query.d.ts +2 -0
  25. package/dist/internal/utils/query.d.ts.map +1 -0
  26. package/dist/{resources/alpha/post-training/post-training.js → internal/utils/query.js} +6 -24
  27. package/dist/internal/utils/query.js.map +1 -0
  28. package/dist/{resources/alpha/post-training.mjs → internal/utils/query.mjs} +5 -2
  29. package/dist/internal/utils/query.mjs.map +1 -0
  30. package/dist/package.json +1 -1
  31. package/dist/resources/alpha/alpha.d.ts +0 -4
  32. package/dist/resources/alpha/alpha.d.ts.map +1 -1
  33. package/dist/resources/alpha/alpha.js +0 -4
  34. package/dist/resources/alpha/alpha.js.map +1 -1
  35. package/dist/resources/alpha/alpha.mjs +0 -4
  36. package/dist/resources/alpha/alpha.mjs.map +1 -1
  37. package/dist/resources/alpha/eval/eval.d.ts +3 -0
  38. package/dist/resources/alpha/eval/eval.d.ts.map +1 -1
  39. package/dist/resources/alpha/eval/eval.js +3 -0
  40. package/dist/resources/alpha/eval/eval.js.map +1 -1
  41. package/dist/resources/alpha/eval/eval.mjs +3 -0
  42. package/dist/resources/alpha/eval/eval.mjs.map +1 -1
  43. package/dist/resources/alpha/eval/jobs.d.ts +3 -0
  44. package/dist/resources/alpha/eval/jobs.d.ts.map +1 -1
  45. package/dist/resources/alpha/eval/jobs.js +3 -0
  46. package/dist/resources/alpha/eval/jobs.js.map +1 -1
  47. package/dist/resources/alpha/eval/jobs.mjs +3 -0
  48. package/dist/resources/alpha/eval/jobs.mjs.map +1 -1
  49. package/dist/resources/alpha/index.d.ts +0 -1
  50. package/dist/resources/alpha/index.d.ts.map +1 -1
  51. package/dist/resources/alpha/index.js +1 -3
  52. package/dist/resources/alpha/index.js.map +1 -1
  53. package/dist/resources/alpha/index.mjs +0 -1
  54. package/dist/resources/alpha/index.mjs.map +1 -1
  55. package/dist/resources/alpha/inference.d.ts +8 -0
  56. package/dist/resources/alpha/inference.d.ts.map +1 -1
  57. package/dist/resources/alpha/inference.js +8 -0
  58. package/dist/resources/alpha/inference.js.map +1 -1
  59. package/dist/resources/alpha/inference.mjs +8 -0
  60. package/dist/resources/alpha/inference.mjs.map +1 -1
  61. package/dist/resources/batches.d.ts +8 -0
  62. package/dist/resources/batches.d.ts.map +1 -1
  63. package/dist/resources/batches.js +8 -0
  64. package/dist/resources/batches.js.map +1 -1
  65. package/dist/resources/batches.mjs +8 -0
  66. package/dist/resources/batches.mjs.map +1 -1
  67. package/dist/resources/beta/datasets.d.ts +4 -8
  68. package/dist/resources/beta/datasets.d.ts.map +1 -1
  69. package/dist/resources/chat/chat.d.ts +34 -32
  70. package/dist/resources/chat/chat.d.ts.map +1 -1
  71. package/dist/resources/chat/chat.js.map +1 -1
  72. package/dist/resources/chat/chat.mjs.map +1 -1
  73. package/dist/resources/chat/completions.d.ts +321 -713
  74. package/dist/resources/chat/completions.d.ts.map +1 -1
  75. package/dist/resources/chat/completions.js +8 -0
  76. package/dist/resources/chat/completions.js.map +1 -1
  77. package/dist/resources/chat/completions.mjs +8 -0
  78. package/dist/resources/chat/completions.mjs.map +1 -1
  79. package/dist/resources/completions.d.ts +10 -4
  80. package/dist/resources/completions.d.ts.map +1 -1
  81. package/dist/resources/completions.js +8 -0
  82. package/dist/resources/completions.js.map +1 -1
  83. package/dist/resources/completions.mjs +8 -0
  84. package/dist/resources/completions.mjs.map +1 -1
  85. package/dist/resources/conversations/conversations.d.ts +95 -2
  86. package/dist/resources/conversations/conversations.d.ts.map +1 -1
  87. package/dist/resources/conversations/conversations.js +3 -0
  88. package/dist/resources/conversations/conversations.js.map +1 -1
  89. package/dist/resources/conversations/conversations.mjs +3 -0
  90. package/dist/resources/conversations/conversations.mjs.map +1 -1
  91. package/dist/resources/conversations/items.d.ts +371 -8
  92. package/dist/resources/conversations/items.d.ts.map +1 -1
  93. package/dist/resources/conversations/items.js +3 -0
  94. package/dist/resources/conversations/items.js.map +1 -1
  95. package/dist/resources/conversations/items.mjs +3 -0
  96. package/dist/resources/conversations/items.mjs.map +1 -1
  97. package/dist/resources/embeddings.d.ts +8 -0
  98. package/dist/resources/embeddings.d.ts.map +1 -1
  99. package/dist/resources/embeddings.js +8 -0
  100. package/dist/resources/embeddings.js.map +1 -1
  101. package/dist/resources/embeddings.mjs +8 -0
  102. package/dist/resources/embeddings.mjs.map +1 -1
  103. package/dist/resources/files.d.ts +11 -8
  104. package/dist/resources/files.d.ts.map +1 -1
  105. package/dist/resources/files.js +3 -0
  106. package/dist/resources/files.js.map +1 -1
  107. package/dist/resources/files.mjs +3 -0
  108. package/dist/resources/files.mjs.map +1 -1
  109. package/dist/resources/index.d.ts +1 -4
  110. package/dist/resources/index.d.ts.map +1 -1
  111. package/dist/resources/index.js +1 -7
  112. package/dist/resources/index.js.map +1 -1
  113. package/dist/resources/index.mjs +0 -3
  114. package/dist/resources/index.mjs.map +1 -1
  115. package/dist/resources/inspect.d.ts +3 -0
  116. package/dist/resources/inspect.d.ts.map +1 -1
  117. package/dist/resources/inspect.js +3 -0
  118. package/dist/resources/inspect.js.map +1 -1
  119. package/dist/resources/inspect.mjs +3 -0
  120. package/dist/resources/inspect.mjs.map +1 -1
  121. package/dist/resources/models/index.d.ts +1 -1
  122. package/dist/resources/models/index.d.ts.map +1 -1
  123. package/dist/resources/models/index.js.map +1 -1
  124. package/dist/resources/models/index.mjs.map +1 -1
  125. package/dist/resources/models/models.d.ts +7 -65
  126. package/dist/resources/models/models.d.ts.map +1 -1
  127. package/dist/resources/models/models.js +0 -19
  128. package/dist/resources/models/models.js.map +1 -1
  129. package/dist/resources/models/models.mjs +0 -19
  130. package/dist/resources/models/models.mjs.map +1 -1
  131. package/dist/resources/moderations.d.ts +3 -0
  132. package/dist/resources/moderations.d.ts.map +1 -1
  133. package/dist/resources/moderations.js +3 -0
  134. package/dist/resources/moderations.js.map +1 -1
  135. package/dist/resources/moderations.mjs +3 -0
  136. package/dist/resources/moderations.mjs.map +1 -1
  137. package/dist/resources/prompts/prompts.d.ts +3 -0
  138. package/dist/resources/prompts/prompts.d.ts.map +1 -1
  139. package/dist/resources/prompts/prompts.js +3 -0
  140. package/dist/resources/prompts/prompts.js.map +1 -1
  141. package/dist/resources/prompts/prompts.mjs +3 -0
  142. package/dist/resources/prompts/prompts.mjs.map +1 -1
  143. package/dist/resources/prompts/versions.d.ts +3 -0
  144. package/dist/resources/prompts/versions.d.ts.map +1 -1
  145. package/dist/resources/prompts/versions.js +3 -0
  146. package/dist/resources/prompts/versions.js.map +1 -1
  147. package/dist/resources/prompts/versions.mjs +3 -0
  148. package/dist/resources/prompts/versions.mjs.map +1 -1
  149. package/dist/resources/providers.d.ts +3 -0
  150. package/dist/resources/providers.d.ts.map +1 -1
  151. package/dist/resources/providers.js +3 -0
  152. package/dist/resources/providers.js.map +1 -1
  153. package/dist/resources/providers.mjs +3 -0
  154. package/dist/resources/providers.mjs.map +1 -1
  155. package/dist/resources/responses/input-items.d.ts +102 -3
  156. package/dist/resources/responses/input-items.d.ts.map +1 -1
  157. package/dist/resources/responses/responses.d.ts +582 -11
  158. package/dist/resources/responses/responses.d.ts.map +1 -1
  159. package/dist/resources/responses/responses.js.map +1 -1
  160. package/dist/resources/responses/responses.mjs.map +1 -1
  161. package/dist/resources/routes.d.ts +3 -0
  162. package/dist/resources/routes.d.ts.map +1 -1
  163. package/dist/resources/routes.js +3 -0
  164. package/dist/resources/routes.js.map +1 -1
  165. package/dist/resources/routes.mjs +3 -0
  166. package/dist/resources/routes.mjs.map +1 -1
  167. package/dist/resources/safety.d.ts +14 -11
  168. package/dist/resources/safety.d.ts.map +1 -1
  169. package/dist/resources/safety.js +3 -0
  170. package/dist/resources/safety.js.map +1 -1
  171. package/dist/resources/safety.mjs +3 -0
  172. package/dist/resources/safety.mjs.map +1 -1
  173. package/dist/resources/vector-io.d.ts +4 -4
  174. package/dist/resources/vector-stores/file-batches.d.ts +49 -1
  175. package/dist/resources/vector-stores/file-batches.d.ts.map +1 -1
  176. package/dist/resources/vector-stores/file-batches.js.map +1 -1
  177. package/dist/resources/vector-stores/file-batches.mjs.map +1 -1
  178. package/dist/resources/vector-stores/files.d.ts +100 -4
  179. package/dist/resources/vector-stores/files.d.ts.map +1 -1
  180. package/dist/resources/vector-stores/files.js.map +1 -1
  181. package/dist/resources/vector-stores/files.mjs.map +1 -1
  182. package/dist/resources/vector-stores/vector-stores.d.ts +51 -3
  183. package/dist/resources/vector-stores/vector-stores.d.ts.map +1 -1
  184. package/dist/resources/vector-stores/vector-stores.js.map +1 -1
  185. package/dist/resources/vector-stores/vector-stores.mjs.map +1 -1
  186. package/dist/src/core.ts +10 -21
  187. package/dist/src/index.ts +51 -48
  188. package/{src/resources/alpha/post-training.ts → dist/src/internal/utils/query.ts} +5 -1
  189. package/dist/src/resources/alpha/alpha.ts +0 -20
  190. package/dist/src/resources/alpha/eval/eval.ts +3 -0
  191. package/dist/src/resources/alpha/eval/jobs.ts +3 -0
  192. package/dist/src/resources/alpha/index.ts +0 -8
  193. package/dist/src/resources/alpha/inference.ts +8 -0
  194. package/dist/src/resources/batches.ts +8 -0
  195. package/dist/src/resources/beta/datasets.ts +4 -9
  196. package/dist/src/resources/chat/chat.ts +36 -33
  197. package/dist/src/resources/chat/completions.ts +307 -811
  198. package/dist/src/resources/completions.ts +10 -4
  199. package/dist/src/resources/conversations/conversations.ts +121 -1
  200. package/dist/src/resources/conversations/items.ts +477 -6
  201. package/dist/src/resources/embeddings.ts +8 -0
  202. package/dist/src/resources/files.ts +12 -9
  203. package/dist/src/resources/index.ts +0 -18
  204. package/dist/src/resources/inspect.ts +3 -0
  205. package/dist/src/resources/models/index.ts +0 -2
  206. package/dist/src/resources/models/models.ts +7 -82
  207. package/dist/src/resources/moderations.ts +3 -0
  208. package/dist/src/resources/prompts/prompts.ts +3 -0
  209. package/dist/src/resources/prompts/versions.ts +3 -0
  210. package/dist/src/resources/providers.ts +3 -0
  211. package/dist/src/resources/responses/input-items.ts +128 -2
  212. package/dist/src/resources/responses/responses.ts +706 -7
  213. package/dist/src/resources/routes.ts +3 -0
  214. package/dist/src/resources/safety.ts +15 -12
  215. package/dist/src/resources/vector-io.ts +4 -4
  216. package/dist/src/resources/vector-stores/file-batches.ts +57 -0
  217. package/dist/src/resources/vector-stores/files.ts +117 -3
  218. package/dist/src/resources/vector-stores/vector-stores.ts +59 -2
  219. package/dist/src/streaming.ts +24 -6
  220. package/dist/src/version.ts +1 -1
  221. package/dist/streaming.d.ts.map +1 -1
  222. package/dist/streaming.js +21 -6
  223. package/dist/streaming.js.map +1 -1
  224. package/dist/streaming.mjs +21 -6
  225. package/dist/streaming.mjs.map +1 -1
  226. package/dist/version.d.ts +1 -1
  227. package/dist/version.js +1 -1
  228. package/dist/version.mjs +1 -1
  229. package/package.json +1 -1
  230. package/scripts/mock +21 -10
  231. package/scripts/test +8 -8
  232. package/src/core.ts +10 -21
  233. package/src/index.ts +51 -48
  234. package/{dist/src/resources/alpha/post-training.ts → src/internal/utils/query.ts} +5 -1
  235. package/src/resources/alpha/alpha.ts +0 -20
  236. package/src/resources/alpha/eval/eval.ts +3 -0
  237. package/src/resources/alpha/eval/jobs.ts +3 -0
  238. package/src/resources/alpha/index.ts +0 -8
  239. package/src/resources/alpha/inference.ts +8 -0
  240. package/src/resources/batches.ts +8 -0
  241. package/src/resources/beta/datasets.ts +4 -9
  242. package/src/resources/chat/chat.ts +36 -33
  243. package/src/resources/chat/completions.ts +307 -811
  244. package/src/resources/completions.ts +10 -4
  245. package/src/resources/conversations/conversations.ts +121 -1
  246. package/src/resources/conversations/items.ts +477 -6
  247. package/src/resources/embeddings.ts +8 -0
  248. package/src/resources/files.ts +12 -9
  249. package/src/resources/index.ts +0 -18
  250. package/src/resources/inspect.ts +3 -0
  251. package/src/resources/models/index.ts +0 -2
  252. package/src/resources/models/models.ts +7 -82
  253. package/src/resources/moderations.ts +3 -0
  254. package/src/resources/prompts/prompts.ts +3 -0
  255. package/src/resources/prompts/versions.ts +3 -0
  256. package/src/resources/providers.ts +3 -0
  257. package/src/resources/responses/input-items.ts +128 -2
  258. package/src/resources/responses/responses.ts +706 -7
  259. package/src/resources/routes.ts +3 -0
  260. package/src/resources/safety.ts +15 -12
  261. package/src/resources/vector-io.ts +4 -4
  262. package/src/resources/vector-stores/file-batches.ts +57 -0
  263. package/src/resources/vector-stores/files.ts +117 -3
  264. package/src/resources/vector-stores/vector-stores.ts +59 -2
  265. package/src/streaming.ts +24 -6
  266. package/src/version.ts +1 -1
  267. package/tests/api-resources/beta/datasets.test.ts +4 -10
  268. package/tests/api-resources/chat/completions.test.ts +2 -0
  269. package/tests/api-resources/files.test.ts +2 -2
  270. package/tests/api-resources/models/models.test.ts +0 -39
  271. package/tests/api-resources/responses/responses.test.ts +10 -1
  272. package/tests/api-resources/vector-stores/file-batches.test.ts +1 -1
  273. package/tests/api-resources/vector-stores/files.test.ts +1 -1
  274. package/tests/api-resources/vector-stores/vector-stores.test.ts +1 -1
  275. package/tests/stringifyQuery.test.ts +2 -4
  276. package/dist/resources/alpha/post-training/index.d.ts +0 -3
  277. package/dist/resources/alpha/post-training/index.d.ts.map +0 -1
  278. package/dist/resources/alpha/post-training/index.js +0 -15
  279. package/dist/resources/alpha/post-training/index.js.map +0 -1
  280. package/dist/resources/alpha/post-training/index.mjs +0 -10
  281. package/dist/resources/alpha/post-training/index.mjs.map +0 -1
  282. package/dist/resources/alpha/post-training/job.d.ts +0 -104
  283. package/dist/resources/alpha/post-training/job.d.ts.map +0 -1
  284. package/dist/resources/alpha/post-training/job.js +0 -42
  285. package/dist/resources/alpha/post-training/job.js.map +0 -1
  286. package/dist/resources/alpha/post-training/job.mjs +0 -38
  287. package/dist/resources/alpha/post-training/job.mjs.map +0 -1
  288. package/dist/resources/alpha/post-training/post-training.d.ts +0 -269
  289. package/dist/resources/alpha/post-training/post-training.d.ts.map +0 -1
  290. package/dist/resources/alpha/post-training/post-training.js.map +0 -1
  291. package/dist/resources/alpha/post-training/post-training.mjs +0 -30
  292. package/dist/resources/alpha/post-training/post-training.mjs.map +0 -1
  293. package/dist/resources/alpha/post-training.d.ts +0 -2
  294. package/dist/resources/alpha/post-training.d.ts.map +0 -1
  295. package/dist/resources/alpha/post-training.js +0 -25
  296. package/dist/resources/alpha/post-training.js.map +0 -1
  297. package/dist/resources/alpha/post-training.mjs.map +0 -1
  298. package/dist/resources/tool-runtime.d.ts +0 -152
  299. package/dist/resources/tool-runtime.d.ts.map +0 -1
  300. package/dist/resources/tool-runtime.js +0 -30
  301. package/dist/resources/tool-runtime.js.map +0 -1
  302. package/dist/resources/tool-runtime.mjs +0 -26
  303. package/dist/resources/tool-runtime.mjs.map +0 -1
  304. package/dist/resources/toolgroups.d.ts +0 -91
  305. package/dist/resources/toolgroups.d.ts.map +0 -1
  306. package/dist/resources/toolgroups.js +0 -54
  307. package/dist/resources/toolgroups.js.map +0 -1
  308. package/dist/resources/toolgroups.mjs +0 -50
  309. package/dist/resources/toolgroups.mjs.map +0 -1
  310. package/dist/resources/tools.d.ts +0 -26
  311. package/dist/resources/tools.d.ts.map +0 -1
  312. package/dist/resources/tools.js +0 -30
  313. package/dist/resources/tools.js.map +0 -1
  314. package/dist/resources/tools.mjs +0 -26
  315. package/dist/resources/tools.mjs.map +0 -1
  316. package/dist/src/resources/alpha/post-training/index.ts +0 -17
  317. package/dist/src/resources/alpha/post-training/job.ts +0 -161
  318. package/dist/src/resources/alpha/post-training/post-training.ts +0 -385
  319. package/dist/src/resources/tool-runtime.ts +0 -217
  320. package/dist/src/resources/toolgroups.ts +0 -135
  321. package/dist/src/resources/tools.ts +0 -52
  322. package/src/resources/alpha/post-training/index.ts +0 -17
  323. package/src/resources/alpha/post-training/job.ts +0 -161
  324. package/src/resources/alpha/post-training/post-training.ts +0 -385
  325. package/src/resources/tool-runtime.ts +0 -217
  326. package/src/resources/toolgroups.ts +0 -135
  327. package/src/resources/tools.ts +0 -52
  328. package/tests/api-resources/alpha/post-training/job.test.ts +0 -86
  329. package/tests/api-resources/alpha/post-training/post-training.test.ts +0 -134
  330. package/tests/api-resources/tool-runtime.test.ts +0 -68
  331. package/tests/api-resources/toolgroups.test.ts +0 -91
  332. package/tests/api-resources/tools.test.ts +0 -57
package/dist/version.js CHANGED
@@ -6,5 +6,5 @@
6
6
  // the root directory of this source tree.
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.VERSION = void 0;
9
- exports.VERSION = '0.6.1'; // x-release-please-version
9
+ exports.VERSION = '0.7.1'; // x-release-please-version
10
10
  //# sourceMappingURL=version.js.map
package/dist/version.mjs CHANGED
@@ -3,5 +3,5 @@
3
3
  //
4
4
  // This source code is licensed under the terms described in the LICENSE file in
5
5
  // the root directory of this source tree.
6
- export const VERSION = '0.6.1'; // x-release-please-version
6
+ export const VERSION = '0.7.1'; // x-release-please-version
7
7
  //# sourceMappingURL=version.mjs.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "llama-stack-client",
3
- "version": "0.6.1",
3
+ "version": "0.7.1",
4
4
  "description": "The official TypeScript library for the Llama Stack Client API",
5
5
  "author": "Llama Stack Client <llamastack@meta.com>",
6
6
  "types": "dist/index.d.ts",
package/scripts/mock CHANGED
@@ -19,23 +19,34 @@ fi
19
19
 
20
20
  echo "==> Starting mock server with URL ${URL}"
21
21
 
22
- # Run prism mock on the given spec
22
+ # Run steady mock on the given spec
23
23
  if [ "$1" == "--daemon" ]; then
24
- npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" &> .prism.log &
24
+ # Pre-install the package so the download doesn't eat into the startup timeout
25
+ npm exec --package=@stdy/cli@0.20.2 -- steady --version
25
26
 
26
- # Wait for server to come online
27
+ npm exec --package=@stdy/cli@0.20.2 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" &> .stdy.log &
28
+
29
+ # Wait for server to come online via health endpoint (max 30s)
27
30
  echo -n "Waiting for server"
28
- while ! grep -q "✖ fatal\|Prism is listening" ".prism.log" ; do
31
+ attempts=0
32
+ while ! curl --silent --fail "http://127.0.0.1:4010/_x-steady/health" >/dev/null 2>&1; do
33
+ if ! kill -0 $! 2>/dev/null; then
34
+ echo
35
+ cat .stdy.log
36
+ exit 1
37
+ fi
38
+ attempts=$((attempts + 1))
39
+ if [ "$attempts" -ge 300 ]; then
40
+ echo
41
+ echo "Timed out waiting for Steady server to start"
42
+ cat .stdy.log
43
+ exit 1
44
+ fi
29
45
  echo -n "."
30
46
  sleep 0.1
31
47
  done
32
48
 
33
- if grep -q "✖ fatal" ".prism.log"; then
34
- cat .prism.log
35
- exit 1
36
- fi
37
-
38
49
  echo
39
50
  else
40
- npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL"
51
+ npm exec --package=@stdy/cli@0.20.2 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL"
41
52
  fi
package/scripts/test CHANGED
@@ -9,8 +9,8 @@ GREEN='\033[0;32m'
9
9
  YELLOW='\033[0;33m'
10
10
  NC='\033[0m' # No Color
11
11
 
12
- function prism_is_running() {
13
- curl --silent "http://localhost:4010" >/dev/null 2>&1
12
+ function steady_is_running() {
13
+ curl --silent "http://127.0.0.1:4010/_x-steady/health" >/dev/null 2>&1
14
14
  }
15
15
 
16
16
  kill_server_on_port() {
@@ -25,7 +25,7 @@ function is_overriding_api_base_url() {
25
25
  [ -n "$TEST_API_BASE_URL" ]
26
26
  }
27
27
 
28
- if ! is_overriding_api_base_url && ! prism_is_running ; then
28
+ if ! is_overriding_api_base_url && ! steady_is_running ; then
29
29
  # When we exit this script, make sure to kill the background mock server process
30
30
  trap 'kill_server_on_port 4010' EXIT
31
31
 
@@ -36,19 +36,19 @@ fi
36
36
  if is_overriding_api_base_url ; then
37
37
  echo -e "${GREEN}✔ Running tests against ${TEST_API_BASE_URL}${NC}"
38
38
  echo
39
- elif ! prism_is_running ; then
40
- echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Prism server"
39
+ elif ! steady_is_running ; then
40
+ echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Steady server"
41
41
  echo -e "running against your OpenAPI spec."
42
42
  echo
43
43
  echo -e "To run the server, pass in the path or url of your OpenAPI"
44
- echo -e "spec to the prism command:"
44
+ echo -e "spec to the steady command:"
45
45
  echo
46
- echo -e " \$ ${YELLOW}npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock path/to/your.openapi.yml${NC}"
46
+ echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.20.2 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets${NC}"
47
47
  echo
48
48
 
49
49
  exit 1
50
50
  else
51
- echo -e "${GREEN}✔ Mock prism server is running with your OpenAPI spec${NC}"
51
+ echo -e "${GREEN}✔ Mock steady server is running with your OpenAPI spec${NC}"
52
52
  echo
53
53
  fi
54
54
 
package/src/core.ts CHANGED
@@ -13,6 +13,7 @@ import {
13
13
  APIConnectionTimeoutError,
14
14
  APIUserAbortError,
15
15
  } from './error';
16
+ import { stringifyQuery } from './internal/utils/query';
16
17
  import {
17
18
  kind as shimsKind,
18
19
  type Readable,
@@ -543,32 +544,20 @@ export abstract class APIClient {
543
544
  : new URL(baseURL + (baseURL.endsWith('/') && path.startsWith('/') ? path.slice(1) : path));
544
545
 
545
546
  const defaultQuery = this.defaultQuery();
546
- if (!isEmptyObj(defaultQuery)) {
547
- query = { ...defaultQuery, ...query } as Req;
547
+ const pathQuery = Object.fromEntries(url.searchParams);
548
+ if (!isEmptyObj(defaultQuery) || !isEmptyObj(pathQuery)) {
549
+ query = { ...pathQuery, ...defaultQuery, ...query } as Req;
548
550
  }
549
551
 
550
552
  if (typeof query === 'object' && query && !Array.isArray(query)) {
551
- url.search = this.stringifyQuery(query as Record<string, unknown>);
553
+ url.search = this.stringifyQuery(query);
552
554
  }
553
555
 
554
556
  return url.toString();
555
557
  }
556
558
 
557
- protected stringifyQuery(query: Record<string, unknown>): string {
558
- return Object.entries(query)
559
- .filter(([_, value]) => typeof value !== 'undefined')
560
- .map(([key, value]) => {
561
- if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
562
- return `${encodeURIComponent(key)}=${encodeURIComponent(value)}`;
563
- }
564
- if (value === null) {
565
- return `${encodeURIComponent(key)}=`;
566
- }
567
- throw new LlamaStackClientError(
568
- `Cannot stringify type ${typeof value}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`,
569
- );
570
- })
571
- .join('&');
559
+ protected stringifyQuery(query: object | Record<string, unknown>): string {
560
+ return stringifyQuery(query);
572
561
  }
573
562
 
574
563
  async fetchWithTimeout(
@@ -650,9 +639,9 @@ export abstract class APIClient {
650
639
  }
651
640
  }
652
641
 
653
- // If the API asks us to wait a certain amount of time (and it's a reasonable amount),
654
- // just do what it says, but otherwise calculate a default
655
- if (!(timeoutMillis && 0 <= timeoutMillis && timeoutMillis < 60 * 1000)) {
642
+ // If the API asks us to wait a certain amount of time, do what it says.
643
+ // Otherwise calculate a default.
644
+ if (timeoutMillis === undefined) {
656
645
  const maxRetries = options.maxRetries ?? this.maxRetries;
657
646
  timeoutMillis = this.calculateDefaultRetryTimeoutMillis(retriesRemaining, maxRetries);
658
647
  }
package/src/index.ts CHANGED
@@ -8,7 +8,7 @@
8
8
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
9
9
 
10
10
  import { type Agent } from './_shims/index';
11
- import * as qs from './internal/qs';
11
+ import { stringifyQuery } from './internal/utils/query';
12
12
  import * as Core from './core';
13
13
  import * as Errors from './error';
14
14
  import * as Pagination from './pagination';
@@ -75,22 +75,6 @@ import {
75
75
  ShieldRegisterParams,
76
76
  Shields,
77
77
  } from './resources/shields';
78
- import {
79
- ToolDef,
80
- ToolInvocationResult,
81
- ToolRuntime,
82
- ToolRuntimeInvokeToolParams,
83
- ToolRuntimeListToolsParams,
84
- ToolRuntimeListToolsResponse,
85
- } from './resources/tool-runtime';
86
- import {
87
- ListToolGroupsResponse,
88
- ToolGroup,
89
- ToolgroupListResponse,
90
- ToolgroupRegisterParams,
91
- Toolgroups,
92
- } from './resources/toolgroups';
93
- import { ToolListParams, ToolListResponse, Tools } from './resources/tools';
94
78
  import {
95
79
  QueryChunksResponse,
96
80
  VectorIo,
@@ -111,8 +95,6 @@ import {
111
95
  ListModelsResponse,
112
96
  Model,
113
97
  ModelListResponse,
114
- ModelRegisterParams,
115
- ModelRegisterResponse,
116
98
  ModelRetrieveResponse,
117
99
  Models,
118
100
  } from './resources/models/models';
@@ -261,27 +243,72 @@ export class LlamaStackClient extends Core.APIClient {
261
243
  this.apiKey = apiKey;
262
244
  }
263
245
 
264
- toolgroups: API.Toolgroups = new API.Toolgroups(this);
265
- tools: API.Tools = new API.Tools(this);
266
- toolRuntime: API.ToolRuntime = new API.ToolRuntime(this);
267
246
  responses: API.Responses = new API.Responses(this);
247
+ /**
248
+ * Protocol for prompt management operations.
249
+ */
268
250
  prompts: API.Prompts = new API.Prompts(this);
251
+ /**
252
+ * Protocol for conversation management operations.
253
+ */
269
254
  conversations: API.Conversations = new API.Conversations(this);
255
+ /**
256
+ * APIs for inspecting the Llama Stack service, including health status, available API routes with methods and implementing providers.
257
+ */
270
258
  inspect: API.Inspect = new API.Inspect(this);
259
+ /**
260
+ * Llama Stack Inference API for generating completions, chat completions, and embeddings.
261
+ *
262
+ * This API provides the raw interface to the underlying models. Three kinds of models are supported:
263
+ * - LLM models: these models generate "raw" and "chat" (conversational) completions.
264
+ * - Embedding models: these models generate embeddings to be used for semantic search.
265
+ * - Rerank models: these models reorder the documents based on their relevance to a query.
266
+ */
271
267
  embeddings: API.Embeddings = new API.Embeddings(this);
272
268
  chat: API.Chat = new API.Chat(this);
269
+ /**
270
+ * Llama Stack Inference API for generating completions, chat completions, and embeddings.
271
+ *
272
+ * This API provides the raw interface to the underlying models. Three kinds of models are supported:
273
+ * - LLM models: these models generate "raw" and "chat" (conversational) completions.
274
+ * - Embedding models: these models generate embeddings to be used for semantic search.
275
+ * - Rerank models: these models reorder the documents based on their relevance to a query.
276
+ */
273
277
  completions: API.Completions = new API.Completions(this);
274
278
  vectorIo: API.VectorIo = new API.VectorIo(this);
275
279
  vectorStores: API.VectorStores = new API.VectorStores(this);
276
280
  models: API.Models = new API.Models(this);
281
+ /**
282
+ * Providers API for inspecting, listing, and modifying providers and their configurations.
283
+ */
277
284
  providers: API.Providers = new API.Providers(this);
285
+ /**
286
+ * APIs for inspecting the Llama Stack service, including health status, available API routes with methods and implementing providers.
287
+ */
278
288
  routes: API.Routes = new API.Routes(this);
289
+ /**
290
+ * OpenAI-compatible Moderations API.
291
+ */
279
292
  moderations: API.Moderations = new API.Moderations(this);
293
+ /**
294
+ * OpenAI-compatible Moderations API.
295
+ */
280
296
  safety: API.Safety = new API.Safety(this);
281
297
  shields: API.Shields = new API.Shields(this);
282
298
  scoring: API.Scoring = new API.Scoring(this);
283
299
  scoringFunctions: API.ScoringFunctions = new API.ScoringFunctions(this);
300
+ /**
301
+ * This API is used to upload documents that can be used with other Llama Stack APIs.
302
+ */
284
303
  files: API.Files = new API.Files(this);
304
+ /**
305
+ * The API is designed to allow use of openai client libraries for seamless integration.
306
+ *
307
+ * This API provides the following extensions:
308
+ * - idempotent batch creation
309
+ *
310
+ * Note: This API is currently under active development and may undergo changes.
311
+ */
285
312
  batches: API.Batches = new API.Batches(this);
286
313
  alpha: API.Alpha = new API.Alpha(this);
287
314
  beta: API.Beta = new API.Beta(this);
@@ -311,8 +338,8 @@ export class LlamaStackClient extends Core.APIClient {
311
338
  return { Authorization: `Bearer ${this.apiKey}` };
312
339
  }
313
340
 
314
- protected override stringifyQuery(query: Record<string, unknown>): string {
315
- return qs.stringify(query, { arrayFormat: 'comma' });
341
+ protected override stringifyQuery(query: object | Record<string, unknown>): string {
342
+ return stringifyQuery(query);
316
343
  }
317
344
 
318
345
  static LlamaStackClient = this;
@@ -336,9 +363,6 @@ export class LlamaStackClient extends Core.APIClient {
336
363
  static fileFromPath = Uploads.fileFromPath;
337
364
  }
338
365
 
339
- LlamaStackClient.Toolgroups = Toolgroups;
340
- LlamaStackClient.Tools = Tools;
341
- LlamaStackClient.ToolRuntime = ToolRuntime;
342
366
  LlamaStackClient.Responses = Responses;
343
367
  LlamaStackClient.ResponseListResponsesOpenAICursorPage = ResponseListResponsesOpenAICursorPage;
344
368
  LlamaStackClient.Prompts = Prompts;
@@ -380,25 +404,6 @@ export declare namespace LlamaStackClient {
380
404
  type OpenAICursorPageResponse as OpenAICursorPageResponse,
381
405
  };
382
406
 
383
- export {
384
- Toolgroups as Toolgroups,
385
- type ListToolGroupsResponse as ListToolGroupsResponse,
386
- type ToolGroup as ToolGroup,
387
- type ToolgroupListResponse as ToolgroupListResponse,
388
- type ToolgroupRegisterParams as ToolgroupRegisterParams,
389
- };
390
-
391
- export { Tools as Tools, type ToolListResponse as ToolListResponse, type ToolListParams as ToolListParams };
392
-
393
- export {
394
- ToolRuntime as ToolRuntime,
395
- type ToolDef as ToolDef,
396
- type ToolInvocationResult as ToolInvocationResult,
397
- type ToolRuntimeListToolsResponse as ToolRuntimeListToolsResponse,
398
- type ToolRuntimeInvokeToolParams as ToolRuntimeInvokeToolParams,
399
- type ToolRuntimeListToolsParams as ToolRuntimeListToolsParams,
400
- };
401
-
402
407
  export {
403
408
  Responses as Responses,
404
409
  type ResponseObject as ResponseObject,
@@ -475,8 +480,6 @@ export declare namespace LlamaStackClient {
475
480
  type Model as Model,
476
481
  type ModelRetrieveResponse as ModelRetrieveResponse,
477
482
  type ModelListResponse as ModelListResponse,
478
- type ModelRegisterResponse as ModelRegisterResponse,
479
- type ModelRegisterParams as ModelRegisterParams,
480
483
  };
481
484
 
482
485
  export { Providers as Providers, type ProviderListResponse as ProviderListResponse };
@@ -6,4 +6,8 @@
6
6
  //
7
7
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
8
8
 
9
- export * from './post-training/index';
9
+ import * as qs from '../qs/stringify';
10
+
11
+ export function stringifyQuery(query: object | Record<string, unknown>) {
12
+ return qs.stringify(query, { arrayFormat: 'comma' });
13
+ }
@@ -30,40 +30,20 @@ import {
30
30
  EvaluateResponse,
31
31
  Job,
32
32
  } from './eval/eval';
33
- import * as PostTrainingAPI from './post-training/post-training';
34
- import {
35
- AlgorithmConfig,
36
- ListPostTrainingJobsResponse,
37
- PostTraining,
38
- PostTrainingJob,
39
- PostTrainingPreferenceOptimizeParams,
40
- PostTrainingSupervisedFineTuneParams,
41
- } from './post-training/post-training';
42
33
 
43
34
  export class Alpha extends APIResource {
44
- postTraining: PostTrainingAPI.PostTraining = new PostTrainingAPI.PostTraining(this._client);
45
35
  benchmarks: BenchmarksAPI.Benchmarks = new BenchmarksAPI.Benchmarks(this._client);
46
36
  eval: EvalAPI.Eval = new EvalAPI.Eval(this._client);
47
37
  admin: AdminAPI.Admin = new AdminAPI.Admin(this._client);
48
38
  inference: InferenceAPI.Inference = new InferenceAPI.Inference(this._client);
49
39
  }
50
40
 
51
- Alpha.PostTraining = PostTraining;
52
41
  Alpha.Benchmarks = Benchmarks;
53
42
  Alpha.Eval = Eval;
54
43
  Alpha.Admin = Admin;
55
44
  Alpha.Inference = Inference;
56
45
 
57
46
  export declare namespace Alpha {
58
- export {
59
- PostTraining as PostTraining,
60
- type AlgorithmConfig as AlgorithmConfig,
61
- type ListPostTrainingJobsResponse as ListPostTrainingJobsResponse,
62
- type PostTrainingJob as PostTrainingJob,
63
- type PostTrainingPreferenceOptimizeParams as PostTrainingPreferenceOptimizeParams,
64
- type PostTrainingSupervisedFineTuneParams as PostTrainingSupervisedFineTuneParams,
65
- };
66
-
67
47
  export {
68
48
  Benchmarks as Benchmarks,
69
49
  type Benchmark as Benchmark,
@@ -12,6 +12,9 @@ import * as Shared from '../../shared';
12
12
  import * as JobsAPI from './jobs';
13
13
  import { Jobs } from './jobs';
14
14
 
15
+ /**
16
+ * Llama Stack Evaluation API for running evaluations on model and agent candidates.
17
+ */
15
18
  export class Eval extends APIResource {
16
19
  jobs: JobsAPI.Jobs = new JobsAPI.Jobs(this._client);
17
20
 
@@ -10,6 +10,9 @@ import { APIResource } from '../../../resource';
10
10
  import * as Core from '../../../core';
11
11
  import * as EvalAPI from './eval';
12
12
 
13
+ /**
14
+ * Llama Stack Evaluation API for running evaluations on model and agent candidates.
15
+ */
13
16
  export class Jobs extends APIResource {
14
17
  /**
15
18
  * Get the result of a job.
@@ -26,11 +26,3 @@ export {
26
26
  type EvalRunEvalAlphaParams,
27
27
  } from './eval/index';
28
28
  export { Inference, type InferenceRerankResponse, type InferenceRerankParams } from './inference';
29
- export {
30
- PostTraining,
31
- type AlgorithmConfig,
32
- type ListPostTrainingJobsResponse,
33
- type PostTrainingJob,
34
- type PostTrainingPreferenceOptimizeParams,
35
- type PostTrainingSupervisedFineTuneParams,
36
- } from './post-training/index';
@@ -9,6 +9,14 @@
9
9
  import { APIResource } from '../../resource';
10
10
  import * as Core from '../../core';
11
11
 
12
+ /**
13
+ * Llama Stack Inference API for generating completions, chat completions, and embeddings.
14
+ *
15
+ * This API provides the raw interface to the underlying models. Three kinds of models are supported:
16
+ * - LLM models: these models generate "raw" and "chat" (conversational) completions.
17
+ * - Embedding models: these models generate embeddings to be used for semantic search.
18
+ * - Rerank models: these models reorder the documents based on their relevance to a query.
19
+ */
12
20
  export class Inference extends APIResource {
13
21
  /**
14
22
  * Rerank a list of documents based on their relevance to a query.
@@ -11,6 +11,14 @@ import { isRequestOptions } from '../core';
11
11
  import * as Core from '../core';
12
12
  import { OpenAICursorPage, type OpenAICursorPageParams } from '../pagination';
13
13
 
14
+ /**
15
+ * The API is designed to allow use of openai client libraries for seamless integration.
16
+ *
17
+ * This API provides the following extensions:
18
+ * - idempotent batch creation
19
+ *
20
+ * Note: This API is currently under active development and may undergo changes.
21
+ */
14
22
  export class Batches extends APIResource {
15
23
  /**
16
24
  * Create a new batch for processing multiple API requests.
@@ -124,7 +124,7 @@ export interface DatasetRetrieveResponse {
124
124
  /**
125
125
  * Purpose of the dataset indicating its intended use
126
126
  */
127
- purpose: 'post-training/messages' | 'eval/question-answer' | 'eval/messages-answer';
127
+ purpose: 'eval/question-answer' | 'eval/messages-answer';
128
128
 
129
129
  /**
130
130
  * Data source configuration for the dataset
@@ -205,7 +205,7 @@ export namespace DatasetListResponse {
205
205
  /**
206
206
  * Purpose of the dataset indicating its intended use
207
207
  */
208
- purpose: 'post-training/messages' | 'eval/question-answer' | 'eval/messages-answer';
208
+ purpose: 'eval/question-answer' | 'eval/messages-answer';
209
209
 
210
210
  /**
211
211
  * Data source configuration for the dataset
@@ -292,7 +292,7 @@ export interface DatasetRegisterResponse {
292
292
  /**
293
293
  * Purpose of the dataset indicating its intended use
294
294
  */
295
- purpose: 'post-training/messages' | 'eval/question-answer' | 'eval/messages-answer';
295
+ purpose: 'eval/question-answer' | 'eval/messages-answer';
296
296
 
297
297
  /**
298
298
  * Data source configuration for the dataset
@@ -351,11 +351,6 @@ export namespace DatasetRegisterResponse {
351
351
  }
352
352
 
353
353
  export interface DatasetAppendrowsParams {
354
- /**
355
- * The ID of the dataset to append the rows to.
356
- */
357
- body_dataset_id: string;
358
-
359
354
  /**
360
355
  * The rows to append to the dataset.
361
356
  */
@@ -378,7 +373,7 @@ export interface DatasetRegisterParams {
378
373
  /**
379
374
  * The purpose of the dataset.
380
375
  */
381
- purpose: 'post-training/messages' | 'eval/question-answer' | 'eval/messages-answer';
376
+ purpose: 'eval/question-answer' | 'eval/messages-answer';
382
377
 
383
378
  /**
384
379
  * The data source of the dataset.