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
|
@@ -1,768 +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 { APIPromise } from '../core';
|
|
11
|
-
import * as Core from '../core';
|
|
12
|
-
import * as InferenceAPI from './inference';
|
|
13
|
-
import * as Shared from './shared';
|
|
14
|
-
import { Stream } from '../streaming';
|
|
15
|
-
|
|
16
|
-
export class Inference extends APIResource {
|
|
17
|
-
/**
|
|
18
|
-
* Generate chat completions for a batch of messages using the specified model.
|
|
19
|
-
*/
|
|
20
|
-
batchChatCompletion(
|
|
21
|
-
body: InferenceBatchChatCompletionParams,
|
|
22
|
-
options?: Core.RequestOptions,
|
|
23
|
-
): Core.APIPromise<InferenceBatchChatCompletionResponse> {
|
|
24
|
-
return this._client.post('/v1/inference/batch-chat-completion', { body, ...options });
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Generate completions for a batch of content using the specified model.
|
|
29
|
-
*/
|
|
30
|
-
batchCompletion(
|
|
31
|
-
body: InferenceBatchCompletionParams,
|
|
32
|
-
options?: Core.RequestOptions,
|
|
33
|
-
): Core.APIPromise<Shared.BatchCompletion> {
|
|
34
|
-
return this._client.post('/v1/inference/batch-completion', { body, ...options });
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Generate a chat completion for the given messages using the specified model.
|
|
39
|
-
*
|
|
40
|
-
* @deprecated /v1/inference/chat-completion is deprecated. Please use /v1/openai/v1/chat/completions.
|
|
41
|
-
*/
|
|
42
|
-
chatCompletion(
|
|
43
|
-
body: InferenceChatCompletionParamsNonStreaming,
|
|
44
|
-
options?: Core.RequestOptions,
|
|
45
|
-
): APIPromise<Shared.ChatCompletionResponse>;
|
|
46
|
-
chatCompletion(
|
|
47
|
-
body: InferenceChatCompletionParamsStreaming,
|
|
48
|
-
options?: Core.RequestOptions,
|
|
49
|
-
): APIPromise<Stream<ChatCompletionResponseStreamChunk>>;
|
|
50
|
-
chatCompletion(
|
|
51
|
-
body: InferenceChatCompletionParamsBase,
|
|
52
|
-
options?: Core.RequestOptions,
|
|
53
|
-
): APIPromise<Stream<ChatCompletionResponseStreamChunk> | Shared.ChatCompletionResponse>;
|
|
54
|
-
chatCompletion(
|
|
55
|
-
body: InferenceChatCompletionParams,
|
|
56
|
-
options?: Core.RequestOptions,
|
|
57
|
-
): APIPromise<Shared.ChatCompletionResponse> | APIPromise<Stream<ChatCompletionResponseStreamChunk>> {
|
|
58
|
-
return this._client.post('/v1/inference/chat-completion', {
|
|
59
|
-
body,
|
|
60
|
-
...options,
|
|
61
|
-
stream: body.stream ?? false,
|
|
62
|
-
}) as APIPromise<Shared.ChatCompletionResponse> | APIPromise<Stream<ChatCompletionResponseStreamChunk>>;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Generate a completion for the given content using the specified model.
|
|
67
|
-
*
|
|
68
|
-
* @deprecated /v1/inference/completion is deprecated. Please use /v1/openai/v1/completions.
|
|
69
|
-
*/
|
|
70
|
-
completion(
|
|
71
|
-
body: InferenceCompletionParamsNonStreaming,
|
|
72
|
-
options?: Core.RequestOptions,
|
|
73
|
-
): APIPromise<CompletionResponse>;
|
|
74
|
-
completion(
|
|
75
|
-
body: InferenceCompletionParamsStreaming,
|
|
76
|
-
options?: Core.RequestOptions,
|
|
77
|
-
): APIPromise<Stream<CompletionResponse>>;
|
|
78
|
-
completion(
|
|
79
|
-
body: InferenceCompletionParamsBase,
|
|
80
|
-
options?: Core.RequestOptions,
|
|
81
|
-
): APIPromise<Stream<CompletionResponse> | CompletionResponse>;
|
|
82
|
-
completion(
|
|
83
|
-
body: InferenceCompletionParams,
|
|
84
|
-
options?: Core.RequestOptions,
|
|
85
|
-
): APIPromise<CompletionResponse> | APIPromise<Stream<CompletionResponse>> {
|
|
86
|
-
return this._client.post('/v1/inference/completion', {
|
|
87
|
-
body,
|
|
88
|
-
...options,
|
|
89
|
-
stream: body.stream ?? false,
|
|
90
|
-
}) as APIPromise<CompletionResponse> | APIPromise<Stream<CompletionResponse>>;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* Generate embeddings for content pieces using the specified model.
|
|
95
|
-
*
|
|
96
|
-
* @deprecated /v1/inference/embeddings is deprecated. Please use /v1/openai/v1/embeddings.
|
|
97
|
-
*/
|
|
98
|
-
embeddings(
|
|
99
|
-
body: InferenceEmbeddingsParams,
|
|
100
|
-
options?: Core.RequestOptions,
|
|
101
|
-
): Core.APIPromise<EmbeddingsResponse> {
|
|
102
|
-
return this._client.post('/v1/inference/embeddings', { body, ...options });
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Rerank a list of documents based on their relevance to a query.
|
|
107
|
-
*/
|
|
108
|
-
rerank(
|
|
109
|
-
body: InferenceRerankParams,
|
|
110
|
-
options?: Core.RequestOptions,
|
|
111
|
-
): Core.APIPromise<InferenceRerankResponse> {
|
|
112
|
-
return (
|
|
113
|
-
this._client.post('/v1/inference/rerank', { body, ...options }) as Core.APIPromise<{
|
|
114
|
-
data: InferenceRerankResponse;
|
|
115
|
-
}>
|
|
116
|
-
)._thenUnwrap((obj) => obj.data);
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* A chunk of a streamed chat completion response.
|
|
122
|
-
*/
|
|
123
|
-
export interface ChatCompletionResponseStreamChunk {
|
|
124
|
-
/**
|
|
125
|
-
* The event containing the new content
|
|
126
|
-
*/
|
|
127
|
-
event: ChatCompletionResponseStreamChunk.Event;
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* (Optional) List of metrics associated with the API response
|
|
131
|
-
*/
|
|
132
|
-
metrics?: Array<Shared.Metric>;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
export namespace ChatCompletionResponseStreamChunk {
|
|
136
|
-
/**
|
|
137
|
-
* The event containing the new content
|
|
138
|
-
*/
|
|
139
|
-
export interface Event {
|
|
140
|
-
/**
|
|
141
|
-
* Content generated since last event. This can be one or more tokens, or a tool
|
|
142
|
-
* call.
|
|
143
|
-
*/
|
|
144
|
-
delta: Shared.ContentDelta;
|
|
145
|
-
|
|
146
|
-
/**
|
|
147
|
-
* Type of the event
|
|
148
|
-
*/
|
|
149
|
-
event_type: 'start' | 'complete' | 'progress';
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* Optional log probabilities for generated tokens
|
|
153
|
-
*/
|
|
154
|
-
logprobs?: Array<InferenceAPI.TokenLogProbs>;
|
|
155
|
-
|
|
156
|
-
/**
|
|
157
|
-
* Optional reason why generation stopped, if complete
|
|
158
|
-
*/
|
|
159
|
-
stop_reason?: 'end_of_turn' | 'end_of_message' | 'out_of_tokens';
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
/**
|
|
164
|
-
* Response from a completion request.
|
|
165
|
-
*/
|
|
166
|
-
export interface CompletionResponse {
|
|
167
|
-
/**
|
|
168
|
-
* The generated completion text
|
|
169
|
-
*/
|
|
170
|
-
content: string;
|
|
171
|
-
|
|
172
|
-
/**
|
|
173
|
-
* Reason why generation stopped
|
|
174
|
-
*/
|
|
175
|
-
stop_reason: 'end_of_turn' | 'end_of_message' | 'out_of_tokens';
|
|
176
|
-
|
|
177
|
-
/**
|
|
178
|
-
* Optional log probabilities for generated tokens
|
|
179
|
-
*/
|
|
180
|
-
logprobs?: Array<TokenLogProbs>;
|
|
181
|
-
|
|
182
|
-
/**
|
|
183
|
-
* (Optional) List of metrics associated with the API response
|
|
184
|
-
*/
|
|
185
|
-
metrics?: Array<Shared.Metric>;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
/**
|
|
189
|
-
* Response containing generated embeddings.
|
|
190
|
-
*/
|
|
191
|
-
export interface EmbeddingsResponse {
|
|
192
|
-
/**
|
|
193
|
-
* List of embedding vectors, one per input content. Each embedding is a list of
|
|
194
|
-
* floats. The dimensionality of the embedding is model-specific; you can check
|
|
195
|
-
* model metadata using /models/{model_id}
|
|
196
|
-
*/
|
|
197
|
-
embeddings: Array<Array<number>>;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
/**
|
|
201
|
-
* Log probabilities for generated tokens.
|
|
202
|
-
*/
|
|
203
|
-
export interface TokenLogProbs {
|
|
204
|
-
/**
|
|
205
|
-
* Dictionary mapping tokens to their log probabilities
|
|
206
|
-
*/
|
|
207
|
-
logprobs_by_token: { [key: string]: number };
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
/**
|
|
211
|
-
* Response from a batch chat completion request.
|
|
212
|
-
*/
|
|
213
|
-
export interface InferenceBatchChatCompletionResponse {
|
|
214
|
-
/**
|
|
215
|
-
* List of chat completion responses, one for each conversation in the batch
|
|
216
|
-
*/
|
|
217
|
-
batch: Array<Shared.ChatCompletionResponse>;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
/**
|
|
221
|
-
* List of rerank result objects, sorted by relevance score (descending)
|
|
222
|
-
*/
|
|
223
|
-
export type InferenceRerankResponse = Array<InferenceRerankResponse.InferenceRerankResponseItem>;
|
|
224
|
-
|
|
225
|
-
export namespace InferenceRerankResponse {
|
|
226
|
-
/**
|
|
227
|
-
* A single rerank result from a reranking response.
|
|
228
|
-
*/
|
|
229
|
-
export interface InferenceRerankResponseItem {
|
|
230
|
-
/**
|
|
231
|
-
* The original index of the document in the input list
|
|
232
|
-
*/
|
|
233
|
-
index: number;
|
|
234
|
-
|
|
235
|
-
/**
|
|
236
|
-
* The relevance score from the model output. Values are inverted when applicable
|
|
237
|
-
* so that higher scores indicate greater relevance.
|
|
238
|
-
*/
|
|
239
|
-
relevance_score: number;
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
export interface InferenceBatchChatCompletionParams {
|
|
244
|
-
/**
|
|
245
|
-
* The messages to generate completions for.
|
|
246
|
-
*/
|
|
247
|
-
messages_batch: Array<Array<Shared.Message>>;
|
|
248
|
-
|
|
249
|
-
/**
|
|
250
|
-
* The identifier of the model to use. The model must be registered with Llama
|
|
251
|
-
* Stack and available via the /models endpoint.
|
|
252
|
-
*/
|
|
253
|
-
model_id: string;
|
|
254
|
-
|
|
255
|
-
/**
|
|
256
|
-
* (Optional) If specified, log probabilities for each token position will be
|
|
257
|
-
* returned.
|
|
258
|
-
*/
|
|
259
|
-
logprobs?: InferenceBatchChatCompletionParams.Logprobs;
|
|
260
|
-
|
|
261
|
-
/**
|
|
262
|
-
* (Optional) Grammar specification for guided (structured) decoding.
|
|
263
|
-
*/
|
|
264
|
-
response_format?: Shared.ResponseFormat;
|
|
265
|
-
|
|
266
|
-
/**
|
|
267
|
-
* (Optional) Parameters to control the sampling strategy.
|
|
268
|
-
*/
|
|
269
|
-
sampling_params?: Shared.SamplingParams;
|
|
270
|
-
|
|
271
|
-
/**
|
|
272
|
-
* (Optional) Configuration for tool use.
|
|
273
|
-
*/
|
|
274
|
-
tool_config?: InferenceBatchChatCompletionParams.ToolConfig;
|
|
275
|
-
|
|
276
|
-
/**
|
|
277
|
-
* (Optional) List of tool definitions available to the model.
|
|
278
|
-
*/
|
|
279
|
-
tools?: Array<InferenceBatchChatCompletionParams.Tool>;
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
export namespace InferenceBatchChatCompletionParams {
|
|
283
|
-
/**
|
|
284
|
-
* (Optional) If specified, log probabilities for each token position will be
|
|
285
|
-
* returned.
|
|
286
|
-
*/
|
|
287
|
-
export interface Logprobs {
|
|
288
|
-
/**
|
|
289
|
-
* How many tokens (for each position) to return log probabilities for.
|
|
290
|
-
*/
|
|
291
|
-
top_k?: number;
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
/**
|
|
295
|
-
* (Optional) Configuration for tool use.
|
|
296
|
-
*/
|
|
297
|
-
export interface ToolConfig {
|
|
298
|
-
/**
|
|
299
|
-
* (Optional) Config for how to override the default system prompt. -
|
|
300
|
-
* `SystemMessageBehavior.append`: Appends the provided system message to the
|
|
301
|
-
* default system prompt. - `SystemMessageBehavior.replace`: Replaces the default
|
|
302
|
-
* system prompt with the provided system message. The system message can include
|
|
303
|
-
* the string '{{function_definitions}}' to indicate where the function definitions
|
|
304
|
-
* should be inserted.
|
|
305
|
-
*/
|
|
306
|
-
system_message_behavior?: 'append' | 'replace';
|
|
307
|
-
|
|
308
|
-
/**
|
|
309
|
-
* (Optional) Whether tool use is automatic, required, or none. Can also specify a
|
|
310
|
-
* tool name to use a specific tool. Defaults to ToolChoice.auto.
|
|
311
|
-
*/
|
|
312
|
-
tool_choice?: 'auto' | 'required' | 'none' | (string & {});
|
|
313
|
-
|
|
314
|
-
/**
|
|
315
|
-
* (Optional) Instructs the model how to format tool calls. By default, Llama Stack
|
|
316
|
-
* will attempt to use a format that is best adapted to the model. -
|
|
317
|
-
* `ToolPromptFormat.json`: The tool calls are formatted as a JSON object. -
|
|
318
|
-
* `ToolPromptFormat.function_tag`: The tool calls are enclosed in a
|
|
319
|
-
* <function=function_name> tag. - `ToolPromptFormat.python_list`: The tool calls
|
|
320
|
-
* are output as Python syntax -- a list of function calls.
|
|
321
|
-
*/
|
|
322
|
-
tool_prompt_format?: 'json' | 'function_tag' | 'python_list';
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
export interface Tool {
|
|
326
|
-
tool_name: 'brave_search' | 'wolfram_alpha' | 'photogen' | 'code_interpreter' | (string & {});
|
|
327
|
-
|
|
328
|
-
description?: string;
|
|
329
|
-
|
|
330
|
-
parameters?: { [key: string]: Shared.ToolParamDefinition };
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
export interface InferenceBatchCompletionParams {
|
|
335
|
-
/**
|
|
336
|
-
* The content to generate completions for.
|
|
337
|
-
*/
|
|
338
|
-
content_batch: Array<Shared.InterleavedContent>;
|
|
339
|
-
|
|
340
|
-
/**
|
|
341
|
-
* The identifier of the model to use. The model must be registered with Llama
|
|
342
|
-
* Stack and available via the /models endpoint.
|
|
343
|
-
*/
|
|
344
|
-
model_id: string;
|
|
345
|
-
|
|
346
|
-
/**
|
|
347
|
-
* (Optional) If specified, log probabilities for each token position will be
|
|
348
|
-
* returned.
|
|
349
|
-
*/
|
|
350
|
-
logprobs?: InferenceBatchCompletionParams.Logprobs;
|
|
351
|
-
|
|
352
|
-
/**
|
|
353
|
-
* (Optional) Grammar specification for guided (structured) decoding.
|
|
354
|
-
*/
|
|
355
|
-
response_format?: Shared.ResponseFormat;
|
|
356
|
-
|
|
357
|
-
/**
|
|
358
|
-
* (Optional) Parameters to control the sampling strategy.
|
|
359
|
-
*/
|
|
360
|
-
sampling_params?: Shared.SamplingParams;
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
export namespace InferenceBatchCompletionParams {
|
|
364
|
-
/**
|
|
365
|
-
* (Optional) If specified, log probabilities for each token position will be
|
|
366
|
-
* returned.
|
|
367
|
-
*/
|
|
368
|
-
export interface Logprobs {
|
|
369
|
-
/**
|
|
370
|
-
* How many tokens (for each position) to return log probabilities for.
|
|
371
|
-
*/
|
|
372
|
-
top_k?: number;
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
export type InferenceChatCompletionParams =
|
|
377
|
-
| InferenceChatCompletionParamsNonStreaming
|
|
378
|
-
| InferenceChatCompletionParamsStreaming;
|
|
379
|
-
|
|
380
|
-
export interface InferenceChatCompletionParamsBase {
|
|
381
|
-
/**
|
|
382
|
-
* List of messages in the conversation.
|
|
383
|
-
*/
|
|
384
|
-
messages: Array<Shared.Message>;
|
|
385
|
-
|
|
386
|
-
/**
|
|
387
|
-
* The identifier of the model to use. The model must be registered with Llama
|
|
388
|
-
* Stack and available via the /models endpoint.
|
|
389
|
-
*/
|
|
390
|
-
model_id: string;
|
|
391
|
-
|
|
392
|
-
/**
|
|
393
|
-
* (Optional) If specified, log probabilities for each token position will be
|
|
394
|
-
* returned.
|
|
395
|
-
*/
|
|
396
|
-
logprobs?: InferenceChatCompletionParams.Logprobs;
|
|
397
|
-
|
|
398
|
-
/**
|
|
399
|
-
* (Optional) Grammar specification for guided (structured) decoding. There are two
|
|
400
|
-
* options: - `ResponseFormat.json_schema`: The grammar is a JSON schema. Most
|
|
401
|
-
* providers support this format. - `ResponseFormat.grammar`: The grammar is a BNF
|
|
402
|
-
* grammar. This format is more flexible, but not all providers support it.
|
|
403
|
-
*/
|
|
404
|
-
response_format?: Shared.ResponseFormat;
|
|
405
|
-
|
|
406
|
-
/**
|
|
407
|
-
* Parameters to control the sampling strategy.
|
|
408
|
-
*/
|
|
409
|
-
sampling_params?: Shared.SamplingParams;
|
|
410
|
-
|
|
411
|
-
/**
|
|
412
|
-
* (Optional) If True, generate an SSE event stream of the response. Defaults to
|
|
413
|
-
* False.
|
|
414
|
-
*/
|
|
415
|
-
stream?: boolean;
|
|
416
|
-
|
|
417
|
-
/**
|
|
418
|
-
* (Optional) Whether tool use is required or automatic. Defaults to
|
|
419
|
-
* ToolChoice.auto. .. deprecated:: Use tool_config instead.
|
|
420
|
-
*/
|
|
421
|
-
tool_choice?: 'auto' | 'required' | 'none';
|
|
422
|
-
|
|
423
|
-
/**
|
|
424
|
-
* (Optional) Configuration for tool use.
|
|
425
|
-
*/
|
|
426
|
-
tool_config?: InferenceChatCompletionParams.ToolConfig;
|
|
427
|
-
|
|
428
|
-
/**
|
|
429
|
-
* (Optional) Instructs the model how to format tool calls. By default, Llama Stack
|
|
430
|
-
* will attempt to use a format that is best adapted to the model. -
|
|
431
|
-
* `ToolPromptFormat.json`: The tool calls are formatted as a JSON object. -
|
|
432
|
-
* `ToolPromptFormat.function_tag`: The tool calls are enclosed in a
|
|
433
|
-
* <function=function_name> tag. - `ToolPromptFormat.python_list`: The tool calls
|
|
434
|
-
* are output as Python syntax -- a list of function calls. .. deprecated:: Use
|
|
435
|
-
* tool_config instead.
|
|
436
|
-
*/
|
|
437
|
-
tool_prompt_format?: 'json' | 'function_tag' | 'python_list';
|
|
438
|
-
|
|
439
|
-
/**
|
|
440
|
-
* (Optional) List of tool definitions available to the model.
|
|
441
|
-
*/
|
|
442
|
-
tools?: Array<InferenceChatCompletionParams.Tool>;
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
export namespace InferenceChatCompletionParams {
|
|
446
|
-
/**
|
|
447
|
-
* (Optional) If specified, log probabilities for each token position will be
|
|
448
|
-
* returned.
|
|
449
|
-
*/
|
|
450
|
-
export interface Logprobs {
|
|
451
|
-
/**
|
|
452
|
-
* How many tokens (for each position) to return log probabilities for.
|
|
453
|
-
*/
|
|
454
|
-
top_k?: number;
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
/**
|
|
458
|
-
* (Optional) Configuration for tool use.
|
|
459
|
-
*/
|
|
460
|
-
export interface ToolConfig {
|
|
461
|
-
/**
|
|
462
|
-
* (Optional) Config for how to override the default system prompt. -
|
|
463
|
-
* `SystemMessageBehavior.append`: Appends the provided system message to the
|
|
464
|
-
* default system prompt. - `SystemMessageBehavior.replace`: Replaces the default
|
|
465
|
-
* system prompt with the provided system message. The system message can include
|
|
466
|
-
* the string '{{function_definitions}}' to indicate where the function definitions
|
|
467
|
-
* should be inserted.
|
|
468
|
-
*/
|
|
469
|
-
system_message_behavior?: 'append' | 'replace';
|
|
470
|
-
|
|
471
|
-
/**
|
|
472
|
-
* (Optional) Whether tool use is automatic, required, or none. Can also specify a
|
|
473
|
-
* tool name to use a specific tool. Defaults to ToolChoice.auto.
|
|
474
|
-
*/
|
|
475
|
-
tool_choice?: 'auto' | 'required' | 'none' | (string & {});
|
|
476
|
-
|
|
477
|
-
/**
|
|
478
|
-
* (Optional) Instructs the model how to format tool calls. By default, Llama Stack
|
|
479
|
-
* will attempt to use a format that is best adapted to the model. -
|
|
480
|
-
* `ToolPromptFormat.json`: The tool calls are formatted as a JSON object. -
|
|
481
|
-
* `ToolPromptFormat.function_tag`: The tool calls are enclosed in a
|
|
482
|
-
* <function=function_name> tag. - `ToolPromptFormat.python_list`: The tool calls
|
|
483
|
-
* are output as Python syntax -- a list of function calls.
|
|
484
|
-
*/
|
|
485
|
-
tool_prompt_format?: 'json' | 'function_tag' | 'python_list';
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
export interface Tool {
|
|
489
|
-
tool_name: 'brave_search' | 'wolfram_alpha' | 'photogen' | 'code_interpreter' | (string & {});
|
|
490
|
-
|
|
491
|
-
description?: string;
|
|
492
|
-
|
|
493
|
-
parameters?: { [key: string]: Shared.ToolParamDefinition };
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
-
export type InferenceChatCompletionParamsNonStreaming =
|
|
497
|
-
InferenceAPI.InferenceChatCompletionParamsNonStreaming;
|
|
498
|
-
export type InferenceChatCompletionParamsStreaming = InferenceAPI.InferenceChatCompletionParamsStreaming;
|
|
499
|
-
}
|
|
500
|
-
|
|
501
|
-
export interface InferenceChatCompletionParamsNonStreaming extends InferenceChatCompletionParamsBase {
|
|
502
|
-
/**
|
|
503
|
-
* (Optional) If True, generate an SSE event stream of the response. Defaults to
|
|
504
|
-
* False.
|
|
505
|
-
*/
|
|
506
|
-
stream?: false;
|
|
507
|
-
}
|
|
508
|
-
|
|
509
|
-
export interface InferenceChatCompletionParamsStreaming extends InferenceChatCompletionParamsBase {
|
|
510
|
-
/**
|
|
511
|
-
* (Optional) If True, generate an SSE event stream of the response. Defaults to
|
|
512
|
-
* False.
|
|
513
|
-
*/
|
|
514
|
-
stream: true;
|
|
515
|
-
}
|
|
516
|
-
|
|
517
|
-
export type InferenceCompletionParams =
|
|
518
|
-
| InferenceCompletionParamsNonStreaming
|
|
519
|
-
| InferenceCompletionParamsStreaming;
|
|
520
|
-
|
|
521
|
-
export interface InferenceCompletionParamsBase {
|
|
522
|
-
/**
|
|
523
|
-
* The content to generate a completion for.
|
|
524
|
-
*/
|
|
525
|
-
content: Shared.InterleavedContent;
|
|
526
|
-
|
|
527
|
-
/**
|
|
528
|
-
* The identifier of the model to use. The model must be registered with Llama
|
|
529
|
-
* Stack and available via the /models endpoint.
|
|
530
|
-
*/
|
|
531
|
-
model_id: string;
|
|
532
|
-
|
|
533
|
-
/**
|
|
534
|
-
* (Optional) If specified, log probabilities for each token position will be
|
|
535
|
-
* returned.
|
|
536
|
-
*/
|
|
537
|
-
logprobs?: InferenceCompletionParams.Logprobs;
|
|
538
|
-
|
|
539
|
-
/**
|
|
540
|
-
* (Optional) Grammar specification for guided (structured) decoding.
|
|
541
|
-
*/
|
|
542
|
-
response_format?: Shared.ResponseFormat;
|
|
543
|
-
|
|
544
|
-
/**
|
|
545
|
-
* (Optional) Parameters to control the sampling strategy.
|
|
546
|
-
*/
|
|
547
|
-
sampling_params?: Shared.SamplingParams;
|
|
548
|
-
|
|
549
|
-
/**
|
|
550
|
-
* (Optional) If True, generate an SSE event stream of the response. Defaults to
|
|
551
|
-
* False.
|
|
552
|
-
*/
|
|
553
|
-
stream?: boolean;
|
|
554
|
-
}
|
|
555
|
-
|
|
556
|
-
export namespace InferenceCompletionParams {
|
|
557
|
-
/**
|
|
558
|
-
* (Optional) If specified, log probabilities for each token position will be
|
|
559
|
-
* returned.
|
|
560
|
-
*/
|
|
561
|
-
export interface Logprobs {
|
|
562
|
-
/**
|
|
563
|
-
* How many tokens (for each position) to return log probabilities for.
|
|
564
|
-
*/
|
|
565
|
-
top_k?: number;
|
|
566
|
-
}
|
|
567
|
-
|
|
568
|
-
export type InferenceCompletionParamsNonStreaming = InferenceAPI.InferenceCompletionParamsNonStreaming;
|
|
569
|
-
export type InferenceCompletionParamsStreaming = InferenceAPI.InferenceCompletionParamsStreaming;
|
|
570
|
-
}
|
|
571
|
-
|
|
572
|
-
export interface InferenceCompletionParamsNonStreaming extends InferenceCompletionParamsBase {
|
|
573
|
-
/**
|
|
574
|
-
* (Optional) If True, generate an SSE event stream of the response. Defaults to
|
|
575
|
-
* False.
|
|
576
|
-
*/
|
|
577
|
-
stream?: false;
|
|
578
|
-
}
|
|
579
|
-
|
|
580
|
-
export interface InferenceCompletionParamsStreaming extends InferenceCompletionParamsBase {
|
|
581
|
-
/**
|
|
582
|
-
* (Optional) If True, generate an SSE event stream of the response. Defaults to
|
|
583
|
-
* False.
|
|
584
|
-
*/
|
|
585
|
-
stream: true;
|
|
586
|
-
}
|
|
587
|
-
|
|
588
|
-
export interface InferenceEmbeddingsParams {
|
|
589
|
-
/**
|
|
590
|
-
* List of contents to generate embeddings for. Each content can be a string or an
|
|
591
|
-
* InterleavedContentItem (and hence can be multimodal). The behavior depends on
|
|
592
|
-
* the model and provider. Some models may only support text.
|
|
593
|
-
*/
|
|
594
|
-
contents: Array<string> | Array<Shared.InterleavedContentItem>;
|
|
595
|
-
|
|
596
|
-
/**
|
|
597
|
-
* The identifier of the model to use. The model must be an embedding model
|
|
598
|
-
* registered with Llama Stack and available via the /models endpoint.
|
|
599
|
-
*/
|
|
600
|
-
model_id: string;
|
|
601
|
-
|
|
602
|
-
/**
|
|
603
|
-
* (Optional) Output dimensionality for the embeddings. Only supported by
|
|
604
|
-
* Matryoshka models.
|
|
605
|
-
*/
|
|
606
|
-
output_dimension?: number;
|
|
607
|
-
|
|
608
|
-
/**
|
|
609
|
-
* (Optional) How is the embedding being used? This is only supported by asymmetric
|
|
610
|
-
* embedding models.
|
|
611
|
-
*/
|
|
612
|
-
task_type?: 'query' | 'document';
|
|
613
|
-
|
|
614
|
-
/**
|
|
615
|
-
* (Optional) Config for how to truncate text for embedding when text is longer
|
|
616
|
-
* than the model's max sequence length.
|
|
617
|
-
*/
|
|
618
|
-
text_truncation?: 'none' | 'start' | 'end';
|
|
619
|
-
}
|
|
620
|
-
|
|
621
|
-
export interface InferenceRerankParams {
|
|
622
|
-
/**
|
|
623
|
-
* List of items to rerank. Each item can be a string, text content part, or image
|
|
624
|
-
* content part. Each input must not exceed the model's max input token length.
|
|
625
|
-
*/
|
|
626
|
-
items: Array<
|
|
627
|
-
| string
|
|
628
|
-
| InferenceRerankParams.OpenAIChatCompletionContentPartTextParam
|
|
629
|
-
| InferenceRerankParams.OpenAIChatCompletionContentPartImageParam
|
|
630
|
-
>;
|
|
631
|
-
|
|
632
|
-
/**
|
|
633
|
-
* The identifier of the reranking model to use.
|
|
634
|
-
*/
|
|
635
|
-
model: string;
|
|
636
|
-
|
|
637
|
-
/**
|
|
638
|
-
* The search query to rank items against. Can be a string, text content part, or
|
|
639
|
-
* image content part. The input must not exceed the model's max input token
|
|
640
|
-
* length.
|
|
641
|
-
*/
|
|
642
|
-
query:
|
|
643
|
-
| string
|
|
644
|
-
| InferenceRerankParams.OpenAIChatCompletionContentPartTextParam
|
|
645
|
-
| InferenceRerankParams.OpenAIChatCompletionContentPartImageParam;
|
|
646
|
-
|
|
647
|
-
/**
|
|
648
|
-
* (Optional) Maximum number of results to return. Default: returns all.
|
|
649
|
-
*/
|
|
650
|
-
max_num_results?: number;
|
|
651
|
-
}
|
|
652
|
-
|
|
653
|
-
export namespace InferenceRerankParams {
|
|
654
|
-
/**
|
|
655
|
-
* Text content part for OpenAI-compatible chat completion messages.
|
|
656
|
-
*/
|
|
657
|
-
export interface OpenAIChatCompletionContentPartTextParam {
|
|
658
|
-
/**
|
|
659
|
-
* The text content of the message
|
|
660
|
-
*/
|
|
661
|
-
text: string;
|
|
662
|
-
|
|
663
|
-
/**
|
|
664
|
-
* Must be "text" to identify this as text content
|
|
665
|
-
*/
|
|
666
|
-
type: 'text';
|
|
667
|
-
}
|
|
668
|
-
|
|
669
|
-
/**
|
|
670
|
-
* Image content part for OpenAI-compatible chat completion messages.
|
|
671
|
-
*/
|
|
672
|
-
export interface OpenAIChatCompletionContentPartImageParam {
|
|
673
|
-
/**
|
|
674
|
-
* Image URL specification and processing details
|
|
675
|
-
*/
|
|
676
|
-
image_url: OpenAIChatCompletionContentPartImageParam.ImageURL;
|
|
677
|
-
|
|
678
|
-
/**
|
|
679
|
-
* Must be "image_url" to identify this as image content
|
|
680
|
-
*/
|
|
681
|
-
type: 'image_url';
|
|
682
|
-
}
|
|
683
|
-
|
|
684
|
-
export namespace OpenAIChatCompletionContentPartImageParam {
|
|
685
|
-
/**
|
|
686
|
-
* Image URL specification and processing details
|
|
687
|
-
*/
|
|
688
|
-
export interface ImageURL {
|
|
689
|
-
/**
|
|
690
|
-
* URL of the image to include in the message
|
|
691
|
-
*/
|
|
692
|
-
url: string;
|
|
693
|
-
|
|
694
|
-
/**
|
|
695
|
-
* (Optional) Level of detail for image processing. Can be "low", "high", or "auto"
|
|
696
|
-
*/
|
|
697
|
-
detail?: string;
|
|
698
|
-
}
|
|
699
|
-
}
|
|
700
|
-
|
|
701
|
-
/**
|
|
702
|
-
* Text content part for OpenAI-compatible chat completion messages.
|
|
703
|
-
*/
|
|
704
|
-
export interface OpenAIChatCompletionContentPartTextParam {
|
|
705
|
-
/**
|
|
706
|
-
* The text content of the message
|
|
707
|
-
*/
|
|
708
|
-
text: string;
|
|
709
|
-
|
|
710
|
-
/**
|
|
711
|
-
* Must be "text" to identify this as text content
|
|
712
|
-
*/
|
|
713
|
-
type: 'text';
|
|
714
|
-
}
|
|
715
|
-
|
|
716
|
-
/**
|
|
717
|
-
* Image content part for OpenAI-compatible chat completion messages.
|
|
718
|
-
*/
|
|
719
|
-
export interface OpenAIChatCompletionContentPartImageParam {
|
|
720
|
-
/**
|
|
721
|
-
* Image URL specification and processing details
|
|
722
|
-
*/
|
|
723
|
-
image_url: OpenAIChatCompletionContentPartImageParam.ImageURL;
|
|
724
|
-
|
|
725
|
-
/**
|
|
726
|
-
* Must be "image_url" to identify this as image content
|
|
727
|
-
*/
|
|
728
|
-
type: 'image_url';
|
|
729
|
-
}
|
|
730
|
-
|
|
731
|
-
export namespace OpenAIChatCompletionContentPartImageParam {
|
|
732
|
-
/**
|
|
733
|
-
* Image URL specification and processing details
|
|
734
|
-
*/
|
|
735
|
-
export interface ImageURL {
|
|
736
|
-
/**
|
|
737
|
-
* URL of the image to include in the message
|
|
738
|
-
*/
|
|
739
|
-
url: string;
|
|
740
|
-
|
|
741
|
-
/**
|
|
742
|
-
* (Optional) Level of detail for image processing. Can be "low", "high", or "auto"
|
|
743
|
-
*/
|
|
744
|
-
detail?: string;
|
|
745
|
-
}
|
|
746
|
-
}
|
|
747
|
-
}
|
|
748
|
-
|
|
749
|
-
export declare namespace Inference {
|
|
750
|
-
export {
|
|
751
|
-
type ChatCompletionResponseStreamChunk as ChatCompletionResponseStreamChunk,
|
|
752
|
-
type CompletionResponse as CompletionResponse,
|
|
753
|
-
type EmbeddingsResponse as EmbeddingsResponse,
|
|
754
|
-
type TokenLogProbs as TokenLogProbs,
|
|
755
|
-
type InferenceBatchChatCompletionResponse as InferenceBatchChatCompletionResponse,
|
|
756
|
-
type InferenceRerankResponse as InferenceRerankResponse,
|
|
757
|
-
type InferenceBatchChatCompletionParams as InferenceBatchChatCompletionParams,
|
|
758
|
-
type InferenceBatchCompletionParams as InferenceBatchCompletionParams,
|
|
759
|
-
type InferenceChatCompletionParams as InferenceChatCompletionParams,
|
|
760
|
-
type InferenceChatCompletionParamsNonStreaming as InferenceChatCompletionParamsNonStreaming,
|
|
761
|
-
type InferenceChatCompletionParamsStreaming as InferenceChatCompletionParamsStreaming,
|
|
762
|
-
type InferenceCompletionParams as InferenceCompletionParams,
|
|
763
|
-
type InferenceCompletionParamsNonStreaming as InferenceCompletionParamsNonStreaming,
|
|
764
|
-
type InferenceCompletionParamsStreaming as InferenceCompletionParamsStreaming,
|
|
765
|
-
type InferenceEmbeddingsParams as InferenceEmbeddingsParams,
|
|
766
|
-
type InferenceRerankParams as InferenceRerankParams,
|
|
767
|
-
};
|
|
768
|
-
}
|