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