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
@@ -1,217 +0,0 @@
1
- // Copyright (c) Meta Platforms, Inc. and affiliates.
2
- // All rights reserved.
3
- //
4
- // This source code is licensed under the terms described in the LICENSE file in
5
- // the root directory of this source tree.
6
- //
7
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
8
-
9
- import { APIResource } from '../resource';
10
- import { isRequestOptions } from '../core';
11
- import * as Core from '../core';
12
-
13
- export class ToolRuntime extends APIResource {
14
- /**
15
- * Run a tool with the given arguments.
16
- *
17
- * @deprecated
18
- */
19
- invokeTool(
20
- body: ToolRuntimeInvokeToolParams,
21
- options?: Core.RequestOptions,
22
- ): Core.APIPromise<ToolInvocationResult> {
23
- return this._client.post('/v1/tool-runtime/invoke', { body, ...options });
24
- }
25
-
26
- /**
27
- * List all tools in the runtime.
28
- *
29
- * @deprecated
30
- */
31
- listTools(
32
- query?: ToolRuntimeListToolsParams,
33
- options?: Core.RequestOptions,
34
- ): Core.APIPromise<ToolRuntimeListToolsResponse>;
35
- listTools(options?: Core.RequestOptions): Core.APIPromise<ToolRuntimeListToolsResponse>;
36
- listTools(
37
- query: ToolRuntimeListToolsParams | Core.RequestOptions = {},
38
- options?: Core.RequestOptions,
39
- ): Core.APIPromise<ToolRuntimeListToolsResponse> {
40
- if (isRequestOptions(query)) {
41
- return this.listTools({}, query);
42
- }
43
- return (
44
- this._client.get('/v1/tool-runtime/list-tools', { query, ...options }) as Core.APIPromise<{
45
- data: ToolRuntimeListToolsResponse;
46
- }>
47
- )._thenUnwrap((obj) => obj.data);
48
- }
49
- }
50
-
51
- /**
52
- * Tool definition used in runtime contexts.
53
- */
54
- export interface ToolDef {
55
- name: string;
56
-
57
- description?: string | null;
58
-
59
- input_schema?: { [key: string]: unknown } | null;
60
-
61
- metadata?: { [key: string]: unknown } | null;
62
-
63
- output_schema?: { [key: string]: unknown } | null;
64
-
65
- toolgroup_id?: string | null;
66
- }
67
-
68
- /**
69
- * Result of a tool invocation.
70
- */
71
- export interface ToolInvocationResult {
72
- /**
73
- * A image content item
74
- */
75
- content?:
76
- | string
77
- | ToolInvocationResult.ImageContentItemOutput
78
- | ToolInvocationResult.TextContentItem
79
- | Array<ToolInvocationResult.ImageContentItemOutput | ToolInvocationResult.TextContentItem>
80
- | null;
81
-
82
- error_code?: number | null;
83
-
84
- error_message?: string | null;
85
-
86
- metadata?: { [key: string]: unknown } | null;
87
- }
88
-
89
- export namespace ToolInvocationResult {
90
- /**
91
- * A image content item
92
- */
93
- export interface ImageContentItemOutput {
94
- /**
95
- * A URL or a base64 encoded string
96
- */
97
- image: ImageContentItemOutput.Image;
98
-
99
- type?: 'image';
100
- }
101
-
102
- export namespace ImageContentItemOutput {
103
- /**
104
- * A URL or a base64 encoded string
105
- */
106
- export interface Image {
107
- data?: string | null;
108
-
109
- /**
110
- * A URL reference to external content.
111
- */
112
- url?: Image.URL | null;
113
- }
114
-
115
- export namespace Image {
116
- /**
117
- * A URL reference to external content.
118
- */
119
- export interface URL {
120
- uri: string;
121
- }
122
- }
123
- }
124
-
125
- /**
126
- * A text content item
127
- */
128
- export interface TextContentItem {
129
- text: string;
130
-
131
- type?: 'text';
132
- }
133
-
134
- /**
135
- * A image content item
136
- */
137
- export interface ImageContentItemOutput {
138
- /**
139
- * A URL or a base64 encoded string
140
- */
141
- image: ImageContentItemOutput.Image;
142
-
143
- type?: 'image';
144
- }
145
-
146
- export namespace ImageContentItemOutput {
147
- /**
148
- * A URL or a base64 encoded string
149
- */
150
- export interface Image {
151
- data?: string | null;
152
-
153
- /**
154
- * A URL reference to external content.
155
- */
156
- url?: Image.URL | null;
157
- }
158
-
159
- export namespace Image {
160
- /**
161
- * A URL reference to external content.
162
- */
163
- export interface URL {
164
- uri: string;
165
- }
166
- }
167
- }
168
-
169
- /**
170
- * A text content item
171
- */
172
- export interface TextContentItem {
173
- text: string;
174
-
175
- type?: 'text';
176
- }
177
- }
178
-
179
- export type ToolRuntimeListToolsResponse = Array<ToolDef>;
180
-
181
- export interface ToolRuntimeInvokeToolParams {
182
- kwargs: { [key: string]: unknown };
183
-
184
- tool_name: string;
185
-
186
- authorization?: string | null;
187
- }
188
-
189
- export interface ToolRuntimeListToolsParams {
190
- authorization?: string | null;
191
-
192
- /**
193
- * A URL reference to external content.
194
- */
195
- mcp_endpoint?: ToolRuntimeListToolsParams.McpEndpoint | null;
196
-
197
- tool_group_id?: string | null;
198
- }
199
-
200
- export namespace ToolRuntimeListToolsParams {
201
- /**
202
- * A URL reference to external content.
203
- */
204
- export interface McpEndpoint {
205
- uri: string;
206
- }
207
- }
208
-
209
- export declare namespace ToolRuntime {
210
- export {
211
- type ToolDef as ToolDef,
212
- type ToolInvocationResult as ToolInvocationResult,
213
- type ToolRuntimeListToolsResponse as ToolRuntimeListToolsResponse,
214
- type ToolRuntimeInvokeToolParams as ToolRuntimeInvokeToolParams,
215
- type ToolRuntimeListToolsParams as ToolRuntimeListToolsParams,
216
- };
217
- }
@@ -1,135 +0,0 @@
1
- // Copyright (c) Meta Platforms, Inc. and affiliates.
2
- // All rights reserved.
3
- //
4
- // This source code is licensed under the terms described in the LICENSE file in
5
- // the root directory of this source tree.
6
- //
7
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
8
-
9
- import { APIResource } from '../resource';
10
- import * as Core from '../core';
11
-
12
- export class Toolgroups extends APIResource {
13
- /**
14
- * List tool groups with optional provider.
15
- *
16
- * @deprecated
17
- */
18
- list(options?: Core.RequestOptions): Core.APIPromise<ToolgroupListResponse> {
19
- return (
20
- this._client.get('/v1/toolgroups', options) as Core.APIPromise<{ data: ToolgroupListResponse }>
21
- )._thenUnwrap((obj) => obj.data);
22
- }
23
-
24
- /**
25
- * Get a tool group by its ID.
26
- *
27
- * @deprecated
28
- */
29
- get(toolgroupId: string, options?: Core.RequestOptions): Core.APIPromise<ToolGroup> {
30
- return this._client.get(`/v1/toolgroups/${toolgroupId}`, options);
31
- }
32
-
33
- /**
34
- * Register a tool group.
35
- *
36
- * @deprecated
37
- */
38
- register(body: ToolgroupRegisterParams, options?: Core.RequestOptions): Core.APIPromise<void> {
39
- return this._client.post('/v1/toolgroups', {
40
- body,
41
- ...options,
42
- headers: { Accept: '*/*', ...options?.headers },
43
- });
44
- }
45
-
46
- /**
47
- * Unregister a tool group.
48
- *
49
- * @deprecated
50
- */
51
- unregister(toolgroupId: string, options?: Core.RequestOptions): Core.APIPromise<void> {
52
- return this._client.delete(`/v1/toolgroups/${toolgroupId}`, {
53
- ...options,
54
- headers: { Accept: '*/*', ...options?.headers },
55
- });
56
- }
57
- }
58
-
59
- /**
60
- * Response containing a list of tool groups.
61
- */
62
- export interface ListToolGroupsResponse {
63
- data: ToolgroupListResponse;
64
- }
65
-
66
- /**
67
- * A group of related tools managed together.
68
- */
69
- export interface ToolGroup {
70
- /**
71
- * Unique identifier for this resource in llama stack
72
- */
73
- identifier: string;
74
-
75
- /**
76
- * ID of the provider that owns this resource
77
- */
78
- provider_id: string;
79
-
80
- args?: { [key: string]: unknown } | null;
81
-
82
- /**
83
- * A URL reference to external content.
84
- */
85
- mcp_endpoint?: ToolGroup.McpEndpoint | null;
86
-
87
- /**
88
- * Unique identifier for this resource in the provider
89
- */
90
- provider_resource_id?: string | null;
91
-
92
- type?: 'tool_group';
93
- }
94
-
95
- export namespace ToolGroup {
96
- /**
97
- * A URL reference to external content.
98
- */
99
- export interface McpEndpoint {
100
- uri: string;
101
- }
102
- }
103
-
104
- export type ToolgroupListResponse = Array<ToolGroup>;
105
-
106
- export interface ToolgroupRegisterParams {
107
- provider_id: string;
108
-
109
- toolgroup_id: string;
110
-
111
- args?: { [key: string]: unknown } | null;
112
-
113
- /**
114
- * A URL reference to external content.
115
- */
116
- mcp_endpoint?: ToolgroupRegisterParams.McpEndpoint | null;
117
- }
118
-
119
- export namespace ToolgroupRegisterParams {
120
- /**
121
- * A URL reference to external content.
122
- */
123
- export interface McpEndpoint {
124
- uri: string;
125
- }
126
- }
127
-
128
- export declare namespace Toolgroups {
129
- export {
130
- type ListToolGroupsResponse as ListToolGroupsResponse,
131
- type ToolGroup as ToolGroup,
132
- type ToolgroupListResponse as ToolgroupListResponse,
133
- type ToolgroupRegisterParams as ToolgroupRegisterParams,
134
- };
135
- }
@@ -1,52 +0,0 @@
1
- // Copyright (c) Meta Platforms, Inc. and affiliates.
2
- // All rights reserved.
3
- //
4
- // This source code is licensed under the terms described in the LICENSE file in
5
- // the root directory of this source tree.
6
- //
7
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
8
-
9
- import { APIResource } from '../resource';
10
- import { isRequestOptions } from '../core';
11
- import * as Core from '../core';
12
- import * as ToolRuntimeAPI from './tool-runtime';
13
-
14
- export class Tools extends APIResource {
15
- /**
16
- * List tools with optional tool group.
17
- *
18
- * @deprecated
19
- */
20
- list(query?: ToolListParams, options?: Core.RequestOptions): Core.APIPromise<ToolListResponse>;
21
- list(options?: Core.RequestOptions): Core.APIPromise<ToolListResponse>;
22
- list(
23
- query: ToolListParams | Core.RequestOptions = {},
24
- options?: Core.RequestOptions,
25
- ): Core.APIPromise<ToolListResponse> {
26
- if (isRequestOptions(query)) {
27
- return this.list({}, query);
28
- }
29
- return (
30
- this._client.get('/v1/tools', { query, ...options }) as Core.APIPromise<{ data: ToolListResponse }>
31
- )._thenUnwrap((obj) => obj.data);
32
- }
33
-
34
- /**
35
- * Get a tool by its name.
36
- *
37
- * @deprecated
38
- */
39
- get(toolName: string, options?: Core.RequestOptions): Core.APIPromise<ToolRuntimeAPI.ToolDef> {
40
- return this._client.get(`/v1/tools/${toolName}`, options);
41
- }
42
- }
43
-
44
- export type ToolListResponse = Array<ToolRuntimeAPI.ToolDef>;
45
-
46
- export interface ToolListParams {
47
- toolgroup_id?: string | null;
48
- }
49
-
50
- export declare namespace Tools {
51
- export { type ToolListResponse as ToolListResponse, type ToolListParams as ToolListParams };
52
- }
@@ -1,17 +0,0 @@
1
- // Copyright (c) Meta Platforms, Inc. and affiliates.
2
- // All rights reserved.
3
- //
4
- // This source code is licensed under the terms described in the LICENSE file in
5
- // the root directory of this source tree.
6
- //
7
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
8
-
9
- export { Job, type JobListResponse, type JobArtifactsResponse, type JobStatusResponse } from './job';
10
- export {
11
- PostTraining,
12
- type AlgorithmConfig,
13
- type ListPostTrainingJobsResponse,
14
- type PostTrainingJob,
15
- type PostTrainingPreferenceOptimizeParams,
16
- type PostTrainingSupervisedFineTuneParams,
17
- } from './post-training';
@@ -1,161 +0,0 @@
1
- // Copyright (c) Meta Platforms, Inc. and affiliates.
2
- // All rights reserved.
3
- //
4
- // This source code is licensed under the terms described in the LICENSE file in
5
- // the root directory of this source tree.
6
- //
7
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
8
-
9
- import { APIResource } from '../../../resource';
10
- import * as Core from '../../../core';
11
- import * as PostTrainingAPI from './post-training';
12
-
13
- export class Job extends APIResource {
14
- /**
15
- * Get all training jobs.
16
- */
17
- list(options?: Core.RequestOptions): Core.APIPromise<JobListResponse> {
18
- return (
19
- this._client.get('/v1alpha/post-training/jobs', options) as Core.APIPromise<{ data: JobListResponse }>
20
- )._thenUnwrap((obj) => obj.data);
21
- }
22
-
23
- /**
24
- * Get the artifacts of a training job.
25
- */
26
- artifacts(options?: Core.RequestOptions): Core.APIPromise<JobArtifactsResponse> {
27
- return this._client.get('/v1alpha/post-training/job/artifacts', options);
28
- }
29
-
30
- /**
31
- * Cancel a training job.
32
- */
33
- cancel(options?: Core.RequestOptions): Core.APIPromise<void> {
34
- return this._client.post('/v1alpha/post-training/job/cancel', {
35
- ...options,
36
- headers: { Accept: '*/*', ...options?.headers },
37
- });
38
- }
39
-
40
- /**
41
- * Get the status of a training job.
42
- */
43
- status(options?: Core.RequestOptions): Core.APIPromise<JobStatusResponse> {
44
- return this._client.get('/v1alpha/post-training/job/status', options);
45
- }
46
- }
47
-
48
- export type JobListResponse = Array<PostTrainingAPI.PostTrainingJob>;
49
-
50
- /**
51
- * Artifacts of a finetuning job.
52
- */
53
- export interface JobArtifactsResponse {
54
- job_uuid: string;
55
-
56
- checkpoints?: Array<JobArtifactsResponse.Checkpoint>;
57
- }
58
-
59
- export namespace JobArtifactsResponse {
60
- /**
61
- * Checkpoint created during training runs.
62
- */
63
- export interface Checkpoint {
64
- created_at: string;
65
-
66
- epoch: number;
67
-
68
- identifier: string;
69
-
70
- path: string;
71
-
72
- post_training_job_id: string;
73
-
74
- /**
75
- * Training metrics captured during post-training jobs.
76
- */
77
- training_metrics?: Checkpoint.TrainingMetrics | null;
78
- }
79
-
80
- export namespace Checkpoint {
81
- /**
82
- * Training metrics captured during post-training jobs.
83
- */
84
- export interface TrainingMetrics {
85
- epoch: number;
86
-
87
- perplexity: number;
88
-
89
- train_loss: number;
90
-
91
- validation_loss: number;
92
- }
93
- }
94
- }
95
-
96
- /**
97
- * Status of a finetuning job.
98
- */
99
- export interface JobStatusResponse {
100
- job_uuid: string;
101
-
102
- /**
103
- * Status of a job execution.
104
- */
105
- status: 'completed' | 'in_progress' | 'failed' | 'scheduled' | 'cancelled';
106
-
107
- checkpoints?: Array<JobStatusResponse.Checkpoint>;
108
-
109
- completed_at?: string | null;
110
-
111
- resources_allocated?: { [key: string]: unknown } | null;
112
-
113
- scheduled_at?: string | null;
114
-
115
- started_at?: string | null;
116
- }
117
-
118
- export namespace JobStatusResponse {
119
- /**
120
- * Checkpoint created during training runs.
121
- */
122
- export interface Checkpoint {
123
- created_at: string;
124
-
125
- epoch: number;
126
-
127
- identifier: string;
128
-
129
- path: string;
130
-
131
- post_training_job_id: string;
132
-
133
- /**
134
- * Training metrics captured during post-training jobs.
135
- */
136
- training_metrics?: Checkpoint.TrainingMetrics | null;
137
- }
138
-
139
- export namespace Checkpoint {
140
- /**
141
- * Training metrics captured during post-training jobs.
142
- */
143
- export interface TrainingMetrics {
144
- epoch: number;
145
-
146
- perplexity: number;
147
-
148
- train_loss: number;
149
-
150
- validation_loss: number;
151
- }
152
- }
153
- }
154
-
155
- export declare namespace Job {
156
- export {
157
- type JobListResponse as JobListResponse,
158
- type JobArtifactsResponse as JobArtifactsResponse,
159
- type JobStatusResponse as JobStatusResponse,
160
- };
161
- }