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