llama-stack-client 0.3.4 → 0.4.0-rc1
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 +19 -21
- 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 +23 -50
- package/index.d.ts +23 -50
- 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 +1 -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/alpha.d.ts +22 -0
- package/resources/alpha/alpha.d.ts.map +1 -0
- package/resources/alpha/alpha.js +57 -0
- package/resources/alpha/alpha.js.map +1 -0
- package/resources/alpha/alpha.mjs +30 -0
- package/resources/alpha/alpha.mjs.map +1 -0
- package/resources/{benchmarks.d.ts → alpha/benchmarks.d.ts} +25 -35
- 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 +6 -0
- package/resources/alpha/index.d.ts.map +1 -0
- package/resources/alpha/index.js +21 -0
- package/resources/alpha/index.js.map +1 -0
- package/resources/alpha/index.mjs +13 -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 +3 -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 +116 -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 +242 -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/beta/datasets.d.ts +257 -0
- 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 +73 -78
- 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 +756 -1402
- 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 +52 -95
- 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 +292 -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 +762 -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 +9 -13
- 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 +6 -32
- package/resources/inspect.d.ts.map +1 -1
- package/resources/inspect.js +6 -1
- package/resources/inspect.js.map +1 -1
- package/resources/inspect.mjs +6 -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 -6
- package/resources/providers.d.ts.map +1 -1
- package/resources/providers.js +6 -1
- package/resources/providers.js.map +1 -1
- package/resources/providers.mjs +6 -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 +190 -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 +1387 -1449
- 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 +7 -7
- 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 +125 -629
- 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 +82 -252
- package/src/lib/response-helpers.ts +60 -0
- package/src/pagination.ts +2 -5
- package/src/resource.ts +1 -0
- package/src/resources/alpha/alpha.ts +85 -0
- package/src/resources/{benchmarks.ts → alpha/benchmarks.ts} +36 -37
- 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 +34 -0
- package/src/resources/alpha/inference.ts +132 -0
- package/src/resources/{post-training → alpha/post-training}/index.ts +2 -2
- package/src/resources/alpha/post-training/job.ts +182 -0
- package/src/resources/alpha/post-training/post-training.ts +369 -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/beta/datasets.ts +350 -0
- package/src/resources/beta/index.ts +20 -0
- package/src/resources/{agents.ts → beta.ts} +2 -2
- package/src/resources/chat/chat.ts +82 -81
- package/src/resources/chat/completions.ts +874 -1484
- package/src/resources/chat/index.ts +1 -2
- package/src/resources/chat.ts +1 -1
- package/src/resources/completions.ts +57 -101
- package/src/resources/conversations/conversations.ts +455 -0
- package/src/resources/conversations/index.ts +25 -0
- package/src/resources/conversations/items.ts +1221 -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 +33 -109
- package/src/resources/inspect.ts +7 -33
- 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 -7
- package/src/resources/responses/index.ts +1 -1
- package/src/resources/responses/input-items.ts +293 -161
- package/src/resources/responses/responses.ts +2112 -1632
- package/src/resources/responses.ts +1 -1
- package/src/resources/routes.ts +25 -10
- 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 +141 -714
- 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 +0 -320
- 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 +0 -3
- 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/datasets.ts +0 -413
- 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.d.ts → alpha/post-training.d.ts} +0 -0
|
@@ -3,7 +3,7 @@
|
|
|
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
9
|
import { APIResource } from '../../resource';
|
|
@@ -12,11 +12,12 @@ import { APIPromise } from '../../core';
|
|
|
12
12
|
import * as Core from '../../core';
|
|
13
13
|
import * as CompletionsAPI from './completions';
|
|
14
14
|
import * as ChatAPI from './chat';
|
|
15
|
-
import { OpenAICursorPage, type OpenAICursorPageParams } from '../../pagination';
|
|
16
15
|
import { Stream } from '../../streaming';
|
|
17
16
|
|
|
18
17
|
export class Completions extends APIResource {
|
|
19
18
|
/**
|
|
19
|
+
* Create chat completions.
|
|
20
|
+
*
|
|
20
21
|
* Generate an OpenAI-compatible chat completion for the given messages using the
|
|
21
22
|
* specified model.
|
|
22
23
|
*/
|
|
@@ -36,516 +37,414 @@ export class Completions extends APIResource {
|
|
|
36
37
|
body: CompletionCreateParams,
|
|
37
38
|
options?: Core.RequestOptions,
|
|
38
39
|
): APIPromise<CompletionCreateResponse> | APIPromise<Stream<ChatAPI.ChatCompletionChunk>> {
|
|
39
|
-
return this._client.post('/v1/
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
stream: body.stream ?? false,
|
|
43
|
-
}) as APIPromise<CompletionCreateResponse> | APIPromise<Stream<ChatAPI.ChatCompletionChunk>>;
|
|
40
|
+
return this._client.post('/v1/chat/completions', { body, ...options, stream: body.stream ?? false }) as
|
|
41
|
+
| APIPromise<CompletionCreateResponse>
|
|
42
|
+
| APIPromise<Stream<ChatAPI.ChatCompletionChunk>>;
|
|
44
43
|
}
|
|
45
44
|
|
|
46
45
|
/**
|
|
46
|
+
* Get chat completion.
|
|
47
|
+
*
|
|
47
48
|
* Describe a chat completion by its ID.
|
|
48
49
|
*/
|
|
49
50
|
retrieve(completionId: string, options?: Core.RequestOptions): Core.APIPromise<CompletionRetrieveResponse> {
|
|
50
|
-
return this._client.get(`/v1/
|
|
51
|
+
return this._client.get(`/v1/chat/completions/${completionId}`, options);
|
|
51
52
|
}
|
|
52
53
|
|
|
53
54
|
/**
|
|
54
|
-
* List
|
|
55
|
+
* List chat completions.
|
|
55
56
|
*/
|
|
56
|
-
list(
|
|
57
|
-
|
|
58
|
-
options?: Core.RequestOptions,
|
|
59
|
-
): Core.PagePromise<CompletionListResponsesOpenAICursorPage, CompletionListResponse>;
|
|
60
|
-
list(
|
|
61
|
-
options?: Core.RequestOptions,
|
|
62
|
-
): Core.PagePromise<CompletionListResponsesOpenAICursorPage, CompletionListResponse>;
|
|
57
|
+
list(query?: CompletionListParams, options?: Core.RequestOptions): Core.APIPromise<CompletionListResponse>;
|
|
58
|
+
list(options?: Core.RequestOptions): Core.APIPromise<CompletionListResponse>;
|
|
63
59
|
list(
|
|
64
60
|
query: CompletionListParams | Core.RequestOptions = {},
|
|
65
61
|
options?: Core.RequestOptions,
|
|
66
|
-
): Core.
|
|
62
|
+
): Core.APIPromise<CompletionListResponse> {
|
|
67
63
|
if (isRequestOptions(query)) {
|
|
68
64
|
return this.list({}, query);
|
|
69
65
|
}
|
|
70
|
-
return this._client.
|
|
71
|
-
'/v1/openai/v1/chat/completions',
|
|
72
|
-
CompletionListResponsesOpenAICursorPage,
|
|
73
|
-
{ query, ...options },
|
|
74
|
-
);
|
|
66
|
+
return this._client.get('/v1/chat/completions', { query, ...options });
|
|
75
67
|
}
|
|
76
68
|
}
|
|
77
69
|
|
|
78
|
-
export class CompletionListResponsesOpenAICursorPage extends OpenAICursorPage<CompletionListResponse> {}
|
|
79
|
-
|
|
80
70
|
/**
|
|
81
71
|
* Response from an OpenAI-compatible chat completion request.
|
|
82
72
|
*/
|
|
83
|
-
export
|
|
84
|
-
|
|
85
|
-
|
|
73
|
+
export interface CompletionCreateResponse {
|
|
74
|
+
id: string;
|
|
75
|
+
|
|
76
|
+
choices: Array<CompletionCreateResponse.Choice>;
|
|
77
|
+
|
|
78
|
+
created: number;
|
|
79
|
+
|
|
80
|
+
model: string;
|
|
81
|
+
|
|
82
|
+
object?: 'chat.completion';
|
|
86
83
|
|
|
87
|
-
export namespace CompletionCreateResponse {
|
|
88
84
|
/**
|
|
89
|
-
*
|
|
85
|
+
* Usage information for OpenAI chat completion.
|
|
90
86
|
*/
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
* The ID of the chat completion
|
|
94
|
-
*/
|
|
95
|
-
id: string;
|
|
87
|
+
usage?: CompletionCreateResponse.Usage | null;
|
|
88
|
+
}
|
|
96
89
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
90
|
+
export namespace CompletionCreateResponse {
|
|
91
|
+
/**
|
|
92
|
+
* A choice from an OpenAI-compatible chat completion response.
|
|
93
|
+
*/
|
|
94
|
+
export interface Choice {
|
|
95
|
+
finish_reason: string;
|
|
101
96
|
|
|
102
|
-
|
|
103
|
-
* The Unix timestamp in seconds when the chat completion was created
|
|
104
|
-
*/
|
|
105
|
-
created: number;
|
|
97
|
+
index: number;
|
|
106
98
|
|
|
107
99
|
/**
|
|
108
|
-
*
|
|
100
|
+
* A message from the user in an OpenAI-compatible chat completion request.
|
|
109
101
|
*/
|
|
110
|
-
|
|
102
|
+
message:
|
|
103
|
+
| Choice.OpenAIUserMessageParamOutput
|
|
104
|
+
| Choice.OpenAISystemMessageParam
|
|
105
|
+
| Choice.OpenAIAssistantMessageParamOutput
|
|
106
|
+
| Choice.OpenAIToolMessageParam
|
|
107
|
+
| Choice.OpenAIDeveloperMessageParam;
|
|
111
108
|
|
|
112
109
|
/**
|
|
113
|
-
* The
|
|
110
|
+
* The log probabilities for the tokens in the message from an OpenAI-compatible
|
|
111
|
+
* chat completion response.
|
|
114
112
|
*/
|
|
115
|
-
|
|
113
|
+
logprobs?: Choice.Logprobs | null;
|
|
116
114
|
}
|
|
117
115
|
|
|
118
|
-
export namespace
|
|
116
|
+
export namespace Choice {
|
|
119
117
|
/**
|
|
120
|
-
* A
|
|
118
|
+
* A message from the user in an OpenAI-compatible chat completion request.
|
|
121
119
|
*/
|
|
122
|
-
export interface
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
120
|
+
export interface OpenAIUserMessageParamOutput {
|
|
121
|
+
content:
|
|
122
|
+
| string
|
|
123
|
+
| Array<
|
|
124
|
+
| OpenAIUserMessageParamOutput.OpenAIChatCompletionContentPartTextParam
|
|
125
|
+
| OpenAIUserMessageParamOutput.OpenAIChatCompletionContentPartImageParam
|
|
126
|
+
| OpenAIUserMessageParamOutput.OpenAIFile
|
|
127
|
+
>;
|
|
127
128
|
|
|
128
|
-
|
|
129
|
-
* The index of the choice
|
|
130
|
-
*/
|
|
131
|
-
index: number;
|
|
129
|
+
name?: string | null;
|
|
132
130
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
*/
|
|
136
|
-
message:
|
|
137
|
-
| Choice.OpenAIUserMessageParam
|
|
138
|
-
| Choice.OpenAISystemMessageParam
|
|
139
|
-
| Choice.OpenAIAssistantMessageParam
|
|
140
|
-
| Choice.OpenAIToolMessageParam
|
|
141
|
-
| Choice.OpenAIDeveloperMessageParam;
|
|
131
|
+
role?: 'user';
|
|
132
|
+
}
|
|
142
133
|
|
|
134
|
+
export namespace OpenAIUserMessageParamOutput {
|
|
143
135
|
/**
|
|
144
|
-
*
|
|
136
|
+
* Text content part for OpenAI-compatible chat completion messages.
|
|
145
137
|
*/
|
|
146
|
-
|
|
147
|
-
|
|
138
|
+
export interface OpenAIChatCompletionContentPartTextParam {
|
|
139
|
+
text: string;
|
|
140
|
+
|
|
141
|
+
type?: 'text';
|
|
142
|
+
}
|
|
148
143
|
|
|
149
|
-
export namespace Choice {
|
|
150
144
|
/**
|
|
151
|
-
*
|
|
145
|
+
* Image content part for OpenAI-compatible chat completion messages.
|
|
152
146
|
*/
|
|
153
|
-
export interface
|
|
154
|
-
/**
|
|
155
|
-
* The content of the message, which can include text and other media
|
|
156
|
-
*/
|
|
157
|
-
content:
|
|
158
|
-
| string
|
|
159
|
-
| Array<
|
|
160
|
-
| OpenAIUserMessageParam.OpenAIChatCompletionContentPartTextParam
|
|
161
|
-
| OpenAIUserMessageParam.OpenAIChatCompletionContentPartImageParam
|
|
162
|
-
| OpenAIUserMessageParam.OpenAIFile
|
|
163
|
-
>;
|
|
164
|
-
|
|
147
|
+
export interface OpenAIChatCompletionContentPartImageParam {
|
|
165
148
|
/**
|
|
166
|
-
*
|
|
149
|
+
* Image URL specification for OpenAI-compatible chat completion messages.
|
|
167
150
|
*/
|
|
168
|
-
|
|
151
|
+
image_url: OpenAIChatCompletionContentPartImageParam.ImageURL;
|
|
169
152
|
|
|
170
|
-
|
|
171
|
-
* (Optional) The name of the user message participant.
|
|
172
|
-
*/
|
|
173
|
-
name?: string;
|
|
153
|
+
type?: 'image_url';
|
|
174
154
|
}
|
|
175
155
|
|
|
176
|
-
export namespace
|
|
156
|
+
export namespace OpenAIChatCompletionContentPartImageParam {
|
|
177
157
|
/**
|
|
178
|
-
*
|
|
158
|
+
* Image URL specification for OpenAI-compatible chat completion messages.
|
|
179
159
|
*/
|
|
180
|
-
export interface
|
|
181
|
-
|
|
182
|
-
* The text content of the message
|
|
183
|
-
*/
|
|
184
|
-
text: string;
|
|
160
|
+
export interface ImageURL {
|
|
161
|
+
url: string;
|
|
185
162
|
|
|
186
|
-
|
|
187
|
-
* Must be "text" to identify this as text content
|
|
188
|
-
*/
|
|
189
|
-
type: 'text';
|
|
163
|
+
detail?: string | null;
|
|
190
164
|
}
|
|
165
|
+
}
|
|
191
166
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
*/
|
|
195
|
-
export interface OpenAIChatCompletionContentPartImageParam {
|
|
196
|
-
/**
|
|
197
|
-
* Image URL specification and processing details
|
|
198
|
-
*/
|
|
199
|
-
image_url: OpenAIChatCompletionContentPartImageParam.ImageURL;
|
|
200
|
-
|
|
201
|
-
/**
|
|
202
|
-
* Must be "image_url" to identify this as image content
|
|
203
|
-
*/
|
|
204
|
-
type: 'image_url';
|
|
205
|
-
}
|
|
167
|
+
export interface OpenAIFile {
|
|
168
|
+
file: OpenAIFile.File;
|
|
206
169
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
* Image URL specification and processing details
|
|
210
|
-
*/
|
|
211
|
-
export interface ImageURL {
|
|
212
|
-
/**
|
|
213
|
-
* URL of the image to include in the message
|
|
214
|
-
*/
|
|
215
|
-
url: string;
|
|
170
|
+
type?: 'file';
|
|
171
|
+
}
|
|
216
172
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
detail?: string;
|
|
221
|
-
}
|
|
222
|
-
}
|
|
173
|
+
export namespace OpenAIFile {
|
|
174
|
+
export interface File {
|
|
175
|
+
file_data?: string | null;
|
|
223
176
|
|
|
224
|
-
|
|
225
|
-
file: OpenAIFile.File;
|
|
177
|
+
file_id?: string | null;
|
|
226
178
|
|
|
227
|
-
|
|
179
|
+
filename?: string | null;
|
|
228
180
|
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
229
183
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
184
|
+
/**
|
|
185
|
+
* A system message providing instructions or context to the model.
|
|
186
|
+
*/
|
|
187
|
+
export interface OpenAISystemMessageParam {
|
|
188
|
+
content: string | Array<OpenAISystemMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
|
|
233
189
|
|
|
234
|
-
|
|
190
|
+
name?: string | null;
|
|
235
191
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
}
|
|
239
|
-
}
|
|
192
|
+
role?: 'system';
|
|
193
|
+
}
|
|
240
194
|
|
|
195
|
+
export namespace OpenAISystemMessageParam {
|
|
241
196
|
/**
|
|
242
|
-
*
|
|
197
|
+
* Text content part for OpenAI-compatible chat completion messages.
|
|
243
198
|
*/
|
|
244
|
-
export interface
|
|
245
|
-
|
|
246
|
-
* The content of the "system prompt". If multiple system messages are provided,
|
|
247
|
-
* they are concatenated. The underlying Llama Stack code may also add other system
|
|
248
|
-
* messages (for example, for formatting tool definitions).
|
|
249
|
-
*/
|
|
250
|
-
content: string | Array<OpenAISystemMessageParam.UnionMember1>;
|
|
251
|
-
|
|
252
|
-
/**
|
|
253
|
-
* Must be "system" to identify this as a system message
|
|
254
|
-
*/
|
|
255
|
-
role: 'system';
|
|
199
|
+
export interface ListOpenAIChatCompletionContentPartTextParam {
|
|
200
|
+
text: string;
|
|
256
201
|
|
|
257
|
-
|
|
258
|
-
* (Optional) The name of the system message participant.
|
|
259
|
-
*/
|
|
260
|
-
name?: string;
|
|
202
|
+
type?: 'text';
|
|
261
203
|
}
|
|
204
|
+
}
|
|
262
205
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
206
|
+
/**
|
|
207
|
+
* A message containing the model's (assistant) response in an OpenAI-compatible
|
|
208
|
+
* chat completion request.
|
|
209
|
+
*/
|
|
210
|
+
export interface OpenAIAssistantMessageParamOutput {
|
|
211
|
+
content?:
|
|
212
|
+
| string
|
|
213
|
+
| Array<OpenAIAssistantMessageParamOutput.ListOpenAIChatCompletionContentPartTextParam>
|
|
214
|
+
| null;
|
|
272
215
|
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
216
|
+
name?: string | null;
|
|
217
|
+
|
|
218
|
+
role?: 'assistant';
|
|
219
|
+
|
|
220
|
+
tool_calls?: Array<OpenAIAssistantMessageParamOutput.ToolCall> | null;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
export namespace OpenAIAssistantMessageParamOutput {
|
|
224
|
+
/**
|
|
225
|
+
* Text content part for OpenAI-compatible chat completion messages.
|
|
226
|
+
*/
|
|
227
|
+
export interface ListOpenAIChatCompletionContentPartTextParam {
|
|
228
|
+
text: string;
|
|
229
|
+
|
|
230
|
+
type?: 'text';
|
|
278
231
|
}
|
|
279
232
|
|
|
280
233
|
/**
|
|
281
|
-
*
|
|
282
|
-
* chat completion request.
|
|
234
|
+
* Tool call specification for OpenAI-compatible chat completion responses.
|
|
283
235
|
*/
|
|
284
|
-
export interface
|
|
285
|
-
|
|
286
|
-
* Must be "assistant" to identify this as the model's response
|
|
287
|
-
*/
|
|
288
|
-
role: 'assistant';
|
|
236
|
+
export interface ToolCall {
|
|
237
|
+
id?: string | null;
|
|
289
238
|
|
|
290
239
|
/**
|
|
291
|
-
*
|
|
240
|
+
* Function call details for OpenAI-compatible tool calls.
|
|
292
241
|
*/
|
|
293
|
-
|
|
242
|
+
function?: ToolCall.Function | null;
|
|
294
243
|
|
|
295
|
-
|
|
296
|
-
* (Optional) The name of the assistant message participant.
|
|
297
|
-
*/
|
|
298
|
-
name?: string;
|
|
244
|
+
index?: number | null;
|
|
299
245
|
|
|
300
|
-
|
|
301
|
-
* List of tool calls. Each tool call is an OpenAIChatCompletionToolCall object.
|
|
302
|
-
*/
|
|
303
|
-
tool_calls?: Array<OpenAIAssistantMessageParam.ToolCall>;
|
|
246
|
+
type?: 'function';
|
|
304
247
|
}
|
|
305
248
|
|
|
306
|
-
export namespace
|
|
249
|
+
export namespace ToolCall {
|
|
307
250
|
/**
|
|
308
|
-
*
|
|
251
|
+
* Function call details for OpenAI-compatible tool calls.
|
|
309
252
|
*/
|
|
310
|
-
export interface
|
|
311
|
-
|
|
312
|
-
* The text content of the message
|
|
313
|
-
*/
|
|
314
|
-
text: string;
|
|
253
|
+
export interface Function {
|
|
254
|
+
arguments?: string | null;
|
|
315
255
|
|
|
316
|
-
|
|
317
|
-
* Must be "text" to identify this as text content
|
|
318
|
-
*/
|
|
319
|
-
type: 'text';
|
|
256
|
+
name?: string | null;
|
|
320
257
|
}
|
|
258
|
+
}
|
|
259
|
+
}
|
|
321
260
|
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
*/
|
|
329
|
-
type: 'function';
|
|
330
|
-
|
|
331
|
-
/**
|
|
332
|
-
* (Optional) Unique identifier for the tool call
|
|
333
|
-
*/
|
|
334
|
-
id?: string;
|
|
335
|
-
|
|
336
|
-
/**
|
|
337
|
-
* (Optional) Function call details
|
|
338
|
-
*/
|
|
339
|
-
function?: ToolCall.Function;
|
|
261
|
+
/**
|
|
262
|
+
* A message representing the result of a tool invocation in an OpenAI-compatible
|
|
263
|
+
* chat completion request.
|
|
264
|
+
*/
|
|
265
|
+
export interface OpenAIToolMessageParam {
|
|
266
|
+
content: string | Array<OpenAIToolMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
|
|
340
267
|
|
|
341
|
-
|
|
342
|
-
* (Optional) Index of the tool call in the list
|
|
343
|
-
*/
|
|
344
|
-
index?: number;
|
|
345
|
-
}
|
|
268
|
+
tool_call_id: string;
|
|
346
269
|
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
* (Optional) Function call details
|
|
350
|
-
*/
|
|
351
|
-
export interface Function {
|
|
352
|
-
/**
|
|
353
|
-
* (Optional) Arguments to pass to the function as a JSON string
|
|
354
|
-
*/
|
|
355
|
-
arguments?: string;
|
|
356
|
-
|
|
357
|
-
/**
|
|
358
|
-
* (Optional) Name of the function to call
|
|
359
|
-
*/
|
|
360
|
-
name?: string;
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
}
|
|
270
|
+
role?: 'tool';
|
|
271
|
+
}
|
|
364
272
|
|
|
273
|
+
export namespace OpenAIToolMessageParam {
|
|
365
274
|
/**
|
|
366
|
-
*
|
|
367
|
-
* chat completion request.
|
|
275
|
+
* Text content part for OpenAI-compatible chat completion messages.
|
|
368
276
|
*/
|
|
369
|
-
export interface
|
|
370
|
-
|
|
371
|
-
* The response content from the tool
|
|
372
|
-
*/
|
|
373
|
-
content: string | Array<OpenAIToolMessageParam.UnionMember1>;
|
|
374
|
-
|
|
375
|
-
/**
|
|
376
|
-
* Must be "tool" to identify this as a tool response
|
|
377
|
-
*/
|
|
378
|
-
role: 'tool';
|
|
277
|
+
export interface ListOpenAIChatCompletionContentPartTextParam {
|
|
278
|
+
text: string;
|
|
379
279
|
|
|
380
|
-
|
|
381
|
-
* Unique identifier for the tool call this response is for
|
|
382
|
-
*/
|
|
383
|
-
tool_call_id: string;
|
|
280
|
+
type?: 'text';
|
|
384
281
|
}
|
|
282
|
+
}
|
|
385
283
|
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
/**
|
|
392
|
-
* The text content of the message
|
|
393
|
-
*/
|
|
394
|
-
text: string;
|
|
284
|
+
/**
|
|
285
|
+
* A message from the developer in an OpenAI-compatible chat completion request.
|
|
286
|
+
*/
|
|
287
|
+
export interface OpenAIDeveloperMessageParam {
|
|
288
|
+
content: string | Array<OpenAIDeveloperMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
|
|
395
289
|
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
}
|
|
401
|
-
}
|
|
290
|
+
name?: string | null;
|
|
291
|
+
|
|
292
|
+
role?: 'developer';
|
|
293
|
+
}
|
|
402
294
|
|
|
295
|
+
export namespace OpenAIDeveloperMessageParam {
|
|
403
296
|
/**
|
|
404
|
-
*
|
|
297
|
+
* Text content part for OpenAI-compatible chat completion messages.
|
|
405
298
|
*/
|
|
406
|
-
export interface
|
|
407
|
-
|
|
408
|
-
* The content of the developer message
|
|
409
|
-
*/
|
|
410
|
-
content: string | Array<OpenAIDeveloperMessageParam.UnionMember1>;
|
|
411
|
-
|
|
412
|
-
/**
|
|
413
|
-
* Must be "developer" to identify this as a developer message
|
|
414
|
-
*/
|
|
415
|
-
role: 'developer';
|
|
299
|
+
export interface ListOpenAIChatCompletionContentPartTextParam {
|
|
300
|
+
text: string;
|
|
416
301
|
|
|
417
|
-
|
|
418
|
-
* (Optional) The name of the developer message participant.
|
|
419
|
-
*/
|
|
420
|
-
name?: string;
|
|
302
|
+
type?: 'text';
|
|
421
303
|
}
|
|
304
|
+
}
|
|
422
305
|
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
* The text content of the message
|
|
430
|
-
*/
|
|
431
|
-
text: string;
|
|
306
|
+
/**
|
|
307
|
+
* The log probabilities for the tokens in the message from an OpenAI-compatible
|
|
308
|
+
* chat completion response.
|
|
309
|
+
*/
|
|
310
|
+
export interface Logprobs {
|
|
311
|
+
content?: Array<Logprobs.Content> | null;
|
|
432
312
|
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
*/
|
|
436
|
-
type: 'text';
|
|
437
|
-
}
|
|
438
|
-
}
|
|
313
|
+
refusal?: Array<Logprobs.Refusal> | null;
|
|
314
|
+
}
|
|
439
315
|
|
|
316
|
+
export namespace Logprobs {
|
|
440
317
|
/**
|
|
441
|
-
*
|
|
318
|
+
* The log probability for a token from an OpenAI-compatible chat completion
|
|
319
|
+
* response.
|
|
320
|
+
*
|
|
321
|
+
* :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
|
|
322
|
+
* probability of the token :top_logprobs: The top log probabilities for the token
|
|
442
323
|
*/
|
|
443
|
-
export interface
|
|
444
|
-
|
|
445
|
-
* (Optional) The log probabilities for the tokens in the message
|
|
446
|
-
*/
|
|
447
|
-
content?: Array<Logprobs.Content>;
|
|
324
|
+
export interface Content {
|
|
325
|
+
token: string;
|
|
448
326
|
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
327
|
+
logprob: number;
|
|
328
|
+
|
|
329
|
+
top_logprobs: Array<Content.TopLogprob>;
|
|
330
|
+
|
|
331
|
+
bytes?: Array<number> | null;
|
|
453
332
|
}
|
|
454
333
|
|
|
455
|
-
export namespace
|
|
334
|
+
export namespace Content {
|
|
456
335
|
/**
|
|
457
|
-
* The log probability for a token from an OpenAI-compatible chat completion
|
|
336
|
+
* The top log probability for a token from an OpenAI-compatible chat completion
|
|
458
337
|
* response.
|
|
338
|
+
*
|
|
339
|
+
* :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
|
|
340
|
+
* probability of the token
|
|
459
341
|
*/
|
|
460
|
-
export interface
|
|
342
|
+
export interface TopLogprob {
|
|
461
343
|
token: string;
|
|
462
344
|
|
|
463
345
|
logprob: number;
|
|
464
346
|
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
bytes?: Array<number>;
|
|
347
|
+
bytes?: Array<number> | null;
|
|
468
348
|
}
|
|
349
|
+
}
|
|
469
350
|
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
351
|
+
/**
|
|
352
|
+
* The log probability for a token from an OpenAI-compatible chat completion
|
|
353
|
+
* response.
|
|
354
|
+
*
|
|
355
|
+
* :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
|
|
356
|
+
* probability of the token :top_logprobs: The top log probabilities for the token
|
|
357
|
+
*/
|
|
358
|
+
export interface Refusal {
|
|
359
|
+
token: string;
|
|
477
360
|
|
|
478
|
-
|
|
361
|
+
logprob: number;
|
|
479
362
|
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
363
|
+
top_logprobs: Array<Refusal.TopLogprob>;
|
|
364
|
+
|
|
365
|
+
bytes?: Array<number> | null;
|
|
366
|
+
}
|
|
483
367
|
|
|
368
|
+
export namespace Refusal {
|
|
484
369
|
/**
|
|
485
|
-
* The log probability for a token from an OpenAI-compatible chat completion
|
|
370
|
+
* The top log probability for a token from an OpenAI-compatible chat completion
|
|
486
371
|
* response.
|
|
372
|
+
*
|
|
373
|
+
* :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
|
|
374
|
+
* probability of the token
|
|
487
375
|
*/
|
|
488
|
-
export interface
|
|
376
|
+
export interface TopLogprob {
|
|
489
377
|
token: string;
|
|
490
378
|
|
|
491
379
|
logprob: number;
|
|
492
380
|
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
bytes?: Array<number>;
|
|
381
|
+
bytes?: Array<number> | null;
|
|
496
382
|
}
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
}
|
|
497
386
|
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
export interface TopLogprob {
|
|
504
|
-
token: string;
|
|
387
|
+
/**
|
|
388
|
+
* Usage information for OpenAI chat completion.
|
|
389
|
+
*/
|
|
390
|
+
export interface Usage {
|
|
391
|
+
completion_tokens: number;
|
|
505
392
|
|
|
506
|
-
|
|
393
|
+
prompt_tokens: number;
|
|
507
394
|
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
395
|
+
total_tokens: number;
|
|
396
|
+
|
|
397
|
+
/**
|
|
398
|
+
* Token details for output tokens in OpenAI chat completion usage.
|
|
399
|
+
*/
|
|
400
|
+
completion_tokens_details?: Usage.CompletionTokensDetails | null;
|
|
401
|
+
|
|
402
|
+
/**
|
|
403
|
+
* Token details for prompt tokens in OpenAI chat completion usage.
|
|
404
|
+
*/
|
|
405
|
+
prompt_tokens_details?: Usage.PromptTokensDetails | null;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
export namespace Usage {
|
|
409
|
+
/**
|
|
410
|
+
* Token details for output tokens in OpenAI chat completion usage.
|
|
411
|
+
*/
|
|
412
|
+
export interface CompletionTokensDetails {
|
|
413
|
+
reasoning_tokens?: number | null;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* Token details for prompt tokens in OpenAI chat completion usage.
|
|
418
|
+
*/
|
|
419
|
+
export interface PromptTokensDetails {
|
|
420
|
+
cached_tokens?: number | null;
|
|
512
421
|
}
|
|
513
422
|
}
|
|
514
423
|
}
|
|
515
424
|
|
|
516
425
|
export interface CompletionRetrieveResponse {
|
|
517
|
-
/**
|
|
518
|
-
* The ID of the chat completion
|
|
519
|
-
*/
|
|
520
426
|
id: string;
|
|
521
427
|
|
|
522
|
-
/**
|
|
523
|
-
* List of choices
|
|
524
|
-
*/
|
|
525
428
|
choices: Array<CompletionRetrieveResponse.Choice>;
|
|
526
429
|
|
|
527
|
-
/**
|
|
528
|
-
* The Unix timestamp in seconds when the chat completion was created
|
|
529
|
-
*/
|
|
530
430
|
created: number;
|
|
531
431
|
|
|
532
432
|
input_messages: Array<
|
|
533
|
-
| CompletionRetrieveResponse.
|
|
433
|
+
| CompletionRetrieveResponse.OpenAIUserMessageParamOutput
|
|
534
434
|
| CompletionRetrieveResponse.OpenAISystemMessageParam
|
|
535
|
-
| CompletionRetrieveResponse.
|
|
435
|
+
| CompletionRetrieveResponse.OpenAIAssistantMessageParamOutput
|
|
536
436
|
| CompletionRetrieveResponse.OpenAIToolMessageParam
|
|
537
437
|
| CompletionRetrieveResponse.OpenAIDeveloperMessageParam
|
|
538
438
|
>;
|
|
539
439
|
|
|
540
|
-
/**
|
|
541
|
-
* The model that was used to generate the chat completion
|
|
542
|
-
*/
|
|
543
440
|
model: string;
|
|
544
441
|
|
|
442
|
+
object?: 'chat.completion';
|
|
443
|
+
|
|
545
444
|
/**
|
|
546
|
-
*
|
|
445
|
+
* Usage information for OpenAI chat completion.
|
|
547
446
|
*/
|
|
548
|
-
|
|
447
|
+
usage?: CompletionRetrieveResponse.Usage | null;
|
|
549
448
|
}
|
|
550
449
|
|
|
551
450
|
export namespace CompletionRetrieveResponse {
|
|
@@ -553,73 +452,53 @@ export namespace CompletionRetrieveResponse {
|
|
|
553
452
|
* A choice from an OpenAI-compatible chat completion response.
|
|
554
453
|
*/
|
|
555
454
|
export interface Choice {
|
|
556
|
-
/**
|
|
557
|
-
* The reason the model stopped generating
|
|
558
|
-
*/
|
|
559
455
|
finish_reason: string;
|
|
560
456
|
|
|
561
|
-
/**
|
|
562
|
-
* The index of the choice
|
|
563
|
-
*/
|
|
564
457
|
index: number;
|
|
565
458
|
|
|
566
459
|
/**
|
|
567
|
-
*
|
|
460
|
+
* A message from the user in an OpenAI-compatible chat completion request.
|
|
568
461
|
*/
|
|
569
462
|
message:
|
|
570
|
-
| Choice.
|
|
463
|
+
| Choice.OpenAIUserMessageParamOutput
|
|
571
464
|
| Choice.OpenAISystemMessageParam
|
|
572
|
-
| Choice.
|
|
465
|
+
| Choice.OpenAIAssistantMessageParamOutput
|
|
573
466
|
| Choice.OpenAIToolMessageParam
|
|
574
467
|
| Choice.OpenAIDeveloperMessageParam;
|
|
575
468
|
|
|
576
469
|
/**
|
|
577
|
-
*
|
|
470
|
+
* The log probabilities for the tokens in the message from an OpenAI-compatible
|
|
471
|
+
* chat completion response.
|
|
578
472
|
*/
|
|
579
|
-
logprobs?: Choice.Logprobs;
|
|
473
|
+
logprobs?: Choice.Logprobs | null;
|
|
580
474
|
}
|
|
581
475
|
|
|
582
476
|
export namespace Choice {
|
|
583
477
|
/**
|
|
584
478
|
* A message from the user in an OpenAI-compatible chat completion request.
|
|
585
479
|
*/
|
|
586
|
-
export interface
|
|
587
|
-
/**
|
|
588
|
-
* The content of the message, which can include text and other media
|
|
589
|
-
*/
|
|
480
|
+
export interface OpenAIUserMessageParamOutput {
|
|
590
481
|
content:
|
|
591
482
|
| string
|
|
592
483
|
| Array<
|
|
593
|
-
|
|
|
594
|
-
|
|
|
595
|
-
|
|
|
484
|
+
| OpenAIUserMessageParamOutput.OpenAIChatCompletionContentPartTextParam
|
|
485
|
+
| OpenAIUserMessageParamOutput.OpenAIChatCompletionContentPartImageParam
|
|
486
|
+
| OpenAIUserMessageParamOutput.OpenAIFile
|
|
596
487
|
>;
|
|
597
488
|
|
|
598
|
-
|
|
599
|
-
* Must be "user" to identify this as a user message
|
|
600
|
-
*/
|
|
601
|
-
role: 'user';
|
|
489
|
+
name?: string | null;
|
|
602
490
|
|
|
603
|
-
|
|
604
|
-
* (Optional) The name of the user message participant.
|
|
605
|
-
*/
|
|
606
|
-
name?: string;
|
|
491
|
+
role?: 'user';
|
|
607
492
|
}
|
|
608
493
|
|
|
609
|
-
export namespace
|
|
494
|
+
export namespace OpenAIUserMessageParamOutput {
|
|
610
495
|
/**
|
|
611
496
|
* Text content part for OpenAI-compatible chat completion messages.
|
|
612
497
|
*/
|
|
613
498
|
export interface OpenAIChatCompletionContentPartTextParam {
|
|
614
|
-
/**
|
|
615
|
-
* The text content of the message
|
|
616
|
-
*/
|
|
617
499
|
text: string;
|
|
618
500
|
|
|
619
|
-
|
|
620
|
-
* Must be "text" to identify this as text content
|
|
621
|
-
*/
|
|
622
|
-
type: 'text';
|
|
501
|
+
type?: 'text';
|
|
623
502
|
}
|
|
624
503
|
|
|
625
504
|
/**
|
|
@@ -627,46 +506,37 @@ export namespace CompletionRetrieveResponse {
|
|
|
627
506
|
*/
|
|
628
507
|
export interface OpenAIChatCompletionContentPartImageParam {
|
|
629
508
|
/**
|
|
630
|
-
* Image URL specification
|
|
509
|
+
* Image URL specification for OpenAI-compatible chat completion messages.
|
|
631
510
|
*/
|
|
632
511
|
image_url: OpenAIChatCompletionContentPartImageParam.ImageURL;
|
|
633
512
|
|
|
634
|
-
|
|
635
|
-
* Must be "image_url" to identify this as image content
|
|
636
|
-
*/
|
|
637
|
-
type: 'image_url';
|
|
513
|
+
type?: 'image_url';
|
|
638
514
|
}
|
|
639
515
|
|
|
640
516
|
export namespace OpenAIChatCompletionContentPartImageParam {
|
|
641
517
|
/**
|
|
642
|
-
* Image URL specification
|
|
518
|
+
* Image URL specification for OpenAI-compatible chat completion messages.
|
|
643
519
|
*/
|
|
644
520
|
export interface ImageURL {
|
|
645
|
-
/**
|
|
646
|
-
* URL of the image to include in the message
|
|
647
|
-
*/
|
|
648
521
|
url: string;
|
|
649
522
|
|
|
650
|
-
|
|
651
|
-
* (Optional) Level of detail for image processing. Can be "low", "high", or "auto"
|
|
652
|
-
*/
|
|
653
|
-
detail?: string;
|
|
523
|
+
detail?: string | null;
|
|
654
524
|
}
|
|
655
525
|
}
|
|
656
526
|
|
|
657
527
|
export interface OpenAIFile {
|
|
658
528
|
file: OpenAIFile.File;
|
|
659
529
|
|
|
660
|
-
type
|
|
530
|
+
type?: 'file';
|
|
661
531
|
}
|
|
662
532
|
|
|
663
533
|
export namespace OpenAIFile {
|
|
664
534
|
export interface File {
|
|
665
|
-
file_data?: string;
|
|
535
|
+
file_data?: string | null;
|
|
666
536
|
|
|
667
|
-
file_id?: string;
|
|
537
|
+
file_id?: string | null;
|
|
668
538
|
|
|
669
|
-
filename?: string;
|
|
539
|
+
filename?: string | null;
|
|
670
540
|
}
|
|
671
541
|
}
|
|
672
542
|
}
|
|
@@ -675,38 +545,21 @@ export namespace CompletionRetrieveResponse {
|
|
|
675
545
|
* A system message providing instructions or context to the model.
|
|
676
546
|
*/
|
|
677
547
|
export interface OpenAISystemMessageParam {
|
|
678
|
-
|
|
679
|
-
* The content of the "system prompt". If multiple system messages are provided,
|
|
680
|
-
* they are concatenated. The underlying Llama Stack code may also add other system
|
|
681
|
-
* messages (for example, for formatting tool definitions).
|
|
682
|
-
*/
|
|
683
|
-
content: string | Array<OpenAISystemMessageParam.UnionMember1>;
|
|
548
|
+
content: string | Array<OpenAISystemMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
|
|
684
549
|
|
|
685
|
-
|
|
686
|
-
* Must be "system" to identify this as a system message
|
|
687
|
-
*/
|
|
688
|
-
role: 'system';
|
|
550
|
+
name?: string | null;
|
|
689
551
|
|
|
690
|
-
|
|
691
|
-
* (Optional) The name of the system message participant.
|
|
692
|
-
*/
|
|
693
|
-
name?: string;
|
|
552
|
+
role?: 'system';
|
|
694
553
|
}
|
|
695
554
|
|
|
696
555
|
export namespace OpenAISystemMessageParam {
|
|
697
556
|
/**
|
|
698
557
|
* Text content part for OpenAI-compatible chat completion messages.
|
|
699
558
|
*/
|
|
700
|
-
export interface
|
|
701
|
-
/**
|
|
702
|
-
* The text content of the message
|
|
703
|
-
*/
|
|
559
|
+
export interface ListOpenAIChatCompletionContentPartTextParam {
|
|
704
560
|
text: string;
|
|
705
561
|
|
|
706
|
-
|
|
707
|
-
* Must be "text" to identify this as text content
|
|
708
|
-
*/
|
|
709
|
-
type: 'text';
|
|
562
|
+
type?: 'text';
|
|
710
563
|
}
|
|
711
564
|
}
|
|
712
565
|
|
|
@@ -714,83 +567,53 @@ export namespace CompletionRetrieveResponse {
|
|
|
714
567
|
* A message containing the model's (assistant) response in an OpenAI-compatible
|
|
715
568
|
* chat completion request.
|
|
716
569
|
*/
|
|
717
|
-
export interface
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
570
|
+
export interface OpenAIAssistantMessageParamOutput {
|
|
571
|
+
content?:
|
|
572
|
+
| string
|
|
573
|
+
| Array<OpenAIAssistantMessageParamOutput.ListOpenAIChatCompletionContentPartTextParam>
|
|
574
|
+
| null;
|
|
722
575
|
|
|
723
|
-
|
|
724
|
-
* The content of the model's response
|
|
725
|
-
*/
|
|
726
|
-
content?: string | Array<OpenAIAssistantMessageParam.UnionMember1>;
|
|
576
|
+
name?: string | null;
|
|
727
577
|
|
|
728
|
-
|
|
729
|
-
* (Optional) The name of the assistant message participant.
|
|
730
|
-
*/
|
|
731
|
-
name?: string;
|
|
578
|
+
role?: 'assistant';
|
|
732
579
|
|
|
733
|
-
|
|
734
|
-
* List of tool calls. Each tool call is an OpenAIChatCompletionToolCall object.
|
|
735
|
-
*/
|
|
736
|
-
tool_calls?: Array<OpenAIAssistantMessageParam.ToolCall>;
|
|
580
|
+
tool_calls?: Array<OpenAIAssistantMessageParamOutput.ToolCall> | null;
|
|
737
581
|
}
|
|
738
582
|
|
|
739
|
-
export namespace
|
|
583
|
+
export namespace OpenAIAssistantMessageParamOutput {
|
|
740
584
|
/**
|
|
741
585
|
* Text content part for OpenAI-compatible chat completion messages.
|
|
742
586
|
*/
|
|
743
|
-
export interface
|
|
744
|
-
/**
|
|
745
|
-
* The text content of the message
|
|
746
|
-
*/
|
|
587
|
+
export interface ListOpenAIChatCompletionContentPartTextParam {
|
|
747
588
|
text: string;
|
|
748
589
|
|
|
749
|
-
|
|
750
|
-
* Must be "text" to identify this as text content
|
|
751
|
-
*/
|
|
752
|
-
type: 'text';
|
|
590
|
+
type?: 'text';
|
|
753
591
|
}
|
|
754
592
|
|
|
755
593
|
/**
|
|
756
594
|
* Tool call specification for OpenAI-compatible chat completion responses.
|
|
757
595
|
*/
|
|
758
596
|
export interface ToolCall {
|
|
759
|
-
|
|
760
|
-
* Must be "function" to identify this as a function call
|
|
761
|
-
*/
|
|
762
|
-
type: 'function';
|
|
597
|
+
id?: string | null;
|
|
763
598
|
|
|
764
599
|
/**
|
|
765
|
-
*
|
|
600
|
+
* Function call details for OpenAI-compatible tool calls.
|
|
766
601
|
*/
|
|
767
|
-
|
|
602
|
+
function?: ToolCall.Function | null;
|
|
768
603
|
|
|
769
|
-
|
|
770
|
-
* (Optional) Function call details
|
|
771
|
-
*/
|
|
772
|
-
function?: ToolCall.Function;
|
|
604
|
+
index?: number | null;
|
|
773
605
|
|
|
774
|
-
|
|
775
|
-
* (Optional) Index of the tool call in the list
|
|
776
|
-
*/
|
|
777
|
-
index?: number;
|
|
606
|
+
type?: 'function';
|
|
778
607
|
}
|
|
779
608
|
|
|
780
609
|
export namespace ToolCall {
|
|
781
610
|
/**
|
|
782
|
-
*
|
|
611
|
+
* Function call details for OpenAI-compatible tool calls.
|
|
783
612
|
*/
|
|
784
613
|
export interface Function {
|
|
785
|
-
|
|
786
|
-
* (Optional) Arguments to pass to the function as a JSON string
|
|
787
|
-
*/
|
|
788
|
-
arguments?: string;
|
|
614
|
+
arguments?: string | null;
|
|
789
615
|
|
|
790
|
-
|
|
791
|
-
* (Optional) Name of the function to call
|
|
792
|
-
*/
|
|
793
|
-
name?: string;
|
|
616
|
+
name?: string | null;
|
|
794
617
|
}
|
|
795
618
|
}
|
|
796
619
|
}
|
|
@@ -800,36 +623,21 @@ export namespace CompletionRetrieveResponse {
|
|
|
800
623
|
* chat completion request.
|
|
801
624
|
*/
|
|
802
625
|
export interface OpenAIToolMessageParam {
|
|
803
|
-
|
|
804
|
-
* The response content from the tool
|
|
805
|
-
*/
|
|
806
|
-
content: string | Array<OpenAIToolMessageParam.UnionMember1>;
|
|
626
|
+
content: string | Array<OpenAIToolMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
|
|
807
627
|
|
|
808
|
-
/**
|
|
809
|
-
* Must be "tool" to identify this as a tool response
|
|
810
|
-
*/
|
|
811
|
-
role: 'tool';
|
|
812
|
-
|
|
813
|
-
/**
|
|
814
|
-
* Unique identifier for the tool call this response is for
|
|
815
|
-
*/
|
|
816
628
|
tool_call_id: string;
|
|
629
|
+
|
|
630
|
+
role?: 'tool';
|
|
817
631
|
}
|
|
818
632
|
|
|
819
633
|
export namespace OpenAIToolMessageParam {
|
|
820
634
|
/**
|
|
821
635
|
* Text content part for OpenAI-compatible chat completion messages.
|
|
822
636
|
*/
|
|
823
|
-
export interface
|
|
824
|
-
/**
|
|
825
|
-
* The text content of the message
|
|
826
|
-
*/
|
|
637
|
+
export interface ListOpenAIChatCompletionContentPartTextParam {
|
|
827
638
|
text: string;
|
|
828
639
|
|
|
829
|
-
|
|
830
|
-
* Must be "text" to identify this as text content
|
|
831
|
-
*/
|
|
832
|
-
type: 'text';
|
|
640
|
+
type?: 'text';
|
|
833
641
|
}
|
|
834
642
|
}
|
|
835
643
|
|
|
@@ -837,58 +645,41 @@ export namespace CompletionRetrieveResponse {
|
|
|
837
645
|
* A message from the developer in an OpenAI-compatible chat completion request.
|
|
838
646
|
*/
|
|
839
647
|
export interface OpenAIDeveloperMessageParam {
|
|
840
|
-
|
|
841
|
-
* The content of the developer message
|
|
842
|
-
*/
|
|
843
|
-
content: string | Array<OpenAIDeveloperMessageParam.UnionMember1>;
|
|
648
|
+
content: string | Array<OpenAIDeveloperMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
|
|
844
649
|
|
|
845
|
-
|
|
846
|
-
* Must be "developer" to identify this as a developer message
|
|
847
|
-
*/
|
|
848
|
-
role: 'developer';
|
|
650
|
+
name?: string | null;
|
|
849
651
|
|
|
850
|
-
|
|
851
|
-
* (Optional) The name of the developer message participant.
|
|
852
|
-
*/
|
|
853
|
-
name?: string;
|
|
652
|
+
role?: 'developer';
|
|
854
653
|
}
|
|
855
654
|
|
|
856
655
|
export namespace OpenAIDeveloperMessageParam {
|
|
857
656
|
/**
|
|
858
657
|
* Text content part for OpenAI-compatible chat completion messages.
|
|
859
658
|
*/
|
|
860
|
-
export interface
|
|
861
|
-
/**
|
|
862
|
-
* The text content of the message
|
|
863
|
-
*/
|
|
659
|
+
export interface ListOpenAIChatCompletionContentPartTextParam {
|
|
864
660
|
text: string;
|
|
865
661
|
|
|
866
|
-
|
|
867
|
-
* Must be "text" to identify this as text content
|
|
868
|
-
*/
|
|
869
|
-
type: 'text';
|
|
662
|
+
type?: 'text';
|
|
870
663
|
}
|
|
871
664
|
}
|
|
872
665
|
|
|
873
666
|
/**
|
|
874
|
-
*
|
|
667
|
+
* The log probabilities for the tokens in the message from an OpenAI-compatible
|
|
668
|
+
* chat completion response.
|
|
875
669
|
*/
|
|
876
670
|
export interface Logprobs {
|
|
877
|
-
|
|
878
|
-
* (Optional) The log probabilities for the tokens in the message
|
|
879
|
-
*/
|
|
880
|
-
content?: Array<Logprobs.Content>;
|
|
671
|
+
content?: Array<Logprobs.Content> | null;
|
|
881
672
|
|
|
882
|
-
|
|
883
|
-
* (Optional) The log probabilities for the tokens in the message
|
|
884
|
-
*/
|
|
885
|
-
refusal?: Array<Logprobs.Refusal>;
|
|
673
|
+
refusal?: Array<Logprobs.Refusal> | null;
|
|
886
674
|
}
|
|
887
675
|
|
|
888
676
|
export namespace Logprobs {
|
|
889
677
|
/**
|
|
890
678
|
* The log probability for a token from an OpenAI-compatible chat completion
|
|
891
679
|
* response.
|
|
680
|
+
*
|
|
681
|
+
* :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
|
|
682
|
+
* probability of the token :top_logprobs: The top log probabilities for the token
|
|
892
683
|
*/
|
|
893
684
|
export interface Content {
|
|
894
685
|
token: string;
|
|
@@ -897,26 +688,32 @@ export namespace CompletionRetrieveResponse {
|
|
|
897
688
|
|
|
898
689
|
top_logprobs: Array<Content.TopLogprob>;
|
|
899
690
|
|
|
900
|
-
bytes?: Array<number
|
|
691
|
+
bytes?: Array<number> | null;
|
|
901
692
|
}
|
|
902
693
|
|
|
903
694
|
export namespace Content {
|
|
904
695
|
/**
|
|
905
696
|
* The top log probability for a token from an OpenAI-compatible chat completion
|
|
906
697
|
* response.
|
|
698
|
+
*
|
|
699
|
+
* :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
|
|
700
|
+
* probability of the token
|
|
907
701
|
*/
|
|
908
702
|
export interface TopLogprob {
|
|
909
703
|
token: string;
|
|
910
704
|
|
|
911
705
|
logprob: number;
|
|
912
706
|
|
|
913
|
-
bytes?: Array<number
|
|
707
|
+
bytes?: Array<number> | null;
|
|
914
708
|
}
|
|
915
709
|
}
|
|
916
710
|
|
|
917
711
|
/**
|
|
918
712
|
* The log probability for a token from an OpenAI-compatible chat completion
|
|
919
713
|
* response.
|
|
714
|
+
*
|
|
715
|
+
* :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
|
|
716
|
+
* probability of the token :top_logprobs: The top log probabilities for the token
|
|
920
717
|
*/
|
|
921
718
|
export interface Refusal {
|
|
922
719
|
token: string;
|
|
@@ -925,20 +722,23 @@ export namespace CompletionRetrieveResponse {
|
|
|
925
722
|
|
|
926
723
|
top_logprobs: Array<Refusal.TopLogprob>;
|
|
927
724
|
|
|
928
|
-
bytes?: Array<number
|
|
725
|
+
bytes?: Array<number> | null;
|
|
929
726
|
}
|
|
930
727
|
|
|
931
728
|
export namespace Refusal {
|
|
932
729
|
/**
|
|
933
730
|
* The top log probability for a token from an OpenAI-compatible chat completion
|
|
934
731
|
* response.
|
|
732
|
+
*
|
|
733
|
+
* :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
|
|
734
|
+
* probability of the token
|
|
935
735
|
*/
|
|
936
736
|
export interface TopLogprob {
|
|
937
737
|
token: string;
|
|
938
738
|
|
|
939
739
|
logprob: number;
|
|
940
740
|
|
|
941
|
-
bytes?: Array<number
|
|
741
|
+
bytes?: Array<number> | null;
|
|
942
742
|
}
|
|
943
743
|
}
|
|
944
744
|
}
|
|
@@ -947,43 +747,28 @@ export namespace CompletionRetrieveResponse {
|
|
|
947
747
|
/**
|
|
948
748
|
* A message from the user in an OpenAI-compatible chat completion request.
|
|
949
749
|
*/
|
|
950
|
-
export interface
|
|
951
|
-
/**
|
|
952
|
-
* The content of the message, which can include text and other media
|
|
953
|
-
*/
|
|
750
|
+
export interface OpenAIUserMessageParamOutput {
|
|
954
751
|
content:
|
|
955
752
|
| string
|
|
956
753
|
| Array<
|
|
957
|
-
|
|
|
958
|
-
|
|
|
959
|
-
|
|
|
754
|
+
| OpenAIUserMessageParamOutput.OpenAIChatCompletionContentPartTextParam
|
|
755
|
+
| OpenAIUserMessageParamOutput.OpenAIChatCompletionContentPartImageParam
|
|
756
|
+
| OpenAIUserMessageParamOutput.OpenAIFile
|
|
960
757
|
>;
|
|
961
758
|
|
|
962
|
-
|
|
963
|
-
* Must be "user" to identify this as a user message
|
|
964
|
-
*/
|
|
965
|
-
role: 'user';
|
|
759
|
+
name?: string | null;
|
|
966
760
|
|
|
967
|
-
|
|
968
|
-
* (Optional) The name of the user message participant.
|
|
969
|
-
*/
|
|
970
|
-
name?: string;
|
|
761
|
+
role?: 'user';
|
|
971
762
|
}
|
|
972
763
|
|
|
973
|
-
export namespace
|
|
764
|
+
export namespace OpenAIUserMessageParamOutput {
|
|
974
765
|
/**
|
|
975
766
|
* Text content part for OpenAI-compatible chat completion messages.
|
|
976
767
|
*/
|
|
977
768
|
export interface OpenAIChatCompletionContentPartTextParam {
|
|
978
|
-
/**
|
|
979
|
-
* The text content of the message
|
|
980
|
-
*/
|
|
981
769
|
text: string;
|
|
982
770
|
|
|
983
|
-
|
|
984
|
-
* Must be "text" to identify this as text content
|
|
985
|
-
*/
|
|
986
|
-
type: 'text';
|
|
771
|
+
type?: 'text';
|
|
987
772
|
}
|
|
988
773
|
|
|
989
774
|
/**
|
|
@@ -991,46 +776,37 @@ export namespace CompletionRetrieveResponse {
|
|
|
991
776
|
*/
|
|
992
777
|
export interface OpenAIChatCompletionContentPartImageParam {
|
|
993
778
|
/**
|
|
994
|
-
* Image URL specification
|
|
779
|
+
* Image URL specification for OpenAI-compatible chat completion messages.
|
|
995
780
|
*/
|
|
996
781
|
image_url: OpenAIChatCompletionContentPartImageParam.ImageURL;
|
|
997
782
|
|
|
998
|
-
|
|
999
|
-
* Must be "image_url" to identify this as image content
|
|
1000
|
-
*/
|
|
1001
|
-
type: 'image_url';
|
|
783
|
+
type?: 'image_url';
|
|
1002
784
|
}
|
|
1003
785
|
|
|
1004
786
|
export namespace OpenAIChatCompletionContentPartImageParam {
|
|
1005
787
|
/**
|
|
1006
|
-
* Image URL specification
|
|
788
|
+
* Image URL specification for OpenAI-compatible chat completion messages.
|
|
1007
789
|
*/
|
|
1008
790
|
export interface ImageURL {
|
|
1009
|
-
/**
|
|
1010
|
-
* URL of the image to include in the message
|
|
1011
|
-
*/
|
|
1012
791
|
url: string;
|
|
1013
792
|
|
|
1014
|
-
|
|
1015
|
-
* (Optional) Level of detail for image processing. Can be "low", "high", or "auto"
|
|
1016
|
-
*/
|
|
1017
|
-
detail?: string;
|
|
793
|
+
detail?: string | null;
|
|
1018
794
|
}
|
|
1019
795
|
}
|
|
1020
796
|
|
|
1021
797
|
export interface OpenAIFile {
|
|
1022
798
|
file: OpenAIFile.File;
|
|
1023
799
|
|
|
1024
|
-
type
|
|
800
|
+
type?: 'file';
|
|
1025
801
|
}
|
|
1026
802
|
|
|
1027
803
|
export namespace OpenAIFile {
|
|
1028
804
|
export interface File {
|
|
1029
|
-
file_data?: string;
|
|
805
|
+
file_data?: string | null;
|
|
1030
806
|
|
|
1031
|
-
file_id?: string;
|
|
807
|
+
file_id?: string | null;
|
|
1032
808
|
|
|
1033
|
-
filename?: string;
|
|
809
|
+
filename?: string | null;
|
|
1034
810
|
}
|
|
1035
811
|
}
|
|
1036
812
|
}
|
|
@@ -1039,38 +815,21 @@ export namespace CompletionRetrieveResponse {
|
|
|
1039
815
|
* A system message providing instructions or context to the model.
|
|
1040
816
|
*/
|
|
1041
817
|
export interface OpenAISystemMessageParam {
|
|
1042
|
-
|
|
1043
|
-
* The content of the "system prompt". If multiple system messages are provided,
|
|
1044
|
-
* they are concatenated. The underlying Llama Stack code may also add other system
|
|
1045
|
-
* messages (for example, for formatting tool definitions).
|
|
1046
|
-
*/
|
|
1047
|
-
content: string | Array<OpenAISystemMessageParam.UnionMember1>;
|
|
818
|
+
content: string | Array<OpenAISystemMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
|
|
1048
819
|
|
|
1049
|
-
|
|
1050
|
-
* Must be "system" to identify this as a system message
|
|
1051
|
-
*/
|
|
1052
|
-
role: 'system';
|
|
820
|
+
name?: string | null;
|
|
1053
821
|
|
|
1054
|
-
|
|
1055
|
-
* (Optional) The name of the system message participant.
|
|
1056
|
-
*/
|
|
1057
|
-
name?: string;
|
|
822
|
+
role?: 'system';
|
|
1058
823
|
}
|
|
1059
824
|
|
|
1060
825
|
export namespace OpenAISystemMessageParam {
|
|
1061
826
|
/**
|
|
1062
827
|
* Text content part for OpenAI-compatible chat completion messages.
|
|
1063
828
|
*/
|
|
1064
|
-
export interface
|
|
1065
|
-
/**
|
|
1066
|
-
* The text content of the message
|
|
1067
|
-
*/
|
|
829
|
+
export interface ListOpenAIChatCompletionContentPartTextParam {
|
|
1068
830
|
text: string;
|
|
1069
831
|
|
|
1070
|
-
|
|
1071
|
-
* Must be "text" to identify this as text content
|
|
1072
|
-
*/
|
|
1073
|
-
type: 'text';
|
|
832
|
+
type?: 'text';
|
|
1074
833
|
}
|
|
1075
834
|
}
|
|
1076
835
|
|
|
@@ -1078,83 +837,53 @@ export namespace CompletionRetrieveResponse {
|
|
|
1078
837
|
* A message containing the model's (assistant) response in an OpenAI-compatible
|
|
1079
838
|
* chat completion request.
|
|
1080
839
|
*/
|
|
1081
|
-
export interface
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
840
|
+
export interface OpenAIAssistantMessageParamOutput {
|
|
841
|
+
content?:
|
|
842
|
+
| string
|
|
843
|
+
| Array<OpenAIAssistantMessageParamOutput.ListOpenAIChatCompletionContentPartTextParam>
|
|
844
|
+
| null;
|
|
1086
845
|
|
|
1087
|
-
|
|
1088
|
-
* The content of the model's response
|
|
1089
|
-
*/
|
|
1090
|
-
content?: string | Array<OpenAIAssistantMessageParam.UnionMember1>;
|
|
846
|
+
name?: string | null;
|
|
1091
847
|
|
|
1092
|
-
|
|
1093
|
-
* (Optional) The name of the assistant message participant.
|
|
1094
|
-
*/
|
|
1095
|
-
name?: string;
|
|
848
|
+
role?: 'assistant';
|
|
1096
849
|
|
|
1097
|
-
|
|
1098
|
-
* List of tool calls. Each tool call is an OpenAIChatCompletionToolCall object.
|
|
1099
|
-
*/
|
|
1100
|
-
tool_calls?: Array<OpenAIAssistantMessageParam.ToolCall>;
|
|
850
|
+
tool_calls?: Array<OpenAIAssistantMessageParamOutput.ToolCall> | null;
|
|
1101
851
|
}
|
|
1102
852
|
|
|
1103
|
-
export namespace
|
|
853
|
+
export namespace OpenAIAssistantMessageParamOutput {
|
|
1104
854
|
/**
|
|
1105
855
|
* Text content part for OpenAI-compatible chat completion messages.
|
|
1106
856
|
*/
|
|
1107
|
-
export interface
|
|
1108
|
-
/**
|
|
1109
|
-
* The text content of the message
|
|
1110
|
-
*/
|
|
857
|
+
export interface ListOpenAIChatCompletionContentPartTextParam {
|
|
1111
858
|
text: string;
|
|
1112
859
|
|
|
1113
|
-
|
|
1114
|
-
* Must be "text" to identify this as text content
|
|
1115
|
-
*/
|
|
1116
|
-
type: 'text';
|
|
860
|
+
type?: 'text';
|
|
1117
861
|
}
|
|
1118
862
|
|
|
1119
863
|
/**
|
|
1120
864
|
* Tool call specification for OpenAI-compatible chat completion responses.
|
|
1121
865
|
*/
|
|
1122
866
|
export interface ToolCall {
|
|
1123
|
-
|
|
1124
|
-
* Must be "function" to identify this as a function call
|
|
1125
|
-
*/
|
|
1126
|
-
type: 'function';
|
|
867
|
+
id?: string | null;
|
|
1127
868
|
|
|
1128
869
|
/**
|
|
1129
|
-
*
|
|
870
|
+
* Function call details for OpenAI-compatible tool calls.
|
|
1130
871
|
*/
|
|
1131
|
-
|
|
872
|
+
function?: ToolCall.Function | null;
|
|
1132
873
|
|
|
1133
|
-
|
|
1134
|
-
* (Optional) Function call details
|
|
1135
|
-
*/
|
|
1136
|
-
function?: ToolCall.Function;
|
|
874
|
+
index?: number | null;
|
|
1137
875
|
|
|
1138
|
-
|
|
1139
|
-
* (Optional) Index of the tool call in the list
|
|
1140
|
-
*/
|
|
1141
|
-
index?: number;
|
|
876
|
+
type?: 'function';
|
|
1142
877
|
}
|
|
1143
878
|
|
|
1144
879
|
export namespace ToolCall {
|
|
1145
880
|
/**
|
|
1146
|
-
*
|
|
881
|
+
* Function call details for OpenAI-compatible tool calls.
|
|
1147
882
|
*/
|
|
1148
883
|
export interface Function {
|
|
1149
|
-
|
|
1150
|
-
* (Optional) Arguments to pass to the function as a JSON string
|
|
1151
|
-
*/
|
|
1152
|
-
arguments?: string;
|
|
884
|
+
arguments?: string | null;
|
|
1153
885
|
|
|
1154
|
-
|
|
1155
|
-
* (Optional) Name of the function to call
|
|
1156
|
-
*/
|
|
1157
|
-
name?: string;
|
|
886
|
+
name?: string | null;
|
|
1158
887
|
}
|
|
1159
888
|
}
|
|
1160
889
|
}
|
|
@@ -1164,36 +893,21 @@ export namespace CompletionRetrieveResponse {
|
|
|
1164
893
|
* chat completion request.
|
|
1165
894
|
*/
|
|
1166
895
|
export interface OpenAIToolMessageParam {
|
|
1167
|
-
|
|
1168
|
-
* The response content from the tool
|
|
1169
|
-
*/
|
|
1170
|
-
content: string | Array<OpenAIToolMessageParam.UnionMember1>;
|
|
896
|
+
content: string | Array<OpenAIToolMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
|
|
1171
897
|
|
|
1172
|
-
/**
|
|
1173
|
-
* Must be "tool" to identify this as a tool response
|
|
1174
|
-
*/
|
|
1175
|
-
role: 'tool';
|
|
1176
|
-
|
|
1177
|
-
/**
|
|
1178
|
-
* Unique identifier for the tool call this response is for
|
|
1179
|
-
*/
|
|
1180
898
|
tool_call_id: string;
|
|
899
|
+
|
|
900
|
+
role?: 'tool';
|
|
1181
901
|
}
|
|
1182
902
|
|
|
1183
903
|
export namespace OpenAIToolMessageParam {
|
|
1184
904
|
/**
|
|
1185
905
|
* Text content part for OpenAI-compatible chat completion messages.
|
|
1186
906
|
*/
|
|
1187
|
-
export interface
|
|
1188
|
-
/**
|
|
1189
|
-
* The text content of the message
|
|
1190
|
-
*/
|
|
907
|
+
export interface ListOpenAIChatCompletionContentPartTextParam {
|
|
1191
908
|
text: string;
|
|
1192
909
|
|
|
1193
|
-
|
|
1194
|
-
* Must be "text" to identify this as text content
|
|
1195
|
-
*/
|
|
1196
|
-
type: 'text';
|
|
910
|
+
type?: 'text';
|
|
1197
911
|
}
|
|
1198
912
|
}
|
|
1199
913
|
|
|
@@ -1201,758 +915,624 @@ export namespace CompletionRetrieveResponse {
|
|
|
1201
915
|
* A message from the developer in an OpenAI-compatible chat completion request.
|
|
1202
916
|
*/
|
|
1203
917
|
export interface OpenAIDeveloperMessageParam {
|
|
1204
|
-
|
|
1205
|
-
* The content of the developer message
|
|
1206
|
-
*/
|
|
1207
|
-
content: string | Array<OpenAIDeveloperMessageParam.UnionMember1>;
|
|
918
|
+
content: string | Array<OpenAIDeveloperMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
|
|
1208
919
|
|
|
1209
|
-
|
|
1210
|
-
* Must be "developer" to identify this as a developer message
|
|
1211
|
-
*/
|
|
1212
|
-
role: 'developer';
|
|
920
|
+
name?: string | null;
|
|
1213
921
|
|
|
1214
|
-
|
|
1215
|
-
* (Optional) The name of the developer message participant.
|
|
1216
|
-
*/
|
|
1217
|
-
name?: string;
|
|
922
|
+
role?: 'developer';
|
|
1218
923
|
}
|
|
1219
924
|
|
|
1220
925
|
export namespace OpenAIDeveloperMessageParam {
|
|
1221
926
|
/**
|
|
1222
927
|
* Text content part for OpenAI-compatible chat completion messages.
|
|
1223
928
|
*/
|
|
1224
|
-
export interface
|
|
1225
|
-
/**
|
|
1226
|
-
* The text content of the message
|
|
1227
|
-
*/
|
|
929
|
+
export interface ListOpenAIChatCompletionContentPartTextParam {
|
|
1228
930
|
text: string;
|
|
1229
931
|
|
|
1230
|
-
|
|
1231
|
-
* Must be "text" to identify this as text content
|
|
1232
|
-
*/
|
|
1233
|
-
type: 'text';
|
|
932
|
+
type?: 'text';
|
|
1234
933
|
}
|
|
1235
934
|
}
|
|
1236
|
-
}
|
|
1237
935
|
|
|
1238
|
-
export interface CompletionListResponse {
|
|
1239
936
|
/**
|
|
1240
|
-
*
|
|
937
|
+
* Usage information for OpenAI chat completion.
|
|
1241
938
|
*/
|
|
1242
|
-
|
|
939
|
+
export interface Usage {
|
|
940
|
+
completion_tokens: number;
|
|
1243
941
|
|
|
1244
|
-
|
|
1245
|
-
* List of choices
|
|
1246
|
-
*/
|
|
1247
|
-
choices: Array<CompletionListResponse.Choice>;
|
|
942
|
+
prompt_tokens: number;
|
|
1248
943
|
|
|
1249
|
-
|
|
1250
|
-
* The Unix timestamp in seconds when the chat completion was created
|
|
1251
|
-
*/
|
|
1252
|
-
created: number;
|
|
944
|
+
total_tokens: number;
|
|
1253
945
|
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
|
1258
|
-
| CompletionListResponse.OpenAIToolMessageParam
|
|
1259
|
-
| CompletionListResponse.OpenAIDeveloperMessageParam
|
|
1260
|
-
>;
|
|
1261
|
-
|
|
1262
|
-
/**
|
|
1263
|
-
* The model that was used to generate the chat completion
|
|
1264
|
-
*/
|
|
1265
|
-
model: string;
|
|
1266
|
-
|
|
1267
|
-
/**
|
|
1268
|
-
* The object type, which will be "chat.completion"
|
|
1269
|
-
*/
|
|
1270
|
-
object: 'chat.completion';
|
|
1271
|
-
}
|
|
946
|
+
/**
|
|
947
|
+
* Token details for output tokens in OpenAI chat completion usage.
|
|
948
|
+
*/
|
|
949
|
+
completion_tokens_details?: Usage.CompletionTokensDetails | null;
|
|
1272
950
|
|
|
1273
|
-
export namespace CompletionListResponse {
|
|
1274
|
-
/**
|
|
1275
|
-
* A choice from an OpenAI-compatible chat completion response.
|
|
1276
|
-
*/
|
|
1277
|
-
export interface Choice {
|
|
1278
951
|
/**
|
|
1279
|
-
*
|
|
952
|
+
* Token details for prompt tokens in OpenAI chat completion usage.
|
|
1280
953
|
*/
|
|
1281
|
-
|
|
954
|
+
prompt_tokens_details?: Usage.PromptTokensDetails | null;
|
|
955
|
+
}
|
|
1282
956
|
|
|
957
|
+
export namespace Usage {
|
|
1283
958
|
/**
|
|
1284
|
-
*
|
|
959
|
+
* Token details for output tokens in OpenAI chat completion usage.
|
|
1285
960
|
*/
|
|
1286
|
-
|
|
961
|
+
export interface CompletionTokensDetails {
|
|
962
|
+
reasoning_tokens?: number | null;
|
|
963
|
+
}
|
|
1287
964
|
|
|
1288
965
|
/**
|
|
1289
|
-
*
|
|
966
|
+
* Token details for prompt tokens in OpenAI chat completion usage.
|
|
1290
967
|
*/
|
|
1291
|
-
|
|
1292
|
-
|
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
968
|
+
export interface PromptTokensDetails {
|
|
969
|
+
cached_tokens?: number | null;
|
|
970
|
+
}
|
|
971
|
+
}
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
/**
|
|
975
|
+
* Response from listing OpenAI-compatible chat completions.
|
|
976
|
+
*/
|
|
977
|
+
export interface CompletionListResponse {
|
|
978
|
+
data: Array<CompletionListResponse.Data>;
|
|
979
|
+
|
|
980
|
+
first_id: string;
|
|
981
|
+
|
|
982
|
+
has_more: boolean;
|
|
983
|
+
|
|
984
|
+
last_id: string;
|
|
985
|
+
|
|
986
|
+
object?: 'list';
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
export namespace CompletionListResponse {
|
|
990
|
+
export interface Data {
|
|
991
|
+
id: string;
|
|
992
|
+
|
|
993
|
+
choices: Array<Data.Choice>;
|
|
994
|
+
|
|
995
|
+
created: number;
|
|
996
|
+
|
|
997
|
+
input_messages: Array<
|
|
998
|
+
| Data.OpenAIUserMessageParamOutput
|
|
999
|
+
| Data.OpenAISystemMessageParam
|
|
1000
|
+
| Data.OpenAIAssistantMessageParamOutput
|
|
1001
|
+
| Data.OpenAIToolMessageParam
|
|
1002
|
+
| Data.OpenAIDeveloperMessageParam
|
|
1003
|
+
>;
|
|
1004
|
+
|
|
1005
|
+
model: string;
|
|
1006
|
+
|
|
1007
|
+
object?: 'chat.completion';
|
|
1297
1008
|
|
|
1298
1009
|
/**
|
|
1299
|
-
*
|
|
1010
|
+
* Usage information for OpenAI chat completion.
|
|
1300
1011
|
*/
|
|
1301
|
-
|
|
1012
|
+
usage?: Data.Usage | null;
|
|
1302
1013
|
}
|
|
1303
1014
|
|
|
1304
|
-
export namespace
|
|
1015
|
+
export namespace Data {
|
|
1305
1016
|
/**
|
|
1306
|
-
* A
|
|
1017
|
+
* A choice from an OpenAI-compatible chat completion response.
|
|
1307
1018
|
*/
|
|
1308
|
-
export interface
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
content:
|
|
1313
|
-
| string
|
|
1314
|
-
| Array<
|
|
1315
|
-
| OpenAIUserMessageParam.OpenAIChatCompletionContentPartTextParam
|
|
1316
|
-
| OpenAIUserMessageParam.OpenAIChatCompletionContentPartImageParam
|
|
1317
|
-
| OpenAIUserMessageParam.OpenAIFile
|
|
1318
|
-
>;
|
|
1019
|
+
export interface Choice {
|
|
1020
|
+
finish_reason: string;
|
|
1021
|
+
|
|
1022
|
+
index: number;
|
|
1319
1023
|
|
|
1320
1024
|
/**
|
|
1321
|
-
*
|
|
1025
|
+
* A message from the user in an OpenAI-compatible chat completion request.
|
|
1322
1026
|
*/
|
|
1323
|
-
|
|
1027
|
+
message:
|
|
1028
|
+
| Choice.OpenAIUserMessageParamOutput
|
|
1029
|
+
| Choice.OpenAISystemMessageParam
|
|
1030
|
+
| Choice.OpenAIAssistantMessageParamOutput
|
|
1031
|
+
| Choice.OpenAIToolMessageParam
|
|
1032
|
+
| Choice.OpenAIDeveloperMessageParam;
|
|
1324
1033
|
|
|
1325
1034
|
/**
|
|
1326
|
-
*
|
|
1035
|
+
* The log probabilities for the tokens in the message from an OpenAI-compatible
|
|
1036
|
+
* chat completion response.
|
|
1327
1037
|
*/
|
|
1328
|
-
|
|
1038
|
+
logprobs?: Choice.Logprobs | null;
|
|
1329
1039
|
}
|
|
1330
1040
|
|
|
1331
|
-
export namespace
|
|
1041
|
+
export namespace Choice {
|
|
1332
1042
|
/**
|
|
1333
|
-
*
|
|
1043
|
+
* A message from the user in an OpenAI-compatible chat completion request.
|
|
1334
1044
|
*/
|
|
1335
|
-
export interface
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1045
|
+
export interface OpenAIUserMessageParamOutput {
|
|
1046
|
+
content:
|
|
1047
|
+
| string
|
|
1048
|
+
| Array<
|
|
1049
|
+
| OpenAIUserMessageParamOutput.OpenAIChatCompletionContentPartTextParam
|
|
1050
|
+
| OpenAIUserMessageParamOutput.OpenAIChatCompletionContentPartImageParam
|
|
1051
|
+
| OpenAIUserMessageParamOutput.OpenAIFile
|
|
1052
|
+
>;
|
|
1340
1053
|
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
type: 'text';
|
|
1054
|
+
name?: string | null;
|
|
1055
|
+
|
|
1056
|
+
role?: 'user';
|
|
1345
1057
|
}
|
|
1346
1058
|
|
|
1347
|
-
|
|
1348
|
-
* Image content part for OpenAI-compatible chat completion messages.
|
|
1349
|
-
*/
|
|
1350
|
-
export interface OpenAIChatCompletionContentPartImageParam {
|
|
1059
|
+
export namespace OpenAIUserMessageParamOutput {
|
|
1351
1060
|
/**
|
|
1352
|
-
*
|
|
1061
|
+
* Text content part for OpenAI-compatible chat completion messages.
|
|
1353
1062
|
*/
|
|
1354
|
-
|
|
1063
|
+
export interface OpenAIChatCompletionContentPartTextParam {
|
|
1064
|
+
text: string;
|
|
1355
1065
|
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
*/
|
|
1359
|
-
type: 'image_url';
|
|
1360
|
-
}
|
|
1066
|
+
type?: 'text';
|
|
1067
|
+
}
|
|
1361
1068
|
|
|
1362
|
-
export namespace OpenAIChatCompletionContentPartImageParam {
|
|
1363
1069
|
/**
|
|
1364
|
-
* Image
|
|
1070
|
+
* Image content part for OpenAI-compatible chat completion messages.
|
|
1365
1071
|
*/
|
|
1366
|
-
export interface
|
|
1072
|
+
export interface OpenAIChatCompletionContentPartImageParam {
|
|
1367
1073
|
/**
|
|
1368
|
-
* URL
|
|
1074
|
+
* Image URL specification for OpenAI-compatible chat completion messages.
|
|
1369
1075
|
*/
|
|
1370
|
-
|
|
1076
|
+
image_url: OpenAIChatCompletionContentPartImageParam.ImageURL;
|
|
1077
|
+
|
|
1078
|
+
type?: 'image_url';
|
|
1079
|
+
}
|
|
1371
1080
|
|
|
1081
|
+
export namespace OpenAIChatCompletionContentPartImageParam {
|
|
1372
1082
|
/**
|
|
1373
|
-
*
|
|
1083
|
+
* Image URL specification for OpenAI-compatible chat completion messages.
|
|
1374
1084
|
*/
|
|
1375
|
-
|
|
1085
|
+
export interface ImageURL {
|
|
1086
|
+
url: string;
|
|
1087
|
+
|
|
1088
|
+
detail?: string | null;
|
|
1089
|
+
}
|
|
1376
1090
|
}
|
|
1377
|
-
}
|
|
1378
1091
|
|
|
1379
|
-
|
|
1380
|
-
|
|
1092
|
+
export interface OpenAIFile {
|
|
1093
|
+
file: OpenAIFile.File;
|
|
1381
1094
|
|
|
1382
|
-
|
|
1383
|
-
|
|
1095
|
+
type?: 'file';
|
|
1096
|
+
}
|
|
1384
1097
|
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1098
|
+
export namespace OpenAIFile {
|
|
1099
|
+
export interface File {
|
|
1100
|
+
file_data?: string | null;
|
|
1388
1101
|
|
|
1389
|
-
|
|
1102
|
+
file_id?: string | null;
|
|
1390
1103
|
|
|
1391
|
-
|
|
1104
|
+
filename?: string | null;
|
|
1105
|
+
}
|
|
1392
1106
|
}
|
|
1393
1107
|
}
|
|
1394
|
-
}
|
|
1395
1108
|
|
|
1396
|
-
/**
|
|
1397
|
-
* A system message providing instructions or context to the model.
|
|
1398
|
-
*/
|
|
1399
|
-
export interface OpenAISystemMessageParam {
|
|
1400
1109
|
/**
|
|
1401
|
-
*
|
|
1402
|
-
* they are concatenated. The underlying Llama Stack code may also add other system
|
|
1403
|
-
* messages (for example, for formatting tool definitions).
|
|
1110
|
+
* A system message providing instructions or context to the model.
|
|
1404
1111
|
*/
|
|
1405
|
-
|
|
1112
|
+
export interface OpenAISystemMessageParam {
|
|
1113
|
+
content: string | Array<OpenAISystemMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
|
|
1406
1114
|
|
|
1407
|
-
|
|
1408
|
-
* Must be "system" to identify this as a system message
|
|
1409
|
-
*/
|
|
1410
|
-
role: 'system';
|
|
1115
|
+
name?: string | null;
|
|
1411
1116
|
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
*/
|
|
1415
|
-
name?: string;
|
|
1416
|
-
}
|
|
1117
|
+
role?: 'system';
|
|
1118
|
+
}
|
|
1417
1119
|
|
|
1418
|
-
|
|
1419
|
-
/**
|
|
1420
|
-
* Text content part for OpenAI-compatible chat completion messages.
|
|
1421
|
-
*/
|
|
1422
|
-
export interface UnionMember1 {
|
|
1120
|
+
export namespace OpenAISystemMessageParam {
|
|
1423
1121
|
/**
|
|
1424
|
-
*
|
|
1122
|
+
* Text content part for OpenAI-compatible chat completion messages.
|
|
1425
1123
|
*/
|
|
1426
|
-
|
|
1124
|
+
export interface ListOpenAIChatCompletionContentPartTextParam {
|
|
1125
|
+
text: string;
|
|
1427
1126
|
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
*/
|
|
1431
|
-
type: 'text';
|
|
1127
|
+
type?: 'text';
|
|
1128
|
+
}
|
|
1432
1129
|
}
|
|
1433
|
-
}
|
|
1434
|
-
|
|
1435
|
-
/**
|
|
1436
|
-
* A message containing the model's (assistant) response in an OpenAI-compatible
|
|
1437
|
-
* chat completion request.
|
|
1438
|
-
*/
|
|
1439
|
-
export interface OpenAIAssistantMessageParam {
|
|
1440
|
-
/**
|
|
1441
|
-
* Must be "assistant" to identify this as the model's response
|
|
1442
|
-
*/
|
|
1443
|
-
role: 'assistant';
|
|
1444
1130
|
|
|
1445
1131
|
/**
|
|
1446
|
-
*
|
|
1132
|
+
* A message containing the model's (assistant) response in an OpenAI-compatible
|
|
1133
|
+
* chat completion request.
|
|
1447
1134
|
*/
|
|
1448
|
-
|
|
1135
|
+
export interface OpenAIAssistantMessageParamOutput {
|
|
1136
|
+
content?:
|
|
1137
|
+
| string
|
|
1138
|
+
| Array<OpenAIAssistantMessageParamOutput.ListOpenAIChatCompletionContentPartTextParam>
|
|
1139
|
+
| null;
|
|
1449
1140
|
|
|
1450
|
-
|
|
1451
|
-
* (Optional) The name of the assistant message participant.
|
|
1452
|
-
*/
|
|
1453
|
-
name?: string;
|
|
1141
|
+
name?: string | null;
|
|
1454
1142
|
|
|
1455
|
-
|
|
1456
|
-
* List of tool calls. Each tool call is an OpenAIChatCompletionToolCall object.
|
|
1457
|
-
*/
|
|
1458
|
-
tool_calls?: Array<OpenAIAssistantMessageParam.ToolCall>;
|
|
1459
|
-
}
|
|
1143
|
+
role?: 'assistant';
|
|
1460
1144
|
|
|
1461
|
-
|
|
1462
|
-
/**
|
|
1463
|
-
* Text content part for OpenAI-compatible chat completion messages.
|
|
1464
|
-
*/
|
|
1465
|
-
export interface UnionMember1 {
|
|
1466
|
-
/**
|
|
1467
|
-
* The text content of the message
|
|
1468
|
-
*/
|
|
1469
|
-
text: string;
|
|
1470
|
-
|
|
1471
|
-
/**
|
|
1472
|
-
* Must be "text" to identify this as text content
|
|
1473
|
-
*/
|
|
1474
|
-
type: 'text';
|
|
1145
|
+
tool_calls?: Array<OpenAIAssistantMessageParamOutput.ToolCall> | null;
|
|
1475
1146
|
}
|
|
1476
1147
|
|
|
1477
|
-
|
|
1478
|
-
* Tool call specification for OpenAI-compatible chat completion responses.
|
|
1479
|
-
*/
|
|
1480
|
-
export interface ToolCall {
|
|
1481
|
-
/**
|
|
1482
|
-
* Must be "function" to identify this as a function call
|
|
1483
|
-
*/
|
|
1484
|
-
type: 'function';
|
|
1485
|
-
|
|
1148
|
+
export namespace OpenAIAssistantMessageParamOutput {
|
|
1486
1149
|
/**
|
|
1487
|
-
*
|
|
1150
|
+
* Text content part for OpenAI-compatible chat completion messages.
|
|
1488
1151
|
*/
|
|
1489
|
-
|
|
1152
|
+
export interface ListOpenAIChatCompletionContentPartTextParam {
|
|
1153
|
+
text: string;
|
|
1490
1154
|
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
*/
|
|
1494
|
-
function?: ToolCall.Function;
|
|
1155
|
+
type?: 'text';
|
|
1156
|
+
}
|
|
1495
1157
|
|
|
1496
1158
|
/**
|
|
1497
|
-
*
|
|
1159
|
+
* Tool call specification for OpenAI-compatible chat completion responses.
|
|
1498
1160
|
*/
|
|
1499
|
-
|
|
1500
|
-
|
|
1161
|
+
export interface ToolCall {
|
|
1162
|
+
id?: string | null;
|
|
1501
1163
|
|
|
1502
|
-
export namespace ToolCall {
|
|
1503
|
-
/**
|
|
1504
|
-
* (Optional) Function call details
|
|
1505
|
-
*/
|
|
1506
|
-
export interface Function {
|
|
1507
1164
|
/**
|
|
1508
|
-
*
|
|
1165
|
+
* Function call details for OpenAI-compatible tool calls.
|
|
1509
1166
|
*/
|
|
1510
|
-
|
|
1167
|
+
function?: ToolCall.Function | null;
|
|
1168
|
+
|
|
1169
|
+
index?: number | null;
|
|
1170
|
+
|
|
1171
|
+
type?: 'function';
|
|
1172
|
+
}
|
|
1511
1173
|
|
|
1174
|
+
export namespace ToolCall {
|
|
1512
1175
|
/**
|
|
1513
|
-
*
|
|
1176
|
+
* Function call details for OpenAI-compatible tool calls.
|
|
1514
1177
|
*/
|
|
1515
|
-
|
|
1178
|
+
export interface Function {
|
|
1179
|
+
arguments?: string | null;
|
|
1180
|
+
|
|
1181
|
+
name?: string | null;
|
|
1182
|
+
}
|
|
1516
1183
|
}
|
|
1517
1184
|
}
|
|
1518
|
-
}
|
|
1519
1185
|
|
|
1520
|
-
/**
|
|
1521
|
-
* A message representing the result of a tool invocation in an OpenAI-compatible
|
|
1522
|
-
* chat completion request.
|
|
1523
|
-
*/
|
|
1524
|
-
export interface OpenAIToolMessageParam {
|
|
1525
1186
|
/**
|
|
1526
|
-
*
|
|
1187
|
+
* A message representing the result of a tool invocation in an OpenAI-compatible
|
|
1188
|
+
* chat completion request.
|
|
1527
1189
|
*/
|
|
1528
|
-
|
|
1190
|
+
export interface OpenAIToolMessageParam {
|
|
1191
|
+
content: string | Array<OpenAIToolMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
|
|
1529
1192
|
|
|
1530
|
-
|
|
1531
|
-
* Must be "tool" to identify this as a tool response
|
|
1532
|
-
*/
|
|
1533
|
-
role: 'tool';
|
|
1193
|
+
tool_call_id: string;
|
|
1534
1194
|
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
*/
|
|
1538
|
-
tool_call_id: string;
|
|
1539
|
-
}
|
|
1195
|
+
role?: 'tool';
|
|
1196
|
+
}
|
|
1540
1197
|
|
|
1541
|
-
|
|
1542
|
-
/**
|
|
1543
|
-
* Text content part for OpenAI-compatible chat completion messages.
|
|
1544
|
-
*/
|
|
1545
|
-
export interface UnionMember1 {
|
|
1198
|
+
export namespace OpenAIToolMessageParam {
|
|
1546
1199
|
/**
|
|
1547
|
-
*
|
|
1200
|
+
* Text content part for OpenAI-compatible chat completion messages.
|
|
1548
1201
|
*/
|
|
1549
|
-
|
|
1202
|
+
export interface ListOpenAIChatCompletionContentPartTextParam {
|
|
1203
|
+
text: string;
|
|
1550
1204
|
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
*/
|
|
1554
|
-
type: 'text';
|
|
1205
|
+
type?: 'text';
|
|
1206
|
+
}
|
|
1555
1207
|
}
|
|
1556
|
-
}
|
|
1557
1208
|
|
|
1558
|
-
/**
|
|
1559
|
-
* A message from the developer in an OpenAI-compatible chat completion request.
|
|
1560
|
-
*/
|
|
1561
|
-
export interface OpenAIDeveloperMessageParam {
|
|
1562
1209
|
/**
|
|
1563
|
-
*
|
|
1210
|
+
* A message from the developer in an OpenAI-compatible chat completion request.
|
|
1564
1211
|
*/
|
|
1565
|
-
|
|
1212
|
+
export interface OpenAIDeveloperMessageParam {
|
|
1213
|
+
content: string | Array<OpenAIDeveloperMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
|
|
1566
1214
|
|
|
1567
|
-
|
|
1568
|
-
* Must be "developer" to identify this as a developer message
|
|
1569
|
-
*/
|
|
1570
|
-
role: 'developer';
|
|
1215
|
+
name?: string | null;
|
|
1571
1216
|
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
*/
|
|
1575
|
-
name?: string;
|
|
1576
|
-
}
|
|
1217
|
+
role?: 'developer';
|
|
1218
|
+
}
|
|
1577
1219
|
|
|
1578
|
-
|
|
1579
|
-
/**
|
|
1580
|
-
* Text content part for OpenAI-compatible chat completion messages.
|
|
1581
|
-
*/
|
|
1582
|
-
export interface UnionMember1 {
|
|
1220
|
+
export namespace OpenAIDeveloperMessageParam {
|
|
1583
1221
|
/**
|
|
1584
|
-
*
|
|
1222
|
+
* Text content part for OpenAI-compatible chat completion messages.
|
|
1585
1223
|
*/
|
|
1586
|
-
|
|
1224
|
+
export interface ListOpenAIChatCompletionContentPartTextParam {
|
|
1225
|
+
text: string;
|
|
1587
1226
|
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
*/
|
|
1591
|
-
type: 'text';
|
|
1227
|
+
type?: 'text';
|
|
1228
|
+
}
|
|
1592
1229
|
}
|
|
1593
|
-
}
|
|
1594
|
-
|
|
1595
|
-
/**
|
|
1596
|
-
* (Optional) The log probabilities for the tokens in the message
|
|
1597
|
-
*/
|
|
1598
|
-
export interface Logprobs {
|
|
1599
|
-
/**
|
|
1600
|
-
* (Optional) The log probabilities for the tokens in the message
|
|
1601
|
-
*/
|
|
1602
|
-
content?: Array<Logprobs.Content>;
|
|
1603
|
-
|
|
1604
|
-
/**
|
|
1605
|
-
* (Optional) The log probabilities for the tokens in the message
|
|
1606
|
-
*/
|
|
1607
|
-
refusal?: Array<Logprobs.Refusal>;
|
|
1608
|
-
}
|
|
1609
1230
|
|
|
1610
|
-
export namespace Logprobs {
|
|
1611
1231
|
/**
|
|
1612
|
-
* The log
|
|
1613
|
-
* response.
|
|
1232
|
+
* The log probabilities for the tokens in the message from an OpenAI-compatible
|
|
1233
|
+
* chat completion response.
|
|
1614
1234
|
*/
|
|
1615
|
-
export interface
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
logprob: number;
|
|
1619
|
-
|
|
1620
|
-
top_logprobs: Array<Content.TopLogprob>;
|
|
1235
|
+
export interface Logprobs {
|
|
1236
|
+
content?: Array<Logprobs.Content> | null;
|
|
1621
1237
|
|
|
1622
|
-
|
|
1238
|
+
refusal?: Array<Logprobs.Refusal> | null;
|
|
1623
1239
|
}
|
|
1624
1240
|
|
|
1625
|
-
export namespace
|
|
1241
|
+
export namespace Logprobs {
|
|
1626
1242
|
/**
|
|
1627
|
-
* The
|
|
1243
|
+
* The log probability for a token from an OpenAI-compatible chat completion
|
|
1628
1244
|
* response.
|
|
1245
|
+
*
|
|
1246
|
+
* :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
|
|
1247
|
+
* probability of the token :top_logprobs: The top log probabilities for the token
|
|
1629
1248
|
*/
|
|
1630
|
-
export interface
|
|
1249
|
+
export interface Content {
|
|
1631
1250
|
token: string;
|
|
1632
1251
|
|
|
1633
1252
|
logprob: number;
|
|
1634
1253
|
|
|
1635
|
-
|
|
1636
|
-
}
|
|
1637
|
-
}
|
|
1254
|
+
top_logprobs: Array<Content.TopLogprob>;
|
|
1638
1255
|
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
* response.
|
|
1642
|
-
*/
|
|
1643
|
-
export interface Refusal {
|
|
1644
|
-
token: string;
|
|
1256
|
+
bytes?: Array<number> | null;
|
|
1257
|
+
}
|
|
1645
1258
|
|
|
1646
|
-
|
|
1259
|
+
export namespace Content {
|
|
1260
|
+
/**
|
|
1261
|
+
* The top log probability for a token from an OpenAI-compatible chat completion
|
|
1262
|
+
* response.
|
|
1263
|
+
*
|
|
1264
|
+
* :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
|
|
1265
|
+
* probability of the token
|
|
1266
|
+
*/
|
|
1267
|
+
export interface TopLogprob {
|
|
1268
|
+
token: string;
|
|
1647
1269
|
|
|
1648
|
-
|
|
1270
|
+
logprob: number;
|
|
1649
1271
|
|
|
1650
|
-
|
|
1651
|
-
|
|
1272
|
+
bytes?: Array<number> | null;
|
|
1273
|
+
}
|
|
1274
|
+
}
|
|
1652
1275
|
|
|
1653
|
-
export namespace Refusal {
|
|
1654
1276
|
/**
|
|
1655
|
-
* The
|
|
1277
|
+
* The log probability for a token from an OpenAI-compatible chat completion
|
|
1656
1278
|
* response.
|
|
1279
|
+
*
|
|
1280
|
+
* :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
|
|
1281
|
+
* probability of the token :top_logprobs: The top log probabilities for the token
|
|
1657
1282
|
*/
|
|
1658
|
-
export interface
|
|
1283
|
+
export interface Refusal {
|
|
1659
1284
|
token: string;
|
|
1660
1285
|
|
|
1661
1286
|
logprob: number;
|
|
1662
1287
|
|
|
1663
|
-
|
|
1288
|
+
top_logprobs: Array<Refusal.TopLogprob>;
|
|
1289
|
+
|
|
1290
|
+
bytes?: Array<number> | null;
|
|
1664
1291
|
}
|
|
1665
|
-
}
|
|
1666
|
-
}
|
|
1667
|
-
}
|
|
1668
1292
|
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
| OpenAIUserMessageParam.OpenAIChatCompletionContentPartTextParam
|
|
1680
|
-
| OpenAIUserMessageParam.OpenAIChatCompletionContentPartImageParam
|
|
1681
|
-
| OpenAIUserMessageParam.OpenAIFile
|
|
1682
|
-
>;
|
|
1293
|
+
export namespace Refusal {
|
|
1294
|
+
/**
|
|
1295
|
+
* The top log probability for a token from an OpenAI-compatible chat completion
|
|
1296
|
+
* response.
|
|
1297
|
+
*
|
|
1298
|
+
* :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
|
|
1299
|
+
* probability of the token
|
|
1300
|
+
*/
|
|
1301
|
+
export interface TopLogprob {
|
|
1302
|
+
token: string;
|
|
1683
1303
|
|
|
1684
|
-
|
|
1685
|
-
* Must be "user" to identify this as a user message
|
|
1686
|
-
*/
|
|
1687
|
-
role: 'user';
|
|
1304
|
+
logprob: number;
|
|
1688
1305
|
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1306
|
+
bytes?: Array<number> | null;
|
|
1307
|
+
}
|
|
1308
|
+
}
|
|
1309
|
+
}
|
|
1310
|
+
}
|
|
1694
1311
|
|
|
1695
|
-
export namespace OpenAIUserMessageParam {
|
|
1696
1312
|
/**
|
|
1697
|
-
*
|
|
1313
|
+
* A message from the user in an OpenAI-compatible chat completion request.
|
|
1698
1314
|
*/
|
|
1699
|
-
export interface
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1315
|
+
export interface OpenAIUserMessageParamOutput {
|
|
1316
|
+
content:
|
|
1317
|
+
| string
|
|
1318
|
+
| Array<
|
|
1319
|
+
| OpenAIUserMessageParamOutput.OpenAIChatCompletionContentPartTextParam
|
|
1320
|
+
| OpenAIUserMessageParamOutput.OpenAIChatCompletionContentPartImageParam
|
|
1321
|
+
| OpenAIUserMessageParamOutput.OpenAIFile
|
|
1322
|
+
>;
|
|
1704
1323
|
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
type: 'text';
|
|
1324
|
+
name?: string | null;
|
|
1325
|
+
|
|
1326
|
+
role?: 'user';
|
|
1709
1327
|
}
|
|
1710
1328
|
|
|
1711
|
-
|
|
1712
|
-
* Image content part for OpenAI-compatible chat completion messages.
|
|
1713
|
-
*/
|
|
1714
|
-
export interface OpenAIChatCompletionContentPartImageParam {
|
|
1329
|
+
export namespace OpenAIUserMessageParamOutput {
|
|
1715
1330
|
/**
|
|
1716
|
-
*
|
|
1331
|
+
* Text content part for OpenAI-compatible chat completion messages.
|
|
1717
1332
|
*/
|
|
1718
|
-
|
|
1333
|
+
export interface OpenAIChatCompletionContentPartTextParam {
|
|
1334
|
+
text: string;
|
|
1719
1335
|
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
*/
|
|
1723
|
-
type: 'image_url';
|
|
1724
|
-
}
|
|
1336
|
+
type?: 'text';
|
|
1337
|
+
}
|
|
1725
1338
|
|
|
1726
|
-
export namespace OpenAIChatCompletionContentPartImageParam {
|
|
1727
1339
|
/**
|
|
1728
|
-
* Image
|
|
1340
|
+
* Image content part for OpenAI-compatible chat completion messages.
|
|
1729
1341
|
*/
|
|
1730
|
-
export interface
|
|
1342
|
+
export interface OpenAIChatCompletionContentPartImageParam {
|
|
1731
1343
|
/**
|
|
1732
|
-
* URL
|
|
1344
|
+
* Image URL specification for OpenAI-compatible chat completion messages.
|
|
1733
1345
|
*/
|
|
1734
|
-
|
|
1346
|
+
image_url: OpenAIChatCompletionContentPartImageParam.ImageURL;
|
|
1735
1347
|
|
|
1736
|
-
|
|
1737
|
-
* (Optional) Level of detail for image processing. Can be "low", "high", or "auto"
|
|
1738
|
-
*/
|
|
1739
|
-
detail?: string;
|
|
1348
|
+
type?: 'image_url';
|
|
1740
1349
|
}
|
|
1741
|
-
}
|
|
1742
|
-
|
|
1743
|
-
export interface OpenAIFile {
|
|
1744
|
-
file: OpenAIFile.File;
|
|
1745
|
-
|
|
1746
|
-
type: 'file';
|
|
1747
|
-
}
|
|
1748
1350
|
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1351
|
+
export namespace OpenAIChatCompletionContentPartImageParam {
|
|
1352
|
+
/**
|
|
1353
|
+
* Image URL specification for OpenAI-compatible chat completion messages.
|
|
1354
|
+
*/
|
|
1355
|
+
export interface ImageURL {
|
|
1356
|
+
url: string;
|
|
1754
1357
|
|
|
1755
|
-
|
|
1358
|
+
detail?: string | null;
|
|
1359
|
+
}
|
|
1756
1360
|
}
|
|
1757
|
-
}
|
|
1758
|
-
}
|
|
1759
1361
|
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
*/
|
|
1763
|
-
export interface OpenAISystemMessageParam {
|
|
1764
|
-
/**
|
|
1765
|
-
* The content of the "system prompt". If multiple system messages are provided,
|
|
1766
|
-
* they are concatenated. The underlying Llama Stack code may also add other system
|
|
1767
|
-
* messages (for example, for formatting tool definitions).
|
|
1768
|
-
*/
|
|
1769
|
-
content: string | Array<OpenAISystemMessageParam.UnionMember1>;
|
|
1362
|
+
export interface OpenAIFile {
|
|
1363
|
+
file: OpenAIFile.File;
|
|
1770
1364
|
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
*/
|
|
1774
|
-
role: 'system';
|
|
1365
|
+
type?: 'file';
|
|
1366
|
+
}
|
|
1775
1367
|
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
name?: string;
|
|
1780
|
-
}
|
|
1368
|
+
export namespace OpenAIFile {
|
|
1369
|
+
export interface File {
|
|
1370
|
+
file_data?: string | null;
|
|
1781
1371
|
|
|
1782
|
-
|
|
1783
|
-
/**
|
|
1784
|
-
* Text content part for OpenAI-compatible chat completion messages.
|
|
1785
|
-
*/
|
|
1786
|
-
export interface UnionMember1 {
|
|
1787
|
-
/**
|
|
1788
|
-
* The text content of the message
|
|
1789
|
-
*/
|
|
1790
|
-
text: string;
|
|
1372
|
+
file_id?: string | null;
|
|
1791
1373
|
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
type: 'text';
|
|
1374
|
+
filename?: string | null;
|
|
1375
|
+
}
|
|
1376
|
+
}
|
|
1796
1377
|
}
|
|
1797
|
-
}
|
|
1798
|
-
|
|
1799
|
-
/**
|
|
1800
|
-
* A message containing the model's (assistant) response in an OpenAI-compatible
|
|
1801
|
-
* chat completion request.
|
|
1802
|
-
*/
|
|
1803
|
-
export interface OpenAIAssistantMessageParam {
|
|
1804
|
-
/**
|
|
1805
|
-
* Must be "assistant" to identify this as the model's response
|
|
1806
|
-
*/
|
|
1807
|
-
role: 'assistant';
|
|
1808
1378
|
|
|
1809
1379
|
/**
|
|
1810
|
-
*
|
|
1380
|
+
* A system message providing instructions or context to the model.
|
|
1811
1381
|
*/
|
|
1812
|
-
|
|
1382
|
+
export interface OpenAISystemMessageParam {
|
|
1383
|
+
content: string | Array<OpenAISystemMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
|
|
1813
1384
|
|
|
1814
|
-
|
|
1815
|
-
* (Optional) The name of the assistant message participant.
|
|
1816
|
-
*/
|
|
1817
|
-
name?: string;
|
|
1385
|
+
name?: string | null;
|
|
1818
1386
|
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
*/
|
|
1822
|
-
tool_calls?: Array<OpenAIAssistantMessageParam.ToolCall>;
|
|
1823
|
-
}
|
|
1387
|
+
role?: 'system';
|
|
1388
|
+
}
|
|
1824
1389
|
|
|
1825
|
-
|
|
1826
|
-
/**
|
|
1827
|
-
* Text content part for OpenAI-compatible chat completion messages.
|
|
1828
|
-
*/
|
|
1829
|
-
export interface UnionMember1 {
|
|
1390
|
+
export namespace OpenAISystemMessageParam {
|
|
1830
1391
|
/**
|
|
1831
|
-
*
|
|
1392
|
+
* Text content part for OpenAI-compatible chat completion messages.
|
|
1832
1393
|
*/
|
|
1833
|
-
|
|
1394
|
+
export interface ListOpenAIChatCompletionContentPartTextParam {
|
|
1395
|
+
text: string;
|
|
1834
1396
|
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
*/
|
|
1838
|
-
type: 'text';
|
|
1397
|
+
type?: 'text';
|
|
1398
|
+
}
|
|
1839
1399
|
}
|
|
1840
1400
|
|
|
1841
1401
|
/**
|
|
1842
|
-
*
|
|
1402
|
+
* A message containing the model's (assistant) response in an OpenAI-compatible
|
|
1403
|
+
* chat completion request.
|
|
1843
1404
|
*/
|
|
1844
|
-
export interface
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1405
|
+
export interface OpenAIAssistantMessageParamOutput {
|
|
1406
|
+
content?:
|
|
1407
|
+
| string
|
|
1408
|
+
| Array<OpenAIAssistantMessageParamOutput.ListOpenAIChatCompletionContentPartTextParam>
|
|
1409
|
+
| null;
|
|
1849
1410
|
|
|
1850
|
-
|
|
1851
|
-
* (Optional) Unique identifier for the tool call
|
|
1852
|
-
*/
|
|
1853
|
-
id?: string;
|
|
1411
|
+
name?: string | null;
|
|
1854
1412
|
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1413
|
+
role?: 'assistant';
|
|
1414
|
+
|
|
1415
|
+
tool_calls?: Array<OpenAIAssistantMessageParamOutput.ToolCall> | null;
|
|
1416
|
+
}
|
|
1859
1417
|
|
|
1418
|
+
export namespace OpenAIAssistantMessageParamOutput {
|
|
1860
1419
|
/**
|
|
1861
|
-
*
|
|
1420
|
+
* Text content part for OpenAI-compatible chat completion messages.
|
|
1862
1421
|
*/
|
|
1863
|
-
|
|
1864
|
-
|
|
1422
|
+
export interface ListOpenAIChatCompletionContentPartTextParam {
|
|
1423
|
+
text: string;
|
|
1424
|
+
|
|
1425
|
+
type?: 'text';
|
|
1426
|
+
}
|
|
1865
1427
|
|
|
1866
|
-
export namespace ToolCall {
|
|
1867
1428
|
/**
|
|
1868
|
-
*
|
|
1429
|
+
* Tool call specification for OpenAI-compatible chat completion responses.
|
|
1869
1430
|
*/
|
|
1870
|
-
export interface
|
|
1431
|
+
export interface ToolCall {
|
|
1432
|
+
id?: string | null;
|
|
1433
|
+
|
|
1871
1434
|
/**
|
|
1872
|
-
*
|
|
1435
|
+
* Function call details for OpenAI-compatible tool calls.
|
|
1873
1436
|
*/
|
|
1874
|
-
|
|
1437
|
+
function?: ToolCall.Function | null;
|
|
1438
|
+
|
|
1439
|
+
index?: number | null;
|
|
1440
|
+
|
|
1441
|
+
type?: 'function';
|
|
1442
|
+
}
|
|
1875
1443
|
|
|
1444
|
+
export namespace ToolCall {
|
|
1876
1445
|
/**
|
|
1877
|
-
*
|
|
1446
|
+
* Function call details for OpenAI-compatible tool calls.
|
|
1878
1447
|
*/
|
|
1879
|
-
|
|
1448
|
+
export interface Function {
|
|
1449
|
+
arguments?: string | null;
|
|
1450
|
+
|
|
1451
|
+
name?: string | null;
|
|
1452
|
+
}
|
|
1880
1453
|
}
|
|
1881
1454
|
}
|
|
1882
|
-
}
|
|
1883
1455
|
|
|
1884
|
-
/**
|
|
1885
|
-
* A message representing the result of a tool invocation in an OpenAI-compatible
|
|
1886
|
-
* chat completion request.
|
|
1887
|
-
*/
|
|
1888
|
-
export interface OpenAIToolMessageParam {
|
|
1889
1456
|
/**
|
|
1890
|
-
*
|
|
1457
|
+
* A message representing the result of a tool invocation in an OpenAI-compatible
|
|
1458
|
+
* chat completion request.
|
|
1891
1459
|
*/
|
|
1892
|
-
|
|
1460
|
+
export interface OpenAIToolMessageParam {
|
|
1461
|
+
content: string | Array<OpenAIToolMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
|
|
1893
1462
|
|
|
1894
|
-
|
|
1895
|
-
* Must be "tool" to identify this as a tool response
|
|
1896
|
-
*/
|
|
1897
|
-
role: 'tool';
|
|
1463
|
+
tool_call_id: string;
|
|
1898
1464
|
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
*/
|
|
1902
|
-
tool_call_id: string;
|
|
1903
|
-
}
|
|
1465
|
+
role?: 'tool';
|
|
1466
|
+
}
|
|
1904
1467
|
|
|
1905
|
-
|
|
1906
|
-
/**
|
|
1907
|
-
* Text content part for OpenAI-compatible chat completion messages.
|
|
1908
|
-
*/
|
|
1909
|
-
export interface UnionMember1 {
|
|
1468
|
+
export namespace OpenAIToolMessageParam {
|
|
1910
1469
|
/**
|
|
1911
|
-
*
|
|
1470
|
+
* Text content part for OpenAI-compatible chat completion messages.
|
|
1912
1471
|
*/
|
|
1913
|
-
|
|
1472
|
+
export interface ListOpenAIChatCompletionContentPartTextParam {
|
|
1473
|
+
text: string;
|
|
1914
1474
|
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
*/
|
|
1918
|
-
type: 'text';
|
|
1475
|
+
type?: 'text';
|
|
1476
|
+
}
|
|
1919
1477
|
}
|
|
1920
|
-
}
|
|
1921
1478
|
|
|
1922
|
-
/**
|
|
1923
|
-
* A message from the developer in an OpenAI-compatible chat completion request.
|
|
1924
|
-
*/
|
|
1925
|
-
export interface OpenAIDeveloperMessageParam {
|
|
1926
1479
|
/**
|
|
1927
|
-
*
|
|
1480
|
+
* A message from the developer in an OpenAI-compatible chat completion request.
|
|
1928
1481
|
*/
|
|
1929
|
-
|
|
1482
|
+
export interface OpenAIDeveloperMessageParam {
|
|
1483
|
+
content: string | Array<OpenAIDeveloperMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
|
|
1930
1484
|
|
|
1931
|
-
|
|
1932
|
-
* Must be "developer" to identify this as a developer message
|
|
1933
|
-
*/
|
|
1934
|
-
role: 'developer';
|
|
1485
|
+
name?: string | null;
|
|
1935
1486
|
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1487
|
+
role?: 'developer';
|
|
1488
|
+
}
|
|
1489
|
+
|
|
1490
|
+
export namespace OpenAIDeveloperMessageParam {
|
|
1491
|
+
/**
|
|
1492
|
+
* Text content part for OpenAI-compatible chat completion messages.
|
|
1493
|
+
*/
|
|
1494
|
+
export interface ListOpenAIChatCompletionContentPartTextParam {
|
|
1495
|
+
text: string;
|
|
1496
|
+
|
|
1497
|
+
type?: 'text';
|
|
1498
|
+
}
|
|
1499
|
+
}
|
|
1941
1500
|
|
|
1942
|
-
export namespace OpenAIDeveloperMessageParam {
|
|
1943
1501
|
/**
|
|
1944
|
-
*
|
|
1502
|
+
* Usage information for OpenAI chat completion.
|
|
1945
1503
|
*/
|
|
1946
|
-
export interface
|
|
1504
|
+
export interface Usage {
|
|
1505
|
+
completion_tokens: number;
|
|
1506
|
+
|
|
1507
|
+
prompt_tokens: number;
|
|
1508
|
+
|
|
1509
|
+
total_tokens: number;
|
|
1510
|
+
|
|
1947
1511
|
/**
|
|
1948
|
-
*
|
|
1512
|
+
* Token details for output tokens in OpenAI chat completion usage.
|
|
1949
1513
|
*/
|
|
1950
|
-
|
|
1514
|
+
completion_tokens_details?: Usage.CompletionTokensDetails | null;
|
|
1515
|
+
|
|
1516
|
+
/**
|
|
1517
|
+
* Token details for prompt tokens in OpenAI chat completion usage.
|
|
1518
|
+
*/
|
|
1519
|
+
prompt_tokens_details?: Usage.PromptTokensDetails | null;
|
|
1520
|
+
}
|
|
1521
|
+
|
|
1522
|
+
export namespace Usage {
|
|
1523
|
+
/**
|
|
1524
|
+
* Token details for output tokens in OpenAI chat completion usage.
|
|
1525
|
+
*/
|
|
1526
|
+
export interface CompletionTokensDetails {
|
|
1527
|
+
reasoning_tokens?: number | null;
|
|
1528
|
+
}
|
|
1951
1529
|
|
|
1952
1530
|
/**
|
|
1953
|
-
*
|
|
1531
|
+
* Token details for prompt tokens in OpenAI chat completion usage.
|
|
1954
1532
|
*/
|
|
1955
|
-
|
|
1533
|
+
export interface PromptTokensDetails {
|
|
1534
|
+
cached_tokens?: number | null;
|
|
1535
|
+
}
|
|
1956
1536
|
}
|
|
1957
1537
|
}
|
|
1958
1538
|
}
|
|
@@ -1960,173 +1540,94 @@ export namespace CompletionListResponse {
|
|
|
1960
1540
|
export type CompletionCreateParams = CompletionCreateParamsNonStreaming | CompletionCreateParamsStreaming;
|
|
1961
1541
|
|
|
1962
1542
|
export interface CompletionCreateParamsBase {
|
|
1963
|
-
/**
|
|
1964
|
-
* List of messages in the conversation.
|
|
1965
|
-
*/
|
|
1966
1543
|
messages: Array<
|
|
1967
|
-
| CompletionCreateParams.
|
|
1544
|
+
| CompletionCreateParams.OpenAIUserMessageParamInput
|
|
1968
1545
|
| CompletionCreateParams.OpenAISystemMessageParam
|
|
1969
|
-
| CompletionCreateParams.
|
|
1546
|
+
| CompletionCreateParams.OpenAIAssistantMessageParamInput
|
|
1970
1547
|
| CompletionCreateParams.OpenAIToolMessageParam
|
|
1971
1548
|
| CompletionCreateParams.OpenAIDeveloperMessageParam
|
|
1972
1549
|
>;
|
|
1973
1550
|
|
|
1974
|
-
/**
|
|
1975
|
-
* The identifier of the model to use. The model must be registered with Llama
|
|
1976
|
-
* Stack and available via the /models endpoint.
|
|
1977
|
-
*/
|
|
1978
1551
|
model: string;
|
|
1979
1552
|
|
|
1980
|
-
|
|
1981
|
-
* (Optional) The penalty for repeated tokens.
|
|
1982
|
-
*/
|
|
1983
|
-
frequency_penalty?: number;
|
|
1553
|
+
frequency_penalty?: number | null;
|
|
1984
1554
|
|
|
1985
|
-
|
|
1986
|
-
* (Optional) The function call to use.
|
|
1987
|
-
*/
|
|
1988
|
-
function_call?: string | { [key: string]: boolean | number | string | Array<unknown> | unknown | null };
|
|
1555
|
+
function_call?: string | { [key: string]: unknown } | null;
|
|
1989
1556
|
|
|
1990
|
-
|
|
1991
|
-
* (Optional) List of functions to use.
|
|
1992
|
-
*/
|
|
1993
|
-
functions?: Array<{ [key: string]: boolean | number | string | Array<unknown> | unknown | null }>;
|
|
1557
|
+
functions?: Array<{ [key: string]: unknown }> | null;
|
|
1994
1558
|
|
|
1995
|
-
|
|
1996
|
-
* (Optional) The logit bias to use.
|
|
1997
|
-
*/
|
|
1998
|
-
logit_bias?: { [key: string]: number };
|
|
1559
|
+
logit_bias?: { [key: string]: number } | null;
|
|
1999
1560
|
|
|
2000
|
-
|
|
2001
|
-
* (Optional) The log probabilities to use.
|
|
2002
|
-
*/
|
|
2003
|
-
logprobs?: boolean;
|
|
1561
|
+
logprobs?: boolean | null;
|
|
2004
1562
|
|
|
2005
|
-
|
|
2006
|
-
* (Optional) The maximum number of tokens to generate.
|
|
2007
|
-
*/
|
|
2008
|
-
max_completion_tokens?: number;
|
|
1563
|
+
max_completion_tokens?: number | null;
|
|
2009
1564
|
|
|
2010
|
-
|
|
2011
|
-
* (Optional) The maximum number of tokens to generate.
|
|
2012
|
-
*/
|
|
2013
|
-
max_tokens?: number;
|
|
1565
|
+
max_tokens?: number | null;
|
|
2014
1566
|
|
|
2015
|
-
|
|
2016
|
-
* (Optional) The number of completions to generate.
|
|
2017
|
-
*/
|
|
2018
|
-
n?: number;
|
|
1567
|
+
n?: number | null;
|
|
2019
1568
|
|
|
2020
|
-
|
|
2021
|
-
* (Optional) Whether to parallelize tool calls.
|
|
2022
|
-
*/
|
|
2023
|
-
parallel_tool_calls?: boolean;
|
|
1569
|
+
parallel_tool_calls?: boolean | null;
|
|
2024
1570
|
|
|
2025
|
-
|
|
2026
|
-
* (Optional) The penalty for repeated tokens.
|
|
2027
|
-
*/
|
|
2028
|
-
presence_penalty?: number;
|
|
1571
|
+
presence_penalty?: number | null;
|
|
2029
1572
|
|
|
2030
1573
|
/**
|
|
2031
|
-
*
|
|
1574
|
+
* Text response format for OpenAI-compatible chat completion requests.
|
|
2032
1575
|
*/
|
|
2033
1576
|
response_format?:
|
|
2034
1577
|
| CompletionCreateParams.OpenAIResponseFormatText
|
|
2035
1578
|
| CompletionCreateParams.OpenAIResponseFormatJsonSchema
|
|
2036
|
-
| CompletionCreateParams.OpenAIResponseFormatJsonObject
|
|
1579
|
+
| CompletionCreateParams.OpenAIResponseFormatJsonObject
|
|
1580
|
+
| null;
|
|
2037
1581
|
|
|
2038
|
-
|
|
2039
|
-
* (Optional) The seed to use.
|
|
2040
|
-
*/
|
|
2041
|
-
seed?: number;
|
|
1582
|
+
seed?: number | null;
|
|
2042
1583
|
|
|
2043
|
-
|
|
2044
|
-
* (Optional) The stop tokens to use.
|
|
2045
|
-
*/
|
|
2046
|
-
stop?: string | Array<string>;
|
|
1584
|
+
stop?: string | Array<string> | null;
|
|
2047
1585
|
|
|
2048
|
-
|
|
2049
|
-
* (Optional) Whether to stream the response.
|
|
2050
|
-
*/
|
|
2051
|
-
stream?: boolean;
|
|
1586
|
+
stream?: boolean | null;
|
|
2052
1587
|
|
|
2053
|
-
|
|
2054
|
-
* (Optional) The stream options to use.
|
|
2055
|
-
*/
|
|
2056
|
-
stream_options?: { [key: string]: boolean | number | string | Array<unknown> | unknown | null };
|
|
1588
|
+
stream_options?: { [key: string]: unknown } | null;
|
|
2057
1589
|
|
|
2058
|
-
|
|
2059
|
-
* (Optional) The temperature to use.
|
|
2060
|
-
*/
|
|
2061
|
-
temperature?: number;
|
|
1590
|
+
temperature?: number | null;
|
|
2062
1591
|
|
|
2063
|
-
|
|
2064
|
-
* (Optional) The tool choice to use.
|
|
2065
|
-
*/
|
|
2066
|
-
tool_choice?: string | { [key: string]: boolean | number | string | Array<unknown> | unknown | null };
|
|
1592
|
+
tool_choice?: string | { [key: string]: unknown } | null;
|
|
2067
1593
|
|
|
2068
|
-
|
|
2069
|
-
* (Optional) The tools to use.
|
|
2070
|
-
*/
|
|
2071
|
-
tools?: Array<{ [key: string]: boolean | number | string | Array<unknown> | unknown | null }>;
|
|
1594
|
+
tools?: Array<{ [key: string]: unknown }> | null;
|
|
2072
1595
|
|
|
2073
|
-
|
|
2074
|
-
* (Optional) The top log probabilities to use.
|
|
2075
|
-
*/
|
|
2076
|
-
top_logprobs?: number;
|
|
1596
|
+
top_logprobs?: number | null;
|
|
2077
1597
|
|
|
2078
|
-
|
|
2079
|
-
* (Optional) The top p to use.
|
|
2080
|
-
*/
|
|
2081
|
-
top_p?: number;
|
|
1598
|
+
top_p?: number | null;
|
|
2082
1599
|
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
user?: string;
|
|
1600
|
+
user?: string | null;
|
|
1601
|
+
|
|
1602
|
+
[k: string]: unknown;
|
|
2087
1603
|
}
|
|
2088
1604
|
|
|
2089
1605
|
export namespace CompletionCreateParams {
|
|
2090
1606
|
/**
|
|
2091
1607
|
* A message from the user in an OpenAI-compatible chat completion request.
|
|
2092
1608
|
*/
|
|
2093
|
-
export interface
|
|
2094
|
-
/**
|
|
2095
|
-
* The content of the message, which can include text and other media
|
|
2096
|
-
*/
|
|
1609
|
+
export interface OpenAIUserMessageParamInput {
|
|
2097
1610
|
content:
|
|
2098
1611
|
| string
|
|
2099
1612
|
| Array<
|
|
2100
|
-
|
|
|
2101
|
-
|
|
|
2102
|
-
|
|
|
1613
|
+
| OpenAIUserMessageParamInput.OpenAIChatCompletionContentPartTextParam
|
|
1614
|
+
| OpenAIUserMessageParamInput.OpenAIChatCompletionContentPartImageParam
|
|
1615
|
+
| OpenAIUserMessageParamInput.OpenAIFile
|
|
2103
1616
|
>;
|
|
2104
1617
|
|
|
2105
|
-
|
|
2106
|
-
* Must be "user" to identify this as a user message
|
|
2107
|
-
*/
|
|
2108
|
-
role: 'user';
|
|
1618
|
+
name?: string | null;
|
|
2109
1619
|
|
|
2110
|
-
|
|
2111
|
-
* (Optional) The name of the user message participant.
|
|
2112
|
-
*/
|
|
2113
|
-
name?: string;
|
|
1620
|
+
role?: 'user';
|
|
2114
1621
|
}
|
|
2115
1622
|
|
|
2116
|
-
export namespace
|
|
1623
|
+
export namespace OpenAIUserMessageParamInput {
|
|
2117
1624
|
/**
|
|
2118
1625
|
* Text content part for OpenAI-compatible chat completion messages.
|
|
2119
1626
|
*/
|
|
2120
1627
|
export interface OpenAIChatCompletionContentPartTextParam {
|
|
2121
|
-
/**
|
|
2122
|
-
* The text content of the message
|
|
2123
|
-
*/
|
|
2124
1628
|
text: string;
|
|
2125
1629
|
|
|
2126
|
-
|
|
2127
|
-
* Must be "text" to identify this as text content
|
|
2128
|
-
*/
|
|
2129
|
-
type: 'text';
|
|
1630
|
+
type?: 'text';
|
|
2130
1631
|
}
|
|
2131
1632
|
|
|
2132
1633
|
/**
|
|
@@ -2134,46 +1635,37 @@ export namespace CompletionCreateParams {
|
|
|
2134
1635
|
*/
|
|
2135
1636
|
export interface OpenAIChatCompletionContentPartImageParam {
|
|
2136
1637
|
/**
|
|
2137
|
-
* Image URL specification
|
|
1638
|
+
* Image URL specification for OpenAI-compatible chat completion messages.
|
|
2138
1639
|
*/
|
|
2139
1640
|
image_url: OpenAIChatCompletionContentPartImageParam.ImageURL;
|
|
2140
1641
|
|
|
2141
|
-
|
|
2142
|
-
* Must be "image_url" to identify this as image content
|
|
2143
|
-
*/
|
|
2144
|
-
type: 'image_url';
|
|
1642
|
+
type?: 'image_url';
|
|
2145
1643
|
}
|
|
2146
1644
|
|
|
2147
1645
|
export namespace OpenAIChatCompletionContentPartImageParam {
|
|
2148
1646
|
/**
|
|
2149
|
-
* Image URL specification
|
|
1647
|
+
* Image URL specification for OpenAI-compatible chat completion messages.
|
|
2150
1648
|
*/
|
|
2151
1649
|
export interface ImageURL {
|
|
2152
|
-
/**
|
|
2153
|
-
* URL of the image to include in the message
|
|
2154
|
-
*/
|
|
2155
1650
|
url: string;
|
|
2156
1651
|
|
|
2157
|
-
|
|
2158
|
-
* (Optional) Level of detail for image processing. Can be "low", "high", or "auto"
|
|
2159
|
-
*/
|
|
2160
|
-
detail?: string;
|
|
1652
|
+
detail?: string | null;
|
|
2161
1653
|
}
|
|
2162
1654
|
}
|
|
2163
1655
|
|
|
2164
1656
|
export interface OpenAIFile {
|
|
2165
1657
|
file: OpenAIFile.File;
|
|
2166
1658
|
|
|
2167
|
-
type
|
|
1659
|
+
type?: 'file';
|
|
2168
1660
|
}
|
|
2169
1661
|
|
|
2170
1662
|
export namespace OpenAIFile {
|
|
2171
1663
|
export interface File {
|
|
2172
|
-
file_data?: string;
|
|
1664
|
+
file_data?: string | null;
|
|
2173
1665
|
|
|
2174
|
-
file_id?: string;
|
|
1666
|
+
file_id?: string | null;
|
|
2175
1667
|
|
|
2176
|
-
filename?: string;
|
|
1668
|
+
filename?: string | null;
|
|
2177
1669
|
}
|
|
2178
1670
|
}
|
|
2179
1671
|
}
|
|
@@ -2182,38 +1674,21 @@ export namespace CompletionCreateParams {
|
|
|
2182
1674
|
* A system message providing instructions or context to the model.
|
|
2183
1675
|
*/
|
|
2184
1676
|
export interface OpenAISystemMessageParam {
|
|
2185
|
-
|
|
2186
|
-
* The content of the "system prompt". If multiple system messages are provided,
|
|
2187
|
-
* they are concatenated. The underlying Llama Stack code may also add other system
|
|
2188
|
-
* messages (for example, for formatting tool definitions).
|
|
2189
|
-
*/
|
|
2190
|
-
content: string | Array<OpenAISystemMessageParam.UnionMember1>;
|
|
1677
|
+
content: string | Array<OpenAISystemMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
|
|
2191
1678
|
|
|
2192
|
-
|
|
2193
|
-
* Must be "system" to identify this as a system message
|
|
2194
|
-
*/
|
|
2195
|
-
role: 'system';
|
|
1679
|
+
name?: string | null;
|
|
2196
1680
|
|
|
2197
|
-
|
|
2198
|
-
* (Optional) The name of the system message participant.
|
|
2199
|
-
*/
|
|
2200
|
-
name?: string;
|
|
1681
|
+
role?: 'system';
|
|
2201
1682
|
}
|
|
2202
1683
|
|
|
2203
1684
|
export namespace OpenAISystemMessageParam {
|
|
2204
1685
|
/**
|
|
2205
1686
|
* Text content part for OpenAI-compatible chat completion messages.
|
|
2206
1687
|
*/
|
|
2207
|
-
export interface
|
|
2208
|
-
/**
|
|
2209
|
-
* The text content of the message
|
|
2210
|
-
*/
|
|
1688
|
+
export interface ListOpenAIChatCompletionContentPartTextParam {
|
|
2211
1689
|
text: string;
|
|
2212
1690
|
|
|
2213
|
-
|
|
2214
|
-
* Must be "text" to identify this as text content
|
|
2215
|
-
*/
|
|
2216
|
-
type: 'text';
|
|
1691
|
+
type?: 'text';
|
|
2217
1692
|
}
|
|
2218
1693
|
}
|
|
2219
1694
|
|
|
@@ -2221,83 +1696,53 @@ export namespace CompletionCreateParams {
|
|
|
2221
1696
|
* A message containing the model's (assistant) response in an OpenAI-compatible
|
|
2222
1697
|
* chat completion request.
|
|
2223
1698
|
*/
|
|
2224
|
-
export interface
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
1699
|
+
export interface OpenAIAssistantMessageParamInput {
|
|
1700
|
+
content?:
|
|
1701
|
+
| string
|
|
1702
|
+
| Array<OpenAIAssistantMessageParamInput.ListOpenAIChatCompletionContentPartTextParam>
|
|
1703
|
+
| null;
|
|
2229
1704
|
|
|
2230
|
-
|
|
2231
|
-
* The content of the model's response
|
|
2232
|
-
*/
|
|
2233
|
-
content?: string | Array<OpenAIAssistantMessageParam.UnionMember1>;
|
|
1705
|
+
name?: string | null;
|
|
2234
1706
|
|
|
2235
|
-
|
|
2236
|
-
* (Optional) The name of the assistant message participant.
|
|
2237
|
-
*/
|
|
2238
|
-
name?: string;
|
|
1707
|
+
role?: 'assistant';
|
|
2239
1708
|
|
|
2240
|
-
|
|
2241
|
-
* List of tool calls. Each tool call is an OpenAIChatCompletionToolCall object.
|
|
2242
|
-
*/
|
|
2243
|
-
tool_calls?: Array<OpenAIAssistantMessageParam.ToolCall>;
|
|
1709
|
+
tool_calls?: Array<OpenAIAssistantMessageParamInput.ToolCall> | null;
|
|
2244
1710
|
}
|
|
2245
1711
|
|
|
2246
|
-
export namespace
|
|
1712
|
+
export namespace OpenAIAssistantMessageParamInput {
|
|
2247
1713
|
/**
|
|
2248
1714
|
* Text content part for OpenAI-compatible chat completion messages.
|
|
2249
1715
|
*/
|
|
2250
|
-
export interface
|
|
2251
|
-
/**
|
|
2252
|
-
* The text content of the message
|
|
2253
|
-
*/
|
|
1716
|
+
export interface ListOpenAIChatCompletionContentPartTextParam {
|
|
2254
1717
|
text: string;
|
|
2255
1718
|
|
|
2256
|
-
|
|
2257
|
-
* Must be "text" to identify this as text content
|
|
2258
|
-
*/
|
|
2259
|
-
type: 'text';
|
|
1719
|
+
type?: 'text';
|
|
2260
1720
|
}
|
|
2261
1721
|
|
|
2262
1722
|
/**
|
|
2263
1723
|
* Tool call specification for OpenAI-compatible chat completion responses.
|
|
2264
1724
|
*/
|
|
2265
1725
|
export interface ToolCall {
|
|
2266
|
-
|
|
2267
|
-
* Must be "function" to identify this as a function call
|
|
2268
|
-
*/
|
|
2269
|
-
type: 'function';
|
|
1726
|
+
id?: string | null;
|
|
2270
1727
|
|
|
2271
1728
|
/**
|
|
2272
|
-
*
|
|
1729
|
+
* Function call details for OpenAI-compatible tool calls.
|
|
2273
1730
|
*/
|
|
2274
|
-
|
|
1731
|
+
function?: ToolCall.Function | null;
|
|
2275
1732
|
|
|
2276
|
-
|
|
2277
|
-
* (Optional) Function call details
|
|
2278
|
-
*/
|
|
2279
|
-
function?: ToolCall.Function;
|
|
1733
|
+
index?: number | null;
|
|
2280
1734
|
|
|
2281
|
-
|
|
2282
|
-
* (Optional) Index of the tool call in the list
|
|
2283
|
-
*/
|
|
2284
|
-
index?: number;
|
|
1735
|
+
type?: 'function';
|
|
2285
1736
|
}
|
|
2286
1737
|
|
|
2287
1738
|
export namespace ToolCall {
|
|
2288
1739
|
/**
|
|
2289
|
-
*
|
|
1740
|
+
* Function call details for OpenAI-compatible tool calls.
|
|
2290
1741
|
*/
|
|
2291
1742
|
export interface Function {
|
|
2292
|
-
|
|
2293
|
-
* (Optional) Arguments to pass to the function as a JSON string
|
|
2294
|
-
*/
|
|
2295
|
-
arguments?: string;
|
|
1743
|
+
arguments?: string | null;
|
|
2296
1744
|
|
|
2297
|
-
|
|
2298
|
-
* (Optional) Name of the function to call
|
|
2299
|
-
*/
|
|
2300
|
-
name?: string;
|
|
1745
|
+
name?: string | null;
|
|
2301
1746
|
}
|
|
2302
1747
|
}
|
|
2303
1748
|
}
|
|
@@ -2307,36 +1752,21 @@ export namespace CompletionCreateParams {
|
|
|
2307
1752
|
* chat completion request.
|
|
2308
1753
|
*/
|
|
2309
1754
|
export interface OpenAIToolMessageParam {
|
|
2310
|
-
|
|
2311
|
-
* The response content from the tool
|
|
2312
|
-
*/
|
|
2313
|
-
content: string | Array<OpenAIToolMessageParam.UnionMember1>;
|
|
2314
|
-
|
|
2315
|
-
/**
|
|
2316
|
-
* Must be "tool" to identify this as a tool response
|
|
2317
|
-
*/
|
|
2318
|
-
role: 'tool';
|
|
1755
|
+
content: string | Array<OpenAIToolMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
|
|
2319
1756
|
|
|
2320
|
-
/**
|
|
2321
|
-
* Unique identifier for the tool call this response is for
|
|
2322
|
-
*/
|
|
2323
1757
|
tool_call_id: string;
|
|
1758
|
+
|
|
1759
|
+
role?: 'tool';
|
|
2324
1760
|
}
|
|
2325
1761
|
|
|
2326
1762
|
export namespace OpenAIToolMessageParam {
|
|
2327
1763
|
/**
|
|
2328
1764
|
* Text content part for OpenAI-compatible chat completion messages.
|
|
2329
1765
|
*/
|
|
2330
|
-
export interface
|
|
2331
|
-
/**
|
|
2332
|
-
* The text content of the message
|
|
2333
|
-
*/
|
|
1766
|
+
export interface ListOpenAIChatCompletionContentPartTextParam {
|
|
2334
1767
|
text: string;
|
|
2335
1768
|
|
|
2336
|
-
|
|
2337
|
-
* Must be "text" to identify this as text content
|
|
2338
|
-
*/
|
|
2339
|
-
type: 'text';
|
|
1769
|
+
type?: 'text';
|
|
2340
1770
|
}
|
|
2341
1771
|
}
|
|
2342
1772
|
|
|
@@ -2344,36 +1774,21 @@ export namespace CompletionCreateParams {
|
|
|
2344
1774
|
* A message from the developer in an OpenAI-compatible chat completion request.
|
|
2345
1775
|
*/
|
|
2346
1776
|
export interface OpenAIDeveloperMessageParam {
|
|
2347
|
-
|
|
2348
|
-
* The content of the developer message
|
|
2349
|
-
*/
|
|
2350
|
-
content: string | Array<OpenAIDeveloperMessageParam.UnionMember1>;
|
|
1777
|
+
content: string | Array<OpenAIDeveloperMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
|
|
2351
1778
|
|
|
2352
|
-
|
|
2353
|
-
* Must be "developer" to identify this as a developer message
|
|
2354
|
-
*/
|
|
2355
|
-
role: 'developer';
|
|
1779
|
+
name?: string | null;
|
|
2356
1780
|
|
|
2357
|
-
|
|
2358
|
-
* (Optional) The name of the developer message participant.
|
|
2359
|
-
*/
|
|
2360
|
-
name?: string;
|
|
1781
|
+
role?: 'developer';
|
|
2361
1782
|
}
|
|
2362
1783
|
|
|
2363
1784
|
export namespace OpenAIDeveloperMessageParam {
|
|
2364
1785
|
/**
|
|
2365
1786
|
* Text content part for OpenAI-compatible chat completion messages.
|
|
2366
1787
|
*/
|
|
2367
|
-
export interface
|
|
2368
|
-
/**
|
|
2369
|
-
* The text content of the message
|
|
2370
|
-
*/
|
|
1788
|
+
export interface ListOpenAIChatCompletionContentPartTextParam {
|
|
2371
1789
|
text: string;
|
|
2372
1790
|
|
|
2373
|
-
|
|
2374
|
-
* Must be "text" to identify this as text content
|
|
2375
|
-
*/
|
|
2376
|
-
type: 'text';
|
|
1791
|
+
type?: 'text';
|
|
2377
1792
|
}
|
|
2378
1793
|
}
|
|
2379
1794
|
|
|
@@ -2381,10 +1796,7 @@ export namespace CompletionCreateParams {
|
|
|
2381
1796
|
* Text response format for OpenAI-compatible chat completion requests.
|
|
2382
1797
|
*/
|
|
2383
1798
|
export interface OpenAIResponseFormatText {
|
|
2384
|
-
|
|
2385
|
-
* Must be "text" to indicate plain text response format
|
|
2386
|
-
*/
|
|
2387
|
-
type: 'text';
|
|
1799
|
+
type?: 'text';
|
|
2388
1800
|
}
|
|
2389
1801
|
|
|
2390
1802
|
/**
|
|
@@ -2392,40 +1804,25 @@ export namespace CompletionCreateParams {
|
|
|
2392
1804
|
*/
|
|
2393
1805
|
export interface OpenAIResponseFormatJsonSchema {
|
|
2394
1806
|
/**
|
|
2395
|
-
*
|
|
1807
|
+
* JSON schema specification for OpenAI-compatible structured response format.
|
|
2396
1808
|
*/
|
|
2397
1809
|
json_schema: OpenAIResponseFormatJsonSchema.JsonSchema;
|
|
2398
1810
|
|
|
2399
|
-
|
|
2400
|
-
* Must be "json_schema" to indicate structured JSON response format
|
|
2401
|
-
*/
|
|
2402
|
-
type: 'json_schema';
|
|
1811
|
+
type?: 'json_schema';
|
|
2403
1812
|
}
|
|
2404
1813
|
|
|
2405
1814
|
export namespace OpenAIResponseFormatJsonSchema {
|
|
2406
1815
|
/**
|
|
2407
|
-
*
|
|
1816
|
+
* JSON schema specification for OpenAI-compatible structured response format.
|
|
2408
1817
|
*/
|
|
2409
1818
|
export interface JsonSchema {
|
|
2410
|
-
|
|
2411
|
-
* Name of the schema
|
|
2412
|
-
*/
|
|
2413
|
-
name: string;
|
|
1819
|
+
description?: string | null;
|
|
2414
1820
|
|
|
2415
|
-
|
|
2416
|
-
* (Optional) Description of the schema
|
|
2417
|
-
*/
|
|
2418
|
-
description?: string;
|
|
1821
|
+
name?: string;
|
|
2419
1822
|
|
|
2420
|
-
|
|
2421
|
-
* (Optional) The JSON schema definition
|
|
2422
|
-
*/
|
|
2423
|
-
schema?: { [key: string]: boolean | number | string | Array<unknown> | unknown | null };
|
|
1823
|
+
schema?: { [key: string]: unknown } | null;
|
|
2424
1824
|
|
|
2425
|
-
|
|
2426
|
-
* (Optional) Whether to enforce strict adherence to the schema
|
|
2427
|
-
*/
|
|
2428
|
-
strict?: boolean;
|
|
1825
|
+
strict?: boolean | null;
|
|
2429
1826
|
}
|
|
2430
1827
|
}
|
|
2431
1828
|
|
|
@@ -2433,10 +1830,7 @@ export namespace CompletionCreateParams {
|
|
|
2433
1830
|
* JSON object response format for OpenAI-compatible chat completion requests.
|
|
2434
1831
|
*/
|
|
2435
1832
|
export interface OpenAIResponseFormatJsonObject {
|
|
2436
|
-
|
|
2437
|
-
* Must be "json_object" to indicate generic JSON object response format
|
|
2438
|
-
*/
|
|
2439
|
-
type: 'json_object';
|
|
1833
|
+
type?: 'json_object';
|
|
2440
1834
|
}
|
|
2441
1835
|
|
|
2442
1836
|
export type CompletionCreateParamsNonStreaming = CompletionsAPI.CompletionCreateParamsNonStreaming;
|
|
@@ -2444,39 +1838,35 @@ export namespace CompletionCreateParams {
|
|
|
2444
1838
|
}
|
|
2445
1839
|
|
|
2446
1840
|
export interface CompletionCreateParamsNonStreaming extends CompletionCreateParamsBase {
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
stream?: false;
|
|
1841
|
+
stream?: false | null;
|
|
1842
|
+
|
|
1843
|
+
[k: string]: unknown;
|
|
2451
1844
|
}
|
|
2452
1845
|
|
|
2453
1846
|
export interface CompletionCreateParamsStreaming extends CompletionCreateParamsBase {
|
|
2454
|
-
/**
|
|
2455
|
-
* (Optional) Whether to stream the response.
|
|
2456
|
-
*/
|
|
2457
1847
|
stream: true;
|
|
1848
|
+
|
|
1849
|
+
[k: string]: unknown;
|
|
2458
1850
|
}
|
|
2459
1851
|
|
|
2460
|
-
export interface CompletionListParams
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
1852
|
+
export interface CompletionListParams {
|
|
1853
|
+
after?: string | null;
|
|
1854
|
+
|
|
1855
|
+
limit?: number | null;
|
|
1856
|
+
|
|
1857
|
+
model?: string | null;
|
|
2465
1858
|
|
|
2466
1859
|
/**
|
|
2467
|
-
*
|
|
1860
|
+
* Sort order for paginated responses.
|
|
2468
1861
|
*/
|
|
2469
|
-
order?: 'asc' | 'desc';
|
|
1862
|
+
order?: 'asc' | 'desc' | null;
|
|
2470
1863
|
}
|
|
2471
1864
|
|
|
2472
|
-
Completions.CompletionListResponsesOpenAICursorPage = CompletionListResponsesOpenAICursorPage;
|
|
2473
|
-
|
|
2474
1865
|
export declare namespace Completions {
|
|
2475
1866
|
export {
|
|
2476
1867
|
type CompletionCreateResponse as CompletionCreateResponse,
|
|
2477
1868
|
type CompletionRetrieveResponse as CompletionRetrieveResponse,
|
|
2478
1869
|
type CompletionListResponse as CompletionListResponse,
|
|
2479
|
-
CompletionListResponsesOpenAICursorPage as CompletionListResponsesOpenAICursorPage,
|
|
2480
1870
|
type CompletionCreateParams as CompletionCreateParams,
|
|
2481
1871
|
type CompletionCreateParamsNonStreaming as CompletionCreateParamsNonStreaming,
|
|
2482
1872
|
type CompletionCreateParamsStreaming as CompletionCreateParamsStreaming,
|