llama-stack-client 0.3.5 → 0.4.0-rc2
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.
- package/CHANGELOG.md +153 -0
- package/README.md +48 -39
- package/error.d.ts.map +1 -1
- package/error.js +1 -0
- package/error.js.map +1 -1
- package/error.mjs.map +1 -1
- package/index.d.mts +33 -54
- package/index.d.ts +33 -54
- package/index.d.ts.map +1 -1
- package/index.js +20 -29
- package/index.js.map +1 -1
- package/index.mjs +18 -28
- package/index.mjs.map +1 -1
- package/lib/response-helpers.d.ts +23 -0
- package/lib/response-helpers.d.ts.map +1 -0
- package/lib/response-helpers.js +53 -0
- package/lib/response-helpers.js.map +1 -0
- package/lib/response-helpers.mjs +49 -0
- package/lib/response-helpers.mjs.map +1 -0
- package/package.json +7 -1
- package/pagination.d.ts.map +1 -1
- package/pagination.js +2 -4
- package/pagination.js.map +1 -1
- package/pagination.mjs +1 -4
- package/pagination.mjs.map +1 -1
- package/resource.d.ts.map +1 -1
- package/resource.js.map +1 -1
- package/resource.mjs.map +1 -1
- package/resources/alpha/admin.d.ts +41 -0
- package/resources/alpha/admin.d.ts.map +1 -0
- package/resources/alpha/admin.js +46 -0
- package/resources/alpha/admin.js.map +1 -0
- package/resources/alpha/admin.mjs +42 -0
- package/resources/alpha/admin.mjs.map +1 -0
- package/resources/alpha/alpha.d.ts +26 -0
- package/resources/alpha/alpha.d.ts.map +1 -0
- package/resources/alpha/alpha.js +61 -0
- package/resources/alpha/alpha.js.map +1 -0
- package/resources/alpha/alpha.mjs +34 -0
- package/resources/alpha/alpha.mjs.map +1 -0
- package/resources/{benchmarks.d.ts → alpha/benchmarks.d.ts} +41 -15
- package/resources/alpha/benchmarks.d.ts.map +1 -0
- package/resources/{benchmarks.js → alpha/benchmarks.js} +18 -4
- package/resources/alpha/benchmarks.js.map +1 -0
- package/resources/alpha/benchmarks.mjs +44 -0
- package/resources/alpha/benchmarks.mjs.map +1 -0
- package/resources/alpha/eval/eval.d.ts +160 -0
- package/resources/alpha/eval/eval.d.ts.map +1 -0
- package/resources/{eval → alpha/eval}/eval.js +7 -6
- package/resources/alpha/eval/eval.js.map +1 -0
- package/resources/{eval → alpha/eval}/eval.mjs +7 -5
- package/resources/alpha/eval/eval.mjs.map +1 -0
- package/resources/alpha/eval/index.d.ts +3 -0
- package/resources/alpha/eval/index.d.ts.map +1 -0
- package/resources/{eval → alpha/eval}/index.js +2 -1
- package/resources/alpha/eval/index.js.map +1 -0
- package/resources/{eval → alpha/eval}/index.mjs +2 -0
- package/resources/alpha/eval/index.mjs.map +1 -0
- package/resources/{eval → alpha/eval}/jobs.d.ts +2 -2
- package/resources/alpha/eval/jobs.d.ts.map +1 -0
- package/resources/{eval → alpha/eval}/jobs.js +6 -5
- package/resources/alpha/eval/jobs.js.map +1 -0
- package/resources/{eval → alpha/eval}/jobs.mjs +6 -4
- package/resources/alpha/eval/jobs.mjs.map +1 -0
- package/resources/alpha/eval.d.ts.map +1 -0
- package/resources/{eval.js → alpha/eval.js} +1 -0
- package/resources/alpha/eval.js.map +1 -0
- package/resources/alpha/eval.mjs.map +1 -0
- package/resources/alpha/index.d.ts +7 -0
- package/resources/alpha/index.d.ts.map +1 -0
- package/resources/alpha/index.js +23 -0
- package/resources/alpha/index.js.map +1 -0
- package/resources/alpha/index.mjs +14 -0
- package/resources/alpha/index.mjs.map +1 -0
- package/resources/alpha/inference.d.ts +85 -0
- package/resources/alpha/inference.d.ts.map +1 -0
- package/resources/{agents/steps.js → alpha/inference.js} +9 -8
- package/resources/alpha/inference.js.map +1 -0
- package/resources/alpha/inference.mjs +17 -0
- package/resources/alpha/inference.mjs.map +1 -0
- package/resources/alpha/post-training/index.d.ts.map +1 -0
- package/resources/{post-training → alpha/post-training}/index.js +2 -1
- package/resources/alpha/post-training/index.js.map +1 -0
- package/resources/{post-training → alpha/post-training}/index.mjs +2 -0
- package/resources/alpha/post-training/index.mjs.map +1 -0
- package/resources/alpha/post-training/job.d.ts +113 -0
- package/resources/alpha/post-training/job.d.ts.map +1 -0
- package/resources/{post-training → alpha/post-training}/job.js +7 -6
- package/resources/alpha/post-training/job.js.map +1 -0
- package/resources/{post-training → alpha/post-training}/job.mjs +7 -5
- package/resources/alpha/post-training/job.mjs.map +1 -0
- package/resources/alpha/post-training/post-training.d.ts +245 -0
- package/resources/alpha/post-training/post-training.d.ts.map +1 -0
- package/resources/{post-training → alpha/post-training}/post-training.js +5 -4
- package/resources/alpha/post-training/post-training.js.map +1 -0
- package/resources/{post-training → alpha/post-training}/post-training.mjs +5 -3
- package/resources/alpha/post-training/post-training.mjs.map +1 -0
- package/resources/alpha/post-training.d.ts.map +1 -0
- package/resources/{post-training.js → alpha/post-training.js} +2 -1
- package/resources/alpha/post-training.js.map +1 -0
- package/resources/{post-training.mjs → alpha/post-training.mjs} +2 -0
- package/resources/alpha/post-training.mjs.map +1 -0
- package/resources/alpha.d.ts +2 -0
- package/resources/alpha.d.ts.map +1 -0
- package/resources/alpha.js +25 -0
- package/resources/alpha.js.map +1 -0
- package/resources/alpha.mjs +9 -0
- package/resources/alpha.mjs.map +1 -0
- package/resources/batches.d.ts +322 -0
- package/resources/batches.d.ts.map +1 -0
- package/resources/batches.js +45 -0
- package/resources/batches.js.map +1 -0
- package/resources/batches.mjs +40 -0
- package/resources/batches.mjs.map +1 -0
- package/resources/beta/beta.d.ts +10 -0
- package/resources/beta/beta.d.ts.map +1 -0
- package/resources/{tool-runtime/tool-runtime.js → beta/beta.js} +10 -22
- package/resources/beta/beta.js.map +1 -0
- package/resources/beta/beta.mjs +18 -0
- package/resources/beta/beta.mjs.map +1 -0
- package/resources/{datasets.d.ts → beta/datasets.d.ts} +117 -99
- package/resources/beta/datasets.d.ts.map +1 -0
- package/resources/{datasets.js → beta/datasets.js} +14 -9
- package/resources/beta/datasets.js.map +1 -0
- package/resources/{datasets.mjs → beta/datasets.mjs} +14 -8
- package/resources/beta/datasets.mjs.map +1 -0
- package/resources/beta/index.d.ts +3 -0
- package/resources/beta/index.d.ts.map +1 -0
- package/resources/beta/index.js +15 -0
- package/resources/beta/index.js.map +1 -0
- package/resources/beta/index.mjs +10 -0
- package/resources/beta/index.mjs.map +1 -0
- package/resources/beta.d.ts +2 -0
- package/resources/beta.d.ts.map +1 -0
- package/resources/{agents.js → beta.js} +4 -3
- package/resources/beta.js.map +1 -0
- package/resources/beta.mjs +9 -0
- package/resources/beta.mjs.map +1 -0
- package/resources/chat/chat.d.ts +75 -80
- package/resources/chat/chat.d.ts.map +1 -1
- package/resources/chat/chat.js +2 -2
- package/resources/chat/chat.js.map +1 -1
- package/resources/chat/chat.mjs +3 -2
- package/resources/chat/chat.mjs.map +1 -1
- package/resources/chat/completions.d.ts +760 -1406
- package/resources/chat/completions.d.ts.map +1 -1
- package/resources/chat/completions.js +8 -14
- package/resources/chat/completions.js.map +1 -1
- package/resources/chat/completions.mjs +7 -11
- package/resources/chat/completions.mjs.map +1 -1
- package/resources/chat/index.d.ts +1 -1
- package/resources/chat/index.d.ts.map +1 -1
- package/resources/chat/index.js +3 -3
- package/resources/chat/index.js.map +1 -1
- package/resources/chat/index.mjs +3 -1
- package/resources/chat/index.mjs.map +1 -1
- package/resources/chat.js +2 -1
- package/resources/chat.js.map +1 -1
- package/resources/chat.mjs +2 -0
- package/resources/chat.mjs.map +1 -1
- package/resources/completions.d.ts +54 -97
- package/resources/completions.d.ts.map +1 -1
- package/resources/completions.js +3 -6
- package/resources/completions.js.map +1 -1
- package/resources/completions.mjs +3 -5
- package/resources/completions.mjs.map +1 -1
- package/resources/conversations/conversations.d.ts +320 -0
- package/resources/conversations/conversations.d.ts.map +1 -0
- package/resources/conversations/conversations.js +78 -0
- package/resources/conversations/conversations.js.map +1 -0
- package/resources/conversations/conversations.mjs +51 -0
- package/resources/conversations/conversations.mjs.map +1 -0
- package/resources/conversations/index.d.ts +3 -0
- package/resources/conversations/index.d.ts.map +1 -0
- package/resources/conversations/index.js +16 -0
- package/resources/conversations/index.js.map +1 -0
- package/resources/conversations/index.mjs +10 -0
- package/resources/conversations/index.mjs.map +1 -0
- package/resources/conversations/items.d.ts +874 -0
- package/resources/conversations/items.d.ts.map +1 -0
- package/resources/conversations/items.js +51 -0
- package/resources/conversations/items.js.map +1 -0
- package/resources/conversations/items.mjs +46 -0
- package/resources/conversations/items.mjs.map +1 -0
- package/resources/conversations.d.ts +2 -0
- package/resources/conversations.d.ts.map +1 -0
- package/resources/conversations.js +25 -0
- package/resources/conversations.js.map +1 -0
- package/resources/conversations.mjs +9 -0
- package/resources/conversations.mjs.map +1 -0
- package/resources/embeddings.d.ts +10 -52
- package/resources/embeddings.d.ts.map +1 -1
- package/resources/embeddings.js +5 -2
- package/resources/embeddings.js.map +1 -1
- package/resources/embeddings.mjs +5 -1
- package/resources/embeddings.mjs.map +1 -1
- package/resources/files.d.ts +44 -54
- package/resources/files.d.ts.map +1 -1
- package/resources/files.js +18 -9
- package/resources/files.js.map +1 -1
- package/resources/files.mjs +18 -8
- package/resources/files.mjs.map +1 -1
- package/resources/index.d.ts +11 -15
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +15 -21
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +9 -11
- package/resources/index.mjs.map +1 -1
- package/resources/inspect.d.ts +3 -71
- package/resources/inspect.d.ts.map +1 -1
- package/resources/inspect.js +2 -1
- package/resources/inspect.js.map +1 -1
- package/resources/inspect.mjs +2 -0
- package/resources/inspect.mjs.map +1 -1
- package/resources/models/index.d.ts +2 -2
- package/resources/models/index.d.ts.map +1 -1
- package/resources/models/index.js +2 -1
- package/resources/models/index.js.map +1 -1
- package/resources/models/index.mjs +2 -0
- package/resources/models/index.mjs.map +1 -1
- package/resources/models/models.d.ts +71 -31
- package/resources/models/models.d.ts.map +1 -1
- package/resources/models/models.js +13 -2
- package/resources/models/models.js.map +1 -1
- package/resources/models/models.mjs +13 -1
- package/resources/models/models.mjs.map +1 -1
- package/resources/models/openai.d.ts +2 -16
- package/resources/models/openai.d.ts.map +1 -1
- package/resources/models/openai.js +3 -2
- package/resources/models/openai.js.map +1 -1
- package/resources/models/openai.mjs +3 -1
- package/resources/models/openai.mjs.map +1 -1
- package/resources/models.js +2 -1
- package/resources/models.js.map +1 -1
- package/resources/models.mjs +2 -0
- package/resources/models.mjs.map +1 -1
- package/resources/moderations.d.ts +9 -35
- package/resources/moderations.d.ts.map +1 -1
- package/resources/moderations.js +5 -2
- package/resources/moderations.js.map +1 -1
- package/resources/moderations.mjs +5 -1
- package/resources/moderations.mjs.map +1 -1
- package/resources/prompts/index.d.ts +3 -0
- package/resources/prompts/index.d.ts.map +1 -0
- package/resources/prompts/index.js +15 -0
- package/resources/prompts/index.js.map +1 -0
- package/resources/prompts/index.mjs +10 -0
- package/resources/prompts/index.mjs.map +1 -0
- package/resources/prompts/prompts.d.ts +96 -0
- package/resources/prompts/prompts.d.ts.map +1 -0
- package/resources/{agents/agents.js → prompts/prompts.js} +43 -30
- package/resources/prompts/prompts.js.map +1 -0
- package/resources/prompts/prompts.mjs +66 -0
- package/resources/prompts/prompts.mjs.map +1 -0
- package/resources/prompts/versions.d.ts +12 -0
- package/resources/prompts/versions.d.ts.map +1 -0
- package/resources/prompts/versions.js +23 -0
- package/resources/prompts/versions.js.map +1 -0
- package/resources/prompts/versions.mjs +19 -0
- package/resources/prompts/versions.mjs.map +1 -0
- package/resources/prompts.d.ts +2 -0
- package/resources/prompts.d.ts.map +1 -0
- package/resources/prompts.js +25 -0
- package/resources/prompts.js.map +1 -0
- package/resources/prompts.mjs +9 -0
- package/resources/prompts.mjs.map +1 -0
- package/resources/providers.d.ts +4 -13
- package/resources/providers.d.ts.map +1 -1
- package/resources/providers.js +2 -1
- package/resources/providers.js.map +1 -1
- package/resources/providers.mjs +2 -0
- package/resources/providers.mjs.map +1 -1
- package/resources/responses/index.js +2 -1
- package/resources/responses/index.js.map +1 -1
- package/resources/responses/index.mjs +2 -0
- package/resources/responses/index.mjs.map +1 -1
- package/resources/responses/input-items.d.ts +246 -151
- package/resources/responses/input-items.d.ts.map +1 -1
- package/resources/responses/input-items.js +3 -2
- package/resources/responses/input-items.js.map +1 -1
- package/resources/responses/input-items.mjs +3 -1
- package/resources/responses/input-items.mjs.map +1 -1
- package/resources/responses/responses.d.ts +1841 -1455
- package/resources/responses/responses.d.ts.map +1 -1
- package/resources/responses/responses.js +8 -11
- package/resources/responses/responses.js.map +1 -1
- package/resources/responses/responses.mjs +8 -10
- package/resources/responses/responses.mjs.map +1 -1
- package/resources/responses.js +2 -1
- package/resources/responses.js.map +1 -1
- package/resources/responses.mjs +2 -0
- package/resources/responses.mjs.map +1 -1
- package/resources/routes.d.ts +11 -10
- package/resources/routes.d.ts.map +1 -1
- package/resources/routes.js +8 -6
- package/resources/routes.js.map +1 -1
- package/resources/routes.mjs +8 -5
- package/resources/routes.mjs.map +1 -1
- package/resources/safety.d.ts +144 -10
- package/resources/safety.d.ts.map +1 -1
- package/resources/safety.js +4 -1
- package/resources/safety.js.map +1 -1
- package/resources/safety.mjs +4 -0
- package/resources/safety.mjs.map +1 -1
- package/resources/scoring-functions.d.ts +120 -50
- package/resources/scoring-functions.d.ts.map +1 -1
- package/resources/scoring-functions.js +15 -1
- package/resources/scoring-functions.js.map +1 -1
- package/resources/scoring-functions.mjs +15 -0
- package/resources/scoring-functions.mjs.map +1 -1
- package/resources/scoring.d.ts +85 -26
- package/resources/scoring.d.ts.map +1 -1
- package/resources/scoring.js +2 -1
- package/resources/scoring.js.map +1 -1
- package/resources/scoring.mjs +2 -0
- package/resources/scoring.mjs.map +1 -1
- package/resources/shared.d.ts +173 -591
- package/resources/shared.d.ts.map +1 -1
- package/resources/shared.js +2 -0
- package/resources/shared.js.map +1 -1
- package/resources/shared.mjs +2 -0
- package/resources/shared.mjs.map +1 -1
- package/resources/shields.d.ts +19 -24
- package/resources/shields.d.ts.map +1 -1
- package/resources/shields.js +6 -1
- package/resources/shields.js.map +1 -1
- package/resources/shields.mjs +6 -0
- package/resources/shields.mjs.map +1 -1
- package/resources/tool-runtime.d.ts +151 -1
- package/resources/tool-runtime.d.ts.map +1 -1
- package/resources/tool-runtime.js +22 -16
- package/resources/tool-runtime.js.map +1 -1
- package/resources/tool-runtime.mjs +20 -1
- package/resources/tool-runtime.mjs.map +1 -1
- package/resources/toolgroups.d.ts +27 -37
- package/resources/toolgroups.d.ts.map +1 -1
- package/resources/toolgroups.js +10 -1
- package/resources/toolgroups.js.map +1 -1
- package/resources/toolgroups.mjs +10 -0
- package/resources/toolgroups.mjs.map +1 -1
- package/resources/tools.d.ts +9 -76
- package/resources/tools.d.ts.map +1 -1
- package/resources/tools.js +4 -1
- package/resources/tools.js.map +1 -1
- package/resources/tools.mjs +4 -0
- package/resources/tools.mjs.map +1 -1
- package/resources/vector-io.d.ts +272 -148
- package/resources/vector-io.d.ts.map +1 -1
- package/resources/vector-io.js +2 -1
- package/resources/vector-io.js.map +1 -1
- package/resources/vector-io.mjs +2 -0
- package/resources/vector-io.mjs.map +1 -1
- package/resources/vector-stores/file-batches.d.ts +111 -0
- package/resources/vector-stores/file-batches.d.ts.map +1 -0
- package/resources/vector-stores/file-batches.js +45 -0
- package/resources/vector-stores/file-batches.js.map +1 -0
- package/resources/vector-stores/file-batches.mjs +41 -0
- package/resources/vector-stores/file-batches.mjs.map +1 -0
- package/resources/vector-stores/files.d.ts +83 -135
- package/resources/vector-stores/files.d.ts.map +1 -1
- package/resources/vector-stores/files.js +15 -14
- package/resources/vector-stores/files.js.map +1 -1
- package/resources/vector-stores/files.mjs +15 -13
- package/resources/vector-stores/files.mjs.map +1 -1
- package/resources/vector-stores/index.d.ts +2 -1
- package/resources/vector-stores/index.d.ts.map +1 -1
- package/resources/vector-stores/index.js +5 -2
- package/resources/vector-stores/index.js.map +1 -1
- package/resources/vector-stores/index.mjs +3 -0
- package/resources/vector-stores/index.mjs.map +1 -1
- package/resources/vector-stores/vector-stores.d.ts +118 -217
- package/resources/vector-stores/vector-stores.d.ts.map +1 -1
- package/resources/vector-stores/vector-stores.js +18 -12
- package/resources/vector-stores/vector-stores.js.map +1 -1
- package/resources/vector-stores/vector-stores.mjs +18 -11
- package/resources/vector-stores/vector-stores.mjs.map +1 -1
- package/resources/vector-stores.js +2 -1
- package/resources/vector-stores.js.map +1 -1
- package/resources/vector-stores.mjs +2 -0
- package/resources/vector-stores.mjs.map +1 -1
- package/src/error.ts +1 -0
- package/src/index.ts +92 -267
- package/src/lib/response-helpers.ts +60 -0
- package/src/pagination.ts +2 -5
- package/src/resource.ts +1 -0
- package/src/resources/alpha/admin.ts +84 -0
- package/src/resources/alpha/alpha.ts +93 -0
- package/src/resources/{benchmarks.ts → alpha/benchmarks.ts} +51 -16
- package/src/resources/{eval → alpha/eval}/eval.ts +83 -65
- package/src/resources/{eval → alpha/eval}/index.ts +1 -2
- package/src/resources/{eval → alpha/eval}/jobs.ts +6 -6
- package/src/resources/{eval.ts → alpha/eval.ts} +1 -0
- package/src/resources/alpha/index.ts +36 -0
- package/src/resources/alpha/inference.ts +132 -0
- package/src/resources/{post-training → alpha/post-training}/index.ts +1 -1
- package/src/resources/alpha/post-training/job.ts +177 -0
- package/src/resources/alpha/post-training/post-training.ts +372 -0
- package/src/resources/{post-training.ts → alpha/post-training.ts} +1 -1
- package/src/resources/alpha.ts +9 -0
- package/src/resources/batches.ts +572 -0
- package/src/resources/beta/beta.ts +41 -0
- package/src/resources/{datasets.ts → beta/datasets.ts} +128 -110
- package/src/resources/beta/index.ts +20 -0
- package/src/resources/{agents.ts → beta.ts} +2 -2
- package/src/resources/chat/chat.ts +84 -83
- package/src/resources/chat/completions.ts +876 -1486
- package/src/resources/chat/index.ts +1 -2
- package/src/resources/chat.ts +1 -1
- package/src/resources/completions.ts +59 -103
- package/src/resources/conversations/conversations.ts +491 -0
- package/src/resources/conversations/index.ts +25 -0
- package/src/resources/conversations/items.ts +1365 -0
- package/src/resources/conversations.ts +9 -0
- package/src/resources/embeddings.ts +14 -55
- package/src/resources/files.ts +54 -61
- package/src/resources/index.ts +35 -111
- package/src/resources/inspect.ts +4 -84
- package/src/resources/models/index.ts +4 -2
- package/src/resources/models/models.ts +79 -30
- package/src/resources/models/openai.ts +4 -24
- package/src/resources/models.ts +1 -1
- package/src/resources/moderations.ts +10 -36
- package/src/resources/prompts/index.ts +19 -0
- package/src/resources/prompts/prompts.ts +171 -0
- package/src/resources/prompts/versions.ts +26 -0
- package/src/resources/prompts.ts +9 -0
- package/src/resources/providers.ts +5 -18
- package/src/resources/responses/index.ts +1 -1
- package/src/resources/responses/input-items.ts +365 -161
- package/src/resources/responses/responses.ts +2959 -1870
- package/src/resources/responses.ts +1 -1
- package/src/resources/routes.ts +25 -14
- package/src/resources/safety.ts +199 -9
- package/src/resources/scoring-functions.ts +168 -52
- package/src/resources/scoring.ts +125 -22
- package/src/resources/shared.ts +187 -665
- package/src/resources/shields.ts +18 -23
- package/src/resources/tool-runtime.ts +210 -2
- package/src/resources/toolgroups.ts +26 -36
- package/src/resources/tools.ts +10 -94
- package/src/resources/vector-io.ts +323 -145
- package/src/resources/vector-stores/file-batches.ts +201 -0
- package/src/resources/vector-stores/files.ts +123 -143
- package/src/resources/vector-stores/index.ts +9 -1
- package/src/resources/vector-stores/vector-stores.ts +150 -216
- package/src/resources/vector-stores.ts +1 -1
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
- package/resources/agents/agents.d.ts +0 -246
- package/resources/agents/agents.d.ts.map +0 -1
- package/resources/agents/agents.js.map +0 -1
- package/resources/agents/agents.mjs +0 -52
- package/resources/agents/agents.mjs.map +0 -1
- package/resources/agents/index.d.ts +0 -5
- package/resources/agents/index.d.ts.map +0 -1
- package/resources/agents/index.js +0 -18
- package/resources/agents/index.js.map +0 -1
- package/resources/agents/index.mjs +0 -10
- package/resources/agents/index.mjs.map +0 -1
- package/resources/agents/session.d.ts +0 -98
- package/resources/agents/session.d.ts.map +0 -1
- package/resources/agents/session.js +0 -42
- package/resources/agents/session.js.map +0 -1
- package/resources/agents/session.mjs +0 -37
- package/resources/agents/session.mjs.map +0 -1
- package/resources/agents/steps.d.ts +0 -22
- package/resources/agents/steps.d.ts.map +0 -1
- package/resources/agents/steps.js.map +0 -1
- package/resources/agents/steps.mjs +0 -15
- package/resources/agents/steps.mjs.map +0 -1
- package/resources/agents/turn.d.ts +0 -461
- package/resources/agents/turn.d.ts.map +0 -1
- package/resources/agents/turn.js +0 -34
- package/resources/agents/turn.js.map +0 -1
- package/resources/agents/turn.mjs +0 -29
- package/resources/agents/turn.mjs.map +0 -1
- package/resources/agents.d.ts +0 -2
- package/resources/agents.d.ts.map +0 -1
- package/resources/agents.js.map +0 -1
- package/resources/agents.mjs +0 -7
- package/resources/agents.mjs.map +0 -1
- package/resources/benchmarks.d.ts.map +0 -1
- package/resources/benchmarks.js.map +0 -1
- package/resources/benchmarks.mjs +0 -31
- package/resources/benchmarks.mjs.map +0 -1
- package/resources/datasets.d.ts.map +0 -1
- package/resources/datasets.js.map +0 -1
- package/resources/datasets.mjs.map +0 -1
- package/resources/eval/eval.d.ts +0 -159
- package/resources/eval/eval.d.ts.map +0 -1
- package/resources/eval/eval.js.map +0 -1
- package/resources/eval/eval.mjs.map +0 -1
- package/resources/eval/index.d.ts +0 -3
- package/resources/eval/index.d.ts.map +0 -1
- package/resources/eval/index.js.map +0 -1
- package/resources/eval/index.mjs.map +0 -1
- package/resources/eval/jobs.d.ts.map +0 -1
- package/resources/eval/jobs.js.map +0 -1
- package/resources/eval/jobs.mjs.map +0 -1
- package/resources/eval.d.ts.map +0 -1
- package/resources/eval.js.map +0 -1
- package/resources/eval.mjs.map +0 -1
- package/resources/inference.d.ts +0 -580
- package/resources/inference.d.ts.map +0 -1
- package/resources/inference.js +0 -54
- package/resources/inference.js.map +0 -1
- package/resources/inference.mjs +0 -49
- package/resources/inference.mjs.map +0 -1
- package/resources/post-training/index.d.ts.map +0 -1
- package/resources/post-training/index.js.map +0 -1
- package/resources/post-training/index.mjs.map +0 -1
- package/resources/post-training/job.d.ts +0 -205
- package/resources/post-training/job.d.ts.map +0 -1
- package/resources/post-training/job.js.map +0 -1
- package/resources/post-training/job.mjs.map +0 -1
- package/resources/post-training/post-training.d.ts +0 -402
- package/resources/post-training/post-training.d.ts.map +0 -1
- package/resources/post-training/post-training.js.map +0 -1
- package/resources/post-training/post-training.mjs.map +0 -1
- package/resources/post-training.d.ts.map +0 -1
- package/resources/post-training.js.map +0 -1
- package/resources/post-training.mjs.map +0 -1
- package/resources/synthetic-data-generation.d.ts +0 -47
- package/resources/synthetic-data-generation.d.ts.map +0 -1
- package/resources/synthetic-data-generation.js +0 -20
- package/resources/synthetic-data-generation.js.map +0 -1
- package/resources/synthetic-data-generation.mjs +0 -15
- package/resources/synthetic-data-generation.mjs.map +0 -1
- package/resources/telemetry.d.ts +0 -519
- package/resources/telemetry.d.ts.map +0 -1
- package/resources/telemetry.js +0 -70
- package/resources/telemetry.js.map +0 -1
- package/resources/telemetry.mjs +0 -65
- package/resources/telemetry.mjs.map +0 -1
- package/resources/tool-runtime/index.d.ts +0 -3
- package/resources/tool-runtime/index.d.ts.map +0 -1
- package/resources/tool-runtime/index.js +0 -14
- package/resources/tool-runtime/index.js.map +0 -1
- package/resources/tool-runtime/index.mjs +0 -8
- package/resources/tool-runtime/index.mjs.map +0 -1
- package/resources/tool-runtime/rag-tool.d.ts +0 -45
- package/resources/tool-runtime/rag-tool.d.ts.map +0 -1
- package/resources/tool-runtime/rag-tool.js +0 -30
- package/resources/tool-runtime/rag-tool.js.map +0 -1
- package/resources/tool-runtime/rag-tool.mjs +0 -25
- package/resources/tool-runtime/rag-tool.mjs.map +0 -1
- package/resources/tool-runtime/tool-runtime.d.ts +0 -132
- package/resources/tool-runtime/tool-runtime.d.ts.map +0 -1
- package/resources/tool-runtime/tool-runtime.js.map +0 -1
- package/resources/tool-runtime/tool-runtime.mjs +0 -29
- package/resources/tool-runtime/tool-runtime.mjs.map +0 -1
- package/resources/vector-dbs.d.ts +0 -128
- package/resources/vector-dbs.d.ts.map +0 -1
- package/resources/vector-dbs.js +0 -41
- package/resources/vector-dbs.js.map +0 -1
- package/resources/vector-dbs.mjs +0 -36
- package/resources/vector-dbs.mjs.map +0 -1
- package/src/resources/agents/agents.ts +0 -372
- package/src/resources/agents/index.ts +0 -44
- package/src/resources/agents/session.ts +0 -169
- package/src/resources/agents/steps.ts +0 -47
- package/src/resources/agents/turn.ts +0 -638
- package/src/resources/inference.ts +0 -768
- package/src/resources/post-training/job.ts +0 -274
- package/src/resources/post-training/post-training.ts +0 -516
- package/src/resources/synthetic-data-generation.ts +0 -65
- package/src/resources/telemetry.ts +0 -692
- package/src/resources/tool-runtime/index.ts +0 -17
- package/src/resources/tool-runtime/rag-tool.ts +0 -69
- package/src/resources/tool-runtime/tool-runtime.ts +0 -191
- package/src/resources/vector-dbs.ts +0 -191
- /package/resources/{eval.d.ts → alpha/eval.d.ts} +0 -0
- /package/resources/{eval.mjs → alpha/eval.mjs} +0 -0
- /package/resources/{post-training → alpha/post-training}/index.d.ts +0 -0
- /package/resources/{post-training.d.ts → alpha/post-training.d.ts} +0 -0
|
@@ -0,0 +1,60 @@
|
|
|
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
|
+
/**
|
|
8
|
+
* Helper utilities for working with response objects.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import type { ResponseObject } from '../resources/responses/responses';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Extracts aggregated text output from a ResponseObject.
|
|
15
|
+
* This concatenates all `output_text` entries from the response's output array.
|
|
16
|
+
*
|
|
17
|
+
* Useful for streaming responses where you want to get the final text from chunk.response:
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts
|
|
21
|
+
* const stream = await client.responses.create({ stream: true, ... });
|
|
22
|
+
* for await (const chunk of stream) {
|
|
23
|
+
* if (chunk.type === 'response.completed') {
|
|
24
|
+
* const text = getResponseOutputText(chunk.response);
|
|
25
|
+
* console.log(text);
|
|
26
|
+
* }
|
|
27
|
+
* }
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export function getResponseOutputText(response: ResponseObject): string {
|
|
31
|
+
const pieces: string[] = [];
|
|
32
|
+
|
|
33
|
+
for (const output of response.output ?? []) {
|
|
34
|
+
if (!output || output.type !== 'message') {
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const content = output.content;
|
|
39
|
+
if (typeof content === 'string') {
|
|
40
|
+
pieces.push(content);
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (!Array.isArray(content)) {
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
for (const item of content) {
|
|
49
|
+
if (typeof item === 'string') {
|
|
50
|
+
pieces.push(item);
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
if (item && item.type === 'output_text' && 'text' in item && typeof item.text === 'string') {
|
|
54
|
+
pieces.push(item.text);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return pieces.join('');
|
|
60
|
+
}
|
package/src/pagination.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
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
6
|
|
|
7
|
+
//
|
|
7
8
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
8
9
|
|
|
9
10
|
import { AbstractPage, Response, APIClient, FinalRequestOptions, PageInfo } from './core';
|
|
@@ -54,11 +55,7 @@ export class DatasetsIterrows<Item> extends AbstractPage<Item> implements Datase
|
|
|
54
55
|
}
|
|
55
56
|
|
|
56
57
|
nextPageInfo(): PageInfo | null {
|
|
57
|
-
const offset = this.next_index;
|
|
58
|
-
if (!offset) {
|
|
59
|
-
return null;
|
|
60
|
-
}
|
|
61
|
-
|
|
58
|
+
const offset = this.next_index ?? 0;
|
|
62
59
|
const length = this.getPaginatedItems().length;
|
|
63
60
|
const currentCount = offset + length;
|
|
64
61
|
|
package/src/resource.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
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
6
|
|
|
7
|
+
//
|
|
7
8
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
8
9
|
|
|
9
10
|
import type { LlamaStackClient } from './index';
|
|
@@ -0,0 +1,84 @@
|
|
|
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 ProvidersAPI from '../providers';
|
|
13
|
+
import * as RoutesAPI from '../routes';
|
|
14
|
+
import * as Shared from '../shared';
|
|
15
|
+
|
|
16
|
+
export class Admin extends APIResource {
|
|
17
|
+
/**
|
|
18
|
+
* Get the current health status of the service.
|
|
19
|
+
*/
|
|
20
|
+
health(options?: Core.RequestOptions): Core.APIPromise<Shared.HealthInfo> {
|
|
21
|
+
return this._client.get('/v1alpha/admin/health', options);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Get detailed information about a specific provider.
|
|
26
|
+
*/
|
|
27
|
+
inspectProvider(providerId: string, options?: Core.RequestOptions): Core.APIPromise<Shared.ProviderInfo> {
|
|
28
|
+
return this._client.get(`/v1alpha/admin/providers/${providerId}`, options);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* List all available providers with their configuration and health status.
|
|
33
|
+
*/
|
|
34
|
+
listProviders(options?: Core.RequestOptions): Core.APIPromise<ProvidersAPI.ProviderListResponse> {
|
|
35
|
+
return (
|
|
36
|
+
this._client.get('/v1alpha/admin/providers', options) as Core.APIPromise<{
|
|
37
|
+
data: ProvidersAPI.ProviderListResponse;
|
|
38
|
+
}>
|
|
39
|
+
)._thenUnwrap((obj) => obj.data);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* List all available API routes with their methods and implementing providers.
|
|
44
|
+
*/
|
|
45
|
+
listRoutes(
|
|
46
|
+
query?: AdminListRoutesParams,
|
|
47
|
+
options?: Core.RequestOptions,
|
|
48
|
+
): Core.APIPromise<RoutesAPI.RouteListResponse>;
|
|
49
|
+
listRoutes(options?: Core.RequestOptions): Core.APIPromise<RoutesAPI.RouteListResponse>;
|
|
50
|
+
listRoutes(
|
|
51
|
+
query: AdminListRoutesParams | Core.RequestOptions = {},
|
|
52
|
+
options?: Core.RequestOptions,
|
|
53
|
+
): Core.APIPromise<RoutesAPI.RouteListResponse> {
|
|
54
|
+
if (isRequestOptions(query)) {
|
|
55
|
+
return this.listRoutes({}, query);
|
|
56
|
+
}
|
|
57
|
+
return (
|
|
58
|
+
this._client.get('/v1alpha/admin/inspect/routes', { query, ...options }) as Core.APIPromise<{
|
|
59
|
+
data: RoutesAPI.RouteListResponse;
|
|
60
|
+
}>
|
|
61
|
+
)._thenUnwrap((obj) => obj.data);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Get the version of the service.
|
|
66
|
+
*/
|
|
67
|
+
version(options?: Core.RequestOptions): Core.APIPromise<Shared.VersionInfo> {
|
|
68
|
+
return this._client.get('/v1alpha/admin/version', options);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export interface AdminListRoutesParams {
|
|
73
|
+
/**
|
|
74
|
+
* Filter to control which routes are returned. Can be an API level ('v1',
|
|
75
|
+
* 'v1alpha', 'v1beta') to show non-deprecated routes at that level, or
|
|
76
|
+
* 'deprecated' to show deprecated routes across all levels. If not specified,
|
|
77
|
+
* returns all non-deprecated routes.
|
|
78
|
+
*/
|
|
79
|
+
api_filter?: 'v1' | 'v1alpha' | 'v1beta' | 'deprecated' | null;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export declare namespace Admin {
|
|
83
|
+
export { type AdminListRoutesParams as AdminListRoutesParams };
|
|
84
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
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 AdminAPI from './admin';
|
|
11
|
+
import { Admin, AdminListRoutesParams } from './admin';
|
|
12
|
+
import * as BenchmarksAPI from './benchmarks';
|
|
13
|
+
import {
|
|
14
|
+
Benchmark,
|
|
15
|
+
BenchmarkListResponse,
|
|
16
|
+
BenchmarkRegisterParams,
|
|
17
|
+
Benchmarks,
|
|
18
|
+
ListBenchmarksResponse,
|
|
19
|
+
} from './benchmarks';
|
|
20
|
+
import * as InferenceAPI from './inference';
|
|
21
|
+
import { Inference, InferenceRerankParams, InferenceRerankResponse } from './inference';
|
|
22
|
+
import * as EvalAPI from './eval/eval';
|
|
23
|
+
import {
|
|
24
|
+
BenchmarkConfig,
|
|
25
|
+
Eval,
|
|
26
|
+
EvalEvaluateRowsAlphaParams,
|
|
27
|
+
EvalEvaluateRowsParams,
|
|
28
|
+
EvalRunEvalAlphaParams,
|
|
29
|
+
EvalRunEvalParams,
|
|
30
|
+
EvaluateResponse,
|
|
31
|
+
Job,
|
|
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
|
+
|
|
43
|
+
export class Alpha extends APIResource {
|
|
44
|
+
inference: InferenceAPI.Inference = new InferenceAPI.Inference(this._client);
|
|
45
|
+
postTraining: PostTrainingAPI.PostTraining = new PostTrainingAPI.PostTraining(this._client);
|
|
46
|
+
benchmarks: BenchmarksAPI.Benchmarks = new BenchmarksAPI.Benchmarks(this._client);
|
|
47
|
+
eval: EvalAPI.Eval = new EvalAPI.Eval(this._client);
|
|
48
|
+
admin: AdminAPI.Admin = new AdminAPI.Admin(this._client);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
Alpha.Inference = Inference;
|
|
52
|
+
Alpha.PostTraining = PostTraining;
|
|
53
|
+
Alpha.Benchmarks = Benchmarks;
|
|
54
|
+
Alpha.Eval = Eval;
|
|
55
|
+
Alpha.Admin = Admin;
|
|
56
|
+
|
|
57
|
+
export declare namespace Alpha {
|
|
58
|
+
export {
|
|
59
|
+
Inference as Inference,
|
|
60
|
+
type InferenceRerankResponse as InferenceRerankResponse,
|
|
61
|
+
type InferenceRerankParams as InferenceRerankParams,
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export {
|
|
65
|
+
PostTraining as PostTraining,
|
|
66
|
+
type AlgorithmConfig as AlgorithmConfig,
|
|
67
|
+
type ListPostTrainingJobsResponse as ListPostTrainingJobsResponse,
|
|
68
|
+
type PostTrainingJob as PostTrainingJob,
|
|
69
|
+
type PostTrainingPreferenceOptimizeParams as PostTrainingPreferenceOptimizeParams,
|
|
70
|
+
type PostTrainingSupervisedFineTuneParams as PostTrainingSupervisedFineTuneParams,
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export {
|
|
74
|
+
Benchmarks as Benchmarks,
|
|
75
|
+
type Benchmark as Benchmark,
|
|
76
|
+
type ListBenchmarksResponse as ListBenchmarksResponse,
|
|
77
|
+
type BenchmarkListResponse as BenchmarkListResponse,
|
|
78
|
+
type BenchmarkRegisterParams as BenchmarkRegisterParams,
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export {
|
|
82
|
+
Eval as Eval,
|
|
83
|
+
type BenchmarkConfig as BenchmarkConfig,
|
|
84
|
+
type EvaluateResponse as EvaluateResponse,
|
|
85
|
+
type Job as Job,
|
|
86
|
+
type EvalEvaluateRowsParams as EvalEvaluateRowsParams,
|
|
87
|
+
type EvalEvaluateRowsAlphaParams as EvalEvaluateRowsAlphaParams,
|
|
88
|
+
type EvalRunEvalParams as EvalRunEvalParams,
|
|
89
|
+
type EvalRunEvalAlphaParams as EvalRunEvalAlphaParams,
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export { Admin as Admin, type AdminListRoutesParams as AdminListRoutesParams };
|
|
93
|
+
}
|
|
@@ -4,17 +4,18 @@
|
|
|
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
6
|
|
|
7
|
+
//
|
|
7
8
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
8
9
|
|
|
9
|
-
import { APIResource } from '
|
|
10
|
-
import * as Core from '
|
|
10
|
+
import { APIResource } from '../../resource';
|
|
11
|
+
import * as Core from '../../core';
|
|
11
12
|
|
|
12
13
|
export class Benchmarks extends APIResource {
|
|
13
14
|
/**
|
|
14
15
|
* Get a benchmark by its ID.
|
|
15
16
|
*/
|
|
16
17
|
retrieve(benchmarkId: string, options?: Core.RequestOptions): Core.APIPromise<Benchmark> {
|
|
17
|
-
return this._client.get(`/
|
|
18
|
+
return this._client.get(`/v1alpha/eval/benchmarks/${benchmarkId}`, options);
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
/**
|
|
@@ -22,20 +23,36 @@ export class Benchmarks extends APIResource {
|
|
|
22
23
|
*/
|
|
23
24
|
list(options?: Core.RequestOptions): Core.APIPromise<BenchmarkListResponse> {
|
|
24
25
|
return (
|
|
25
|
-
this._client.get('/
|
|
26
|
+
this._client.get('/v1alpha/eval/benchmarks', options) as Core.APIPromise<{
|
|
27
|
+
data: BenchmarkListResponse;
|
|
28
|
+
}>
|
|
26
29
|
)._thenUnwrap((obj) => obj.data);
|
|
27
30
|
}
|
|
28
31
|
|
|
29
32
|
/**
|
|
30
33
|
* Register a benchmark.
|
|
34
|
+
*
|
|
35
|
+
* @deprecated
|
|
31
36
|
*/
|
|
32
37
|
register(body: BenchmarkRegisterParams, options?: Core.RequestOptions): Core.APIPromise<void> {
|
|
33
|
-
return this._client.post('/
|
|
38
|
+
return this._client.post('/v1alpha/eval/benchmarks', {
|
|
34
39
|
body,
|
|
35
40
|
...options,
|
|
36
41
|
headers: { Accept: '*/*', ...options?.headers },
|
|
37
42
|
});
|
|
38
43
|
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Unregister a benchmark.
|
|
47
|
+
*
|
|
48
|
+
* @deprecated
|
|
49
|
+
*/
|
|
50
|
+
unregister(benchmarkId: string, options?: Core.RequestOptions): Core.APIPromise<void> {
|
|
51
|
+
return this._client.delete(`/v1alpha/eval/benchmarks/${benchmarkId}`, {
|
|
52
|
+
...options,
|
|
53
|
+
headers: { Accept: '*/*', ...options?.headers },
|
|
54
|
+
});
|
|
55
|
+
}
|
|
39
56
|
}
|
|
40
57
|
|
|
41
58
|
/**
|
|
@@ -43,36 +60,54 @@ export class Benchmarks extends APIResource {
|
|
|
43
60
|
*/
|
|
44
61
|
export interface Benchmark {
|
|
45
62
|
/**
|
|
46
|
-
* Identifier of the dataset to use for the benchmark evaluation
|
|
63
|
+
* Identifier of the dataset to use for the benchmark evaluation.
|
|
47
64
|
*/
|
|
48
65
|
dataset_id: string;
|
|
49
66
|
|
|
67
|
+
/**
|
|
68
|
+
* Unique identifier for this resource in llama stack
|
|
69
|
+
*/
|
|
50
70
|
identifier: string;
|
|
51
71
|
|
|
52
72
|
/**
|
|
53
|
-
*
|
|
73
|
+
* ID of the provider that owns this resource
|
|
54
74
|
*/
|
|
55
|
-
metadata: { [key: string]: boolean | number | string | Array<unknown> | unknown | null };
|
|
56
|
-
|
|
57
75
|
provider_id: string;
|
|
58
76
|
|
|
59
77
|
/**
|
|
60
|
-
* List of scoring function identifiers to apply during evaluation
|
|
78
|
+
* List of scoring function identifiers to apply during evaluation.
|
|
61
79
|
*/
|
|
62
80
|
scoring_functions: Array<string>;
|
|
63
81
|
|
|
64
82
|
/**
|
|
65
|
-
*
|
|
83
|
+
* Metadata for this evaluation task.
|
|
66
84
|
*/
|
|
67
|
-
|
|
85
|
+
metadata?: { [key: string]: unknown };
|
|
68
86
|
|
|
69
|
-
|
|
87
|
+
/**
|
|
88
|
+
* Unique identifier for this resource in the provider
|
|
89
|
+
*/
|
|
90
|
+
provider_resource_id?: string | null;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* The resource type, always benchmark.
|
|
94
|
+
*/
|
|
95
|
+
type?: 'benchmark';
|
|
70
96
|
}
|
|
71
97
|
|
|
98
|
+
/**
|
|
99
|
+
* Response containing a list of benchmark objects.
|
|
100
|
+
*/
|
|
72
101
|
export interface ListBenchmarksResponse {
|
|
102
|
+
/**
|
|
103
|
+
* List of benchmark objects.
|
|
104
|
+
*/
|
|
73
105
|
data: BenchmarkListResponse;
|
|
74
106
|
}
|
|
75
107
|
|
|
108
|
+
/**
|
|
109
|
+
* List of benchmark objects.
|
|
110
|
+
*/
|
|
76
111
|
export type BenchmarkListResponse = Array<Benchmark>;
|
|
77
112
|
|
|
78
113
|
export interface BenchmarkRegisterParams {
|
|
@@ -94,17 +129,17 @@ export interface BenchmarkRegisterParams {
|
|
|
94
129
|
/**
|
|
95
130
|
* The metadata to use for the benchmark.
|
|
96
131
|
*/
|
|
97
|
-
metadata?: { [key: string]:
|
|
132
|
+
metadata?: { [key: string]: unknown } | null;
|
|
98
133
|
|
|
99
134
|
/**
|
|
100
135
|
* The ID of the provider benchmark to use for the benchmark.
|
|
101
136
|
*/
|
|
102
|
-
provider_benchmark_id?: string;
|
|
137
|
+
provider_benchmark_id?: string | null;
|
|
103
138
|
|
|
104
139
|
/**
|
|
105
140
|
* The ID of the provider to use for the benchmark.
|
|
106
141
|
*/
|
|
107
|
-
provider_id?: string;
|
|
142
|
+
provider_id?: string | null;
|
|
108
143
|
}
|
|
109
144
|
|
|
110
145
|
export declare namespace Benchmarks {
|
|
@@ -3,13 +3,12 @@
|
|
|
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
|
-
|
|
6
|
+
//
|
|
7
7
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
8
8
|
|
|
9
|
-
import { APIResource } from '
|
|
10
|
-
import * as Core from '
|
|
11
|
-
import * as
|
|
12
|
-
import * as Shared from '../shared';
|
|
9
|
+
import { APIResource } from '../../../resource';
|
|
10
|
+
import * as Core from '../../../core';
|
|
11
|
+
import * as Shared from '../../shared';
|
|
13
12
|
import * as JobsAPI from './jobs';
|
|
14
13
|
import { Jobs } from './jobs';
|
|
15
14
|
|
|
@@ -24,7 +23,7 @@ export class Eval extends APIResource {
|
|
|
24
23
|
body: EvalEvaluateRowsParams,
|
|
25
24
|
options?: Core.RequestOptions,
|
|
26
25
|
): Core.APIPromise<EvaluateResponse> {
|
|
27
|
-
return this._client.post(`/
|
|
26
|
+
return this._client.post(`/v1alpha/eval/benchmarks/${benchmarkId}/evaluations`, { body, ...options });
|
|
28
27
|
}
|
|
29
28
|
|
|
30
29
|
/**
|
|
@@ -35,14 +34,14 @@ export class Eval extends APIResource {
|
|
|
35
34
|
body: EvalEvaluateRowsAlphaParams,
|
|
36
35
|
options?: Core.RequestOptions,
|
|
37
36
|
): Core.APIPromise<EvaluateResponse> {
|
|
38
|
-
return this._client.post(`/
|
|
37
|
+
return this._client.post(`/v1alpha/eval/benchmarks/${benchmarkId}/evaluations`, { body, ...options });
|
|
39
38
|
}
|
|
40
39
|
|
|
41
40
|
/**
|
|
42
41
|
* Run an evaluation on a benchmark.
|
|
43
42
|
*/
|
|
44
43
|
runEval(benchmarkId: string, body: EvalRunEvalParams, options?: Core.RequestOptions): Core.APIPromise<Job> {
|
|
45
|
-
return this._client.post(`/
|
|
44
|
+
return this._client.post(`/v1alpha/eval/benchmarks/${benchmarkId}/jobs`, { body, ...options });
|
|
46
45
|
}
|
|
47
46
|
|
|
48
47
|
/**
|
|
@@ -53,7 +52,7 @@ export class Eval extends APIResource {
|
|
|
53
52
|
body: EvalRunEvalAlphaParams,
|
|
54
53
|
options?: Core.RequestOptions,
|
|
55
54
|
): Core.APIPromise<Job> {
|
|
56
|
-
return this._client.post(`/
|
|
55
|
+
return this._client.post(`/v1alpha/eval/benchmarks/${benchmarkId}/jobs`, { body, ...options });
|
|
57
56
|
}
|
|
58
57
|
}
|
|
59
58
|
|
|
@@ -62,61 +61,102 @@ export class Eval extends APIResource {
|
|
|
62
61
|
*/
|
|
63
62
|
export interface BenchmarkConfig {
|
|
64
63
|
/**
|
|
65
|
-
*
|
|
64
|
+
* A model candidate for evaluation.
|
|
65
|
+
*/
|
|
66
|
+
eval_candidate: BenchmarkConfig.EvalCandidate;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Number of examples to evaluate (useful for testing), if not provided, all
|
|
70
|
+
* examples in the dataset will be evaluated
|
|
66
71
|
*/
|
|
67
|
-
|
|
72
|
+
num_examples?: number | null;
|
|
68
73
|
|
|
69
74
|
/**
|
|
70
75
|
* Map between scoring function id and parameters for each scoring function you
|
|
71
76
|
* want to run
|
|
72
77
|
*/
|
|
73
|
-
scoring_params
|
|
78
|
+
scoring_params?: {
|
|
79
|
+
[key: string]:
|
|
80
|
+
| BenchmarkConfig.LlmAsJudgeScoringFnParams
|
|
81
|
+
| BenchmarkConfig.RegexParserScoringFnParams
|
|
82
|
+
| BenchmarkConfig.BasicScoringFnParams;
|
|
83
|
+
};
|
|
84
|
+
}
|
|
74
85
|
|
|
86
|
+
export namespace BenchmarkConfig {
|
|
75
87
|
/**
|
|
76
|
-
*
|
|
77
|
-
* the dataset will be evaluated
|
|
88
|
+
* A model candidate for evaluation.
|
|
78
89
|
*/
|
|
79
|
-
|
|
80
|
-
|
|
90
|
+
export interface EvalCandidate {
|
|
91
|
+
model: string;
|
|
81
92
|
|
|
82
|
-
/**
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
93
|
+
/**
|
|
94
|
+
* Sampling parameters.
|
|
95
|
+
*/
|
|
96
|
+
sampling_params: Shared.SamplingParams;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* A system message providing instructions or context to the model.
|
|
100
|
+
*/
|
|
101
|
+
system_message?: Shared.SystemMessage | null;
|
|
102
|
+
|
|
103
|
+
type?: 'model';
|
|
104
|
+
}
|
|
86
105
|
|
|
87
|
-
export namespace EvalCandidate {
|
|
88
106
|
/**
|
|
89
|
-
*
|
|
107
|
+
* Parameters for LLM-as-judge scoring function configuration.
|
|
90
108
|
*/
|
|
91
|
-
export interface
|
|
109
|
+
export interface LlmAsJudgeScoringFnParams {
|
|
110
|
+
judge_model: string;
|
|
111
|
+
|
|
92
112
|
/**
|
|
93
|
-
*
|
|
113
|
+
* Aggregation functions to apply to the scores of each row
|
|
94
114
|
*/
|
|
95
|
-
|
|
115
|
+
aggregation_functions?: Array<
|
|
116
|
+
'average' | 'weighted_average' | 'median' | 'categorical_count' | 'accuracy'
|
|
117
|
+
>;
|
|
96
118
|
|
|
97
119
|
/**
|
|
98
|
-
*
|
|
120
|
+
* Regexes to extract the answer from generated response
|
|
99
121
|
*/
|
|
100
|
-
|
|
122
|
+
judge_score_regexes?: Array<string>;
|
|
123
|
+
|
|
124
|
+
prompt_template?: string | null;
|
|
125
|
+
|
|
126
|
+
type?: 'llm_as_judge';
|
|
127
|
+
}
|
|
101
128
|
|
|
102
|
-
|
|
129
|
+
/**
|
|
130
|
+
* Parameters for regex parser scoring function configuration.
|
|
131
|
+
*/
|
|
132
|
+
export interface RegexParserScoringFnParams {
|
|
133
|
+
/**
|
|
134
|
+
* Aggregation functions to apply to the scores of each row
|
|
135
|
+
*/
|
|
136
|
+
aggregation_functions?: Array<
|
|
137
|
+
'average' | 'weighted_average' | 'median' | 'categorical_count' | 'accuracy'
|
|
138
|
+
>;
|
|
103
139
|
|
|
104
140
|
/**
|
|
105
|
-
*
|
|
141
|
+
* Regex to extract the answer from generated response
|
|
106
142
|
*/
|
|
107
|
-
|
|
143
|
+
parsing_regexes?: Array<string>;
|
|
144
|
+
|
|
145
|
+
type?: 'regex_parser';
|
|
108
146
|
}
|
|
109
147
|
|
|
110
148
|
/**
|
|
111
|
-
*
|
|
149
|
+
* Parameters for basic scoring function configuration.
|
|
112
150
|
*/
|
|
113
|
-
export interface
|
|
151
|
+
export interface BasicScoringFnParams {
|
|
114
152
|
/**
|
|
115
|
-
*
|
|
153
|
+
* Aggregation functions to apply to the scores of each row
|
|
116
154
|
*/
|
|
117
|
-
|
|
155
|
+
aggregation_functions?: Array<
|
|
156
|
+
'average' | 'weighted_average' | 'median' | 'categorical_count' | 'accuracy'
|
|
157
|
+
>;
|
|
118
158
|
|
|
119
|
-
type
|
|
159
|
+
type?: 'basic';
|
|
120
160
|
}
|
|
121
161
|
}
|
|
122
162
|
|
|
@@ -124,14 +164,8 @@ export namespace EvalCandidate {
|
|
|
124
164
|
* The response from an evaluation.
|
|
125
165
|
*/
|
|
126
166
|
export interface EvaluateResponse {
|
|
127
|
-
|
|
128
|
-
* The generations from the evaluation.
|
|
129
|
-
*/
|
|
130
|
-
generations: Array<{ [key: string]: boolean | number | string | Array<unknown> | unknown | null }>;
|
|
167
|
+
generations: Array<{ [key: string]: unknown }>;
|
|
131
168
|
|
|
132
|
-
/**
|
|
133
|
-
* The scores from the evaluation.
|
|
134
|
-
*/
|
|
135
169
|
scores: { [key: string]: Shared.ScoringResult };
|
|
136
170
|
}
|
|
137
171
|
|
|
@@ -139,61 +173,46 @@ export interface EvaluateResponse {
|
|
|
139
173
|
* A job execution instance with status tracking.
|
|
140
174
|
*/
|
|
141
175
|
export interface Job {
|
|
142
|
-
/**
|
|
143
|
-
* Unique identifier for the job
|
|
144
|
-
*/
|
|
145
176
|
job_id: string;
|
|
146
177
|
|
|
147
178
|
/**
|
|
148
|
-
*
|
|
179
|
+
* Status of a job execution.
|
|
149
180
|
*/
|
|
150
181
|
status: 'completed' | 'in_progress' | 'failed' | 'scheduled' | 'cancelled';
|
|
151
182
|
}
|
|
152
183
|
|
|
153
184
|
export interface EvalEvaluateRowsParams {
|
|
154
185
|
/**
|
|
155
|
-
*
|
|
186
|
+
* A benchmark configuration for evaluation.
|
|
156
187
|
*/
|
|
157
188
|
benchmark_config: BenchmarkConfig;
|
|
158
189
|
|
|
159
|
-
|
|
160
|
-
* The rows to evaluate.
|
|
161
|
-
*/
|
|
162
|
-
input_rows: Array<{ [key: string]: boolean | number | string | Array<unknown> | unknown | null }>;
|
|
190
|
+
input_rows: Array<{ [key: string]: unknown }>;
|
|
163
191
|
|
|
164
|
-
/**
|
|
165
|
-
* The scoring functions to use for the evaluation.
|
|
166
|
-
*/
|
|
167
192
|
scoring_functions: Array<string>;
|
|
168
193
|
}
|
|
169
194
|
|
|
170
195
|
export interface EvalEvaluateRowsAlphaParams {
|
|
171
196
|
/**
|
|
172
|
-
*
|
|
197
|
+
* A benchmark configuration for evaluation.
|
|
173
198
|
*/
|
|
174
199
|
benchmark_config: BenchmarkConfig;
|
|
175
200
|
|
|
176
|
-
|
|
177
|
-
* The rows to evaluate.
|
|
178
|
-
*/
|
|
179
|
-
input_rows: Array<{ [key: string]: boolean | number | string | Array<unknown> | unknown | null }>;
|
|
201
|
+
input_rows: Array<{ [key: string]: unknown }>;
|
|
180
202
|
|
|
181
|
-
/**
|
|
182
|
-
* The scoring functions to use for the evaluation.
|
|
183
|
-
*/
|
|
184
203
|
scoring_functions: Array<string>;
|
|
185
204
|
}
|
|
186
205
|
|
|
187
206
|
export interface EvalRunEvalParams {
|
|
188
207
|
/**
|
|
189
|
-
*
|
|
208
|
+
* A benchmark configuration for evaluation.
|
|
190
209
|
*/
|
|
191
210
|
benchmark_config: BenchmarkConfig;
|
|
192
211
|
}
|
|
193
212
|
|
|
194
213
|
export interface EvalRunEvalAlphaParams {
|
|
195
214
|
/**
|
|
196
|
-
*
|
|
215
|
+
* A benchmark configuration for evaluation.
|
|
197
216
|
*/
|
|
198
217
|
benchmark_config: BenchmarkConfig;
|
|
199
218
|
}
|
|
@@ -203,7 +222,6 @@ Eval.Jobs = Jobs;
|
|
|
203
222
|
export declare namespace Eval {
|
|
204
223
|
export {
|
|
205
224
|
type BenchmarkConfig as BenchmarkConfig,
|
|
206
|
-
type EvalCandidate as EvalCandidate,
|
|
207
225
|
type EvaluateResponse as EvaluateResponse,
|
|
208
226
|
type Job as Job,
|
|
209
227
|
type EvalEvaluateRowsParams as EvalEvaluateRowsParams,
|