ogx-client 0.7.2-rc1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +512 -0
- package/LICENSE +7 -0
- package/README.md +391 -0
- package/_shims/MultipartBody.d.ts +9 -0
- package/_shims/MultipartBody.d.ts.map +1 -0
- package/_shims/MultipartBody.js +21 -0
- package/_shims/MultipartBody.js.map +1 -0
- package/_shims/MultipartBody.mjs +17 -0
- package/_shims/MultipartBody.mjs.map +1 -0
- package/_shims/README.md +46 -0
- package/_shims/auto/runtime-bun.d.ts +5 -0
- package/_shims/auto/runtime-bun.d.ts.map +1 -0
- package/_shims/auto/runtime-bun.js +26 -0
- package/_shims/auto/runtime-bun.js.map +1 -0
- package/_shims/auto/runtime-bun.mjs +7 -0
- package/_shims/auto/runtime-bun.mjs.map +1 -0
- package/_shims/auto/runtime-node.d.ts +5 -0
- package/_shims/auto/runtime-node.d.ts.map +1 -0
- package/_shims/auto/runtime-node.js +26 -0
- package/_shims/auto/runtime-node.js.map +1 -0
- package/_shims/auto/runtime-node.mjs +7 -0
- package/_shims/auto/runtime-node.mjs.map +1 -0
- package/_shims/auto/runtime.d.ts +5 -0
- package/_shims/auto/runtime.d.ts.map +1 -0
- package/_shims/auto/runtime.js +26 -0
- package/_shims/auto/runtime.js.map +1 -0
- package/_shims/auto/runtime.mjs +7 -0
- package/_shims/auto/runtime.mjs.map +1 -0
- package/_shims/auto/types-node.d.ts +5 -0
- package/_shims/auto/types-node.d.ts.map +1 -0
- package/_shims/auto/types-node.js +26 -0
- package/_shims/auto/types-node.js.map +1 -0
- package/_shims/auto/types-node.mjs +7 -0
- package/_shims/auto/types-node.mjs.map +1 -0
- package/_shims/auto/types.d.ts +107 -0
- package/_shims/auto/types.js +9 -0
- package/_shims/auto/types.mjs +10 -0
- package/_shims/bun-runtime.d.ts +6 -0
- package/_shims/bun-runtime.d.ts.map +1 -0
- package/_shims/bun-runtime.js +19 -0
- package/_shims/bun-runtime.js.map +1 -0
- package/_shims/bun-runtime.mjs +15 -0
- package/_shims/bun-runtime.mjs.map +1 -0
- package/_shims/index.d.ts +89 -0
- package/_shims/index.js +23 -0
- package/_shims/index.mjs +18 -0
- package/_shims/manual-types.d.ts +18 -0
- package/_shims/manual-types.js +9 -0
- package/_shims/manual-types.mjs +10 -0
- package/_shims/node-runtime.d.ts +3 -0
- package/_shims/node-runtime.d.ts.map +1 -0
- package/_shims/node-runtime.js +94 -0
- package/_shims/node-runtime.js.map +1 -0
- package/_shims/node-runtime.mjs +61 -0
- package/_shims/node-runtime.mjs.map +1 -0
- package/_shims/node-types.d.ts +48 -0
- package/_shims/node-types.js +9 -0
- package/_shims/node-types.mjs +10 -0
- package/_shims/registry.d.ts +37 -0
- package/_shims/registry.d.ts.map +1 -0
- package/_shims/registry.js +46 -0
- package/_shims/registry.js.map +1 -0
- package/_shims/registry.mjs +42 -0
- package/_shims/registry.mjs.map +1 -0
- package/_shims/web-runtime.d.ts +5 -0
- package/_shims/web-runtime.d.ts.map +1 -0
- package/_shims/web-runtime.js +83 -0
- package/_shims/web-runtime.js.map +1 -0
- package/_shims/web-runtime.mjs +76 -0
- package/_shims/web-runtime.mjs.map +1 -0
- package/_shims/web-types.d.ts +89 -0
- package/_shims/web-types.js +9 -0
- package/_shims/web-types.mjs +10 -0
- package/core.d.ts +257 -0
- package/core.d.ts.map +1 -0
- package/core.js +936 -0
- package/core.js.map +1 -0
- package/core.mjs +904 -0
- package/core.mjs.map +1 -0
- package/error.d.ts +47 -0
- package/error.d.ts.map +1 -0
- package/error.js +119 -0
- package/error.js.map +1 -0
- package/error.mjs +101 -0
- package/error.mjs.map +1 -0
- package/index.d.mts +233 -0
- package/index.d.ts +233 -0
- package/index.d.ts.map +1 -0
- package/index.js +254 -0
- package/index.js.map +1 -0
- package/index.mjs +210 -0
- package/index.mjs.map +1 -0
- package/internal/decoders/line.d.ts +21 -0
- package/internal/decoders/line.d.ts.map +1 -0
- package/internal/decoders/line.js +155 -0
- package/internal/decoders/line.js.map +1 -0
- package/internal/decoders/line.mjs +150 -0
- package/internal/decoders/line.mjs.map +1 -0
- package/internal/qs/formats.d.ts +6 -0
- package/internal/qs/formats.d.ts.map +1 -0
- package/internal/qs/formats.js +16 -0
- package/internal/qs/formats.js.map +1 -0
- package/internal/qs/formats.mjs +13 -0
- package/internal/qs/formats.mjs.map +1 -0
- package/internal/qs/index.d.ts +10 -0
- package/internal/qs/index.d.ts.map +1 -0
- package/internal/qs/index.js +19 -0
- package/internal/qs/index.js.map +1 -0
- package/internal/qs/index.mjs +15 -0
- package/internal/qs/index.mjs.map +1 -0
- package/internal/qs/stringify.d.ts +3 -0
- package/internal/qs/stringify.d.ts.map +1 -0
- package/internal/qs/stringify.js +285 -0
- package/internal/qs/stringify.js.map +1 -0
- package/internal/qs/stringify.mjs +281 -0
- package/internal/qs/stringify.mjs.map +1 -0
- package/internal/qs/types.d.ts +57 -0
- package/internal/qs/types.d.ts.map +1 -0
- package/internal/qs/types.js +8 -0
- package/internal/qs/types.js.map +1 -0
- package/internal/qs/types.mjs +7 -0
- package/internal/qs/types.mjs.map +1 -0
- package/internal/qs/utils.d.ts +14 -0
- package/internal/qs/utils.d.ts.map +1 -0
- package/internal/qs/utils.js +234 -0
- package/internal/qs/utils.js.map +1 -0
- package/internal/qs/utils.mjs +222 -0
- package/internal/qs/utils.mjs.map +1 -0
- package/internal/stream-utils.d.ts +8 -0
- package/internal/stream-utils.d.ts.map +1 -0
- package/internal/stream-utils.js +44 -0
- package/internal/stream-utils.js.map +1 -0
- package/internal/stream-utils.mjs +40 -0
- package/internal/stream-utils.mjs.map +1 -0
- package/internal/utils/query.d.ts +2 -0
- package/internal/utils/query.d.ts.map +1 -0
- package/internal/utils/query.js +39 -0
- package/internal/utils/query.js.map +1 -0
- package/internal/utils/query.mjs +12 -0
- package/internal/utils/query.mjs.map +1 -0
- package/lib/response-helpers.d.ts +23 -0
- package/lib/response-helpers.d.ts.map +1 -0
- package/lib/response-helpers.js +53 -0
- package/lib/response-helpers.js.map +1 -0
- package/lib/response-helpers.mjs +49 -0
- package/lib/response-helpers.mjs.map +1 -0
- package/ogx-client-0.7.2-rc1.tgz +0 -0
- package/package.json +108 -0
- package/pagination.d.ts +21 -0
- package/pagination.d.ts.map +1 -0
- package/pagination.js +53 -0
- package/pagination.js.map +1 -0
- package/pagination.mjs +47 -0
- package/pagination.mjs.map +1 -0
- package/resource.d.ts +6 -0
- package/resource.d.ts.map +1 -0
- package/resource.js +15 -0
- package/resource.js.map +1 -0
- package/resource.mjs +11 -0
- package/resource.mjs.map +1 -0
- package/resources/alpha/admin.d.ts +44 -0
- package/resources/alpha/admin.d.ts.map +1 -0
- package/resources/alpha/admin.js +49 -0
- package/resources/alpha/admin.js.map +1 -0
- package/resources/alpha/admin.mjs +45 -0
- package/resources/alpha/admin.mjs.map +1 -0
- package/resources/alpha/alpha.d.ts +14 -0
- package/resources/alpha/alpha.d.ts.map +1 -0
- package/resources/alpha/alpha.js +49 -0
- package/resources/alpha/alpha.js.map +1 -0
- package/resources/alpha/alpha.mjs +22 -0
- package/resources/alpha/alpha.mjs.map +1 -0
- package/resources/alpha/benchmarks.d.ts +104 -0
- package/resources/alpha/benchmarks.d.ts.map +1 -0
- package/resources/alpha/benchmarks.js +50 -0
- package/resources/alpha/benchmarks.js.map +1 -0
- package/resources/alpha/benchmarks.mjs +44 -0
- package/resources/alpha/benchmarks.mjs.map +1 -0
- package/resources/alpha/index.d.ts +4 -0
- package/resources/alpha/index.d.ts.map +1 -0
- package/resources/alpha/index.js +17 -0
- package/resources/alpha/index.js.map +1 -0
- package/resources/alpha/index.mjs +11 -0
- package/resources/alpha/index.mjs.map +1 -0
- package/resources/alpha/inference.d.ts +144 -0
- package/resources/alpha/inference.d.ts.map +1 -0
- package/resources/alpha/inference.js +29 -0
- package/resources/alpha/inference.js.map +1 -0
- package/resources/alpha/inference.mjs +25 -0
- package/resources/alpha/inference.mjs.map +1 -0
- package/resources/alpha.d.ts +2 -0
- package/resources/alpha.d.ts.map +1 -0
- package/resources/alpha.js +25 -0
- package/resources/alpha.js.map +1 -0
- package/resources/alpha.mjs +9 -0
- package/resources/alpha.mjs.map +1 -0
- package/resources/batches.d.ts +442 -0
- package/resources/batches.d.ts.map +1 -0
- package/resources/batches.js +53 -0
- package/resources/batches.js.map +1 -0
- package/resources/batches.mjs +48 -0
- package/resources/batches.mjs.map +1 -0
- package/resources/chat/chat.d.ts +276 -0
- package/resources/chat/chat.d.ts.map +1 -0
- package/resources/chat/chat.js +45 -0
- package/resources/chat/chat.js.map +1 -0
- package/resources/chat/chat.mjs +18 -0
- package/resources/chat/chat.mjs.map +1 -0
- package/resources/chat/completions.d.ts +2021 -0
- package/resources/chat/completions.d.ts.map +1 -0
- package/resources/chat/completions.js +39 -0
- package/resources/chat/completions.js.map +1 -0
- package/resources/chat/completions.mjs +35 -0
- package/resources/chat/completions.mjs.map +1 -0
- package/resources/chat/index.d.ts +3 -0
- package/resources/chat/index.d.ts.map +1 -0
- package/resources/chat/index.js +15 -0
- package/resources/chat/index.js.map +1 -0
- package/resources/chat/index.mjs +10 -0
- package/resources/chat/index.mjs.map +1 -0
- package/resources/chat.d.ts +2 -0
- package/resources/chat.d.ts.map +1 -0
- package/resources/chat.js +25 -0
- package/resources/chat.js.map +1 -0
- package/resources/chat.mjs +9 -0
- package/resources/chat.mjs.map +1 -0
- package/resources/completions.d.ts +273 -0
- package/resources/completions.d.ts.map +1 -0
- package/resources/completions.js +26 -0
- package/resources/completions.js.map +1 -0
- package/resources/completions.mjs +22 -0
- package/resources/completions.mjs.map +1 -0
- package/resources/conversations/conversations.d.ts +429 -0
- package/resources/conversations/conversations.d.ts.map +1 -0
- package/resources/conversations/conversations.js +73 -0
- package/resources/conversations/conversations.js.map +1 -0
- package/resources/conversations/conversations.mjs +46 -0
- package/resources/conversations/conversations.mjs.map +1 -0
- package/resources/conversations/index.d.ts +3 -0
- package/resources/conversations/index.d.ts.map +1 -0
- package/resources/conversations/index.js +16 -0
- package/resources/conversations/index.js.map +1 -0
- package/resources/conversations/index.mjs +10 -0
- package/resources/conversations/index.mjs.map +1 -0
- package/resources/conversations/items.d.ts +1408 -0
- package/resources/conversations/items.d.ts.map +1 -0
- package/resources/conversations/items.js +48 -0
- package/resources/conversations/items.js.map +1 -0
- package/resources/conversations/items.mjs +43 -0
- package/resources/conversations/items.mjs.map +1 -0
- package/resources/conversations.d.ts +2 -0
- package/resources/conversations.d.ts.map +1 -0
- package/resources/conversations.js +25 -0
- package/resources/conversations.js.map +1 -0
- package/resources/conversations.mjs +9 -0
- package/resources/conversations.mjs.map +1 -0
- package/resources/embeddings.d.ts +98 -0
- package/resources/embeddings.d.ts.map +1 -0
- package/resources/embeddings.js +30 -0
- package/resources/embeddings.js.map +1 -0
- package/resources/embeddings.mjs +26 -0
- package/resources/embeddings.mjs.map +1 -0
- package/resources/files.d.ts +159 -0
- package/resources/files.d.ts.map +1 -0
- package/resources/files.js +78 -0
- package/resources/files.js.map +1 -0
- package/resources/files.mjs +50 -0
- package/resources/files.mjs.map +1 -0
- package/resources/index.d.ts +20 -0
- package/resources/index.d.ts.map +1 -0
- package/resources/index.js +66 -0
- package/resources/index.js.map +1 -0
- package/resources/index.mjs +27 -0
- package/resources/index.mjs.map +1 -0
- package/resources/inspect.d.ts +17 -0
- package/resources/inspect.d.ts.map +1 -0
- package/resources/inspect.js +30 -0
- package/resources/inspect.js.map +1 -0
- package/resources/inspect.mjs +26 -0
- package/resources/inspect.mjs.map +1 -0
- package/resources/models/index.d.ts +3 -0
- package/resources/models/index.d.ts.map +1 -0
- package/resources/models/index.js +15 -0
- package/resources/models/index.js.map +1 -0
- package/resources/models/index.mjs +10 -0
- package/resources/models/index.mjs.map +1 -0
- package/resources/models/models.d.ts +97 -0
- package/resources/models/models.d.ts.map +1 -0
- package/resources/models/models.js +57 -0
- package/resources/models/models.js.map +1 -0
- package/resources/models/models.mjs +30 -0
- package/resources/models/models.mjs.map +1 -0
- package/resources/models/openai.d.ts +10 -0
- package/resources/models/openai.d.ts.map +1 -0
- package/resources/models/openai.js +21 -0
- package/resources/models/openai.js.map +1 -0
- package/resources/models/openai.mjs +17 -0
- package/resources/models/openai.mjs.map +1 -0
- package/resources/models.d.ts +2 -0
- package/resources/models.d.ts.map +1 -0
- package/resources/models.js +25 -0
- package/resources/models.js.map +1 -0
- package/resources/models.mjs +9 -0
- package/resources/models.mjs.map +1 -0
- package/resources/moderations.d.ts +83 -0
- package/resources/moderations.d.ts.map +1 -0
- package/resources/moderations.js +24 -0
- package/resources/moderations.js.map +1 -0
- package/resources/moderations.mjs +20 -0
- package/resources/moderations.mjs.map +1 -0
- package/resources/prompts/index.d.ts +3 -0
- package/resources/prompts/index.d.ts.map +1 -0
- package/resources/prompts/index.js +15 -0
- package/resources/prompts/index.js.map +1 -0
- package/resources/prompts/index.mjs +10 -0
- package/resources/prompts/index.mjs.map +1 -0
- package/resources/prompts/prompts.d.ts +113 -0
- package/resources/prompts/prompts.d.ts.map +1 -0
- package/resources/prompts/prompts.js +88 -0
- package/resources/prompts/prompts.js.map +1 -0
- package/resources/prompts/prompts.mjs +61 -0
- package/resources/prompts/prompts.mjs.map +1 -0
- package/resources/prompts/versions.d.ts +13 -0
- package/resources/prompts/versions.d.ts.map +1 -0
- package/resources/prompts/versions.js +24 -0
- package/resources/prompts/versions.js.map +1 -0
- package/resources/prompts/versions.mjs +20 -0
- package/resources/prompts/versions.mjs.map +1 -0
- package/resources/prompts.d.ts +2 -0
- package/resources/prompts.d.ts.map +1 -0
- package/resources/prompts.js +25 -0
- package/resources/prompts.js.map +1 -0
- package/resources/prompts.mjs +9 -0
- package/resources/prompts.mjs.map +1 -0
- package/resources/providers.d.ts +24 -0
- package/resources/providers.d.ts.map +1 -0
- package/resources/providers.js +30 -0
- package/resources/providers.js.map +1 -0
- package/resources/providers.mjs +26 -0
- package/resources/providers.mjs.map +1 -0
- package/resources/responses/index.d.ts +3 -0
- package/resources/responses/index.d.ts.map +1 -0
- package/resources/responses/index.js +16 -0
- package/resources/responses/index.js.map +1 -0
- package/resources/responses/index.mjs +10 -0
- package/resources/responses/index.mjs.map +1 -0
- package/resources/responses/input-items.d.ts +382 -0
- package/resources/responses/input-items.d.ts.map +1 -0
- package/resources/responses/input-items.js +25 -0
- package/resources/responses/input-items.js.map +1 -0
- package/resources/responses/input-items.mjs +21 -0
- package/resources/responses/input-items.mjs.map +1 -0
- package/resources/responses/responses.d.ts +4808 -0
- package/resources/responses/responses.d.ts.map +1 -0
- package/resources/responses/responses.js +85 -0
- package/resources/responses/responses.js.map +1 -0
- package/resources/responses/responses.mjs +57 -0
- package/resources/responses/responses.mjs.map +1 -0
- package/resources/responses.d.ts +2 -0
- package/resources/responses.d.ts.map +1 -0
- package/resources/responses.js +25 -0
- package/resources/responses.js.map +1 -0
- package/resources/responses.mjs +9 -0
- package/resources/responses.mjs.map +1 -0
- package/resources/routes.d.ts +30 -0
- package/resources/routes.d.ts.map +1 -0
- package/resources/routes.js +25 -0
- package/resources/routes.js.map +1 -0
- package/resources/routes.mjs +21 -0
- package/resources/routes.mjs.map +1 -0
- package/resources/safety.d.ts +297 -0
- package/resources/safety.d.ts.map +1 -0
- package/resources/safety.js +24 -0
- package/resources/safety.js.map +1 -0
- package/resources/safety.mjs +20 -0
- package/resources/safety.mjs.map +1 -0
- package/resources/shared.d.ts +447 -0
- package/resources/shared.d.ts.map +1 -0
- package/resources/shared.js +10 -0
- package/resources/shared.js.map +1 -0
- package/resources/shared.mjs +9 -0
- package/resources/shared.mjs.map +1 -0
- package/resources/shields.d.ts +82 -0
- package/resources/shields.d.ts.map +1 -0
- package/resources/shields.js +46 -0
- package/resources/shields.js.map +1 -0
- package/resources/shields.mjs +42 -0
- package/resources/shields.mjs.map +1 -0
- package/resources/vector-io.d.ts +375 -0
- package/resources/vector-io.d.ts.map +1 -0
- package/resources/vector-io.js +31 -0
- package/resources/vector-io.js.map +1 -0
- package/resources/vector-io.mjs +27 -0
- package/resources/vector-io.mjs.map +1 -0
- package/resources/vector-stores/file-batches.d.ts +268 -0
- package/resources/vector-stores/file-batches.d.ts.map +1 -0
- package/resources/vector-stores/file-batches.js +42 -0
- package/resources/vector-stores/file-batches.js.map +1 -0
- package/resources/vector-stores/file-batches.mjs +38 -0
- package/resources/vector-stores/file-batches.mjs.map +1 -0
- package/resources/vector-stores/files.d.ts +335 -0
- package/resources/vector-stores/files.d.ts.map +1 -0
- package/resources/vector-stores/files.js +60 -0
- package/resources/vector-stores/files.js.map +1 -0
- package/resources/vector-stores/files.mjs +55 -0
- package/resources/vector-stores/files.mjs.map +1 -0
- package/resources/vector-stores/index.d.ts +4 -0
- package/resources/vector-stores/index.d.ts.map +1 -0
- package/resources/vector-stores/index.js +19 -0
- package/resources/vector-stores/index.js.map +1 -0
- package/resources/vector-stores/index.mjs +11 -0
- package/resources/vector-stores/index.mjs.map +1 -0
- package/resources/vector-stores/vector-stores.d.ts +412 -0
- package/resources/vector-stores/vector-stores.d.ts.map +1 -0
- package/resources/vector-stores/vector-stores.js +92 -0
- package/resources/vector-stores/vector-stores.js.map +1 -0
- package/resources/vector-stores/vector-stores.mjs +64 -0
- package/resources/vector-stores/vector-stores.mjs.map +1 -0
- package/resources/vector-stores.d.ts +2 -0
- package/resources/vector-stores.d.ts.map +1 -0
- package/resources/vector-stores.js +25 -0
- package/resources/vector-stores.js.map +1 -0
- package/resources/vector-stores.mjs +9 -0
- package/resources/vector-stores.mjs.map +1 -0
- package/resources.d.ts +2 -0
- package/resources.d.ts.map +1 -0
- package/resources.js +23 -0
- package/resources.js.map +1 -0
- package/resources.mjs +7 -0
- package/resources.mjs.map +1 -0
- package/shims/node.d.ts +30 -0
- package/shims/node.d.ts.map +1 -0
- package/shims/node.js +36 -0
- package/shims/node.js.map +1 -0
- package/shims/node.mjs +10 -0
- package/shims/node.mjs.map +1 -0
- package/shims/web.d.ts +26 -0
- package/shims/web.d.ts.map +1 -0
- package/shims/web.js +36 -0
- package/shims/web.js.map +1 -0
- package/shims/web.mjs +10 -0
- package/shims/web.mjs.map +1 -0
- package/src/_shims/MultipartBody.ts +15 -0
- package/src/_shims/README.md +46 -0
- package/src/_shims/auto/runtime-bun.ts +10 -0
- package/src/_shims/auto/runtime-node.ts +10 -0
- package/src/_shims/auto/runtime.ts +10 -0
- package/src/_shims/auto/types-node.ts +10 -0
- package/src/_shims/auto/types.d.ts +107 -0
- package/src/_shims/auto/types.js +9 -0
- package/src/_shims/auto/types.mjs +10 -0
- package/src/_shims/bun-runtime.ts +20 -0
- package/src/_shims/index.d.ts +89 -0
- package/src/_shims/index.js +23 -0
- package/src/_shims/index.mjs +18 -0
- package/src/_shims/manual-types.d.ts +18 -0
- package/src/_shims/manual-types.js +9 -0
- package/src/_shims/manual-types.mjs +10 -0
- package/src/_shims/node-runtime.ts +87 -0
- package/src/_shims/node-types.d.ts +48 -0
- package/src/_shims/node-types.js +9 -0
- package/src/_shims/node-types.mjs +10 -0
- package/src/_shims/registry.ts +73 -0
- package/src/_shims/web-runtime.ts +109 -0
- package/src/_shims/web-types.d.ts +89 -0
- package/src/_shims/web-types.js +9 -0
- package/src/_shims/web-types.mjs +10 -0
- package/src/core.ts +1253 -0
- package/src/error.ts +137 -0
- package/src/index.ts +554 -0
- package/src/internal/decoders/line.ts +182 -0
- package/src/internal/qs/LICENSE.md +13 -0
- package/src/internal/qs/README.md +3 -0
- package/src/internal/qs/formats.ts +15 -0
- package/src/internal/qs/index.ts +19 -0
- package/src/internal/qs/stringify.ts +394 -0
- package/src/internal/qs/types.ts +77 -0
- package/src/internal/qs/utils.ts +271 -0
- package/src/internal/stream-utils.ts +38 -0
- package/src/internal/utils/query.ts +13 -0
- package/src/lib/response-helpers.ts +60 -0
- package/src/pagination.ts +80 -0
- package/src/resource.ts +18 -0
- package/src/resources/alpha/admin.ts +87 -0
- package/src/resources/alpha/alpha.ts +31 -0
- package/src/resources/alpha/benchmarks.ts +152 -0
- package/src/resources/alpha/index.ts +11 -0
- package/src/resources/alpha/inference.ts +191 -0
- package/src/resources/alpha.ts +9 -0
- package/src/resources/batches.ts +692 -0
- package/src/resources/chat/chat.ts +351 -0
- package/src/resources/chat/completions.ts +2430 -0
- package/src/resources/chat/index.ts +19 -0
- package/src/resources/chat.ts +9 -0
- package/src/resources/completions.ts +350 -0
- package/src/resources/conversations/conversations.ts +627 -0
- package/src/resources/conversations/index.ts +25 -0
- package/src/resources/conversations/items.ts +2061 -0
- package/src/resources/conversations.ts +9 -0
- package/src/resources/embeddings.ts +130 -0
- package/src/resources/files.ts +225 -0
- package/src/resources/index.ts +104 -0
- package/src/resources/inspect.ts +30 -0
- package/src/resources/models/index.ts +10 -0
- package/src/resources/models/models.ts +133 -0
- package/src/resources/models/openai.ts +20 -0
- package/src/resources/models.ts +9 -0
- package/src/resources/moderations.ts +97 -0
- package/src/resources/prompts/index.ts +19 -0
- package/src/resources/prompts/prompts.ts +188 -0
- package/src/resources/prompts/versions.ts +27 -0
- package/src/resources/prompts.ts +9 -0
- package/src/resources/providers.ts +41 -0
- package/src/resources/responses/index.ts +26 -0
- package/src/resources/responses/input-items.ts +571 -0
- package/src/resources/responses/responses.ts +6718 -0
- package/src/resources/responses.ts +9 -0
- package/src/resources/routes.ts +55 -0
- package/src/resources/safety.ts +367 -0
- package/src/resources/shared.ts +544 -0
- package/src/resources/shields.ts +119 -0
- package/src/resources/vector-io.ts +485 -0
- package/src/resources/vector-stores/file-batches.ts +386 -0
- package/src/resources/vector-stores/files.ts +496 -0
- package/src/resources/vector-stores/index.ts +38 -0
- package/src/resources/vector-stores/vector-stores.ts +588 -0
- package/src/resources/vector-stores.ts +9 -0
- package/src/resources.ts +7 -0
- package/src/shims/node.ts +56 -0
- package/src/shims/web.ts +56 -0
- package/src/streaming.ts +315 -0
- package/src/tsconfig.json +11 -0
- package/src/uploads.ts +261 -0
- package/src/version.ts +7 -0
- package/streaming.d.ts +32 -0
- package/streaming.d.ts.map +1 -0
- package/streaming.js +272 -0
- package/streaming.js.map +1 -0
- package/streaming.mjs +267 -0
- package/streaming.mjs.map +1 -0
- package/uploads.d.ts +75 -0
- package/uploads.d.ts.map +1 -0
- package/uploads.js +176 -0
- package/uploads.js.map +1 -0
- package/uploads.mjs +163 -0
- package/uploads.mjs.map +1 -0
- package/version.d.ts +2 -0
- package/version.d.ts.map +1 -0
- package/version.js +10 -0
- package/version.js.map +1 -0
- package/version.mjs +7 -0
- package/version.mjs.map +1 -0
|
@@ -0,0 +1,4808 @@
|
|
|
1
|
+
import { APIResource } from "../../resource.js";
|
|
2
|
+
import { APIPromise } from "../../core.js";
|
|
3
|
+
import * as Core from "../../core.js";
|
|
4
|
+
import * as ResponsesAPI from "./responses.js";
|
|
5
|
+
import * as InputItemsAPI from "./input-items.js";
|
|
6
|
+
import { InputItemListParams, InputItemListResponse, InputItems } from "./input-items.js";
|
|
7
|
+
import { OpenAICursorPage, type OpenAICursorPageParams } from "../../pagination.js";
|
|
8
|
+
import { Stream } from "../../streaming.js";
|
|
9
|
+
/**
|
|
10
|
+
* OpenAI Responses API for agent orchestration with tool use, multi-turn conversations, and background processing.
|
|
11
|
+
*/
|
|
12
|
+
export declare class Responses extends APIResource {
|
|
13
|
+
inputItems: InputItemsAPI.InputItems;
|
|
14
|
+
/**
|
|
15
|
+
* Create a model response.
|
|
16
|
+
*/
|
|
17
|
+
create(body: ResponseCreateParamsNonStreaming, options?: Core.RequestOptions): APIPromise<ResponseObject>;
|
|
18
|
+
create(body: ResponseCreateParamsStreaming, options?: Core.RequestOptions): APIPromise<Stream<ResponseObjectStream>>;
|
|
19
|
+
create(body: ResponseCreateParamsBase, options?: Core.RequestOptions): APIPromise<Stream<ResponseObjectStream> | ResponseObject>;
|
|
20
|
+
/**
|
|
21
|
+
* Get a model response.
|
|
22
|
+
*/
|
|
23
|
+
retrieve(responseId: string, options?: Core.RequestOptions): Core.APIPromise<ResponseObject>;
|
|
24
|
+
/**
|
|
25
|
+
* List all responses.
|
|
26
|
+
*/
|
|
27
|
+
list(query?: ResponseListParams, options?: Core.RequestOptions): Core.PagePromise<ResponseListResponsesOpenAICursorPage, ResponseListResponse>;
|
|
28
|
+
list(options?: Core.RequestOptions): Core.PagePromise<ResponseListResponsesOpenAICursorPage, ResponseListResponse>;
|
|
29
|
+
/**
|
|
30
|
+
* Delete a response.
|
|
31
|
+
*/
|
|
32
|
+
delete(responseId: string, options?: Core.RequestOptions): Core.APIPromise<ResponseDeleteResponse>;
|
|
33
|
+
/**
|
|
34
|
+
* **[alpha]** Compresses conversation history into a smaller representation while
|
|
35
|
+
* preserving context. This endpoint is in alpha and may change without notice.
|
|
36
|
+
*/
|
|
37
|
+
compact(body: ResponseCompactParams, options?: Core.RequestOptions): Core.APIPromise<CompactedResponse>;
|
|
38
|
+
}
|
|
39
|
+
export declare class ResponseListResponsesOpenAICursorPage extends OpenAICursorPage<ResponseListResponse> {
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Response from compacting a conversation.
|
|
43
|
+
*/
|
|
44
|
+
export interface CompactedResponse {
|
|
45
|
+
id: string;
|
|
46
|
+
created_at: number;
|
|
47
|
+
output: Array<CompactedResponse.OpenAIResponseMessageOutput | CompactedResponse.OpenAIResponseOutputMessageWebSearchToolCall | CompactedResponse.OpenAIResponseOutputMessageFileSearchToolCall | CompactedResponse.OpenAIResponseOutputMessageFunctionToolCall | CompactedResponse.OpenAIResponseOutputMessageMcpCall | CompactedResponse.OpenAIResponseOutputMessageMcpListTools | CompactedResponse.OpenAIResponseMcpApprovalRequest | CompactedResponse.OpenAIResponseOutputMessageReasoningItem | CompactedResponse.OpenAIResponseInputFunctionToolCallOutput | CompactedResponse.OpenAIResponseMcpApprovalResponse | CompactedResponse.OpenAIResponseCompaction>;
|
|
48
|
+
/**
|
|
49
|
+
* Usage information for OpenAI response.
|
|
50
|
+
*/
|
|
51
|
+
usage: CompactedResponse.Usage;
|
|
52
|
+
object?: 'response.compaction';
|
|
53
|
+
}
|
|
54
|
+
export declare namespace CompactedResponse {
|
|
55
|
+
/**
|
|
56
|
+
* Corresponds to the various Message types in the Responses API. They are all
|
|
57
|
+
* under one type because the Responses API gives them all the same "type" value,
|
|
58
|
+
* and there is no way to tell them apart in certain scenarios.
|
|
59
|
+
*/
|
|
60
|
+
interface OpenAIResponseMessageOutput {
|
|
61
|
+
content: string | Array<OpenAIResponseMessageOutput.OpenAIResponseInputMessageContentText | OpenAIResponseMessageOutput.OpenAIResponseInputMessageContentImage | OpenAIResponseMessageOutput.OpenAIResponseInputMessageContentFile> | Array<OpenAIResponseMessageOutput.OpenAIResponseOutputMessageContentOutputTextOutput | OpenAIResponseMessageOutput.OpenAIResponseContentPartRefusal>;
|
|
62
|
+
role: 'system' | 'developer' | 'user' | 'assistant';
|
|
63
|
+
id?: string | null;
|
|
64
|
+
status?: string | null;
|
|
65
|
+
type?: 'message';
|
|
66
|
+
}
|
|
67
|
+
namespace OpenAIResponseMessageOutput {
|
|
68
|
+
/**
|
|
69
|
+
* Text content for input messages in OpenAI response format.
|
|
70
|
+
*/
|
|
71
|
+
interface OpenAIResponseInputMessageContentText {
|
|
72
|
+
text: string;
|
|
73
|
+
type?: 'input_text';
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Image content for input messages in OpenAI response format.
|
|
77
|
+
*/
|
|
78
|
+
interface OpenAIResponseInputMessageContentImage {
|
|
79
|
+
detail?: 'low' | 'high' | 'auto';
|
|
80
|
+
file_id?: string | null;
|
|
81
|
+
image_url?: string | null;
|
|
82
|
+
type?: 'input_image';
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* File content for input messages in OpenAI response format.
|
|
86
|
+
*/
|
|
87
|
+
interface OpenAIResponseInputMessageContentFile {
|
|
88
|
+
file_data?: string | null;
|
|
89
|
+
file_id?: string | null;
|
|
90
|
+
file_url?: string | null;
|
|
91
|
+
filename?: string | null;
|
|
92
|
+
type?: 'input_file';
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Text content within an output message of an OpenAI response.
|
|
96
|
+
*/
|
|
97
|
+
interface OpenAIResponseOutputMessageContentOutputTextOutput {
|
|
98
|
+
text: string;
|
|
99
|
+
annotations?: Array<OpenAIResponseOutputMessageContentOutputTextOutput.OpenAIResponseAnnotationFileCitation | OpenAIResponseOutputMessageContentOutputTextOutput.OpenAIResponseAnnotationCitation | OpenAIResponseOutputMessageContentOutputTextOutput.OpenAIResponseAnnotationContainerFileCitation | OpenAIResponseOutputMessageContentOutputTextOutput.OpenAIResponseAnnotationFilePath>;
|
|
100
|
+
logprobs?: Array<OpenAIResponseOutputMessageContentOutputTextOutput.Logprob> | null;
|
|
101
|
+
type?: 'output_text';
|
|
102
|
+
}
|
|
103
|
+
namespace OpenAIResponseOutputMessageContentOutputTextOutput {
|
|
104
|
+
/**
|
|
105
|
+
* File citation annotation for referencing specific files in response content.
|
|
106
|
+
*/
|
|
107
|
+
interface OpenAIResponseAnnotationFileCitation {
|
|
108
|
+
file_id: string;
|
|
109
|
+
filename: string;
|
|
110
|
+
index: number;
|
|
111
|
+
type?: 'file_citation';
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* URL citation annotation for referencing external web resources.
|
|
115
|
+
*/
|
|
116
|
+
interface OpenAIResponseAnnotationCitation {
|
|
117
|
+
end_index: number;
|
|
118
|
+
start_index: number;
|
|
119
|
+
title: string;
|
|
120
|
+
url: string;
|
|
121
|
+
type?: 'url_citation';
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Container file citation annotation referencing a file within a container.
|
|
125
|
+
*/
|
|
126
|
+
interface OpenAIResponseAnnotationContainerFileCitation {
|
|
127
|
+
container_id: string;
|
|
128
|
+
end_index: number;
|
|
129
|
+
file_id: string;
|
|
130
|
+
filename: string;
|
|
131
|
+
start_index: number;
|
|
132
|
+
type?: 'container_file_citation';
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* File path annotation referencing a generated file in response content.
|
|
136
|
+
*/
|
|
137
|
+
interface OpenAIResponseAnnotationFilePath {
|
|
138
|
+
file_id: string;
|
|
139
|
+
index: number;
|
|
140
|
+
type?: 'file_path';
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* The log probability for a token from an OpenAI-compatible chat completion
|
|
144
|
+
* response.
|
|
145
|
+
*/
|
|
146
|
+
interface Logprob {
|
|
147
|
+
/**
|
|
148
|
+
* The token.
|
|
149
|
+
*/
|
|
150
|
+
token: string;
|
|
151
|
+
/**
|
|
152
|
+
* The log probability of the token.
|
|
153
|
+
*/
|
|
154
|
+
logprob: number;
|
|
155
|
+
/**
|
|
156
|
+
* The bytes for the token.
|
|
157
|
+
*/
|
|
158
|
+
bytes?: Array<number> | null;
|
|
159
|
+
/**
|
|
160
|
+
* The top log probabilities for the token.
|
|
161
|
+
*/
|
|
162
|
+
top_logprobs?: Array<Logprob.TopLogprob> | null;
|
|
163
|
+
}
|
|
164
|
+
namespace Logprob {
|
|
165
|
+
/**
|
|
166
|
+
* The top log probability for a token from an OpenAI-compatible chat completion
|
|
167
|
+
* response.
|
|
168
|
+
*/
|
|
169
|
+
interface TopLogprob {
|
|
170
|
+
/**
|
|
171
|
+
* The token.
|
|
172
|
+
*/
|
|
173
|
+
token: string;
|
|
174
|
+
/**
|
|
175
|
+
* The log probability of the token.
|
|
176
|
+
*/
|
|
177
|
+
logprob: number;
|
|
178
|
+
/**
|
|
179
|
+
* The bytes for the token.
|
|
180
|
+
*/
|
|
181
|
+
bytes?: Array<number> | null;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Refusal content within a streamed response part.
|
|
187
|
+
*/
|
|
188
|
+
interface OpenAIResponseContentPartRefusal {
|
|
189
|
+
refusal: string;
|
|
190
|
+
type?: 'refusal';
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Web search tool call output message for OpenAI responses.
|
|
195
|
+
*/
|
|
196
|
+
interface OpenAIResponseOutputMessageWebSearchToolCall {
|
|
197
|
+
id: string;
|
|
198
|
+
status: string;
|
|
199
|
+
type?: 'web_search_call';
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* File search tool call output message for OpenAI responses.
|
|
203
|
+
*/
|
|
204
|
+
interface OpenAIResponseOutputMessageFileSearchToolCall {
|
|
205
|
+
id: string;
|
|
206
|
+
queries: Array<string>;
|
|
207
|
+
status: string;
|
|
208
|
+
results?: Array<OpenAIResponseOutputMessageFileSearchToolCall.Result> | null;
|
|
209
|
+
type?: 'file_search_call';
|
|
210
|
+
}
|
|
211
|
+
namespace OpenAIResponseOutputMessageFileSearchToolCall {
|
|
212
|
+
/**
|
|
213
|
+
* Search results returned by the file search operation.
|
|
214
|
+
*/
|
|
215
|
+
interface Result {
|
|
216
|
+
attributes: {
|
|
217
|
+
[key: string]: unknown;
|
|
218
|
+
};
|
|
219
|
+
file_id: string;
|
|
220
|
+
filename: string;
|
|
221
|
+
score: number;
|
|
222
|
+
text: string;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Function tool call output message for OpenAI responses.
|
|
227
|
+
*/
|
|
228
|
+
interface OpenAIResponseOutputMessageFunctionToolCall {
|
|
229
|
+
arguments: string;
|
|
230
|
+
call_id: string;
|
|
231
|
+
name: string;
|
|
232
|
+
id?: string | null;
|
|
233
|
+
status?: string | null;
|
|
234
|
+
type?: 'function_call';
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Model Context Protocol (MCP) call output message for OpenAI responses.
|
|
238
|
+
*/
|
|
239
|
+
interface OpenAIResponseOutputMessageMcpCall {
|
|
240
|
+
id: string;
|
|
241
|
+
arguments: string;
|
|
242
|
+
name: string;
|
|
243
|
+
server_label: string;
|
|
244
|
+
error?: string | null;
|
|
245
|
+
output?: string | null;
|
|
246
|
+
type?: 'mcp_call';
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* MCP list tools output message containing available tools from an MCP server.
|
|
250
|
+
*/
|
|
251
|
+
interface OpenAIResponseOutputMessageMcpListTools {
|
|
252
|
+
id: string;
|
|
253
|
+
server_label: string;
|
|
254
|
+
tools: Array<OpenAIResponseOutputMessageMcpListTools.Tool>;
|
|
255
|
+
type?: 'mcp_list_tools';
|
|
256
|
+
}
|
|
257
|
+
namespace OpenAIResponseOutputMessageMcpListTools {
|
|
258
|
+
/**
|
|
259
|
+
* Tool definition returned by MCP list tools operation.
|
|
260
|
+
*/
|
|
261
|
+
interface Tool {
|
|
262
|
+
input_schema: {
|
|
263
|
+
[key: string]: unknown;
|
|
264
|
+
};
|
|
265
|
+
name: string;
|
|
266
|
+
description?: string | null;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* A request for human approval of a tool invocation.
|
|
271
|
+
*/
|
|
272
|
+
interface OpenAIResponseMcpApprovalRequest {
|
|
273
|
+
id: string;
|
|
274
|
+
arguments: string;
|
|
275
|
+
name: string;
|
|
276
|
+
server_label: string;
|
|
277
|
+
type?: 'mcp_approval_request';
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* Reasoning output from the model, representing the model's thinking process.
|
|
281
|
+
*/
|
|
282
|
+
interface OpenAIResponseOutputMessageReasoningItem {
|
|
283
|
+
/**
|
|
284
|
+
* Unique identifier for the reasoning output item.
|
|
285
|
+
*/
|
|
286
|
+
id: string;
|
|
287
|
+
/**
|
|
288
|
+
* Summary of the reasoning output.
|
|
289
|
+
*/
|
|
290
|
+
summary: Array<OpenAIResponseOutputMessageReasoningItem.Summary>;
|
|
291
|
+
/**
|
|
292
|
+
* The reasoning content from the model.
|
|
293
|
+
*/
|
|
294
|
+
content?: Array<OpenAIResponseOutputMessageReasoningItem.Content> | null;
|
|
295
|
+
/**
|
|
296
|
+
* The status of the reasoning output.
|
|
297
|
+
*/
|
|
298
|
+
status?: 'in_progress' | 'completed' | 'incomplete' | null;
|
|
299
|
+
/**
|
|
300
|
+
* The type identifier, always 'reasoning'.
|
|
301
|
+
*/
|
|
302
|
+
type?: 'reasoning';
|
|
303
|
+
}
|
|
304
|
+
namespace OpenAIResponseOutputMessageReasoningItem {
|
|
305
|
+
/**
|
|
306
|
+
* A summary of reasoning output from the model.
|
|
307
|
+
*/
|
|
308
|
+
interface Summary {
|
|
309
|
+
/**
|
|
310
|
+
* The summary text of the reasoning output.
|
|
311
|
+
*/
|
|
312
|
+
text: string;
|
|
313
|
+
/**
|
|
314
|
+
* The type identifier, always 'summary_text'.
|
|
315
|
+
*/
|
|
316
|
+
type?: 'summary_text';
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* Reasoning text from the model.
|
|
320
|
+
*/
|
|
321
|
+
interface Content {
|
|
322
|
+
/**
|
|
323
|
+
* The reasoning text content from the model.
|
|
324
|
+
*/
|
|
325
|
+
text: string;
|
|
326
|
+
/**
|
|
327
|
+
* The type identifier, always 'reasoning_text'.
|
|
328
|
+
*/
|
|
329
|
+
type?: 'reasoning_text';
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* This represents the output of a function call that gets passed back to the
|
|
334
|
+
* model.
|
|
335
|
+
*/
|
|
336
|
+
interface OpenAIResponseInputFunctionToolCallOutput {
|
|
337
|
+
call_id: string;
|
|
338
|
+
output: string | Array<OpenAIResponseInputFunctionToolCallOutput.OpenAIResponseInputMessageContentText | OpenAIResponseInputFunctionToolCallOutput.OpenAIResponseInputMessageContentImage | OpenAIResponseInputFunctionToolCallOutput.OpenAIResponseInputMessageContentFile>;
|
|
339
|
+
id?: string | null;
|
|
340
|
+
status?: string | null;
|
|
341
|
+
type?: 'function_call_output';
|
|
342
|
+
}
|
|
343
|
+
namespace OpenAIResponseInputFunctionToolCallOutput {
|
|
344
|
+
/**
|
|
345
|
+
* Text content for input messages in OpenAI response format.
|
|
346
|
+
*/
|
|
347
|
+
interface OpenAIResponseInputMessageContentText {
|
|
348
|
+
text: string;
|
|
349
|
+
type?: 'input_text';
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* Image content for input messages in OpenAI response format.
|
|
353
|
+
*/
|
|
354
|
+
interface OpenAIResponseInputMessageContentImage {
|
|
355
|
+
detail?: 'low' | 'high' | 'auto';
|
|
356
|
+
file_id?: string | null;
|
|
357
|
+
image_url?: string | null;
|
|
358
|
+
type?: 'input_image';
|
|
359
|
+
}
|
|
360
|
+
/**
|
|
361
|
+
* File content for input messages in OpenAI response format.
|
|
362
|
+
*/
|
|
363
|
+
interface OpenAIResponseInputMessageContentFile {
|
|
364
|
+
file_data?: string | null;
|
|
365
|
+
file_id?: string | null;
|
|
366
|
+
file_url?: string | null;
|
|
367
|
+
filename?: string | null;
|
|
368
|
+
type?: 'input_file';
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
/**
|
|
372
|
+
* A response to an MCP approval request.
|
|
373
|
+
*/
|
|
374
|
+
interface OpenAIResponseMcpApprovalResponse {
|
|
375
|
+
approval_request_id: string;
|
|
376
|
+
approve: boolean;
|
|
377
|
+
id?: string | null;
|
|
378
|
+
reason?: string | null;
|
|
379
|
+
type?: 'mcp_approval_response';
|
|
380
|
+
}
|
|
381
|
+
/**
|
|
382
|
+
* A compaction item that summarizes prior conversation context.
|
|
383
|
+
*/
|
|
384
|
+
interface OpenAIResponseCompaction {
|
|
385
|
+
encrypted_content: string;
|
|
386
|
+
id?: string | null;
|
|
387
|
+
type?: 'compaction';
|
|
388
|
+
}
|
|
389
|
+
/**
|
|
390
|
+
* Usage information for OpenAI response.
|
|
391
|
+
*/
|
|
392
|
+
interface Usage {
|
|
393
|
+
input_tokens: number;
|
|
394
|
+
/**
|
|
395
|
+
* Token details for input tokens in OpenAI response usage.
|
|
396
|
+
*/
|
|
397
|
+
input_tokens_details: Usage.InputTokensDetails;
|
|
398
|
+
output_tokens: number;
|
|
399
|
+
/**
|
|
400
|
+
* Token details for output tokens in OpenAI response usage.
|
|
401
|
+
*/
|
|
402
|
+
output_tokens_details: Usage.OutputTokensDetails;
|
|
403
|
+
total_tokens: number;
|
|
404
|
+
}
|
|
405
|
+
namespace Usage {
|
|
406
|
+
/**
|
|
407
|
+
* Token details for input tokens in OpenAI response usage.
|
|
408
|
+
*/
|
|
409
|
+
interface InputTokensDetails {
|
|
410
|
+
cached_tokens: number;
|
|
411
|
+
}
|
|
412
|
+
/**
|
|
413
|
+
* Token details for output tokens in OpenAI response usage.
|
|
414
|
+
*/
|
|
415
|
+
interface OutputTokensDetails {
|
|
416
|
+
reasoning_tokens: number;
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
/**
|
|
421
|
+
* Corresponds to the various Message types in the Responses API. They are all
|
|
422
|
+
* under one type because the Responses API gives them all the same "type" value,
|
|
423
|
+
* and there is no way to tell them apart in certain scenarios.
|
|
424
|
+
*/
|
|
425
|
+
export type ResponseInput = ResponseMessage | ResponseInput.OpenAIResponseOutputMessageWebSearchToolCall | ResponseInput.OpenAIResponseOutputMessageFileSearchToolCall | ResponseInput.OpenAIResponseOutputMessageFunctionToolCall | ResponseInput.OpenAIResponseOutputMessageMcpCall | ResponseInput.OpenAIResponseOutputMessageMcpListTools | ResponseInput.OpenAIResponseMcpApprovalRequest | ResponseInput.OpenAIResponseOutputMessageReasoningItem | ResponseInput.OpenAIResponseInputFunctionToolCallOutput | ResponseInput.OpenAIResponseMcpApprovalResponse | ResponseInput.OpenAIResponseCompaction | ResponseMessage;
|
|
426
|
+
export declare namespace ResponseInput {
|
|
427
|
+
/**
|
|
428
|
+
* Web search tool call output message for OpenAI responses.
|
|
429
|
+
*/
|
|
430
|
+
interface OpenAIResponseOutputMessageWebSearchToolCall {
|
|
431
|
+
id: string;
|
|
432
|
+
status: string;
|
|
433
|
+
type?: 'web_search_call';
|
|
434
|
+
}
|
|
435
|
+
/**
|
|
436
|
+
* File search tool call output message for OpenAI responses.
|
|
437
|
+
*/
|
|
438
|
+
interface OpenAIResponseOutputMessageFileSearchToolCall {
|
|
439
|
+
id: string;
|
|
440
|
+
queries: Array<string>;
|
|
441
|
+
status: string;
|
|
442
|
+
results?: Array<OpenAIResponseOutputMessageFileSearchToolCall.Result> | null;
|
|
443
|
+
type?: 'file_search_call';
|
|
444
|
+
}
|
|
445
|
+
namespace OpenAIResponseOutputMessageFileSearchToolCall {
|
|
446
|
+
/**
|
|
447
|
+
* Search results returned by the file search operation.
|
|
448
|
+
*/
|
|
449
|
+
interface Result {
|
|
450
|
+
attributes: {
|
|
451
|
+
[key: string]: unknown;
|
|
452
|
+
};
|
|
453
|
+
file_id: string;
|
|
454
|
+
filename: string;
|
|
455
|
+
score: number;
|
|
456
|
+
text: string;
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
/**
|
|
460
|
+
* Function tool call output message for OpenAI responses.
|
|
461
|
+
*/
|
|
462
|
+
interface OpenAIResponseOutputMessageFunctionToolCall {
|
|
463
|
+
arguments: string;
|
|
464
|
+
call_id: string;
|
|
465
|
+
name: string;
|
|
466
|
+
id?: string | null;
|
|
467
|
+
status?: string | null;
|
|
468
|
+
type?: 'function_call';
|
|
469
|
+
}
|
|
470
|
+
/**
|
|
471
|
+
* Model Context Protocol (MCP) call output message for OpenAI responses.
|
|
472
|
+
*/
|
|
473
|
+
interface OpenAIResponseOutputMessageMcpCall {
|
|
474
|
+
id: string;
|
|
475
|
+
arguments: string;
|
|
476
|
+
name: string;
|
|
477
|
+
server_label: string;
|
|
478
|
+
error?: string | null;
|
|
479
|
+
output?: string | null;
|
|
480
|
+
type?: 'mcp_call';
|
|
481
|
+
}
|
|
482
|
+
/**
|
|
483
|
+
* MCP list tools output message containing available tools from an MCP server.
|
|
484
|
+
*/
|
|
485
|
+
interface OpenAIResponseOutputMessageMcpListTools {
|
|
486
|
+
id: string;
|
|
487
|
+
server_label: string;
|
|
488
|
+
tools: Array<OpenAIResponseOutputMessageMcpListTools.Tool>;
|
|
489
|
+
type?: 'mcp_list_tools';
|
|
490
|
+
}
|
|
491
|
+
namespace OpenAIResponseOutputMessageMcpListTools {
|
|
492
|
+
/**
|
|
493
|
+
* Tool definition returned by MCP list tools operation.
|
|
494
|
+
*/
|
|
495
|
+
interface Tool {
|
|
496
|
+
input_schema: {
|
|
497
|
+
[key: string]: unknown;
|
|
498
|
+
};
|
|
499
|
+
name: string;
|
|
500
|
+
description?: string | null;
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
/**
|
|
504
|
+
* A request for human approval of a tool invocation.
|
|
505
|
+
*/
|
|
506
|
+
interface OpenAIResponseMcpApprovalRequest {
|
|
507
|
+
id: string;
|
|
508
|
+
arguments: string;
|
|
509
|
+
name: string;
|
|
510
|
+
server_label: string;
|
|
511
|
+
type?: 'mcp_approval_request';
|
|
512
|
+
}
|
|
513
|
+
/**
|
|
514
|
+
* Reasoning output from the model, representing the model's thinking process.
|
|
515
|
+
*/
|
|
516
|
+
interface OpenAIResponseOutputMessageReasoningItem {
|
|
517
|
+
/**
|
|
518
|
+
* Unique identifier for the reasoning output item.
|
|
519
|
+
*/
|
|
520
|
+
id: string;
|
|
521
|
+
/**
|
|
522
|
+
* Summary of the reasoning output.
|
|
523
|
+
*/
|
|
524
|
+
summary: Array<OpenAIResponseOutputMessageReasoningItem.Summary>;
|
|
525
|
+
/**
|
|
526
|
+
* The reasoning content from the model.
|
|
527
|
+
*/
|
|
528
|
+
content?: Array<OpenAIResponseOutputMessageReasoningItem.Content> | null;
|
|
529
|
+
/**
|
|
530
|
+
* The status of the reasoning output.
|
|
531
|
+
*/
|
|
532
|
+
status?: 'in_progress' | 'completed' | 'incomplete' | null;
|
|
533
|
+
/**
|
|
534
|
+
* The type identifier, always 'reasoning'.
|
|
535
|
+
*/
|
|
536
|
+
type?: 'reasoning';
|
|
537
|
+
}
|
|
538
|
+
namespace OpenAIResponseOutputMessageReasoningItem {
|
|
539
|
+
/**
|
|
540
|
+
* A summary of reasoning output from the model.
|
|
541
|
+
*/
|
|
542
|
+
interface Summary {
|
|
543
|
+
/**
|
|
544
|
+
* The summary text of the reasoning output.
|
|
545
|
+
*/
|
|
546
|
+
text: string;
|
|
547
|
+
/**
|
|
548
|
+
* The type identifier, always 'summary_text'.
|
|
549
|
+
*/
|
|
550
|
+
type?: 'summary_text';
|
|
551
|
+
}
|
|
552
|
+
/**
|
|
553
|
+
* Reasoning text from the model.
|
|
554
|
+
*/
|
|
555
|
+
interface Content {
|
|
556
|
+
/**
|
|
557
|
+
* The reasoning text content from the model.
|
|
558
|
+
*/
|
|
559
|
+
text: string;
|
|
560
|
+
/**
|
|
561
|
+
* The type identifier, always 'reasoning_text'.
|
|
562
|
+
*/
|
|
563
|
+
type?: 'reasoning_text';
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
/**
|
|
567
|
+
* This represents the output of a function call that gets passed back to the
|
|
568
|
+
* model.
|
|
569
|
+
*/
|
|
570
|
+
interface OpenAIResponseInputFunctionToolCallOutput {
|
|
571
|
+
call_id: string;
|
|
572
|
+
output: string | Array<OpenAIResponseInputFunctionToolCallOutput.OpenAIResponseInputMessageContentText | OpenAIResponseInputFunctionToolCallOutput.OpenAIResponseInputMessageContentImage | OpenAIResponseInputFunctionToolCallOutput.OpenAIResponseInputMessageContentFile>;
|
|
573
|
+
id?: string | null;
|
|
574
|
+
status?: string | null;
|
|
575
|
+
type?: 'function_call_output';
|
|
576
|
+
}
|
|
577
|
+
namespace OpenAIResponseInputFunctionToolCallOutput {
|
|
578
|
+
/**
|
|
579
|
+
* Text content for input messages in OpenAI response format.
|
|
580
|
+
*/
|
|
581
|
+
interface OpenAIResponseInputMessageContentText {
|
|
582
|
+
text: string;
|
|
583
|
+
type?: 'input_text';
|
|
584
|
+
}
|
|
585
|
+
/**
|
|
586
|
+
* Image content for input messages in OpenAI response format.
|
|
587
|
+
*/
|
|
588
|
+
interface OpenAIResponseInputMessageContentImage {
|
|
589
|
+
detail?: 'low' | 'high' | 'auto';
|
|
590
|
+
file_id?: string | null;
|
|
591
|
+
image_url?: string | null;
|
|
592
|
+
type?: 'input_image';
|
|
593
|
+
}
|
|
594
|
+
/**
|
|
595
|
+
* File content for input messages in OpenAI response format.
|
|
596
|
+
*/
|
|
597
|
+
interface OpenAIResponseInputMessageContentFile {
|
|
598
|
+
file_data?: string | null;
|
|
599
|
+
file_id?: string | null;
|
|
600
|
+
file_url?: string | null;
|
|
601
|
+
filename?: string | null;
|
|
602
|
+
type?: 'input_file';
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
/**
|
|
606
|
+
* A response to an MCP approval request.
|
|
607
|
+
*/
|
|
608
|
+
interface OpenAIResponseMcpApprovalResponse {
|
|
609
|
+
approval_request_id: string;
|
|
610
|
+
approve: boolean;
|
|
611
|
+
id?: string | null;
|
|
612
|
+
reason?: string | null;
|
|
613
|
+
type?: 'mcp_approval_response';
|
|
614
|
+
}
|
|
615
|
+
/**
|
|
616
|
+
* A compaction item that summarizes prior conversation context.
|
|
617
|
+
*/
|
|
618
|
+
interface OpenAIResponseCompaction {
|
|
619
|
+
encrypted_content: string;
|
|
620
|
+
id?: string | null;
|
|
621
|
+
type?: 'compaction';
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
/**
|
|
625
|
+
* Corresponds to the various Message types in the Responses API. They are all
|
|
626
|
+
* under one type because the Responses API gives them all the same "type" value,
|
|
627
|
+
* and there is no way to tell them apart in certain scenarios.
|
|
628
|
+
*/
|
|
629
|
+
export interface ResponseMessage {
|
|
630
|
+
content: string | Array<ResponseMessage.OpenAIResponseInputMessageContentText | ResponseMessage.OpenAIResponseInputMessageContentImage | ResponseMessage.OpenAIResponseInputMessageContentFile> | Array<ResponseMessage.OpenAIResponseOutputMessageContentOutputText | ResponseMessage.OpenAIResponseContentPartRefusal>;
|
|
631
|
+
role: 'system' | 'developer' | 'user' | 'assistant';
|
|
632
|
+
id?: string | null;
|
|
633
|
+
status?: string | null;
|
|
634
|
+
type?: 'message';
|
|
635
|
+
}
|
|
636
|
+
export declare namespace ResponseMessage {
|
|
637
|
+
/**
|
|
638
|
+
* Text content for input messages in OpenAI response format.
|
|
639
|
+
*/
|
|
640
|
+
interface OpenAIResponseInputMessageContentText {
|
|
641
|
+
text: string;
|
|
642
|
+
type?: 'input_text';
|
|
643
|
+
}
|
|
644
|
+
/**
|
|
645
|
+
* Image content for input messages in OpenAI response format.
|
|
646
|
+
*/
|
|
647
|
+
interface OpenAIResponseInputMessageContentImage {
|
|
648
|
+
detail?: 'low' | 'high' | 'auto';
|
|
649
|
+
file_id?: string | null;
|
|
650
|
+
image_url?: string | null;
|
|
651
|
+
type?: 'input_image';
|
|
652
|
+
}
|
|
653
|
+
/**
|
|
654
|
+
* File content for input messages in OpenAI response format.
|
|
655
|
+
*/
|
|
656
|
+
interface OpenAIResponseInputMessageContentFile {
|
|
657
|
+
file_data?: string | null;
|
|
658
|
+
file_id?: string | null;
|
|
659
|
+
file_url?: string | null;
|
|
660
|
+
filename?: string | null;
|
|
661
|
+
type?: 'input_file';
|
|
662
|
+
}
|
|
663
|
+
/**
|
|
664
|
+
* Text content within an output message of an OpenAI response.
|
|
665
|
+
*/
|
|
666
|
+
interface OpenAIResponseOutputMessageContentOutputText {
|
|
667
|
+
text: string;
|
|
668
|
+
annotations?: Array<OpenAIResponseOutputMessageContentOutputText.OpenAIResponseAnnotationFileCitation | OpenAIResponseOutputMessageContentOutputText.OpenAIResponseAnnotationCitation | OpenAIResponseOutputMessageContentOutputText.OpenAIResponseAnnotationContainerFileCitation | OpenAIResponseOutputMessageContentOutputText.OpenAIResponseAnnotationFilePath>;
|
|
669
|
+
logprobs?: Array<OpenAIResponseOutputMessageContentOutputText.Logprob> | null;
|
|
670
|
+
type?: 'output_text';
|
|
671
|
+
}
|
|
672
|
+
namespace OpenAIResponseOutputMessageContentOutputText {
|
|
673
|
+
/**
|
|
674
|
+
* File citation annotation for referencing specific files in response content.
|
|
675
|
+
*/
|
|
676
|
+
interface OpenAIResponseAnnotationFileCitation {
|
|
677
|
+
file_id: string;
|
|
678
|
+
filename: string;
|
|
679
|
+
index: number;
|
|
680
|
+
type?: 'file_citation';
|
|
681
|
+
}
|
|
682
|
+
/**
|
|
683
|
+
* URL citation annotation for referencing external web resources.
|
|
684
|
+
*/
|
|
685
|
+
interface OpenAIResponseAnnotationCitation {
|
|
686
|
+
end_index: number;
|
|
687
|
+
start_index: number;
|
|
688
|
+
title: string;
|
|
689
|
+
url: string;
|
|
690
|
+
type?: 'url_citation';
|
|
691
|
+
}
|
|
692
|
+
/**
|
|
693
|
+
* Container file citation annotation referencing a file within a container.
|
|
694
|
+
*/
|
|
695
|
+
interface OpenAIResponseAnnotationContainerFileCitation {
|
|
696
|
+
container_id: string;
|
|
697
|
+
end_index: number;
|
|
698
|
+
file_id: string;
|
|
699
|
+
filename: string;
|
|
700
|
+
start_index: number;
|
|
701
|
+
type?: 'container_file_citation';
|
|
702
|
+
}
|
|
703
|
+
/**
|
|
704
|
+
* File path annotation referencing a generated file in response content.
|
|
705
|
+
*/
|
|
706
|
+
interface OpenAIResponseAnnotationFilePath {
|
|
707
|
+
file_id: string;
|
|
708
|
+
index: number;
|
|
709
|
+
type?: 'file_path';
|
|
710
|
+
}
|
|
711
|
+
/**
|
|
712
|
+
* The log probability for a token from an OpenAI-compatible chat completion
|
|
713
|
+
* response.
|
|
714
|
+
*/
|
|
715
|
+
interface Logprob {
|
|
716
|
+
/**
|
|
717
|
+
* The token.
|
|
718
|
+
*/
|
|
719
|
+
token: string;
|
|
720
|
+
/**
|
|
721
|
+
* The log probability of the token.
|
|
722
|
+
*/
|
|
723
|
+
logprob: number;
|
|
724
|
+
/**
|
|
725
|
+
* The bytes for the token.
|
|
726
|
+
*/
|
|
727
|
+
bytes?: Array<number> | null;
|
|
728
|
+
/**
|
|
729
|
+
* The top log probabilities for the token.
|
|
730
|
+
*/
|
|
731
|
+
top_logprobs?: Array<Logprob.TopLogprob> | null;
|
|
732
|
+
}
|
|
733
|
+
namespace Logprob {
|
|
734
|
+
/**
|
|
735
|
+
* The top log probability for a token from an OpenAI-compatible chat completion
|
|
736
|
+
* response.
|
|
737
|
+
*/
|
|
738
|
+
interface TopLogprob {
|
|
739
|
+
/**
|
|
740
|
+
* The token.
|
|
741
|
+
*/
|
|
742
|
+
token: string;
|
|
743
|
+
/**
|
|
744
|
+
* The log probability of the token.
|
|
745
|
+
*/
|
|
746
|
+
logprob: number;
|
|
747
|
+
/**
|
|
748
|
+
* The bytes for the token.
|
|
749
|
+
*/
|
|
750
|
+
bytes?: Array<number> | null;
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
/**
|
|
755
|
+
* Refusal content within a streamed response part.
|
|
756
|
+
*/
|
|
757
|
+
interface OpenAIResponseContentPartRefusal {
|
|
758
|
+
refusal: string;
|
|
759
|
+
type?: 'refusal';
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
/**
|
|
763
|
+
* Complete OpenAI response object containing generation results and metadata.
|
|
764
|
+
*/
|
|
765
|
+
export interface ResponseObject {
|
|
766
|
+
id: string;
|
|
767
|
+
created_at: number;
|
|
768
|
+
model: string;
|
|
769
|
+
output: Array<ResponseObject.OpenAIResponseMessageOutput | ResponseObject.OpenAIResponseOutputMessageWebSearchToolCall | ResponseObject.OpenAIResponseOutputMessageFileSearchToolCall | ResponseObject.OpenAIResponseOutputMessageFunctionToolCall | ResponseObject.OpenAIResponseOutputMessageMcpCall | ResponseObject.OpenAIResponseOutputMessageMcpListTools | ResponseObject.OpenAIResponseMcpApprovalRequest | ResponseObject.OpenAIResponseOutputMessageReasoningItem>;
|
|
770
|
+
status: string;
|
|
771
|
+
store: boolean;
|
|
772
|
+
background?: boolean;
|
|
773
|
+
completed_at?: number | null;
|
|
774
|
+
/**
|
|
775
|
+
* Error details for failed OpenAI response requests.
|
|
776
|
+
*/
|
|
777
|
+
error?: ResponseObject.Error | null;
|
|
778
|
+
frequency_penalty?: number;
|
|
779
|
+
/**
|
|
780
|
+
* Details explaining why a response was incomplete.
|
|
781
|
+
*/
|
|
782
|
+
incomplete_details?: ResponseObject.IncompleteDetails | null;
|
|
783
|
+
instructions?: string | null;
|
|
784
|
+
max_output_tokens?: number | null;
|
|
785
|
+
max_tool_calls?: number | null;
|
|
786
|
+
metadata?: {
|
|
787
|
+
[key: string]: string;
|
|
788
|
+
} | null;
|
|
789
|
+
object?: 'response';
|
|
790
|
+
parallel_tool_calls?: boolean;
|
|
791
|
+
presence_penalty?: number;
|
|
792
|
+
previous_response_id?: string | null;
|
|
793
|
+
/**
|
|
794
|
+
* OpenAI compatible Prompt object that is used in OpenAI responses.
|
|
795
|
+
*/
|
|
796
|
+
prompt?: ResponseObject.Prompt | null;
|
|
797
|
+
prompt_cache_key?: string | null;
|
|
798
|
+
/**
|
|
799
|
+
* Configuration for reasoning effort in OpenAI responses.
|
|
800
|
+
*
|
|
801
|
+
* Controls how much reasoning the model performs before generating a response.
|
|
802
|
+
*/
|
|
803
|
+
reasoning?: ResponseObject.Reasoning | null;
|
|
804
|
+
safety_identifier?: string | null;
|
|
805
|
+
service_tier?: string;
|
|
806
|
+
temperature?: number;
|
|
807
|
+
/**
|
|
808
|
+
* Text response configuration for OpenAI responses.
|
|
809
|
+
*/
|
|
810
|
+
text?: ResponseObject.Text;
|
|
811
|
+
/**
|
|
812
|
+
* Enumeration of simple tool choice modes for response generation.
|
|
813
|
+
*/
|
|
814
|
+
tool_choice?: 'auto' | 'required' | 'none' | ResponseObject.OpenAIResponseInputToolChoiceAllowedTools | ResponseObject.OpenAIResponseInputToolChoiceFileSearch | ResponseObject.OpenAIResponseInputToolChoiceWebSearch | ResponseObject.OpenAIResponseInputToolChoiceFunctionTool | ResponseObject.OpenAIResponseInputToolChoiceMcpTool | ResponseObject.OpenAIResponseInputToolChoiceCustomTool | null;
|
|
815
|
+
tools?: Array<ResponseObject.OpenAIResponseInputToolWebSearch | ResponseObject.OpenAIResponseInputToolFileSearch | ResponseObject.OpenAIResponseInputToolFunction | ResponseObject.OpenAIResponseToolMcp>;
|
|
816
|
+
top_logprobs?: number;
|
|
817
|
+
top_p?: number;
|
|
818
|
+
truncation?: string | null;
|
|
819
|
+
/**
|
|
820
|
+
* Usage information for OpenAI response.
|
|
821
|
+
*/
|
|
822
|
+
usage?: ResponseObject.Usage | null;
|
|
823
|
+
}
|
|
824
|
+
export declare namespace ResponseObject {
|
|
825
|
+
/**
|
|
826
|
+
* Corresponds to the various Message types in the Responses API. They are all
|
|
827
|
+
* under one type because the Responses API gives them all the same "type" value,
|
|
828
|
+
* and there is no way to tell them apart in certain scenarios.
|
|
829
|
+
*/
|
|
830
|
+
interface OpenAIResponseMessageOutput {
|
|
831
|
+
content: string | Array<OpenAIResponseMessageOutput.OpenAIResponseInputMessageContentText | OpenAIResponseMessageOutput.OpenAIResponseInputMessageContentImage | OpenAIResponseMessageOutput.OpenAIResponseInputMessageContentFile> | Array<OpenAIResponseMessageOutput.OpenAIResponseOutputMessageContentOutputTextOutput | OpenAIResponseMessageOutput.OpenAIResponseContentPartRefusal>;
|
|
832
|
+
role: 'system' | 'developer' | 'user' | 'assistant';
|
|
833
|
+
id?: string | null;
|
|
834
|
+
status?: string | null;
|
|
835
|
+
type?: 'message';
|
|
836
|
+
}
|
|
837
|
+
namespace OpenAIResponseMessageOutput {
|
|
838
|
+
/**
|
|
839
|
+
* Text content for input messages in OpenAI response format.
|
|
840
|
+
*/
|
|
841
|
+
interface OpenAIResponseInputMessageContentText {
|
|
842
|
+
text: string;
|
|
843
|
+
type?: 'input_text';
|
|
844
|
+
}
|
|
845
|
+
/**
|
|
846
|
+
* Image content for input messages in OpenAI response format.
|
|
847
|
+
*/
|
|
848
|
+
interface OpenAIResponseInputMessageContentImage {
|
|
849
|
+
detail?: 'low' | 'high' | 'auto';
|
|
850
|
+
file_id?: string | null;
|
|
851
|
+
image_url?: string | null;
|
|
852
|
+
type?: 'input_image';
|
|
853
|
+
}
|
|
854
|
+
/**
|
|
855
|
+
* File content for input messages in OpenAI response format.
|
|
856
|
+
*/
|
|
857
|
+
interface OpenAIResponseInputMessageContentFile {
|
|
858
|
+
file_data?: string | null;
|
|
859
|
+
file_id?: string | null;
|
|
860
|
+
file_url?: string | null;
|
|
861
|
+
filename?: string | null;
|
|
862
|
+
type?: 'input_file';
|
|
863
|
+
}
|
|
864
|
+
/**
|
|
865
|
+
* Text content within an output message of an OpenAI response.
|
|
866
|
+
*/
|
|
867
|
+
interface OpenAIResponseOutputMessageContentOutputTextOutput {
|
|
868
|
+
text: string;
|
|
869
|
+
annotations?: Array<OpenAIResponseOutputMessageContentOutputTextOutput.OpenAIResponseAnnotationFileCitation | OpenAIResponseOutputMessageContentOutputTextOutput.OpenAIResponseAnnotationCitation | OpenAIResponseOutputMessageContentOutputTextOutput.OpenAIResponseAnnotationContainerFileCitation | OpenAIResponseOutputMessageContentOutputTextOutput.OpenAIResponseAnnotationFilePath>;
|
|
870
|
+
logprobs?: Array<OpenAIResponseOutputMessageContentOutputTextOutput.Logprob> | null;
|
|
871
|
+
type?: 'output_text';
|
|
872
|
+
}
|
|
873
|
+
namespace OpenAIResponseOutputMessageContentOutputTextOutput {
|
|
874
|
+
/**
|
|
875
|
+
* File citation annotation for referencing specific files in response content.
|
|
876
|
+
*/
|
|
877
|
+
interface OpenAIResponseAnnotationFileCitation {
|
|
878
|
+
file_id: string;
|
|
879
|
+
filename: string;
|
|
880
|
+
index: number;
|
|
881
|
+
type?: 'file_citation';
|
|
882
|
+
}
|
|
883
|
+
/**
|
|
884
|
+
* URL citation annotation for referencing external web resources.
|
|
885
|
+
*/
|
|
886
|
+
interface OpenAIResponseAnnotationCitation {
|
|
887
|
+
end_index: number;
|
|
888
|
+
start_index: number;
|
|
889
|
+
title: string;
|
|
890
|
+
url: string;
|
|
891
|
+
type?: 'url_citation';
|
|
892
|
+
}
|
|
893
|
+
/**
|
|
894
|
+
* Container file citation annotation referencing a file within a container.
|
|
895
|
+
*/
|
|
896
|
+
interface OpenAIResponseAnnotationContainerFileCitation {
|
|
897
|
+
container_id: string;
|
|
898
|
+
end_index: number;
|
|
899
|
+
file_id: string;
|
|
900
|
+
filename: string;
|
|
901
|
+
start_index: number;
|
|
902
|
+
type?: 'container_file_citation';
|
|
903
|
+
}
|
|
904
|
+
/**
|
|
905
|
+
* File path annotation referencing a generated file in response content.
|
|
906
|
+
*/
|
|
907
|
+
interface OpenAIResponseAnnotationFilePath {
|
|
908
|
+
file_id: string;
|
|
909
|
+
index: number;
|
|
910
|
+
type?: 'file_path';
|
|
911
|
+
}
|
|
912
|
+
/**
|
|
913
|
+
* The log probability for a token from an OpenAI-compatible chat completion
|
|
914
|
+
* response.
|
|
915
|
+
*/
|
|
916
|
+
interface Logprob {
|
|
917
|
+
/**
|
|
918
|
+
* The token.
|
|
919
|
+
*/
|
|
920
|
+
token: string;
|
|
921
|
+
/**
|
|
922
|
+
* The log probability of the token.
|
|
923
|
+
*/
|
|
924
|
+
logprob: number;
|
|
925
|
+
/**
|
|
926
|
+
* The bytes for the token.
|
|
927
|
+
*/
|
|
928
|
+
bytes?: Array<number> | null;
|
|
929
|
+
/**
|
|
930
|
+
* The top log probabilities for the token.
|
|
931
|
+
*/
|
|
932
|
+
top_logprobs?: Array<Logprob.TopLogprob> | null;
|
|
933
|
+
}
|
|
934
|
+
namespace Logprob {
|
|
935
|
+
/**
|
|
936
|
+
* The top log probability for a token from an OpenAI-compatible chat completion
|
|
937
|
+
* response.
|
|
938
|
+
*/
|
|
939
|
+
interface TopLogprob {
|
|
940
|
+
/**
|
|
941
|
+
* The token.
|
|
942
|
+
*/
|
|
943
|
+
token: string;
|
|
944
|
+
/**
|
|
945
|
+
* The log probability of the token.
|
|
946
|
+
*/
|
|
947
|
+
logprob: number;
|
|
948
|
+
/**
|
|
949
|
+
* The bytes for the token.
|
|
950
|
+
*/
|
|
951
|
+
bytes?: Array<number> | null;
|
|
952
|
+
}
|
|
953
|
+
}
|
|
954
|
+
}
|
|
955
|
+
/**
|
|
956
|
+
* Refusal content within a streamed response part.
|
|
957
|
+
*/
|
|
958
|
+
interface OpenAIResponseContentPartRefusal {
|
|
959
|
+
refusal: string;
|
|
960
|
+
type?: 'refusal';
|
|
961
|
+
}
|
|
962
|
+
}
|
|
963
|
+
/**
|
|
964
|
+
* Web search tool call output message for OpenAI responses.
|
|
965
|
+
*/
|
|
966
|
+
interface OpenAIResponseOutputMessageWebSearchToolCall {
|
|
967
|
+
id: string;
|
|
968
|
+
status: string;
|
|
969
|
+
type?: 'web_search_call';
|
|
970
|
+
}
|
|
971
|
+
/**
|
|
972
|
+
* File search tool call output message for OpenAI responses.
|
|
973
|
+
*/
|
|
974
|
+
interface OpenAIResponseOutputMessageFileSearchToolCall {
|
|
975
|
+
id: string;
|
|
976
|
+
queries: Array<string>;
|
|
977
|
+
status: string;
|
|
978
|
+
results?: Array<OpenAIResponseOutputMessageFileSearchToolCall.Result> | null;
|
|
979
|
+
type?: 'file_search_call';
|
|
980
|
+
}
|
|
981
|
+
namespace OpenAIResponseOutputMessageFileSearchToolCall {
|
|
982
|
+
/**
|
|
983
|
+
* Search results returned by the file search operation.
|
|
984
|
+
*/
|
|
985
|
+
interface Result {
|
|
986
|
+
attributes: {
|
|
987
|
+
[key: string]: unknown;
|
|
988
|
+
};
|
|
989
|
+
file_id: string;
|
|
990
|
+
filename: string;
|
|
991
|
+
score: number;
|
|
992
|
+
text: string;
|
|
993
|
+
}
|
|
994
|
+
}
|
|
995
|
+
/**
|
|
996
|
+
* Function tool call output message for OpenAI responses.
|
|
997
|
+
*/
|
|
998
|
+
interface OpenAIResponseOutputMessageFunctionToolCall {
|
|
999
|
+
arguments: string;
|
|
1000
|
+
call_id: string;
|
|
1001
|
+
name: string;
|
|
1002
|
+
id?: string | null;
|
|
1003
|
+
status?: string | null;
|
|
1004
|
+
type?: 'function_call';
|
|
1005
|
+
}
|
|
1006
|
+
/**
|
|
1007
|
+
* Model Context Protocol (MCP) call output message for OpenAI responses.
|
|
1008
|
+
*/
|
|
1009
|
+
interface OpenAIResponseOutputMessageMcpCall {
|
|
1010
|
+
id: string;
|
|
1011
|
+
arguments: string;
|
|
1012
|
+
name: string;
|
|
1013
|
+
server_label: string;
|
|
1014
|
+
error?: string | null;
|
|
1015
|
+
output?: string | null;
|
|
1016
|
+
type?: 'mcp_call';
|
|
1017
|
+
}
|
|
1018
|
+
/**
|
|
1019
|
+
* MCP list tools output message containing available tools from an MCP server.
|
|
1020
|
+
*/
|
|
1021
|
+
interface OpenAIResponseOutputMessageMcpListTools {
|
|
1022
|
+
id: string;
|
|
1023
|
+
server_label: string;
|
|
1024
|
+
tools: Array<OpenAIResponseOutputMessageMcpListTools.Tool>;
|
|
1025
|
+
type?: 'mcp_list_tools';
|
|
1026
|
+
}
|
|
1027
|
+
namespace OpenAIResponseOutputMessageMcpListTools {
|
|
1028
|
+
/**
|
|
1029
|
+
* Tool definition returned by MCP list tools operation.
|
|
1030
|
+
*/
|
|
1031
|
+
interface Tool {
|
|
1032
|
+
input_schema: {
|
|
1033
|
+
[key: string]: unknown;
|
|
1034
|
+
};
|
|
1035
|
+
name: string;
|
|
1036
|
+
description?: string | null;
|
|
1037
|
+
}
|
|
1038
|
+
}
|
|
1039
|
+
/**
|
|
1040
|
+
* A request for human approval of a tool invocation.
|
|
1041
|
+
*/
|
|
1042
|
+
interface OpenAIResponseMcpApprovalRequest {
|
|
1043
|
+
id: string;
|
|
1044
|
+
arguments: string;
|
|
1045
|
+
name: string;
|
|
1046
|
+
server_label: string;
|
|
1047
|
+
type?: 'mcp_approval_request';
|
|
1048
|
+
}
|
|
1049
|
+
/**
|
|
1050
|
+
* Reasoning output from the model, representing the model's thinking process.
|
|
1051
|
+
*/
|
|
1052
|
+
interface OpenAIResponseOutputMessageReasoningItem {
|
|
1053
|
+
/**
|
|
1054
|
+
* Unique identifier for the reasoning output item.
|
|
1055
|
+
*/
|
|
1056
|
+
id: string;
|
|
1057
|
+
/**
|
|
1058
|
+
* Summary of the reasoning output.
|
|
1059
|
+
*/
|
|
1060
|
+
summary: Array<OpenAIResponseOutputMessageReasoningItem.Summary>;
|
|
1061
|
+
/**
|
|
1062
|
+
* The reasoning content from the model.
|
|
1063
|
+
*/
|
|
1064
|
+
content?: Array<OpenAIResponseOutputMessageReasoningItem.Content> | null;
|
|
1065
|
+
/**
|
|
1066
|
+
* The status of the reasoning output.
|
|
1067
|
+
*/
|
|
1068
|
+
status?: 'in_progress' | 'completed' | 'incomplete' | null;
|
|
1069
|
+
/**
|
|
1070
|
+
* The type identifier, always 'reasoning'.
|
|
1071
|
+
*/
|
|
1072
|
+
type?: 'reasoning';
|
|
1073
|
+
}
|
|
1074
|
+
namespace OpenAIResponseOutputMessageReasoningItem {
|
|
1075
|
+
/**
|
|
1076
|
+
* A summary of reasoning output from the model.
|
|
1077
|
+
*/
|
|
1078
|
+
interface Summary {
|
|
1079
|
+
/**
|
|
1080
|
+
* The summary text of the reasoning output.
|
|
1081
|
+
*/
|
|
1082
|
+
text: string;
|
|
1083
|
+
/**
|
|
1084
|
+
* The type identifier, always 'summary_text'.
|
|
1085
|
+
*/
|
|
1086
|
+
type?: 'summary_text';
|
|
1087
|
+
}
|
|
1088
|
+
/**
|
|
1089
|
+
* Reasoning text from the model.
|
|
1090
|
+
*/
|
|
1091
|
+
interface Content {
|
|
1092
|
+
/**
|
|
1093
|
+
* The reasoning text content from the model.
|
|
1094
|
+
*/
|
|
1095
|
+
text: string;
|
|
1096
|
+
/**
|
|
1097
|
+
* The type identifier, always 'reasoning_text'.
|
|
1098
|
+
*/
|
|
1099
|
+
type?: 'reasoning_text';
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1102
|
+
/**
|
|
1103
|
+
* Error details for failed OpenAI response requests.
|
|
1104
|
+
*/
|
|
1105
|
+
interface Error {
|
|
1106
|
+
code: string;
|
|
1107
|
+
message: string;
|
|
1108
|
+
}
|
|
1109
|
+
/**
|
|
1110
|
+
* Details explaining why a response was incomplete.
|
|
1111
|
+
*/
|
|
1112
|
+
interface IncompleteDetails {
|
|
1113
|
+
reason: string;
|
|
1114
|
+
}
|
|
1115
|
+
/**
|
|
1116
|
+
* OpenAI compatible Prompt object that is used in OpenAI responses.
|
|
1117
|
+
*/
|
|
1118
|
+
interface Prompt {
|
|
1119
|
+
id: string;
|
|
1120
|
+
variables?: {
|
|
1121
|
+
[key: string]: Prompt.OpenAIResponseInputMessageContentText | Prompt.OpenAIResponseInputMessageContentImage | Prompt.OpenAIResponseInputMessageContentFile;
|
|
1122
|
+
} | null;
|
|
1123
|
+
version?: string | null;
|
|
1124
|
+
}
|
|
1125
|
+
namespace Prompt {
|
|
1126
|
+
/**
|
|
1127
|
+
* Text content for input messages in OpenAI response format.
|
|
1128
|
+
*/
|
|
1129
|
+
interface OpenAIResponseInputMessageContentText {
|
|
1130
|
+
text: string;
|
|
1131
|
+
type?: 'input_text';
|
|
1132
|
+
}
|
|
1133
|
+
/**
|
|
1134
|
+
* Image content for input messages in OpenAI response format.
|
|
1135
|
+
*/
|
|
1136
|
+
interface OpenAIResponseInputMessageContentImage {
|
|
1137
|
+
detail?: 'low' | 'high' | 'auto';
|
|
1138
|
+
file_id?: string | null;
|
|
1139
|
+
image_url?: string | null;
|
|
1140
|
+
type?: 'input_image';
|
|
1141
|
+
}
|
|
1142
|
+
/**
|
|
1143
|
+
* File content for input messages in OpenAI response format.
|
|
1144
|
+
*/
|
|
1145
|
+
interface OpenAIResponseInputMessageContentFile {
|
|
1146
|
+
file_data?: string | null;
|
|
1147
|
+
file_id?: string | null;
|
|
1148
|
+
file_url?: string | null;
|
|
1149
|
+
filename?: string | null;
|
|
1150
|
+
type?: 'input_file';
|
|
1151
|
+
}
|
|
1152
|
+
}
|
|
1153
|
+
/**
|
|
1154
|
+
* Configuration for reasoning effort in OpenAI responses.
|
|
1155
|
+
*
|
|
1156
|
+
* Controls how much reasoning the model performs before generating a response.
|
|
1157
|
+
*/
|
|
1158
|
+
interface Reasoning {
|
|
1159
|
+
effort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | null;
|
|
1160
|
+
/**
|
|
1161
|
+
* Summary mode for reasoning output. One of 'auto', 'concise', or 'detailed'.
|
|
1162
|
+
*/
|
|
1163
|
+
summary?: 'auto' | 'concise' | 'detailed' | null;
|
|
1164
|
+
}
|
|
1165
|
+
/**
|
|
1166
|
+
* Text response configuration for OpenAI responses.
|
|
1167
|
+
*/
|
|
1168
|
+
interface Text {
|
|
1169
|
+
/**
|
|
1170
|
+
* Configuration for Responses API text format.
|
|
1171
|
+
*/
|
|
1172
|
+
format?: Text.Format | null;
|
|
1173
|
+
verbosity?: 'low' | 'medium' | 'high' | null;
|
|
1174
|
+
}
|
|
1175
|
+
namespace Text {
|
|
1176
|
+
/**
|
|
1177
|
+
* Configuration for Responses API text format.
|
|
1178
|
+
*/
|
|
1179
|
+
interface Format {
|
|
1180
|
+
description?: string | null;
|
|
1181
|
+
name?: string | null;
|
|
1182
|
+
schema?: {
|
|
1183
|
+
[key: string]: unknown;
|
|
1184
|
+
} | null;
|
|
1185
|
+
strict?: boolean | null;
|
|
1186
|
+
type?: 'text' | 'json_schema' | 'json_object';
|
|
1187
|
+
}
|
|
1188
|
+
}
|
|
1189
|
+
/**
|
|
1190
|
+
* Constrains the tools available to the model to a pre-defined set.
|
|
1191
|
+
*/
|
|
1192
|
+
interface OpenAIResponseInputToolChoiceAllowedTools {
|
|
1193
|
+
tools: Array<{
|
|
1194
|
+
[key: string]: string;
|
|
1195
|
+
}>;
|
|
1196
|
+
mode?: 'auto' | 'required';
|
|
1197
|
+
type?: 'allowed_tools';
|
|
1198
|
+
}
|
|
1199
|
+
/**
|
|
1200
|
+
* Indicates that the model should use file search to generate a response.
|
|
1201
|
+
*/
|
|
1202
|
+
interface OpenAIResponseInputToolChoiceFileSearch {
|
|
1203
|
+
type?: 'file_search';
|
|
1204
|
+
}
|
|
1205
|
+
/**
|
|
1206
|
+
* Indicates that the model should use web search to generate a response
|
|
1207
|
+
*/
|
|
1208
|
+
interface OpenAIResponseInputToolChoiceWebSearch {
|
|
1209
|
+
type?: 'web_search' | 'web_search_preview' | 'web_search_preview_2025_03_11' | 'web_search_2025_08_26';
|
|
1210
|
+
}
|
|
1211
|
+
/**
|
|
1212
|
+
* Forces the model to call a specific function.
|
|
1213
|
+
*/
|
|
1214
|
+
interface OpenAIResponseInputToolChoiceFunctionTool {
|
|
1215
|
+
name: string;
|
|
1216
|
+
type?: 'function';
|
|
1217
|
+
}
|
|
1218
|
+
/**
|
|
1219
|
+
* Forces the model to call a specific tool on a remote MCP server
|
|
1220
|
+
*/
|
|
1221
|
+
interface OpenAIResponseInputToolChoiceMcpTool {
|
|
1222
|
+
server_label: string;
|
|
1223
|
+
name?: string | null;
|
|
1224
|
+
type?: 'mcp';
|
|
1225
|
+
}
|
|
1226
|
+
/**
|
|
1227
|
+
* Forces the model to call a custom tool.
|
|
1228
|
+
*/
|
|
1229
|
+
interface OpenAIResponseInputToolChoiceCustomTool {
|
|
1230
|
+
name: string;
|
|
1231
|
+
type?: 'custom';
|
|
1232
|
+
}
|
|
1233
|
+
/**
|
|
1234
|
+
* Web search tool configuration for OpenAI response inputs.
|
|
1235
|
+
*/
|
|
1236
|
+
interface OpenAIResponseInputToolWebSearch {
|
|
1237
|
+
search_context_size?: string | null;
|
|
1238
|
+
type?: 'web_search' | 'web_search_preview' | 'web_search_preview_2025_03_11' | 'web_search_2025_08_26';
|
|
1239
|
+
}
|
|
1240
|
+
/**
|
|
1241
|
+
* File search tool configuration for OpenAI response inputs.
|
|
1242
|
+
*/
|
|
1243
|
+
interface OpenAIResponseInputToolFileSearch {
|
|
1244
|
+
vector_store_ids: Array<string>;
|
|
1245
|
+
filters?: {
|
|
1246
|
+
[key: string]: unknown;
|
|
1247
|
+
} | null;
|
|
1248
|
+
max_num_results?: number | null;
|
|
1249
|
+
/**
|
|
1250
|
+
* Options for ranking and filtering search results.
|
|
1251
|
+
*
|
|
1252
|
+
* This class configures how search results are ranked and filtered. You can use
|
|
1253
|
+
* algorithm-based rerankers (weighted, RRF) or neural rerankers. Defaults from
|
|
1254
|
+
* VectorStoresConfig are used when parameters are not provided.
|
|
1255
|
+
*
|
|
1256
|
+
* Examples: # Weighted ranker with custom alpha
|
|
1257
|
+
* SearchRankingOptions(ranker="weighted", alpha=0.7)
|
|
1258
|
+
*
|
|
1259
|
+
* # RRF ranker with custom impact factor
|
|
1260
|
+
* SearchRankingOptions(ranker="rrf", impact_factor=50.0)
|
|
1261
|
+
*
|
|
1262
|
+
* # Use config defaults (just specify ranker type)
|
|
1263
|
+
* SearchRankingOptions(ranker="weighted") # Uses alpha from VectorStoresConfig
|
|
1264
|
+
*
|
|
1265
|
+
* # Score threshold filtering
|
|
1266
|
+
* SearchRankingOptions(ranker="weighted", score_threshold=0.5)
|
|
1267
|
+
*/
|
|
1268
|
+
ranking_options?: OpenAIResponseInputToolFileSearch.RankingOptions | null;
|
|
1269
|
+
type?: 'file_search';
|
|
1270
|
+
}
|
|
1271
|
+
namespace OpenAIResponseInputToolFileSearch {
|
|
1272
|
+
/**
|
|
1273
|
+
* Options for ranking and filtering search results.
|
|
1274
|
+
*
|
|
1275
|
+
* This class configures how search results are ranked and filtered. You can use
|
|
1276
|
+
* algorithm-based rerankers (weighted, RRF) or neural rerankers. Defaults from
|
|
1277
|
+
* VectorStoresConfig are used when parameters are not provided.
|
|
1278
|
+
*
|
|
1279
|
+
* Examples: # Weighted ranker with custom alpha
|
|
1280
|
+
* SearchRankingOptions(ranker="weighted", alpha=0.7)
|
|
1281
|
+
*
|
|
1282
|
+
* # RRF ranker with custom impact factor
|
|
1283
|
+
* SearchRankingOptions(ranker="rrf", impact_factor=50.0)
|
|
1284
|
+
*
|
|
1285
|
+
* # Use config defaults (just specify ranker type)
|
|
1286
|
+
* SearchRankingOptions(ranker="weighted") # Uses alpha from VectorStoresConfig
|
|
1287
|
+
*
|
|
1288
|
+
* # Score threshold filtering
|
|
1289
|
+
* SearchRankingOptions(ranker="weighted", score_threshold=0.5)
|
|
1290
|
+
*/
|
|
1291
|
+
interface RankingOptions {
|
|
1292
|
+
/**
|
|
1293
|
+
* Weight factor for weighted ranker
|
|
1294
|
+
*/
|
|
1295
|
+
alpha?: number | null;
|
|
1296
|
+
/**
|
|
1297
|
+
* Impact factor for RRF algorithm
|
|
1298
|
+
*/
|
|
1299
|
+
impact_factor?: number | null;
|
|
1300
|
+
/**
|
|
1301
|
+
* Model identifier for neural reranker
|
|
1302
|
+
*/
|
|
1303
|
+
model?: string | null;
|
|
1304
|
+
ranker?: string | null;
|
|
1305
|
+
score_threshold?: number | null;
|
|
1306
|
+
/**
|
|
1307
|
+
* Weights for combining vector, keyword, and neural scores. Keys: 'vector',
|
|
1308
|
+
* 'keyword', 'neural'
|
|
1309
|
+
*/
|
|
1310
|
+
weights?: {
|
|
1311
|
+
[key: string]: number;
|
|
1312
|
+
} | null;
|
|
1313
|
+
}
|
|
1314
|
+
}
|
|
1315
|
+
/**
|
|
1316
|
+
* Function tool configuration for OpenAI response inputs.
|
|
1317
|
+
*/
|
|
1318
|
+
interface OpenAIResponseInputToolFunction {
|
|
1319
|
+
name: string;
|
|
1320
|
+
parameters: {
|
|
1321
|
+
[key: string]: unknown;
|
|
1322
|
+
} | null;
|
|
1323
|
+
description?: string | null;
|
|
1324
|
+
strict?: boolean | null;
|
|
1325
|
+
type?: 'function';
|
|
1326
|
+
}
|
|
1327
|
+
/**
|
|
1328
|
+
* Model Context Protocol (MCP) tool configuration for OpenAI response object.
|
|
1329
|
+
*/
|
|
1330
|
+
interface OpenAIResponseToolMcp {
|
|
1331
|
+
server_label: string;
|
|
1332
|
+
/**
|
|
1333
|
+
* Filter configuration for restricting which MCP tools can be used.
|
|
1334
|
+
*/
|
|
1335
|
+
allowed_tools?: Array<string> | OpenAIResponseToolMcp.AllowedToolsFilter | null;
|
|
1336
|
+
type?: 'mcp';
|
|
1337
|
+
}
|
|
1338
|
+
namespace OpenAIResponseToolMcp {
|
|
1339
|
+
/**
|
|
1340
|
+
* Filter configuration for restricting which MCP tools can be used.
|
|
1341
|
+
*/
|
|
1342
|
+
interface AllowedToolsFilter {
|
|
1343
|
+
tool_names?: Array<string> | null;
|
|
1344
|
+
}
|
|
1345
|
+
}
|
|
1346
|
+
/**
|
|
1347
|
+
* Usage information for OpenAI response.
|
|
1348
|
+
*/
|
|
1349
|
+
interface Usage {
|
|
1350
|
+
input_tokens: number;
|
|
1351
|
+
/**
|
|
1352
|
+
* Token details for input tokens in OpenAI response usage.
|
|
1353
|
+
*/
|
|
1354
|
+
input_tokens_details: Usage.InputTokensDetails;
|
|
1355
|
+
output_tokens: number;
|
|
1356
|
+
/**
|
|
1357
|
+
* Token details for output tokens in OpenAI response usage.
|
|
1358
|
+
*/
|
|
1359
|
+
output_tokens_details: Usage.OutputTokensDetails;
|
|
1360
|
+
total_tokens: number;
|
|
1361
|
+
}
|
|
1362
|
+
namespace Usage {
|
|
1363
|
+
/**
|
|
1364
|
+
* Token details for input tokens in OpenAI response usage.
|
|
1365
|
+
*/
|
|
1366
|
+
interface InputTokensDetails {
|
|
1367
|
+
cached_tokens: number;
|
|
1368
|
+
}
|
|
1369
|
+
/**
|
|
1370
|
+
* Token details for output tokens in OpenAI response usage.
|
|
1371
|
+
*/
|
|
1372
|
+
interface OutputTokensDetails {
|
|
1373
|
+
reasoning_tokens: number;
|
|
1374
|
+
}
|
|
1375
|
+
}
|
|
1376
|
+
}
|
|
1377
|
+
/**
|
|
1378
|
+
* Streaming event indicating a new response has been created.
|
|
1379
|
+
*/
|
|
1380
|
+
export type ResponseObjectStream = ResponseObjectStream.OpenAIResponseObjectStreamResponseCreated | ResponseObjectStream.OpenAIResponseObjectStreamResponseInProgress | ResponseObjectStream.OpenAIResponseObjectStreamResponseOutputItemAdded | ResponseObjectStream.OpenAIResponseObjectStreamResponseOutputItemDone | ResponseObjectStream.OpenAIResponseObjectStreamResponseOutputTextDelta | ResponseObjectStream.OpenAIResponseObjectStreamResponseOutputTextDone | ResponseObjectStream.OpenAIResponseObjectStreamResponseFunctionCallArgumentsDelta | ResponseObjectStream.OpenAIResponseObjectStreamResponseFunctionCallArgumentsDone | ResponseObjectStream.OpenAIResponseObjectStreamResponseWebSearchCallInProgress | ResponseObjectStream.OpenAIResponseObjectStreamResponseWebSearchCallSearching | ResponseObjectStream.OpenAIResponseObjectStreamResponseWebSearchCallCompleted | ResponseObjectStream.OpenAIResponseObjectStreamResponseMcpListToolsInProgress | ResponseObjectStream.OpenAIResponseObjectStreamResponseMcpListToolsFailed | ResponseObjectStream.OpenAIResponseObjectStreamResponseMcpListToolsCompleted | ResponseObjectStream.OpenAIResponseObjectStreamResponseMcpCallArgumentsDelta | ResponseObjectStream.OpenAIResponseObjectStreamResponseMcpCallArgumentsDone | ResponseObjectStream.OpenAIResponseObjectStreamResponseMcpCallInProgress | ResponseObjectStream.OpenAIResponseObjectStreamResponseMcpCallFailed | ResponseObjectStream.OpenAIResponseObjectStreamResponseMcpCallCompleted | ResponseObjectStream.OpenAIResponseObjectStreamResponseContentPartAdded | ResponseObjectStream.OpenAIResponseObjectStreamResponseContentPartDone | ResponseObjectStream.OpenAIResponseObjectStreamResponseReasoningTextDelta | ResponseObjectStream.OpenAIResponseObjectStreamResponseReasoningTextDone | ResponseObjectStream.OpenAIResponseObjectStreamResponseReasoningSummaryPartAdded | ResponseObjectStream.OpenAIResponseObjectStreamResponseReasoningSummaryPartDone | ResponseObjectStream.OpenAIResponseObjectStreamResponseReasoningSummaryTextDelta | ResponseObjectStream.OpenAIResponseObjectStreamResponseReasoningSummaryTextDone | ResponseObjectStream.OpenAIResponseObjectStreamResponseRefusalDelta | ResponseObjectStream.OpenAIResponseObjectStreamResponseRefusalDone | ResponseObjectStream.OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded | ResponseObjectStream.OpenAIResponseObjectStreamResponseFileSearchCallInProgress | ResponseObjectStream.OpenAIResponseObjectStreamResponseFileSearchCallSearching | ResponseObjectStream.OpenAIResponseObjectStreamResponseFileSearchCallCompleted | ResponseObjectStream.OpenAIResponseObjectStreamResponseIncomplete | ResponseObjectStream.OpenAIResponseObjectStreamResponseFailed | ResponseObjectStream.OpenAIResponseObjectStreamResponseCompleted | ResponseObjectStream.OpenAIResponseObjectStreamError;
|
|
1381
|
+
export declare namespace ResponseObjectStream {
|
|
1382
|
+
/**
|
|
1383
|
+
* Streaming event indicating a new response has been created.
|
|
1384
|
+
*/
|
|
1385
|
+
interface OpenAIResponseObjectStreamResponseCreated {
|
|
1386
|
+
/**
|
|
1387
|
+
* Complete OpenAI response object containing generation results and metadata.
|
|
1388
|
+
*/
|
|
1389
|
+
response: ResponsesAPI.ResponseObject;
|
|
1390
|
+
sequence_number: number;
|
|
1391
|
+
type?: 'response.created';
|
|
1392
|
+
}
|
|
1393
|
+
/**
|
|
1394
|
+
* Streaming event indicating the response remains in progress.
|
|
1395
|
+
*/
|
|
1396
|
+
interface OpenAIResponseObjectStreamResponseInProgress {
|
|
1397
|
+
/**
|
|
1398
|
+
* Complete OpenAI response object containing generation results and metadata.
|
|
1399
|
+
*/
|
|
1400
|
+
response: ResponsesAPI.ResponseObject;
|
|
1401
|
+
sequence_number: number;
|
|
1402
|
+
type?: 'response.in_progress';
|
|
1403
|
+
}
|
|
1404
|
+
/**
|
|
1405
|
+
* Streaming event for when a new output item is added to the response.
|
|
1406
|
+
*/
|
|
1407
|
+
interface OpenAIResponseObjectStreamResponseOutputItemAdded {
|
|
1408
|
+
/**
|
|
1409
|
+
* Corresponds to the various Message types in the Responses API. They are all
|
|
1410
|
+
* under one type because the Responses API gives them all the same "type" value,
|
|
1411
|
+
* and there is no way to tell them apart in certain scenarios.
|
|
1412
|
+
*/
|
|
1413
|
+
item: ResponsesAPI.ResponseMessage | OpenAIResponseObjectStreamResponseOutputItemAdded.OpenAIResponseOutputMessageWebSearchToolCall | OpenAIResponseObjectStreamResponseOutputItemAdded.OpenAIResponseOutputMessageFileSearchToolCall | OpenAIResponseObjectStreamResponseOutputItemAdded.OpenAIResponseOutputMessageFunctionToolCall | OpenAIResponseObjectStreamResponseOutputItemAdded.OpenAIResponseOutputMessageMcpCall | OpenAIResponseObjectStreamResponseOutputItemAdded.OpenAIResponseOutputMessageMcpListTools | OpenAIResponseObjectStreamResponseOutputItemAdded.OpenAIResponseMcpApprovalRequest | OpenAIResponseObjectStreamResponseOutputItemAdded.OpenAIResponseOutputMessageReasoningItem;
|
|
1414
|
+
output_index: number;
|
|
1415
|
+
response_id: string;
|
|
1416
|
+
sequence_number: number;
|
|
1417
|
+
type?: 'response.output_item.added';
|
|
1418
|
+
}
|
|
1419
|
+
namespace OpenAIResponseObjectStreamResponseOutputItemAdded {
|
|
1420
|
+
/**
|
|
1421
|
+
* Web search tool call output message for OpenAI responses.
|
|
1422
|
+
*/
|
|
1423
|
+
interface OpenAIResponseOutputMessageWebSearchToolCall {
|
|
1424
|
+
id: string;
|
|
1425
|
+
status: string;
|
|
1426
|
+
type?: 'web_search_call';
|
|
1427
|
+
}
|
|
1428
|
+
/**
|
|
1429
|
+
* File search tool call output message for OpenAI responses.
|
|
1430
|
+
*/
|
|
1431
|
+
interface OpenAIResponseOutputMessageFileSearchToolCall {
|
|
1432
|
+
id: string;
|
|
1433
|
+
queries: Array<string>;
|
|
1434
|
+
status: string;
|
|
1435
|
+
results?: Array<OpenAIResponseOutputMessageFileSearchToolCall.Result> | null;
|
|
1436
|
+
type?: 'file_search_call';
|
|
1437
|
+
}
|
|
1438
|
+
namespace OpenAIResponseOutputMessageFileSearchToolCall {
|
|
1439
|
+
/**
|
|
1440
|
+
* Search results returned by the file search operation.
|
|
1441
|
+
*/
|
|
1442
|
+
interface Result {
|
|
1443
|
+
attributes: {
|
|
1444
|
+
[key: string]: unknown;
|
|
1445
|
+
};
|
|
1446
|
+
file_id: string;
|
|
1447
|
+
filename: string;
|
|
1448
|
+
score: number;
|
|
1449
|
+
text: string;
|
|
1450
|
+
}
|
|
1451
|
+
}
|
|
1452
|
+
/**
|
|
1453
|
+
* Function tool call output message for OpenAI responses.
|
|
1454
|
+
*/
|
|
1455
|
+
interface OpenAIResponseOutputMessageFunctionToolCall {
|
|
1456
|
+
arguments: string;
|
|
1457
|
+
call_id: string;
|
|
1458
|
+
name: string;
|
|
1459
|
+
id?: string | null;
|
|
1460
|
+
status?: string | null;
|
|
1461
|
+
type?: 'function_call';
|
|
1462
|
+
}
|
|
1463
|
+
/**
|
|
1464
|
+
* Model Context Protocol (MCP) call output message for OpenAI responses.
|
|
1465
|
+
*/
|
|
1466
|
+
interface OpenAIResponseOutputMessageMcpCall {
|
|
1467
|
+
id: string;
|
|
1468
|
+
arguments: string;
|
|
1469
|
+
name: string;
|
|
1470
|
+
server_label: string;
|
|
1471
|
+
error?: string | null;
|
|
1472
|
+
output?: string | null;
|
|
1473
|
+
type?: 'mcp_call';
|
|
1474
|
+
}
|
|
1475
|
+
/**
|
|
1476
|
+
* MCP list tools output message containing available tools from an MCP server.
|
|
1477
|
+
*/
|
|
1478
|
+
interface OpenAIResponseOutputMessageMcpListTools {
|
|
1479
|
+
id: string;
|
|
1480
|
+
server_label: string;
|
|
1481
|
+
tools: Array<OpenAIResponseOutputMessageMcpListTools.Tool>;
|
|
1482
|
+
type?: 'mcp_list_tools';
|
|
1483
|
+
}
|
|
1484
|
+
namespace OpenAIResponseOutputMessageMcpListTools {
|
|
1485
|
+
/**
|
|
1486
|
+
* Tool definition returned by MCP list tools operation.
|
|
1487
|
+
*/
|
|
1488
|
+
interface Tool {
|
|
1489
|
+
input_schema: {
|
|
1490
|
+
[key: string]: unknown;
|
|
1491
|
+
};
|
|
1492
|
+
name: string;
|
|
1493
|
+
description?: string | null;
|
|
1494
|
+
}
|
|
1495
|
+
}
|
|
1496
|
+
/**
|
|
1497
|
+
* A request for human approval of a tool invocation.
|
|
1498
|
+
*/
|
|
1499
|
+
interface OpenAIResponseMcpApprovalRequest {
|
|
1500
|
+
id: string;
|
|
1501
|
+
arguments: string;
|
|
1502
|
+
name: string;
|
|
1503
|
+
server_label: string;
|
|
1504
|
+
type?: 'mcp_approval_request';
|
|
1505
|
+
}
|
|
1506
|
+
/**
|
|
1507
|
+
* Reasoning output from the model, representing the model's thinking process.
|
|
1508
|
+
*/
|
|
1509
|
+
interface OpenAIResponseOutputMessageReasoningItem {
|
|
1510
|
+
/**
|
|
1511
|
+
* Unique identifier for the reasoning output item.
|
|
1512
|
+
*/
|
|
1513
|
+
id: string;
|
|
1514
|
+
/**
|
|
1515
|
+
* Summary of the reasoning output.
|
|
1516
|
+
*/
|
|
1517
|
+
summary: Array<OpenAIResponseOutputMessageReasoningItem.Summary>;
|
|
1518
|
+
/**
|
|
1519
|
+
* The reasoning content from the model.
|
|
1520
|
+
*/
|
|
1521
|
+
content?: Array<OpenAIResponseOutputMessageReasoningItem.Content> | null;
|
|
1522
|
+
/**
|
|
1523
|
+
* The status of the reasoning output.
|
|
1524
|
+
*/
|
|
1525
|
+
status?: 'in_progress' | 'completed' | 'incomplete' | null;
|
|
1526
|
+
/**
|
|
1527
|
+
* The type identifier, always 'reasoning'.
|
|
1528
|
+
*/
|
|
1529
|
+
type?: 'reasoning';
|
|
1530
|
+
}
|
|
1531
|
+
namespace OpenAIResponseOutputMessageReasoningItem {
|
|
1532
|
+
/**
|
|
1533
|
+
* A summary of reasoning output from the model.
|
|
1534
|
+
*/
|
|
1535
|
+
interface Summary {
|
|
1536
|
+
/**
|
|
1537
|
+
* The summary text of the reasoning output.
|
|
1538
|
+
*/
|
|
1539
|
+
text: string;
|
|
1540
|
+
/**
|
|
1541
|
+
* The type identifier, always 'summary_text'.
|
|
1542
|
+
*/
|
|
1543
|
+
type?: 'summary_text';
|
|
1544
|
+
}
|
|
1545
|
+
/**
|
|
1546
|
+
* Reasoning text from the model.
|
|
1547
|
+
*/
|
|
1548
|
+
interface Content {
|
|
1549
|
+
/**
|
|
1550
|
+
* The reasoning text content from the model.
|
|
1551
|
+
*/
|
|
1552
|
+
text: string;
|
|
1553
|
+
/**
|
|
1554
|
+
* The type identifier, always 'reasoning_text'.
|
|
1555
|
+
*/
|
|
1556
|
+
type?: 'reasoning_text';
|
|
1557
|
+
}
|
|
1558
|
+
}
|
|
1559
|
+
}
|
|
1560
|
+
/**
|
|
1561
|
+
* Streaming event for when an output item is completed.
|
|
1562
|
+
*/
|
|
1563
|
+
interface OpenAIResponseObjectStreamResponseOutputItemDone {
|
|
1564
|
+
/**
|
|
1565
|
+
* Corresponds to the various Message types in the Responses API. They are all
|
|
1566
|
+
* under one type because the Responses API gives them all the same "type" value,
|
|
1567
|
+
* and there is no way to tell them apart in certain scenarios.
|
|
1568
|
+
*/
|
|
1569
|
+
item: ResponsesAPI.ResponseMessage | OpenAIResponseObjectStreamResponseOutputItemDone.OpenAIResponseOutputMessageWebSearchToolCall | OpenAIResponseObjectStreamResponseOutputItemDone.OpenAIResponseOutputMessageFileSearchToolCall | OpenAIResponseObjectStreamResponseOutputItemDone.OpenAIResponseOutputMessageFunctionToolCall | OpenAIResponseObjectStreamResponseOutputItemDone.OpenAIResponseOutputMessageMcpCall | OpenAIResponseObjectStreamResponseOutputItemDone.OpenAIResponseOutputMessageMcpListTools | OpenAIResponseObjectStreamResponseOutputItemDone.OpenAIResponseMcpApprovalRequest | OpenAIResponseObjectStreamResponseOutputItemDone.OpenAIResponseOutputMessageReasoningItem;
|
|
1570
|
+
output_index: number;
|
|
1571
|
+
response_id: string;
|
|
1572
|
+
sequence_number: number;
|
|
1573
|
+
type?: 'response.output_item.done';
|
|
1574
|
+
}
|
|
1575
|
+
namespace OpenAIResponseObjectStreamResponseOutputItemDone {
|
|
1576
|
+
/**
|
|
1577
|
+
* Web search tool call output message for OpenAI responses.
|
|
1578
|
+
*/
|
|
1579
|
+
interface OpenAIResponseOutputMessageWebSearchToolCall {
|
|
1580
|
+
id: string;
|
|
1581
|
+
status: string;
|
|
1582
|
+
type?: 'web_search_call';
|
|
1583
|
+
}
|
|
1584
|
+
/**
|
|
1585
|
+
* File search tool call output message for OpenAI responses.
|
|
1586
|
+
*/
|
|
1587
|
+
interface OpenAIResponseOutputMessageFileSearchToolCall {
|
|
1588
|
+
id: string;
|
|
1589
|
+
queries: Array<string>;
|
|
1590
|
+
status: string;
|
|
1591
|
+
results?: Array<OpenAIResponseOutputMessageFileSearchToolCall.Result> | null;
|
|
1592
|
+
type?: 'file_search_call';
|
|
1593
|
+
}
|
|
1594
|
+
namespace OpenAIResponseOutputMessageFileSearchToolCall {
|
|
1595
|
+
/**
|
|
1596
|
+
* Search results returned by the file search operation.
|
|
1597
|
+
*/
|
|
1598
|
+
interface Result {
|
|
1599
|
+
attributes: {
|
|
1600
|
+
[key: string]: unknown;
|
|
1601
|
+
};
|
|
1602
|
+
file_id: string;
|
|
1603
|
+
filename: string;
|
|
1604
|
+
score: number;
|
|
1605
|
+
text: string;
|
|
1606
|
+
}
|
|
1607
|
+
}
|
|
1608
|
+
/**
|
|
1609
|
+
* Function tool call output message for OpenAI responses.
|
|
1610
|
+
*/
|
|
1611
|
+
interface OpenAIResponseOutputMessageFunctionToolCall {
|
|
1612
|
+
arguments: string;
|
|
1613
|
+
call_id: string;
|
|
1614
|
+
name: string;
|
|
1615
|
+
id?: string | null;
|
|
1616
|
+
status?: string | null;
|
|
1617
|
+
type?: 'function_call';
|
|
1618
|
+
}
|
|
1619
|
+
/**
|
|
1620
|
+
* Model Context Protocol (MCP) call output message for OpenAI responses.
|
|
1621
|
+
*/
|
|
1622
|
+
interface OpenAIResponseOutputMessageMcpCall {
|
|
1623
|
+
id: string;
|
|
1624
|
+
arguments: string;
|
|
1625
|
+
name: string;
|
|
1626
|
+
server_label: string;
|
|
1627
|
+
error?: string | null;
|
|
1628
|
+
output?: string | null;
|
|
1629
|
+
type?: 'mcp_call';
|
|
1630
|
+
}
|
|
1631
|
+
/**
|
|
1632
|
+
* MCP list tools output message containing available tools from an MCP server.
|
|
1633
|
+
*/
|
|
1634
|
+
interface OpenAIResponseOutputMessageMcpListTools {
|
|
1635
|
+
id: string;
|
|
1636
|
+
server_label: string;
|
|
1637
|
+
tools: Array<OpenAIResponseOutputMessageMcpListTools.Tool>;
|
|
1638
|
+
type?: 'mcp_list_tools';
|
|
1639
|
+
}
|
|
1640
|
+
namespace OpenAIResponseOutputMessageMcpListTools {
|
|
1641
|
+
/**
|
|
1642
|
+
* Tool definition returned by MCP list tools operation.
|
|
1643
|
+
*/
|
|
1644
|
+
interface Tool {
|
|
1645
|
+
input_schema: {
|
|
1646
|
+
[key: string]: unknown;
|
|
1647
|
+
};
|
|
1648
|
+
name: string;
|
|
1649
|
+
description?: string | null;
|
|
1650
|
+
}
|
|
1651
|
+
}
|
|
1652
|
+
/**
|
|
1653
|
+
* A request for human approval of a tool invocation.
|
|
1654
|
+
*/
|
|
1655
|
+
interface OpenAIResponseMcpApprovalRequest {
|
|
1656
|
+
id: string;
|
|
1657
|
+
arguments: string;
|
|
1658
|
+
name: string;
|
|
1659
|
+
server_label: string;
|
|
1660
|
+
type?: 'mcp_approval_request';
|
|
1661
|
+
}
|
|
1662
|
+
/**
|
|
1663
|
+
* Reasoning output from the model, representing the model's thinking process.
|
|
1664
|
+
*/
|
|
1665
|
+
interface OpenAIResponseOutputMessageReasoningItem {
|
|
1666
|
+
/**
|
|
1667
|
+
* Unique identifier for the reasoning output item.
|
|
1668
|
+
*/
|
|
1669
|
+
id: string;
|
|
1670
|
+
/**
|
|
1671
|
+
* Summary of the reasoning output.
|
|
1672
|
+
*/
|
|
1673
|
+
summary: Array<OpenAIResponseOutputMessageReasoningItem.Summary>;
|
|
1674
|
+
/**
|
|
1675
|
+
* The reasoning content from the model.
|
|
1676
|
+
*/
|
|
1677
|
+
content?: Array<OpenAIResponseOutputMessageReasoningItem.Content> | null;
|
|
1678
|
+
/**
|
|
1679
|
+
* The status of the reasoning output.
|
|
1680
|
+
*/
|
|
1681
|
+
status?: 'in_progress' | 'completed' | 'incomplete' | null;
|
|
1682
|
+
/**
|
|
1683
|
+
* The type identifier, always 'reasoning'.
|
|
1684
|
+
*/
|
|
1685
|
+
type?: 'reasoning';
|
|
1686
|
+
}
|
|
1687
|
+
namespace OpenAIResponseOutputMessageReasoningItem {
|
|
1688
|
+
/**
|
|
1689
|
+
* A summary of reasoning output from the model.
|
|
1690
|
+
*/
|
|
1691
|
+
interface Summary {
|
|
1692
|
+
/**
|
|
1693
|
+
* The summary text of the reasoning output.
|
|
1694
|
+
*/
|
|
1695
|
+
text: string;
|
|
1696
|
+
/**
|
|
1697
|
+
* The type identifier, always 'summary_text'.
|
|
1698
|
+
*/
|
|
1699
|
+
type?: 'summary_text';
|
|
1700
|
+
}
|
|
1701
|
+
/**
|
|
1702
|
+
* Reasoning text from the model.
|
|
1703
|
+
*/
|
|
1704
|
+
interface Content {
|
|
1705
|
+
/**
|
|
1706
|
+
* The reasoning text content from the model.
|
|
1707
|
+
*/
|
|
1708
|
+
text: string;
|
|
1709
|
+
/**
|
|
1710
|
+
* The type identifier, always 'reasoning_text'.
|
|
1711
|
+
*/
|
|
1712
|
+
type?: 'reasoning_text';
|
|
1713
|
+
}
|
|
1714
|
+
}
|
|
1715
|
+
}
|
|
1716
|
+
/**
|
|
1717
|
+
* Streaming event for incremental text content updates.
|
|
1718
|
+
*/
|
|
1719
|
+
interface OpenAIResponseObjectStreamResponseOutputTextDelta {
|
|
1720
|
+
content_index: number;
|
|
1721
|
+
delta: string;
|
|
1722
|
+
item_id: string;
|
|
1723
|
+
output_index: number;
|
|
1724
|
+
sequence_number: number;
|
|
1725
|
+
logprobs?: Array<OpenAIResponseObjectStreamResponseOutputTextDelta.Logprob> | null;
|
|
1726
|
+
type?: 'response.output_text.delta';
|
|
1727
|
+
}
|
|
1728
|
+
namespace OpenAIResponseObjectStreamResponseOutputTextDelta {
|
|
1729
|
+
/**
|
|
1730
|
+
* The log probability for a token from an OpenAI-compatible chat completion
|
|
1731
|
+
* response.
|
|
1732
|
+
*/
|
|
1733
|
+
interface Logprob {
|
|
1734
|
+
/**
|
|
1735
|
+
* The token.
|
|
1736
|
+
*/
|
|
1737
|
+
token: string;
|
|
1738
|
+
/**
|
|
1739
|
+
* The log probability of the token.
|
|
1740
|
+
*/
|
|
1741
|
+
logprob: number;
|
|
1742
|
+
/**
|
|
1743
|
+
* The bytes for the token.
|
|
1744
|
+
*/
|
|
1745
|
+
bytes?: Array<number> | null;
|
|
1746
|
+
/**
|
|
1747
|
+
* The top log probabilities for the token.
|
|
1748
|
+
*/
|
|
1749
|
+
top_logprobs?: Array<Logprob.TopLogprob> | null;
|
|
1750
|
+
}
|
|
1751
|
+
namespace Logprob {
|
|
1752
|
+
/**
|
|
1753
|
+
* The top log probability for a token from an OpenAI-compatible chat completion
|
|
1754
|
+
* response.
|
|
1755
|
+
*/
|
|
1756
|
+
interface TopLogprob {
|
|
1757
|
+
/**
|
|
1758
|
+
* The token.
|
|
1759
|
+
*/
|
|
1760
|
+
token: string;
|
|
1761
|
+
/**
|
|
1762
|
+
* The log probability of the token.
|
|
1763
|
+
*/
|
|
1764
|
+
logprob: number;
|
|
1765
|
+
/**
|
|
1766
|
+
* The bytes for the token.
|
|
1767
|
+
*/
|
|
1768
|
+
bytes?: Array<number> | null;
|
|
1769
|
+
}
|
|
1770
|
+
}
|
|
1771
|
+
}
|
|
1772
|
+
/**
|
|
1773
|
+
* Streaming event for when text output is completed.
|
|
1774
|
+
*/
|
|
1775
|
+
interface OpenAIResponseObjectStreamResponseOutputTextDone {
|
|
1776
|
+
content_index: number;
|
|
1777
|
+
item_id: string;
|
|
1778
|
+
output_index: number;
|
|
1779
|
+
sequence_number: number;
|
|
1780
|
+
text: string;
|
|
1781
|
+
type?: 'response.output_text.done';
|
|
1782
|
+
}
|
|
1783
|
+
/**
|
|
1784
|
+
* Streaming event for incremental function call argument updates.
|
|
1785
|
+
*/
|
|
1786
|
+
interface OpenAIResponseObjectStreamResponseFunctionCallArgumentsDelta {
|
|
1787
|
+
delta: string;
|
|
1788
|
+
item_id: string;
|
|
1789
|
+
output_index: number;
|
|
1790
|
+
sequence_number: number;
|
|
1791
|
+
type?: 'response.function_call_arguments.delta';
|
|
1792
|
+
}
|
|
1793
|
+
/**
|
|
1794
|
+
* Streaming event for when function call arguments are completed.
|
|
1795
|
+
*/
|
|
1796
|
+
interface OpenAIResponseObjectStreamResponseFunctionCallArgumentsDone {
|
|
1797
|
+
arguments: string;
|
|
1798
|
+
item_id: string;
|
|
1799
|
+
output_index: number;
|
|
1800
|
+
sequence_number: number;
|
|
1801
|
+
type?: 'response.function_call_arguments.done';
|
|
1802
|
+
}
|
|
1803
|
+
/**
|
|
1804
|
+
* Streaming event for web search calls in progress.
|
|
1805
|
+
*/
|
|
1806
|
+
interface OpenAIResponseObjectStreamResponseWebSearchCallInProgress {
|
|
1807
|
+
item_id: string;
|
|
1808
|
+
output_index: number;
|
|
1809
|
+
sequence_number: number;
|
|
1810
|
+
type?: 'response.web_search_call.in_progress';
|
|
1811
|
+
}
|
|
1812
|
+
/**
|
|
1813
|
+
* Streaming event for web search calls currently searching.
|
|
1814
|
+
*/
|
|
1815
|
+
interface OpenAIResponseObjectStreamResponseWebSearchCallSearching {
|
|
1816
|
+
item_id: string;
|
|
1817
|
+
output_index: number;
|
|
1818
|
+
sequence_number: number;
|
|
1819
|
+
type?: 'response.web_search_call.searching';
|
|
1820
|
+
}
|
|
1821
|
+
/**
|
|
1822
|
+
* Streaming event for completed web search calls.
|
|
1823
|
+
*/
|
|
1824
|
+
interface OpenAIResponseObjectStreamResponseWebSearchCallCompleted {
|
|
1825
|
+
item_id: string;
|
|
1826
|
+
output_index: number;
|
|
1827
|
+
sequence_number: number;
|
|
1828
|
+
type?: 'response.web_search_call.completed';
|
|
1829
|
+
}
|
|
1830
|
+
/**
|
|
1831
|
+
* Streaming event for MCP list tools operation in progress.
|
|
1832
|
+
*/
|
|
1833
|
+
interface OpenAIResponseObjectStreamResponseMcpListToolsInProgress {
|
|
1834
|
+
sequence_number: number;
|
|
1835
|
+
type?: 'response.mcp_list_tools.in_progress';
|
|
1836
|
+
}
|
|
1837
|
+
/**
|
|
1838
|
+
* Streaming event for a failed MCP list tools operation.
|
|
1839
|
+
*/
|
|
1840
|
+
interface OpenAIResponseObjectStreamResponseMcpListToolsFailed {
|
|
1841
|
+
sequence_number: number;
|
|
1842
|
+
type?: 'response.mcp_list_tools.failed';
|
|
1843
|
+
}
|
|
1844
|
+
/**
|
|
1845
|
+
* Streaming event for a completed MCP list tools operation.
|
|
1846
|
+
*/
|
|
1847
|
+
interface OpenAIResponseObjectStreamResponseMcpListToolsCompleted {
|
|
1848
|
+
sequence_number: number;
|
|
1849
|
+
type?: 'response.mcp_list_tools.completed';
|
|
1850
|
+
}
|
|
1851
|
+
/**
|
|
1852
|
+
* Streaming event for incremental MCP call argument updates.
|
|
1853
|
+
*/
|
|
1854
|
+
interface OpenAIResponseObjectStreamResponseMcpCallArgumentsDelta {
|
|
1855
|
+
delta: string;
|
|
1856
|
+
item_id: string;
|
|
1857
|
+
output_index: number;
|
|
1858
|
+
sequence_number: number;
|
|
1859
|
+
type?: 'response.mcp_call.arguments.delta';
|
|
1860
|
+
}
|
|
1861
|
+
/**
|
|
1862
|
+
* Streaming event for completed MCP call arguments.
|
|
1863
|
+
*/
|
|
1864
|
+
interface OpenAIResponseObjectStreamResponseMcpCallArgumentsDone {
|
|
1865
|
+
arguments: string;
|
|
1866
|
+
item_id: string;
|
|
1867
|
+
output_index: number;
|
|
1868
|
+
sequence_number: number;
|
|
1869
|
+
type?: 'response.mcp_call.arguments.done';
|
|
1870
|
+
}
|
|
1871
|
+
/**
|
|
1872
|
+
* Streaming event for MCP calls in progress.
|
|
1873
|
+
*/
|
|
1874
|
+
interface OpenAIResponseObjectStreamResponseMcpCallInProgress {
|
|
1875
|
+
item_id: string;
|
|
1876
|
+
output_index: number;
|
|
1877
|
+
sequence_number: number;
|
|
1878
|
+
type?: 'response.mcp_call.in_progress';
|
|
1879
|
+
}
|
|
1880
|
+
/**
|
|
1881
|
+
* Streaming event for failed MCP calls.
|
|
1882
|
+
*/
|
|
1883
|
+
interface OpenAIResponseObjectStreamResponseMcpCallFailed {
|
|
1884
|
+
sequence_number: number;
|
|
1885
|
+
type?: 'response.mcp_call.failed';
|
|
1886
|
+
}
|
|
1887
|
+
/**
|
|
1888
|
+
* Streaming event for completed MCP calls.
|
|
1889
|
+
*/
|
|
1890
|
+
interface OpenAIResponseObjectStreamResponseMcpCallCompleted {
|
|
1891
|
+
sequence_number: number;
|
|
1892
|
+
type?: 'response.mcp_call.completed';
|
|
1893
|
+
}
|
|
1894
|
+
/**
|
|
1895
|
+
* Streaming event for when a new content part is added to a response item.
|
|
1896
|
+
*/
|
|
1897
|
+
interface OpenAIResponseObjectStreamResponseContentPartAdded {
|
|
1898
|
+
content_index: number;
|
|
1899
|
+
item_id: string;
|
|
1900
|
+
output_index: number;
|
|
1901
|
+
/**
|
|
1902
|
+
* Text content within a streamed response part.
|
|
1903
|
+
*/
|
|
1904
|
+
part: OpenAIResponseObjectStreamResponseContentPartAdded.OpenAIResponseContentPartOutputText | OpenAIResponseObjectStreamResponseContentPartAdded.OpenAIResponseContentPartRefusal | OpenAIResponseObjectStreamResponseContentPartAdded.OpenAIResponseContentPartReasoningText;
|
|
1905
|
+
response_id: string;
|
|
1906
|
+
sequence_number: number;
|
|
1907
|
+
type?: 'response.content_part.added';
|
|
1908
|
+
}
|
|
1909
|
+
namespace OpenAIResponseObjectStreamResponseContentPartAdded {
|
|
1910
|
+
/**
|
|
1911
|
+
* Text content within a streamed response part.
|
|
1912
|
+
*/
|
|
1913
|
+
interface OpenAIResponseContentPartOutputText {
|
|
1914
|
+
text: string;
|
|
1915
|
+
annotations?: Array<OpenAIResponseContentPartOutputText.OpenAIResponseAnnotationFileCitation | OpenAIResponseContentPartOutputText.OpenAIResponseAnnotationCitation | OpenAIResponseContentPartOutputText.OpenAIResponseAnnotationContainerFileCitation | OpenAIResponseContentPartOutputText.OpenAIResponseAnnotationFilePath>;
|
|
1916
|
+
logprobs?: Array<OpenAIResponseContentPartOutputText.Logprob> | null;
|
|
1917
|
+
type?: 'output_text';
|
|
1918
|
+
}
|
|
1919
|
+
namespace OpenAIResponseContentPartOutputText {
|
|
1920
|
+
/**
|
|
1921
|
+
* File citation annotation for referencing specific files in response content.
|
|
1922
|
+
*/
|
|
1923
|
+
interface OpenAIResponseAnnotationFileCitation {
|
|
1924
|
+
file_id: string;
|
|
1925
|
+
filename: string;
|
|
1926
|
+
index: number;
|
|
1927
|
+
type?: 'file_citation';
|
|
1928
|
+
}
|
|
1929
|
+
/**
|
|
1930
|
+
* URL citation annotation for referencing external web resources.
|
|
1931
|
+
*/
|
|
1932
|
+
interface OpenAIResponseAnnotationCitation {
|
|
1933
|
+
end_index: number;
|
|
1934
|
+
start_index: number;
|
|
1935
|
+
title: string;
|
|
1936
|
+
url: string;
|
|
1937
|
+
type?: 'url_citation';
|
|
1938
|
+
}
|
|
1939
|
+
/**
|
|
1940
|
+
* Container file citation annotation referencing a file within a container.
|
|
1941
|
+
*/
|
|
1942
|
+
interface OpenAIResponseAnnotationContainerFileCitation {
|
|
1943
|
+
container_id: string;
|
|
1944
|
+
end_index: number;
|
|
1945
|
+
file_id: string;
|
|
1946
|
+
filename: string;
|
|
1947
|
+
start_index: number;
|
|
1948
|
+
type?: 'container_file_citation';
|
|
1949
|
+
}
|
|
1950
|
+
/**
|
|
1951
|
+
* File path annotation referencing a generated file in response content.
|
|
1952
|
+
*/
|
|
1953
|
+
interface OpenAIResponseAnnotationFilePath {
|
|
1954
|
+
file_id: string;
|
|
1955
|
+
index: number;
|
|
1956
|
+
type?: 'file_path';
|
|
1957
|
+
}
|
|
1958
|
+
/**
|
|
1959
|
+
* The log probability for a token from an OpenAI-compatible chat completion
|
|
1960
|
+
* response.
|
|
1961
|
+
*/
|
|
1962
|
+
interface Logprob {
|
|
1963
|
+
/**
|
|
1964
|
+
* The token.
|
|
1965
|
+
*/
|
|
1966
|
+
token: string;
|
|
1967
|
+
/**
|
|
1968
|
+
* The log probability of the token.
|
|
1969
|
+
*/
|
|
1970
|
+
logprob: number;
|
|
1971
|
+
/**
|
|
1972
|
+
* The bytes for the token.
|
|
1973
|
+
*/
|
|
1974
|
+
bytes?: Array<number> | null;
|
|
1975
|
+
/**
|
|
1976
|
+
* The top log probabilities for the token.
|
|
1977
|
+
*/
|
|
1978
|
+
top_logprobs?: Array<Logprob.TopLogprob> | null;
|
|
1979
|
+
}
|
|
1980
|
+
namespace Logprob {
|
|
1981
|
+
/**
|
|
1982
|
+
* The top log probability for a token from an OpenAI-compatible chat completion
|
|
1983
|
+
* response.
|
|
1984
|
+
*/
|
|
1985
|
+
interface TopLogprob {
|
|
1986
|
+
/**
|
|
1987
|
+
* The token.
|
|
1988
|
+
*/
|
|
1989
|
+
token: string;
|
|
1990
|
+
/**
|
|
1991
|
+
* The log probability of the token.
|
|
1992
|
+
*/
|
|
1993
|
+
logprob: number;
|
|
1994
|
+
/**
|
|
1995
|
+
* The bytes for the token.
|
|
1996
|
+
*/
|
|
1997
|
+
bytes?: Array<number> | null;
|
|
1998
|
+
}
|
|
1999
|
+
}
|
|
2000
|
+
}
|
|
2001
|
+
/**
|
|
2002
|
+
* Refusal content within a streamed response part.
|
|
2003
|
+
*/
|
|
2004
|
+
interface OpenAIResponseContentPartRefusal {
|
|
2005
|
+
refusal: string;
|
|
2006
|
+
type?: 'refusal';
|
|
2007
|
+
}
|
|
2008
|
+
/**
|
|
2009
|
+
* Reasoning text emitted as part of a streamed response.
|
|
2010
|
+
*/
|
|
2011
|
+
interface OpenAIResponseContentPartReasoningText {
|
|
2012
|
+
text: string;
|
|
2013
|
+
type?: 'reasoning_text';
|
|
2014
|
+
}
|
|
2015
|
+
}
|
|
2016
|
+
/**
|
|
2017
|
+
* Streaming event for when a content part is completed.
|
|
2018
|
+
*/
|
|
2019
|
+
interface OpenAIResponseObjectStreamResponseContentPartDone {
|
|
2020
|
+
content_index: number;
|
|
2021
|
+
item_id: string;
|
|
2022
|
+
output_index: number;
|
|
2023
|
+
/**
|
|
2024
|
+
* Text content within a streamed response part.
|
|
2025
|
+
*/
|
|
2026
|
+
part: OpenAIResponseObjectStreamResponseContentPartDone.OpenAIResponseContentPartOutputText | OpenAIResponseObjectStreamResponseContentPartDone.OpenAIResponseContentPartRefusal | OpenAIResponseObjectStreamResponseContentPartDone.OpenAIResponseContentPartReasoningText;
|
|
2027
|
+
response_id: string;
|
|
2028
|
+
sequence_number: number;
|
|
2029
|
+
type?: 'response.content_part.done';
|
|
2030
|
+
}
|
|
2031
|
+
namespace OpenAIResponseObjectStreamResponseContentPartDone {
|
|
2032
|
+
/**
|
|
2033
|
+
* Text content within a streamed response part.
|
|
2034
|
+
*/
|
|
2035
|
+
interface OpenAIResponseContentPartOutputText {
|
|
2036
|
+
text: string;
|
|
2037
|
+
annotations?: Array<OpenAIResponseContentPartOutputText.OpenAIResponseAnnotationFileCitation | OpenAIResponseContentPartOutputText.OpenAIResponseAnnotationCitation | OpenAIResponseContentPartOutputText.OpenAIResponseAnnotationContainerFileCitation | OpenAIResponseContentPartOutputText.OpenAIResponseAnnotationFilePath>;
|
|
2038
|
+
logprobs?: Array<OpenAIResponseContentPartOutputText.Logprob> | null;
|
|
2039
|
+
type?: 'output_text';
|
|
2040
|
+
}
|
|
2041
|
+
namespace OpenAIResponseContentPartOutputText {
|
|
2042
|
+
/**
|
|
2043
|
+
* File citation annotation for referencing specific files in response content.
|
|
2044
|
+
*/
|
|
2045
|
+
interface OpenAIResponseAnnotationFileCitation {
|
|
2046
|
+
file_id: string;
|
|
2047
|
+
filename: string;
|
|
2048
|
+
index: number;
|
|
2049
|
+
type?: 'file_citation';
|
|
2050
|
+
}
|
|
2051
|
+
/**
|
|
2052
|
+
* URL citation annotation for referencing external web resources.
|
|
2053
|
+
*/
|
|
2054
|
+
interface OpenAIResponseAnnotationCitation {
|
|
2055
|
+
end_index: number;
|
|
2056
|
+
start_index: number;
|
|
2057
|
+
title: string;
|
|
2058
|
+
url: string;
|
|
2059
|
+
type?: 'url_citation';
|
|
2060
|
+
}
|
|
2061
|
+
/**
|
|
2062
|
+
* Container file citation annotation referencing a file within a container.
|
|
2063
|
+
*/
|
|
2064
|
+
interface OpenAIResponseAnnotationContainerFileCitation {
|
|
2065
|
+
container_id: string;
|
|
2066
|
+
end_index: number;
|
|
2067
|
+
file_id: string;
|
|
2068
|
+
filename: string;
|
|
2069
|
+
start_index: number;
|
|
2070
|
+
type?: 'container_file_citation';
|
|
2071
|
+
}
|
|
2072
|
+
/**
|
|
2073
|
+
* File path annotation referencing a generated file in response content.
|
|
2074
|
+
*/
|
|
2075
|
+
interface OpenAIResponseAnnotationFilePath {
|
|
2076
|
+
file_id: string;
|
|
2077
|
+
index: number;
|
|
2078
|
+
type?: 'file_path';
|
|
2079
|
+
}
|
|
2080
|
+
/**
|
|
2081
|
+
* The log probability for a token from an OpenAI-compatible chat completion
|
|
2082
|
+
* response.
|
|
2083
|
+
*/
|
|
2084
|
+
interface Logprob {
|
|
2085
|
+
/**
|
|
2086
|
+
* The token.
|
|
2087
|
+
*/
|
|
2088
|
+
token: string;
|
|
2089
|
+
/**
|
|
2090
|
+
* The log probability of the token.
|
|
2091
|
+
*/
|
|
2092
|
+
logprob: number;
|
|
2093
|
+
/**
|
|
2094
|
+
* The bytes for the token.
|
|
2095
|
+
*/
|
|
2096
|
+
bytes?: Array<number> | null;
|
|
2097
|
+
/**
|
|
2098
|
+
* The top log probabilities for the token.
|
|
2099
|
+
*/
|
|
2100
|
+
top_logprobs?: Array<Logprob.TopLogprob> | null;
|
|
2101
|
+
}
|
|
2102
|
+
namespace Logprob {
|
|
2103
|
+
/**
|
|
2104
|
+
* The top log probability for a token from an OpenAI-compatible chat completion
|
|
2105
|
+
* response.
|
|
2106
|
+
*/
|
|
2107
|
+
interface TopLogprob {
|
|
2108
|
+
/**
|
|
2109
|
+
* The token.
|
|
2110
|
+
*/
|
|
2111
|
+
token: string;
|
|
2112
|
+
/**
|
|
2113
|
+
* The log probability of the token.
|
|
2114
|
+
*/
|
|
2115
|
+
logprob: number;
|
|
2116
|
+
/**
|
|
2117
|
+
* The bytes for the token.
|
|
2118
|
+
*/
|
|
2119
|
+
bytes?: Array<number> | null;
|
|
2120
|
+
}
|
|
2121
|
+
}
|
|
2122
|
+
}
|
|
2123
|
+
/**
|
|
2124
|
+
* Refusal content within a streamed response part.
|
|
2125
|
+
*/
|
|
2126
|
+
interface OpenAIResponseContentPartRefusal {
|
|
2127
|
+
refusal: string;
|
|
2128
|
+
type?: 'refusal';
|
|
2129
|
+
}
|
|
2130
|
+
/**
|
|
2131
|
+
* Reasoning text emitted as part of a streamed response.
|
|
2132
|
+
*/
|
|
2133
|
+
interface OpenAIResponseContentPartReasoningText {
|
|
2134
|
+
text: string;
|
|
2135
|
+
type?: 'reasoning_text';
|
|
2136
|
+
}
|
|
2137
|
+
}
|
|
2138
|
+
/**
|
|
2139
|
+
* Streaming event for incremental reasoning text updates.
|
|
2140
|
+
*/
|
|
2141
|
+
interface OpenAIResponseObjectStreamResponseReasoningTextDelta {
|
|
2142
|
+
content_index: number;
|
|
2143
|
+
delta: string;
|
|
2144
|
+
item_id: string;
|
|
2145
|
+
output_index: number;
|
|
2146
|
+
sequence_number: number;
|
|
2147
|
+
type?: 'response.reasoning_text.delta';
|
|
2148
|
+
}
|
|
2149
|
+
/**
|
|
2150
|
+
* Streaming event for when reasoning text is completed.
|
|
2151
|
+
*/
|
|
2152
|
+
interface OpenAIResponseObjectStreamResponseReasoningTextDone {
|
|
2153
|
+
content_index: number;
|
|
2154
|
+
item_id: string;
|
|
2155
|
+
output_index: number;
|
|
2156
|
+
sequence_number: number;
|
|
2157
|
+
text: string;
|
|
2158
|
+
type?: 'response.reasoning_text.done';
|
|
2159
|
+
}
|
|
2160
|
+
/**
|
|
2161
|
+
* Streaming event for when a new reasoning summary part is added.
|
|
2162
|
+
*/
|
|
2163
|
+
interface OpenAIResponseObjectStreamResponseReasoningSummaryPartAdded {
|
|
2164
|
+
item_id: string;
|
|
2165
|
+
output_index: number;
|
|
2166
|
+
/**
|
|
2167
|
+
* Reasoning summary part in a streamed response.
|
|
2168
|
+
*/
|
|
2169
|
+
part: OpenAIResponseObjectStreamResponseReasoningSummaryPartAdded.Part;
|
|
2170
|
+
sequence_number: number;
|
|
2171
|
+
summary_index: number;
|
|
2172
|
+
type?: 'response.reasoning_summary_part.added';
|
|
2173
|
+
}
|
|
2174
|
+
namespace OpenAIResponseObjectStreamResponseReasoningSummaryPartAdded {
|
|
2175
|
+
/**
|
|
2176
|
+
* Reasoning summary part in a streamed response.
|
|
2177
|
+
*/
|
|
2178
|
+
interface Part {
|
|
2179
|
+
text: string;
|
|
2180
|
+
type?: 'summary_text';
|
|
2181
|
+
}
|
|
2182
|
+
}
|
|
2183
|
+
/**
|
|
2184
|
+
* Streaming event for when a reasoning summary part is completed.
|
|
2185
|
+
*/
|
|
2186
|
+
interface OpenAIResponseObjectStreamResponseReasoningSummaryPartDone {
|
|
2187
|
+
item_id: string;
|
|
2188
|
+
output_index: number;
|
|
2189
|
+
/**
|
|
2190
|
+
* Reasoning summary part in a streamed response.
|
|
2191
|
+
*/
|
|
2192
|
+
part: OpenAIResponseObjectStreamResponseReasoningSummaryPartDone.Part;
|
|
2193
|
+
sequence_number: number;
|
|
2194
|
+
summary_index: number;
|
|
2195
|
+
type?: 'response.reasoning_summary_part.done';
|
|
2196
|
+
}
|
|
2197
|
+
namespace OpenAIResponseObjectStreamResponseReasoningSummaryPartDone {
|
|
2198
|
+
/**
|
|
2199
|
+
* Reasoning summary part in a streamed response.
|
|
2200
|
+
*/
|
|
2201
|
+
interface Part {
|
|
2202
|
+
text: string;
|
|
2203
|
+
type?: 'summary_text';
|
|
2204
|
+
}
|
|
2205
|
+
}
|
|
2206
|
+
/**
|
|
2207
|
+
* Streaming event for incremental reasoning summary text updates.
|
|
2208
|
+
*/
|
|
2209
|
+
interface OpenAIResponseObjectStreamResponseReasoningSummaryTextDelta {
|
|
2210
|
+
delta: string;
|
|
2211
|
+
item_id: string;
|
|
2212
|
+
output_index: number;
|
|
2213
|
+
sequence_number: number;
|
|
2214
|
+
summary_index: number;
|
|
2215
|
+
type?: 'response.reasoning_summary_text.delta';
|
|
2216
|
+
}
|
|
2217
|
+
/**
|
|
2218
|
+
* Streaming event for when reasoning summary text is completed.
|
|
2219
|
+
*/
|
|
2220
|
+
interface OpenAIResponseObjectStreamResponseReasoningSummaryTextDone {
|
|
2221
|
+
item_id: string;
|
|
2222
|
+
output_index: number;
|
|
2223
|
+
sequence_number: number;
|
|
2224
|
+
summary_index: number;
|
|
2225
|
+
text: string;
|
|
2226
|
+
type?: 'response.reasoning_summary_text.done';
|
|
2227
|
+
}
|
|
2228
|
+
/**
|
|
2229
|
+
* Streaming event for incremental refusal text updates.
|
|
2230
|
+
*/
|
|
2231
|
+
interface OpenAIResponseObjectStreamResponseRefusalDelta {
|
|
2232
|
+
content_index: number;
|
|
2233
|
+
delta: string;
|
|
2234
|
+
item_id: string;
|
|
2235
|
+
output_index: number;
|
|
2236
|
+
sequence_number: number;
|
|
2237
|
+
type?: 'response.refusal.delta';
|
|
2238
|
+
}
|
|
2239
|
+
/**
|
|
2240
|
+
* Streaming event for when refusal text is completed.
|
|
2241
|
+
*/
|
|
2242
|
+
interface OpenAIResponseObjectStreamResponseRefusalDone {
|
|
2243
|
+
content_index: number;
|
|
2244
|
+
item_id: string;
|
|
2245
|
+
output_index: number;
|
|
2246
|
+
refusal: string;
|
|
2247
|
+
sequence_number: number;
|
|
2248
|
+
type?: 'response.refusal.done';
|
|
2249
|
+
}
|
|
2250
|
+
/**
|
|
2251
|
+
* Streaming event for when an annotation is added to output text.
|
|
2252
|
+
*/
|
|
2253
|
+
interface OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded {
|
|
2254
|
+
/**
|
|
2255
|
+
* File citation annotation for referencing specific files in response content.
|
|
2256
|
+
*/
|
|
2257
|
+
annotation: OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded.OpenAIResponseAnnotationFileCitation | OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded.OpenAIResponseAnnotationCitation | OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded.OpenAIResponseAnnotationContainerFileCitation | OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded.OpenAIResponseAnnotationFilePath;
|
|
2258
|
+
annotation_index: number;
|
|
2259
|
+
content_index: number;
|
|
2260
|
+
item_id: string;
|
|
2261
|
+
output_index: number;
|
|
2262
|
+
sequence_number: number;
|
|
2263
|
+
type?: 'response.output_text.annotation.added';
|
|
2264
|
+
}
|
|
2265
|
+
namespace OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded {
|
|
2266
|
+
/**
|
|
2267
|
+
* File citation annotation for referencing specific files in response content.
|
|
2268
|
+
*/
|
|
2269
|
+
interface OpenAIResponseAnnotationFileCitation {
|
|
2270
|
+
file_id: string;
|
|
2271
|
+
filename: string;
|
|
2272
|
+
index: number;
|
|
2273
|
+
type?: 'file_citation';
|
|
2274
|
+
}
|
|
2275
|
+
/**
|
|
2276
|
+
* URL citation annotation for referencing external web resources.
|
|
2277
|
+
*/
|
|
2278
|
+
interface OpenAIResponseAnnotationCitation {
|
|
2279
|
+
end_index: number;
|
|
2280
|
+
start_index: number;
|
|
2281
|
+
title: string;
|
|
2282
|
+
url: string;
|
|
2283
|
+
type?: 'url_citation';
|
|
2284
|
+
}
|
|
2285
|
+
/**
|
|
2286
|
+
* Container file citation annotation referencing a file within a container.
|
|
2287
|
+
*/
|
|
2288
|
+
interface OpenAIResponseAnnotationContainerFileCitation {
|
|
2289
|
+
container_id: string;
|
|
2290
|
+
end_index: number;
|
|
2291
|
+
file_id: string;
|
|
2292
|
+
filename: string;
|
|
2293
|
+
start_index: number;
|
|
2294
|
+
type?: 'container_file_citation';
|
|
2295
|
+
}
|
|
2296
|
+
/**
|
|
2297
|
+
* File path annotation referencing a generated file in response content.
|
|
2298
|
+
*/
|
|
2299
|
+
interface OpenAIResponseAnnotationFilePath {
|
|
2300
|
+
file_id: string;
|
|
2301
|
+
index: number;
|
|
2302
|
+
type?: 'file_path';
|
|
2303
|
+
}
|
|
2304
|
+
}
|
|
2305
|
+
/**
|
|
2306
|
+
* Streaming event for file search calls in progress.
|
|
2307
|
+
*/
|
|
2308
|
+
interface OpenAIResponseObjectStreamResponseFileSearchCallInProgress {
|
|
2309
|
+
item_id: string;
|
|
2310
|
+
output_index: number;
|
|
2311
|
+
sequence_number: number;
|
|
2312
|
+
type?: 'response.file_search_call.in_progress';
|
|
2313
|
+
}
|
|
2314
|
+
/**
|
|
2315
|
+
* Streaming event for file search currently searching.
|
|
2316
|
+
*/
|
|
2317
|
+
interface OpenAIResponseObjectStreamResponseFileSearchCallSearching {
|
|
2318
|
+
item_id: string;
|
|
2319
|
+
output_index: number;
|
|
2320
|
+
sequence_number: number;
|
|
2321
|
+
type?: 'response.file_search_call.searching';
|
|
2322
|
+
}
|
|
2323
|
+
/**
|
|
2324
|
+
* Streaming event for completed file search calls.
|
|
2325
|
+
*/
|
|
2326
|
+
interface OpenAIResponseObjectStreamResponseFileSearchCallCompleted {
|
|
2327
|
+
item_id: string;
|
|
2328
|
+
output_index: number;
|
|
2329
|
+
sequence_number: number;
|
|
2330
|
+
type?: 'response.file_search_call.completed';
|
|
2331
|
+
}
|
|
2332
|
+
/**
|
|
2333
|
+
* Streaming event emitted when a response ends in an incomplete state.
|
|
2334
|
+
*/
|
|
2335
|
+
interface OpenAIResponseObjectStreamResponseIncomplete {
|
|
2336
|
+
/**
|
|
2337
|
+
* Complete OpenAI response object containing generation results and metadata.
|
|
2338
|
+
*/
|
|
2339
|
+
response: ResponsesAPI.ResponseObject;
|
|
2340
|
+
sequence_number: number;
|
|
2341
|
+
type?: 'response.incomplete';
|
|
2342
|
+
}
|
|
2343
|
+
/**
|
|
2344
|
+
* Streaming event emitted when a response fails.
|
|
2345
|
+
*/
|
|
2346
|
+
interface OpenAIResponseObjectStreamResponseFailed {
|
|
2347
|
+
/**
|
|
2348
|
+
* Complete OpenAI response object containing generation results and metadata.
|
|
2349
|
+
*/
|
|
2350
|
+
response: ResponsesAPI.ResponseObject;
|
|
2351
|
+
sequence_number: number;
|
|
2352
|
+
type?: 'response.failed';
|
|
2353
|
+
}
|
|
2354
|
+
/**
|
|
2355
|
+
* Streaming event indicating a response has been completed.
|
|
2356
|
+
*/
|
|
2357
|
+
interface OpenAIResponseObjectStreamResponseCompleted {
|
|
2358
|
+
/**
|
|
2359
|
+
* Complete OpenAI response object containing generation results and metadata.
|
|
2360
|
+
*/
|
|
2361
|
+
response: ResponsesAPI.ResponseObject;
|
|
2362
|
+
sequence_number: number;
|
|
2363
|
+
type?: 'response.completed';
|
|
2364
|
+
}
|
|
2365
|
+
/**
|
|
2366
|
+
* Standalone error event emitted during streaming when an error occurs.
|
|
2367
|
+
*
|
|
2368
|
+
* This is distinct from response.failed which is a response lifecycle event. The
|
|
2369
|
+
* error event signals transport/infrastructure-level errors to the client.
|
|
2370
|
+
*/
|
|
2371
|
+
interface OpenAIResponseObjectStreamError {
|
|
2372
|
+
message: string;
|
|
2373
|
+
sequence_number: number;
|
|
2374
|
+
code?: string | null;
|
|
2375
|
+
param?: string | null;
|
|
2376
|
+
type?: 'error';
|
|
2377
|
+
}
|
|
2378
|
+
}
|
|
2379
|
+
/**
|
|
2380
|
+
* Corresponds to the various Message types in the Responses API. They are all
|
|
2381
|
+
* under one type because the Responses API gives them all the same "type" value,
|
|
2382
|
+
* and there is no way to tell them apart in certain scenarios.
|
|
2383
|
+
*/
|
|
2384
|
+
export type ResponseOutput = ResponseMessage | ResponseOutput.OpenAIResponseOutputMessageWebSearchToolCall | ResponseOutput.OpenAIResponseOutputMessageFileSearchToolCall | ResponseOutput.OpenAIResponseOutputMessageFunctionToolCall | ResponseOutput.OpenAIResponseOutputMessageMcpCall | ResponseOutput.OpenAIResponseOutputMessageMcpListTools | ResponseOutput.OpenAIResponseMcpApprovalRequest | ResponseOutput.OpenAIResponseOutputMessageReasoningItem;
|
|
2385
|
+
export declare namespace ResponseOutput {
|
|
2386
|
+
/**
|
|
2387
|
+
* Web search tool call output message for OpenAI responses.
|
|
2388
|
+
*/
|
|
2389
|
+
interface OpenAIResponseOutputMessageWebSearchToolCall {
|
|
2390
|
+
id: string;
|
|
2391
|
+
status: string;
|
|
2392
|
+
type?: 'web_search_call';
|
|
2393
|
+
}
|
|
2394
|
+
/**
|
|
2395
|
+
* File search tool call output message for OpenAI responses.
|
|
2396
|
+
*/
|
|
2397
|
+
interface OpenAIResponseOutputMessageFileSearchToolCall {
|
|
2398
|
+
id: string;
|
|
2399
|
+
queries: Array<string>;
|
|
2400
|
+
status: string;
|
|
2401
|
+
results?: Array<OpenAIResponseOutputMessageFileSearchToolCall.Result> | null;
|
|
2402
|
+
type?: 'file_search_call';
|
|
2403
|
+
}
|
|
2404
|
+
namespace OpenAIResponseOutputMessageFileSearchToolCall {
|
|
2405
|
+
/**
|
|
2406
|
+
* Search results returned by the file search operation.
|
|
2407
|
+
*/
|
|
2408
|
+
interface Result {
|
|
2409
|
+
attributes: {
|
|
2410
|
+
[key: string]: unknown;
|
|
2411
|
+
};
|
|
2412
|
+
file_id: string;
|
|
2413
|
+
filename: string;
|
|
2414
|
+
score: number;
|
|
2415
|
+
text: string;
|
|
2416
|
+
}
|
|
2417
|
+
}
|
|
2418
|
+
/**
|
|
2419
|
+
* Function tool call output message for OpenAI responses.
|
|
2420
|
+
*/
|
|
2421
|
+
interface OpenAIResponseOutputMessageFunctionToolCall {
|
|
2422
|
+
arguments: string;
|
|
2423
|
+
call_id: string;
|
|
2424
|
+
name: string;
|
|
2425
|
+
id?: string | null;
|
|
2426
|
+
status?: string | null;
|
|
2427
|
+
type?: 'function_call';
|
|
2428
|
+
}
|
|
2429
|
+
/**
|
|
2430
|
+
* Model Context Protocol (MCP) call output message for OpenAI responses.
|
|
2431
|
+
*/
|
|
2432
|
+
interface OpenAIResponseOutputMessageMcpCall {
|
|
2433
|
+
id: string;
|
|
2434
|
+
arguments: string;
|
|
2435
|
+
name: string;
|
|
2436
|
+
server_label: string;
|
|
2437
|
+
error?: string | null;
|
|
2438
|
+
output?: string | null;
|
|
2439
|
+
type?: 'mcp_call';
|
|
2440
|
+
}
|
|
2441
|
+
/**
|
|
2442
|
+
* MCP list tools output message containing available tools from an MCP server.
|
|
2443
|
+
*/
|
|
2444
|
+
interface OpenAIResponseOutputMessageMcpListTools {
|
|
2445
|
+
id: string;
|
|
2446
|
+
server_label: string;
|
|
2447
|
+
tools: Array<OpenAIResponseOutputMessageMcpListTools.Tool>;
|
|
2448
|
+
type?: 'mcp_list_tools';
|
|
2449
|
+
}
|
|
2450
|
+
namespace OpenAIResponseOutputMessageMcpListTools {
|
|
2451
|
+
/**
|
|
2452
|
+
* Tool definition returned by MCP list tools operation.
|
|
2453
|
+
*/
|
|
2454
|
+
interface Tool {
|
|
2455
|
+
input_schema: {
|
|
2456
|
+
[key: string]: unknown;
|
|
2457
|
+
};
|
|
2458
|
+
name: string;
|
|
2459
|
+
description?: string | null;
|
|
2460
|
+
}
|
|
2461
|
+
}
|
|
2462
|
+
/**
|
|
2463
|
+
* A request for human approval of a tool invocation.
|
|
2464
|
+
*/
|
|
2465
|
+
interface OpenAIResponseMcpApprovalRequest {
|
|
2466
|
+
id: string;
|
|
2467
|
+
arguments: string;
|
|
2468
|
+
name: string;
|
|
2469
|
+
server_label: string;
|
|
2470
|
+
type?: 'mcp_approval_request';
|
|
2471
|
+
}
|
|
2472
|
+
/**
|
|
2473
|
+
* Reasoning output from the model, representing the model's thinking process.
|
|
2474
|
+
*/
|
|
2475
|
+
interface OpenAIResponseOutputMessageReasoningItem {
|
|
2476
|
+
/**
|
|
2477
|
+
* Unique identifier for the reasoning output item.
|
|
2478
|
+
*/
|
|
2479
|
+
id: string;
|
|
2480
|
+
/**
|
|
2481
|
+
* Summary of the reasoning output.
|
|
2482
|
+
*/
|
|
2483
|
+
summary: Array<OpenAIResponseOutputMessageReasoningItem.Summary>;
|
|
2484
|
+
/**
|
|
2485
|
+
* The reasoning content from the model.
|
|
2486
|
+
*/
|
|
2487
|
+
content?: Array<OpenAIResponseOutputMessageReasoningItem.Content> | null;
|
|
2488
|
+
/**
|
|
2489
|
+
* The status of the reasoning output.
|
|
2490
|
+
*/
|
|
2491
|
+
status?: 'in_progress' | 'completed' | 'incomplete' | null;
|
|
2492
|
+
/**
|
|
2493
|
+
* The type identifier, always 'reasoning'.
|
|
2494
|
+
*/
|
|
2495
|
+
type?: 'reasoning';
|
|
2496
|
+
}
|
|
2497
|
+
namespace OpenAIResponseOutputMessageReasoningItem {
|
|
2498
|
+
/**
|
|
2499
|
+
* A summary of reasoning output from the model.
|
|
2500
|
+
*/
|
|
2501
|
+
interface Summary {
|
|
2502
|
+
/**
|
|
2503
|
+
* The summary text of the reasoning output.
|
|
2504
|
+
*/
|
|
2505
|
+
text: string;
|
|
2506
|
+
/**
|
|
2507
|
+
* The type identifier, always 'summary_text'.
|
|
2508
|
+
*/
|
|
2509
|
+
type?: 'summary_text';
|
|
2510
|
+
}
|
|
2511
|
+
/**
|
|
2512
|
+
* Reasoning text from the model.
|
|
2513
|
+
*/
|
|
2514
|
+
interface Content {
|
|
2515
|
+
/**
|
|
2516
|
+
* The reasoning text content from the model.
|
|
2517
|
+
*/
|
|
2518
|
+
text: string;
|
|
2519
|
+
/**
|
|
2520
|
+
* The type identifier, always 'reasoning_text'.
|
|
2521
|
+
*/
|
|
2522
|
+
type?: 'reasoning_text';
|
|
2523
|
+
}
|
|
2524
|
+
}
|
|
2525
|
+
}
|
|
2526
|
+
/**
|
|
2527
|
+
* OpenAI response object extended with input context information.
|
|
2528
|
+
*/
|
|
2529
|
+
export interface ResponseListResponse {
|
|
2530
|
+
id: string;
|
|
2531
|
+
created_at: number;
|
|
2532
|
+
input: Array<ResponseListResponse.OpenAIResponseMessageOutput | ResponseListResponse.OpenAIResponseOutputMessageWebSearchToolCall | ResponseListResponse.OpenAIResponseOutputMessageFileSearchToolCall | ResponseListResponse.OpenAIResponseOutputMessageFunctionToolCall | ResponseListResponse.OpenAIResponseOutputMessageMcpCall | ResponseListResponse.OpenAIResponseOutputMessageMcpListTools | ResponseListResponse.OpenAIResponseMcpApprovalRequest | ResponseListResponse.OpenAIResponseOutputMessageReasoningItem | ResponseListResponse.OpenAIResponseInputFunctionToolCallOutput | ResponseListResponse.OpenAIResponseMcpApprovalResponse | ResponseListResponse.OpenAIResponseCompaction>;
|
|
2533
|
+
model: string;
|
|
2534
|
+
output: Array<ResponseListResponse.OpenAIResponseMessageOutput | ResponseListResponse.OpenAIResponseOutputMessageWebSearchToolCall | ResponseListResponse.OpenAIResponseOutputMessageFileSearchToolCall | ResponseListResponse.OpenAIResponseOutputMessageFunctionToolCall | ResponseListResponse.OpenAIResponseOutputMessageMcpCall | ResponseListResponse.OpenAIResponseOutputMessageMcpListTools | ResponseListResponse.OpenAIResponseMcpApprovalRequest | ResponseListResponse.OpenAIResponseOutputMessageReasoningItem>;
|
|
2535
|
+
status: string;
|
|
2536
|
+
store: boolean;
|
|
2537
|
+
background?: boolean;
|
|
2538
|
+
completed_at?: number | null;
|
|
2539
|
+
/**
|
|
2540
|
+
* Error details for failed OpenAI response requests.
|
|
2541
|
+
*/
|
|
2542
|
+
error?: ResponseListResponse.Error | null;
|
|
2543
|
+
frequency_penalty?: number;
|
|
2544
|
+
/**
|
|
2545
|
+
* Details explaining why a response was incomplete.
|
|
2546
|
+
*/
|
|
2547
|
+
incomplete_details?: ResponseListResponse.IncompleteDetails | null;
|
|
2548
|
+
instructions?: string | null;
|
|
2549
|
+
max_output_tokens?: number | null;
|
|
2550
|
+
max_tool_calls?: number | null;
|
|
2551
|
+
metadata?: {
|
|
2552
|
+
[key: string]: string;
|
|
2553
|
+
} | null;
|
|
2554
|
+
object?: 'response';
|
|
2555
|
+
parallel_tool_calls?: boolean;
|
|
2556
|
+
presence_penalty?: number;
|
|
2557
|
+
previous_response_id?: string | null;
|
|
2558
|
+
/**
|
|
2559
|
+
* OpenAI compatible Prompt object that is used in OpenAI responses.
|
|
2560
|
+
*/
|
|
2561
|
+
prompt?: ResponseListResponse.Prompt | null;
|
|
2562
|
+
prompt_cache_key?: string | null;
|
|
2563
|
+
/**
|
|
2564
|
+
* Configuration for reasoning effort in OpenAI responses.
|
|
2565
|
+
*
|
|
2566
|
+
* Controls how much reasoning the model performs before generating a response.
|
|
2567
|
+
*/
|
|
2568
|
+
reasoning?: ResponseListResponse.Reasoning | null;
|
|
2569
|
+
safety_identifier?: string | null;
|
|
2570
|
+
service_tier?: string;
|
|
2571
|
+
temperature?: number;
|
|
2572
|
+
/**
|
|
2573
|
+
* Text response configuration for OpenAI responses.
|
|
2574
|
+
*/
|
|
2575
|
+
text?: ResponseListResponse.Text;
|
|
2576
|
+
/**
|
|
2577
|
+
* Enumeration of simple tool choice modes for response generation.
|
|
2578
|
+
*/
|
|
2579
|
+
tool_choice?: 'auto' | 'required' | 'none' | ResponseListResponse.OpenAIResponseInputToolChoiceAllowedTools | ResponseListResponse.OpenAIResponseInputToolChoiceFileSearch | ResponseListResponse.OpenAIResponseInputToolChoiceWebSearch | ResponseListResponse.OpenAIResponseInputToolChoiceFunctionTool | ResponseListResponse.OpenAIResponseInputToolChoiceMcpTool | ResponseListResponse.OpenAIResponseInputToolChoiceCustomTool | null;
|
|
2580
|
+
tools?: Array<ResponseListResponse.OpenAIResponseInputToolWebSearch | ResponseListResponse.OpenAIResponseInputToolFileSearch | ResponseListResponse.OpenAIResponseInputToolFunction | ResponseListResponse.OpenAIResponseToolMcp>;
|
|
2581
|
+
top_logprobs?: number;
|
|
2582
|
+
top_p?: number;
|
|
2583
|
+
truncation?: string | null;
|
|
2584
|
+
/**
|
|
2585
|
+
* Usage information for OpenAI response.
|
|
2586
|
+
*/
|
|
2587
|
+
usage?: ResponseListResponse.Usage | null;
|
|
2588
|
+
}
|
|
2589
|
+
export declare namespace ResponseListResponse {
|
|
2590
|
+
/**
|
|
2591
|
+
* Corresponds to the various Message types in the Responses API. They are all
|
|
2592
|
+
* under one type because the Responses API gives them all the same "type" value,
|
|
2593
|
+
* and there is no way to tell them apart in certain scenarios.
|
|
2594
|
+
*/
|
|
2595
|
+
interface OpenAIResponseMessageOutput {
|
|
2596
|
+
content: string | Array<OpenAIResponseMessageOutput.OpenAIResponseInputMessageContentText | OpenAIResponseMessageOutput.OpenAIResponseInputMessageContentImage | OpenAIResponseMessageOutput.OpenAIResponseInputMessageContentFile> | Array<OpenAIResponseMessageOutput.OpenAIResponseOutputMessageContentOutputTextOutput | OpenAIResponseMessageOutput.OpenAIResponseContentPartRefusal>;
|
|
2597
|
+
role: 'system' | 'developer' | 'user' | 'assistant';
|
|
2598
|
+
id?: string | null;
|
|
2599
|
+
status?: string | null;
|
|
2600
|
+
type?: 'message';
|
|
2601
|
+
}
|
|
2602
|
+
namespace OpenAIResponseMessageOutput {
|
|
2603
|
+
/**
|
|
2604
|
+
* Text content for input messages in OpenAI response format.
|
|
2605
|
+
*/
|
|
2606
|
+
interface OpenAIResponseInputMessageContentText {
|
|
2607
|
+
text: string;
|
|
2608
|
+
type?: 'input_text';
|
|
2609
|
+
}
|
|
2610
|
+
/**
|
|
2611
|
+
* Image content for input messages in OpenAI response format.
|
|
2612
|
+
*/
|
|
2613
|
+
interface OpenAIResponseInputMessageContentImage {
|
|
2614
|
+
detail?: 'low' | 'high' | 'auto';
|
|
2615
|
+
file_id?: string | null;
|
|
2616
|
+
image_url?: string | null;
|
|
2617
|
+
type?: 'input_image';
|
|
2618
|
+
}
|
|
2619
|
+
/**
|
|
2620
|
+
* File content for input messages in OpenAI response format.
|
|
2621
|
+
*/
|
|
2622
|
+
interface OpenAIResponseInputMessageContentFile {
|
|
2623
|
+
file_data?: string | null;
|
|
2624
|
+
file_id?: string | null;
|
|
2625
|
+
file_url?: string | null;
|
|
2626
|
+
filename?: string | null;
|
|
2627
|
+
type?: 'input_file';
|
|
2628
|
+
}
|
|
2629
|
+
/**
|
|
2630
|
+
* Text content within an output message of an OpenAI response.
|
|
2631
|
+
*/
|
|
2632
|
+
interface OpenAIResponseOutputMessageContentOutputTextOutput {
|
|
2633
|
+
text: string;
|
|
2634
|
+
annotations?: Array<OpenAIResponseOutputMessageContentOutputTextOutput.OpenAIResponseAnnotationFileCitation | OpenAIResponseOutputMessageContentOutputTextOutput.OpenAIResponseAnnotationCitation | OpenAIResponseOutputMessageContentOutputTextOutput.OpenAIResponseAnnotationContainerFileCitation | OpenAIResponseOutputMessageContentOutputTextOutput.OpenAIResponseAnnotationFilePath>;
|
|
2635
|
+
logprobs?: Array<OpenAIResponseOutputMessageContentOutputTextOutput.Logprob> | null;
|
|
2636
|
+
type?: 'output_text';
|
|
2637
|
+
}
|
|
2638
|
+
namespace OpenAIResponseOutputMessageContentOutputTextOutput {
|
|
2639
|
+
/**
|
|
2640
|
+
* File citation annotation for referencing specific files in response content.
|
|
2641
|
+
*/
|
|
2642
|
+
interface OpenAIResponseAnnotationFileCitation {
|
|
2643
|
+
file_id: string;
|
|
2644
|
+
filename: string;
|
|
2645
|
+
index: number;
|
|
2646
|
+
type?: 'file_citation';
|
|
2647
|
+
}
|
|
2648
|
+
/**
|
|
2649
|
+
* URL citation annotation for referencing external web resources.
|
|
2650
|
+
*/
|
|
2651
|
+
interface OpenAIResponseAnnotationCitation {
|
|
2652
|
+
end_index: number;
|
|
2653
|
+
start_index: number;
|
|
2654
|
+
title: string;
|
|
2655
|
+
url: string;
|
|
2656
|
+
type?: 'url_citation';
|
|
2657
|
+
}
|
|
2658
|
+
/**
|
|
2659
|
+
* Container file citation annotation referencing a file within a container.
|
|
2660
|
+
*/
|
|
2661
|
+
interface OpenAIResponseAnnotationContainerFileCitation {
|
|
2662
|
+
container_id: string;
|
|
2663
|
+
end_index: number;
|
|
2664
|
+
file_id: string;
|
|
2665
|
+
filename: string;
|
|
2666
|
+
start_index: number;
|
|
2667
|
+
type?: 'container_file_citation';
|
|
2668
|
+
}
|
|
2669
|
+
/**
|
|
2670
|
+
* File path annotation referencing a generated file in response content.
|
|
2671
|
+
*/
|
|
2672
|
+
interface OpenAIResponseAnnotationFilePath {
|
|
2673
|
+
file_id: string;
|
|
2674
|
+
index: number;
|
|
2675
|
+
type?: 'file_path';
|
|
2676
|
+
}
|
|
2677
|
+
/**
|
|
2678
|
+
* The log probability for a token from an OpenAI-compatible chat completion
|
|
2679
|
+
* response.
|
|
2680
|
+
*/
|
|
2681
|
+
interface Logprob {
|
|
2682
|
+
/**
|
|
2683
|
+
* The token.
|
|
2684
|
+
*/
|
|
2685
|
+
token: string;
|
|
2686
|
+
/**
|
|
2687
|
+
* The log probability of the token.
|
|
2688
|
+
*/
|
|
2689
|
+
logprob: number;
|
|
2690
|
+
/**
|
|
2691
|
+
* The bytes for the token.
|
|
2692
|
+
*/
|
|
2693
|
+
bytes?: Array<number> | null;
|
|
2694
|
+
/**
|
|
2695
|
+
* The top log probabilities for the token.
|
|
2696
|
+
*/
|
|
2697
|
+
top_logprobs?: Array<Logprob.TopLogprob> | null;
|
|
2698
|
+
}
|
|
2699
|
+
namespace Logprob {
|
|
2700
|
+
/**
|
|
2701
|
+
* The top log probability for a token from an OpenAI-compatible chat completion
|
|
2702
|
+
* response.
|
|
2703
|
+
*/
|
|
2704
|
+
interface TopLogprob {
|
|
2705
|
+
/**
|
|
2706
|
+
* The token.
|
|
2707
|
+
*/
|
|
2708
|
+
token: string;
|
|
2709
|
+
/**
|
|
2710
|
+
* The log probability of the token.
|
|
2711
|
+
*/
|
|
2712
|
+
logprob: number;
|
|
2713
|
+
/**
|
|
2714
|
+
* The bytes for the token.
|
|
2715
|
+
*/
|
|
2716
|
+
bytes?: Array<number> | null;
|
|
2717
|
+
}
|
|
2718
|
+
}
|
|
2719
|
+
}
|
|
2720
|
+
/**
|
|
2721
|
+
* Refusal content within a streamed response part.
|
|
2722
|
+
*/
|
|
2723
|
+
interface OpenAIResponseContentPartRefusal {
|
|
2724
|
+
refusal: string;
|
|
2725
|
+
type?: 'refusal';
|
|
2726
|
+
}
|
|
2727
|
+
}
|
|
2728
|
+
/**
|
|
2729
|
+
* Web search tool call output message for OpenAI responses.
|
|
2730
|
+
*/
|
|
2731
|
+
interface OpenAIResponseOutputMessageWebSearchToolCall {
|
|
2732
|
+
id: string;
|
|
2733
|
+
status: string;
|
|
2734
|
+
type?: 'web_search_call';
|
|
2735
|
+
}
|
|
2736
|
+
/**
|
|
2737
|
+
* File search tool call output message for OpenAI responses.
|
|
2738
|
+
*/
|
|
2739
|
+
interface OpenAIResponseOutputMessageFileSearchToolCall {
|
|
2740
|
+
id: string;
|
|
2741
|
+
queries: Array<string>;
|
|
2742
|
+
status: string;
|
|
2743
|
+
results?: Array<OpenAIResponseOutputMessageFileSearchToolCall.Result> | null;
|
|
2744
|
+
type?: 'file_search_call';
|
|
2745
|
+
}
|
|
2746
|
+
namespace OpenAIResponseOutputMessageFileSearchToolCall {
|
|
2747
|
+
/**
|
|
2748
|
+
* Search results returned by the file search operation.
|
|
2749
|
+
*/
|
|
2750
|
+
interface Result {
|
|
2751
|
+
attributes: {
|
|
2752
|
+
[key: string]: unknown;
|
|
2753
|
+
};
|
|
2754
|
+
file_id: string;
|
|
2755
|
+
filename: string;
|
|
2756
|
+
score: number;
|
|
2757
|
+
text: string;
|
|
2758
|
+
}
|
|
2759
|
+
}
|
|
2760
|
+
/**
|
|
2761
|
+
* Function tool call output message for OpenAI responses.
|
|
2762
|
+
*/
|
|
2763
|
+
interface OpenAIResponseOutputMessageFunctionToolCall {
|
|
2764
|
+
arguments: string;
|
|
2765
|
+
call_id: string;
|
|
2766
|
+
name: string;
|
|
2767
|
+
id?: string | null;
|
|
2768
|
+
status?: string | null;
|
|
2769
|
+
type?: 'function_call';
|
|
2770
|
+
}
|
|
2771
|
+
/**
|
|
2772
|
+
* Model Context Protocol (MCP) call output message for OpenAI responses.
|
|
2773
|
+
*/
|
|
2774
|
+
interface OpenAIResponseOutputMessageMcpCall {
|
|
2775
|
+
id: string;
|
|
2776
|
+
arguments: string;
|
|
2777
|
+
name: string;
|
|
2778
|
+
server_label: string;
|
|
2779
|
+
error?: string | null;
|
|
2780
|
+
output?: string | null;
|
|
2781
|
+
type?: 'mcp_call';
|
|
2782
|
+
}
|
|
2783
|
+
/**
|
|
2784
|
+
* MCP list tools output message containing available tools from an MCP server.
|
|
2785
|
+
*/
|
|
2786
|
+
interface OpenAIResponseOutputMessageMcpListTools {
|
|
2787
|
+
id: string;
|
|
2788
|
+
server_label: string;
|
|
2789
|
+
tools: Array<OpenAIResponseOutputMessageMcpListTools.Tool>;
|
|
2790
|
+
type?: 'mcp_list_tools';
|
|
2791
|
+
}
|
|
2792
|
+
namespace OpenAIResponseOutputMessageMcpListTools {
|
|
2793
|
+
/**
|
|
2794
|
+
* Tool definition returned by MCP list tools operation.
|
|
2795
|
+
*/
|
|
2796
|
+
interface Tool {
|
|
2797
|
+
input_schema: {
|
|
2798
|
+
[key: string]: unknown;
|
|
2799
|
+
};
|
|
2800
|
+
name: string;
|
|
2801
|
+
description?: string | null;
|
|
2802
|
+
}
|
|
2803
|
+
}
|
|
2804
|
+
/**
|
|
2805
|
+
* A request for human approval of a tool invocation.
|
|
2806
|
+
*/
|
|
2807
|
+
interface OpenAIResponseMcpApprovalRequest {
|
|
2808
|
+
id: string;
|
|
2809
|
+
arguments: string;
|
|
2810
|
+
name: string;
|
|
2811
|
+
server_label: string;
|
|
2812
|
+
type?: 'mcp_approval_request';
|
|
2813
|
+
}
|
|
2814
|
+
/**
|
|
2815
|
+
* Reasoning output from the model, representing the model's thinking process.
|
|
2816
|
+
*/
|
|
2817
|
+
interface OpenAIResponseOutputMessageReasoningItem {
|
|
2818
|
+
/**
|
|
2819
|
+
* Unique identifier for the reasoning output item.
|
|
2820
|
+
*/
|
|
2821
|
+
id: string;
|
|
2822
|
+
/**
|
|
2823
|
+
* Summary of the reasoning output.
|
|
2824
|
+
*/
|
|
2825
|
+
summary: Array<OpenAIResponseOutputMessageReasoningItem.Summary>;
|
|
2826
|
+
/**
|
|
2827
|
+
* The reasoning content from the model.
|
|
2828
|
+
*/
|
|
2829
|
+
content?: Array<OpenAIResponseOutputMessageReasoningItem.Content> | null;
|
|
2830
|
+
/**
|
|
2831
|
+
* The status of the reasoning output.
|
|
2832
|
+
*/
|
|
2833
|
+
status?: 'in_progress' | 'completed' | 'incomplete' | null;
|
|
2834
|
+
/**
|
|
2835
|
+
* The type identifier, always 'reasoning'.
|
|
2836
|
+
*/
|
|
2837
|
+
type?: 'reasoning';
|
|
2838
|
+
}
|
|
2839
|
+
namespace OpenAIResponseOutputMessageReasoningItem {
|
|
2840
|
+
/**
|
|
2841
|
+
* A summary of reasoning output from the model.
|
|
2842
|
+
*/
|
|
2843
|
+
interface Summary {
|
|
2844
|
+
/**
|
|
2845
|
+
* The summary text of the reasoning output.
|
|
2846
|
+
*/
|
|
2847
|
+
text: string;
|
|
2848
|
+
/**
|
|
2849
|
+
* The type identifier, always 'summary_text'.
|
|
2850
|
+
*/
|
|
2851
|
+
type?: 'summary_text';
|
|
2852
|
+
}
|
|
2853
|
+
/**
|
|
2854
|
+
* Reasoning text from the model.
|
|
2855
|
+
*/
|
|
2856
|
+
interface Content {
|
|
2857
|
+
/**
|
|
2858
|
+
* The reasoning text content from the model.
|
|
2859
|
+
*/
|
|
2860
|
+
text: string;
|
|
2861
|
+
/**
|
|
2862
|
+
* The type identifier, always 'reasoning_text'.
|
|
2863
|
+
*/
|
|
2864
|
+
type?: 'reasoning_text';
|
|
2865
|
+
}
|
|
2866
|
+
}
|
|
2867
|
+
/**
|
|
2868
|
+
* This represents the output of a function call that gets passed back to the
|
|
2869
|
+
* model.
|
|
2870
|
+
*/
|
|
2871
|
+
interface OpenAIResponseInputFunctionToolCallOutput {
|
|
2872
|
+
call_id: string;
|
|
2873
|
+
output: string | Array<OpenAIResponseInputFunctionToolCallOutput.OpenAIResponseInputMessageContentText | OpenAIResponseInputFunctionToolCallOutput.OpenAIResponseInputMessageContentImage | OpenAIResponseInputFunctionToolCallOutput.OpenAIResponseInputMessageContentFile>;
|
|
2874
|
+
id?: string | null;
|
|
2875
|
+
status?: string | null;
|
|
2876
|
+
type?: 'function_call_output';
|
|
2877
|
+
}
|
|
2878
|
+
namespace OpenAIResponseInputFunctionToolCallOutput {
|
|
2879
|
+
/**
|
|
2880
|
+
* Text content for input messages in OpenAI response format.
|
|
2881
|
+
*/
|
|
2882
|
+
interface OpenAIResponseInputMessageContentText {
|
|
2883
|
+
text: string;
|
|
2884
|
+
type?: 'input_text';
|
|
2885
|
+
}
|
|
2886
|
+
/**
|
|
2887
|
+
* Image content for input messages in OpenAI response format.
|
|
2888
|
+
*/
|
|
2889
|
+
interface OpenAIResponseInputMessageContentImage {
|
|
2890
|
+
detail?: 'low' | 'high' | 'auto';
|
|
2891
|
+
file_id?: string | null;
|
|
2892
|
+
image_url?: string | null;
|
|
2893
|
+
type?: 'input_image';
|
|
2894
|
+
}
|
|
2895
|
+
/**
|
|
2896
|
+
* File content for input messages in OpenAI response format.
|
|
2897
|
+
*/
|
|
2898
|
+
interface OpenAIResponseInputMessageContentFile {
|
|
2899
|
+
file_data?: string | null;
|
|
2900
|
+
file_id?: string | null;
|
|
2901
|
+
file_url?: string | null;
|
|
2902
|
+
filename?: string | null;
|
|
2903
|
+
type?: 'input_file';
|
|
2904
|
+
}
|
|
2905
|
+
}
|
|
2906
|
+
/**
|
|
2907
|
+
* A response to an MCP approval request.
|
|
2908
|
+
*/
|
|
2909
|
+
interface OpenAIResponseMcpApprovalResponse {
|
|
2910
|
+
approval_request_id: string;
|
|
2911
|
+
approve: boolean;
|
|
2912
|
+
id?: string | null;
|
|
2913
|
+
reason?: string | null;
|
|
2914
|
+
type?: 'mcp_approval_response';
|
|
2915
|
+
}
|
|
2916
|
+
/**
|
|
2917
|
+
* A compaction item that summarizes prior conversation context.
|
|
2918
|
+
*/
|
|
2919
|
+
interface OpenAIResponseCompaction {
|
|
2920
|
+
encrypted_content: string;
|
|
2921
|
+
id?: string | null;
|
|
2922
|
+
type?: 'compaction';
|
|
2923
|
+
}
|
|
2924
|
+
/**
|
|
2925
|
+
* Corresponds to the various Message types in the Responses API. They are all
|
|
2926
|
+
* under one type because the Responses API gives them all the same "type" value,
|
|
2927
|
+
* and there is no way to tell them apart in certain scenarios.
|
|
2928
|
+
*/
|
|
2929
|
+
interface OpenAIResponseMessageOutput {
|
|
2930
|
+
content: string | Array<OpenAIResponseMessageOutput.OpenAIResponseInputMessageContentText | OpenAIResponseMessageOutput.OpenAIResponseInputMessageContentImage | OpenAIResponseMessageOutput.OpenAIResponseInputMessageContentFile> | Array<OpenAIResponseMessageOutput.OpenAIResponseOutputMessageContentOutputTextOutput | OpenAIResponseMessageOutput.OpenAIResponseContentPartRefusal>;
|
|
2931
|
+
role: 'system' | 'developer' | 'user' | 'assistant';
|
|
2932
|
+
id?: string | null;
|
|
2933
|
+
status?: string | null;
|
|
2934
|
+
type?: 'message';
|
|
2935
|
+
}
|
|
2936
|
+
namespace OpenAIResponseMessageOutput {
|
|
2937
|
+
/**
|
|
2938
|
+
* Text content for input messages in OpenAI response format.
|
|
2939
|
+
*/
|
|
2940
|
+
interface OpenAIResponseInputMessageContentText {
|
|
2941
|
+
text: string;
|
|
2942
|
+
type?: 'input_text';
|
|
2943
|
+
}
|
|
2944
|
+
/**
|
|
2945
|
+
* Image content for input messages in OpenAI response format.
|
|
2946
|
+
*/
|
|
2947
|
+
interface OpenAIResponseInputMessageContentImage {
|
|
2948
|
+
detail?: 'low' | 'high' | 'auto';
|
|
2949
|
+
file_id?: string | null;
|
|
2950
|
+
image_url?: string | null;
|
|
2951
|
+
type?: 'input_image';
|
|
2952
|
+
}
|
|
2953
|
+
/**
|
|
2954
|
+
* File content for input messages in OpenAI response format.
|
|
2955
|
+
*/
|
|
2956
|
+
interface OpenAIResponseInputMessageContentFile {
|
|
2957
|
+
file_data?: string | null;
|
|
2958
|
+
file_id?: string | null;
|
|
2959
|
+
file_url?: string | null;
|
|
2960
|
+
filename?: string | null;
|
|
2961
|
+
type?: 'input_file';
|
|
2962
|
+
}
|
|
2963
|
+
/**
|
|
2964
|
+
* Text content within an output message of an OpenAI response.
|
|
2965
|
+
*/
|
|
2966
|
+
interface OpenAIResponseOutputMessageContentOutputTextOutput {
|
|
2967
|
+
text: string;
|
|
2968
|
+
annotations?: Array<OpenAIResponseOutputMessageContentOutputTextOutput.OpenAIResponseAnnotationFileCitation | OpenAIResponseOutputMessageContentOutputTextOutput.OpenAIResponseAnnotationCitation | OpenAIResponseOutputMessageContentOutputTextOutput.OpenAIResponseAnnotationContainerFileCitation | OpenAIResponseOutputMessageContentOutputTextOutput.OpenAIResponseAnnotationFilePath>;
|
|
2969
|
+
logprobs?: Array<OpenAIResponseOutputMessageContentOutputTextOutput.Logprob> | null;
|
|
2970
|
+
type?: 'output_text';
|
|
2971
|
+
}
|
|
2972
|
+
namespace OpenAIResponseOutputMessageContentOutputTextOutput {
|
|
2973
|
+
/**
|
|
2974
|
+
* File citation annotation for referencing specific files in response content.
|
|
2975
|
+
*/
|
|
2976
|
+
interface OpenAIResponseAnnotationFileCitation {
|
|
2977
|
+
file_id: string;
|
|
2978
|
+
filename: string;
|
|
2979
|
+
index: number;
|
|
2980
|
+
type?: 'file_citation';
|
|
2981
|
+
}
|
|
2982
|
+
/**
|
|
2983
|
+
* URL citation annotation for referencing external web resources.
|
|
2984
|
+
*/
|
|
2985
|
+
interface OpenAIResponseAnnotationCitation {
|
|
2986
|
+
end_index: number;
|
|
2987
|
+
start_index: number;
|
|
2988
|
+
title: string;
|
|
2989
|
+
url: string;
|
|
2990
|
+
type?: 'url_citation';
|
|
2991
|
+
}
|
|
2992
|
+
/**
|
|
2993
|
+
* Container file citation annotation referencing a file within a container.
|
|
2994
|
+
*/
|
|
2995
|
+
interface OpenAIResponseAnnotationContainerFileCitation {
|
|
2996
|
+
container_id: string;
|
|
2997
|
+
end_index: number;
|
|
2998
|
+
file_id: string;
|
|
2999
|
+
filename: string;
|
|
3000
|
+
start_index: number;
|
|
3001
|
+
type?: 'container_file_citation';
|
|
3002
|
+
}
|
|
3003
|
+
/**
|
|
3004
|
+
* File path annotation referencing a generated file in response content.
|
|
3005
|
+
*/
|
|
3006
|
+
interface OpenAIResponseAnnotationFilePath {
|
|
3007
|
+
file_id: string;
|
|
3008
|
+
index: number;
|
|
3009
|
+
type?: 'file_path';
|
|
3010
|
+
}
|
|
3011
|
+
/**
|
|
3012
|
+
* The log probability for a token from an OpenAI-compatible chat completion
|
|
3013
|
+
* response.
|
|
3014
|
+
*/
|
|
3015
|
+
interface Logprob {
|
|
3016
|
+
/**
|
|
3017
|
+
* The token.
|
|
3018
|
+
*/
|
|
3019
|
+
token: string;
|
|
3020
|
+
/**
|
|
3021
|
+
* The log probability of the token.
|
|
3022
|
+
*/
|
|
3023
|
+
logprob: number;
|
|
3024
|
+
/**
|
|
3025
|
+
* The bytes for the token.
|
|
3026
|
+
*/
|
|
3027
|
+
bytes?: Array<number> | null;
|
|
3028
|
+
/**
|
|
3029
|
+
* The top log probabilities for the token.
|
|
3030
|
+
*/
|
|
3031
|
+
top_logprobs?: Array<Logprob.TopLogprob> | null;
|
|
3032
|
+
}
|
|
3033
|
+
namespace Logprob {
|
|
3034
|
+
/**
|
|
3035
|
+
* The top log probability for a token from an OpenAI-compatible chat completion
|
|
3036
|
+
* response.
|
|
3037
|
+
*/
|
|
3038
|
+
interface TopLogprob {
|
|
3039
|
+
/**
|
|
3040
|
+
* The token.
|
|
3041
|
+
*/
|
|
3042
|
+
token: string;
|
|
3043
|
+
/**
|
|
3044
|
+
* The log probability of the token.
|
|
3045
|
+
*/
|
|
3046
|
+
logprob: number;
|
|
3047
|
+
/**
|
|
3048
|
+
* The bytes for the token.
|
|
3049
|
+
*/
|
|
3050
|
+
bytes?: Array<number> | null;
|
|
3051
|
+
}
|
|
3052
|
+
}
|
|
3053
|
+
}
|
|
3054
|
+
/**
|
|
3055
|
+
* Refusal content within a streamed response part.
|
|
3056
|
+
*/
|
|
3057
|
+
interface OpenAIResponseContentPartRefusal {
|
|
3058
|
+
refusal: string;
|
|
3059
|
+
type?: 'refusal';
|
|
3060
|
+
}
|
|
3061
|
+
}
|
|
3062
|
+
/**
|
|
3063
|
+
* Web search tool call output message for OpenAI responses.
|
|
3064
|
+
*/
|
|
3065
|
+
interface OpenAIResponseOutputMessageWebSearchToolCall {
|
|
3066
|
+
id: string;
|
|
3067
|
+
status: string;
|
|
3068
|
+
type?: 'web_search_call';
|
|
3069
|
+
}
|
|
3070
|
+
/**
|
|
3071
|
+
* File search tool call output message for OpenAI responses.
|
|
3072
|
+
*/
|
|
3073
|
+
interface OpenAIResponseOutputMessageFileSearchToolCall {
|
|
3074
|
+
id: string;
|
|
3075
|
+
queries: Array<string>;
|
|
3076
|
+
status: string;
|
|
3077
|
+
results?: Array<OpenAIResponseOutputMessageFileSearchToolCall.Result> | null;
|
|
3078
|
+
type?: 'file_search_call';
|
|
3079
|
+
}
|
|
3080
|
+
namespace OpenAIResponseOutputMessageFileSearchToolCall {
|
|
3081
|
+
/**
|
|
3082
|
+
* Search results returned by the file search operation.
|
|
3083
|
+
*/
|
|
3084
|
+
interface Result {
|
|
3085
|
+
attributes: {
|
|
3086
|
+
[key: string]: unknown;
|
|
3087
|
+
};
|
|
3088
|
+
file_id: string;
|
|
3089
|
+
filename: string;
|
|
3090
|
+
score: number;
|
|
3091
|
+
text: string;
|
|
3092
|
+
}
|
|
3093
|
+
}
|
|
3094
|
+
/**
|
|
3095
|
+
* Function tool call output message for OpenAI responses.
|
|
3096
|
+
*/
|
|
3097
|
+
interface OpenAIResponseOutputMessageFunctionToolCall {
|
|
3098
|
+
arguments: string;
|
|
3099
|
+
call_id: string;
|
|
3100
|
+
name: string;
|
|
3101
|
+
id?: string | null;
|
|
3102
|
+
status?: string | null;
|
|
3103
|
+
type?: 'function_call';
|
|
3104
|
+
}
|
|
3105
|
+
/**
|
|
3106
|
+
* Model Context Protocol (MCP) call output message for OpenAI responses.
|
|
3107
|
+
*/
|
|
3108
|
+
interface OpenAIResponseOutputMessageMcpCall {
|
|
3109
|
+
id: string;
|
|
3110
|
+
arguments: string;
|
|
3111
|
+
name: string;
|
|
3112
|
+
server_label: string;
|
|
3113
|
+
error?: string | null;
|
|
3114
|
+
output?: string | null;
|
|
3115
|
+
type?: 'mcp_call';
|
|
3116
|
+
}
|
|
3117
|
+
/**
|
|
3118
|
+
* MCP list tools output message containing available tools from an MCP server.
|
|
3119
|
+
*/
|
|
3120
|
+
interface OpenAIResponseOutputMessageMcpListTools {
|
|
3121
|
+
id: string;
|
|
3122
|
+
server_label: string;
|
|
3123
|
+
tools: Array<OpenAIResponseOutputMessageMcpListTools.Tool>;
|
|
3124
|
+
type?: 'mcp_list_tools';
|
|
3125
|
+
}
|
|
3126
|
+
namespace OpenAIResponseOutputMessageMcpListTools {
|
|
3127
|
+
/**
|
|
3128
|
+
* Tool definition returned by MCP list tools operation.
|
|
3129
|
+
*/
|
|
3130
|
+
interface Tool {
|
|
3131
|
+
input_schema: {
|
|
3132
|
+
[key: string]: unknown;
|
|
3133
|
+
};
|
|
3134
|
+
name: string;
|
|
3135
|
+
description?: string | null;
|
|
3136
|
+
}
|
|
3137
|
+
}
|
|
3138
|
+
/**
|
|
3139
|
+
* A request for human approval of a tool invocation.
|
|
3140
|
+
*/
|
|
3141
|
+
interface OpenAIResponseMcpApprovalRequest {
|
|
3142
|
+
id: string;
|
|
3143
|
+
arguments: string;
|
|
3144
|
+
name: string;
|
|
3145
|
+
server_label: string;
|
|
3146
|
+
type?: 'mcp_approval_request';
|
|
3147
|
+
}
|
|
3148
|
+
/**
|
|
3149
|
+
* Reasoning output from the model, representing the model's thinking process.
|
|
3150
|
+
*/
|
|
3151
|
+
interface OpenAIResponseOutputMessageReasoningItem {
|
|
3152
|
+
/**
|
|
3153
|
+
* Unique identifier for the reasoning output item.
|
|
3154
|
+
*/
|
|
3155
|
+
id: string;
|
|
3156
|
+
/**
|
|
3157
|
+
* Summary of the reasoning output.
|
|
3158
|
+
*/
|
|
3159
|
+
summary: Array<OpenAIResponseOutputMessageReasoningItem.Summary>;
|
|
3160
|
+
/**
|
|
3161
|
+
* The reasoning content from the model.
|
|
3162
|
+
*/
|
|
3163
|
+
content?: Array<OpenAIResponseOutputMessageReasoningItem.Content> | null;
|
|
3164
|
+
/**
|
|
3165
|
+
* The status of the reasoning output.
|
|
3166
|
+
*/
|
|
3167
|
+
status?: 'in_progress' | 'completed' | 'incomplete' | null;
|
|
3168
|
+
/**
|
|
3169
|
+
* The type identifier, always 'reasoning'.
|
|
3170
|
+
*/
|
|
3171
|
+
type?: 'reasoning';
|
|
3172
|
+
}
|
|
3173
|
+
namespace OpenAIResponseOutputMessageReasoningItem {
|
|
3174
|
+
/**
|
|
3175
|
+
* A summary of reasoning output from the model.
|
|
3176
|
+
*/
|
|
3177
|
+
interface Summary {
|
|
3178
|
+
/**
|
|
3179
|
+
* The summary text of the reasoning output.
|
|
3180
|
+
*/
|
|
3181
|
+
text: string;
|
|
3182
|
+
/**
|
|
3183
|
+
* The type identifier, always 'summary_text'.
|
|
3184
|
+
*/
|
|
3185
|
+
type?: 'summary_text';
|
|
3186
|
+
}
|
|
3187
|
+
/**
|
|
3188
|
+
* Reasoning text from the model.
|
|
3189
|
+
*/
|
|
3190
|
+
interface Content {
|
|
3191
|
+
/**
|
|
3192
|
+
* The reasoning text content from the model.
|
|
3193
|
+
*/
|
|
3194
|
+
text: string;
|
|
3195
|
+
/**
|
|
3196
|
+
* The type identifier, always 'reasoning_text'.
|
|
3197
|
+
*/
|
|
3198
|
+
type?: 'reasoning_text';
|
|
3199
|
+
}
|
|
3200
|
+
}
|
|
3201
|
+
/**
|
|
3202
|
+
* Error details for failed OpenAI response requests.
|
|
3203
|
+
*/
|
|
3204
|
+
interface Error {
|
|
3205
|
+
code: string;
|
|
3206
|
+
message: string;
|
|
3207
|
+
}
|
|
3208
|
+
/**
|
|
3209
|
+
* Details explaining why a response was incomplete.
|
|
3210
|
+
*/
|
|
3211
|
+
interface IncompleteDetails {
|
|
3212
|
+
reason: string;
|
|
3213
|
+
}
|
|
3214
|
+
/**
|
|
3215
|
+
* OpenAI compatible Prompt object that is used in OpenAI responses.
|
|
3216
|
+
*/
|
|
3217
|
+
interface Prompt {
|
|
3218
|
+
id: string;
|
|
3219
|
+
variables?: {
|
|
3220
|
+
[key: string]: Prompt.OpenAIResponseInputMessageContentText | Prompt.OpenAIResponseInputMessageContentImage | Prompt.OpenAIResponseInputMessageContentFile;
|
|
3221
|
+
} | null;
|
|
3222
|
+
version?: string | null;
|
|
3223
|
+
}
|
|
3224
|
+
namespace Prompt {
|
|
3225
|
+
/**
|
|
3226
|
+
* Text content for input messages in OpenAI response format.
|
|
3227
|
+
*/
|
|
3228
|
+
interface OpenAIResponseInputMessageContentText {
|
|
3229
|
+
text: string;
|
|
3230
|
+
type?: 'input_text';
|
|
3231
|
+
}
|
|
3232
|
+
/**
|
|
3233
|
+
* Image content for input messages in OpenAI response format.
|
|
3234
|
+
*/
|
|
3235
|
+
interface OpenAIResponseInputMessageContentImage {
|
|
3236
|
+
detail?: 'low' | 'high' | 'auto';
|
|
3237
|
+
file_id?: string | null;
|
|
3238
|
+
image_url?: string | null;
|
|
3239
|
+
type?: 'input_image';
|
|
3240
|
+
}
|
|
3241
|
+
/**
|
|
3242
|
+
* File content for input messages in OpenAI response format.
|
|
3243
|
+
*/
|
|
3244
|
+
interface OpenAIResponseInputMessageContentFile {
|
|
3245
|
+
file_data?: string | null;
|
|
3246
|
+
file_id?: string | null;
|
|
3247
|
+
file_url?: string | null;
|
|
3248
|
+
filename?: string | null;
|
|
3249
|
+
type?: 'input_file';
|
|
3250
|
+
}
|
|
3251
|
+
}
|
|
3252
|
+
/**
|
|
3253
|
+
* Configuration for reasoning effort in OpenAI responses.
|
|
3254
|
+
*
|
|
3255
|
+
* Controls how much reasoning the model performs before generating a response.
|
|
3256
|
+
*/
|
|
3257
|
+
interface Reasoning {
|
|
3258
|
+
effort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | null;
|
|
3259
|
+
/**
|
|
3260
|
+
* Summary mode for reasoning output. One of 'auto', 'concise', or 'detailed'.
|
|
3261
|
+
*/
|
|
3262
|
+
summary?: 'auto' | 'concise' | 'detailed' | null;
|
|
3263
|
+
}
|
|
3264
|
+
/**
|
|
3265
|
+
* Text response configuration for OpenAI responses.
|
|
3266
|
+
*/
|
|
3267
|
+
interface Text {
|
|
3268
|
+
/**
|
|
3269
|
+
* Configuration for Responses API text format.
|
|
3270
|
+
*/
|
|
3271
|
+
format?: Text.Format | null;
|
|
3272
|
+
verbosity?: 'low' | 'medium' | 'high' | null;
|
|
3273
|
+
}
|
|
3274
|
+
namespace Text {
|
|
3275
|
+
/**
|
|
3276
|
+
* Configuration for Responses API text format.
|
|
3277
|
+
*/
|
|
3278
|
+
interface Format {
|
|
3279
|
+
description?: string | null;
|
|
3280
|
+
name?: string | null;
|
|
3281
|
+
schema?: {
|
|
3282
|
+
[key: string]: unknown;
|
|
3283
|
+
} | null;
|
|
3284
|
+
strict?: boolean | null;
|
|
3285
|
+
type?: 'text' | 'json_schema' | 'json_object';
|
|
3286
|
+
}
|
|
3287
|
+
}
|
|
3288
|
+
/**
|
|
3289
|
+
* Constrains the tools available to the model to a pre-defined set.
|
|
3290
|
+
*/
|
|
3291
|
+
interface OpenAIResponseInputToolChoiceAllowedTools {
|
|
3292
|
+
tools: Array<{
|
|
3293
|
+
[key: string]: string;
|
|
3294
|
+
}>;
|
|
3295
|
+
mode?: 'auto' | 'required';
|
|
3296
|
+
type?: 'allowed_tools';
|
|
3297
|
+
}
|
|
3298
|
+
/**
|
|
3299
|
+
* Indicates that the model should use file search to generate a response.
|
|
3300
|
+
*/
|
|
3301
|
+
interface OpenAIResponseInputToolChoiceFileSearch {
|
|
3302
|
+
type?: 'file_search';
|
|
3303
|
+
}
|
|
3304
|
+
/**
|
|
3305
|
+
* Indicates that the model should use web search to generate a response
|
|
3306
|
+
*/
|
|
3307
|
+
interface OpenAIResponseInputToolChoiceWebSearch {
|
|
3308
|
+
type?: 'web_search' | 'web_search_preview' | 'web_search_preview_2025_03_11' | 'web_search_2025_08_26';
|
|
3309
|
+
}
|
|
3310
|
+
/**
|
|
3311
|
+
* Forces the model to call a specific function.
|
|
3312
|
+
*/
|
|
3313
|
+
interface OpenAIResponseInputToolChoiceFunctionTool {
|
|
3314
|
+
name: string;
|
|
3315
|
+
type?: 'function';
|
|
3316
|
+
}
|
|
3317
|
+
/**
|
|
3318
|
+
* Forces the model to call a specific tool on a remote MCP server
|
|
3319
|
+
*/
|
|
3320
|
+
interface OpenAIResponseInputToolChoiceMcpTool {
|
|
3321
|
+
server_label: string;
|
|
3322
|
+
name?: string | null;
|
|
3323
|
+
type?: 'mcp';
|
|
3324
|
+
}
|
|
3325
|
+
/**
|
|
3326
|
+
* Forces the model to call a custom tool.
|
|
3327
|
+
*/
|
|
3328
|
+
interface OpenAIResponseInputToolChoiceCustomTool {
|
|
3329
|
+
name: string;
|
|
3330
|
+
type?: 'custom';
|
|
3331
|
+
}
|
|
3332
|
+
/**
|
|
3333
|
+
* Web search tool configuration for OpenAI response inputs.
|
|
3334
|
+
*/
|
|
3335
|
+
interface OpenAIResponseInputToolWebSearch {
|
|
3336
|
+
search_context_size?: string | null;
|
|
3337
|
+
type?: 'web_search' | 'web_search_preview' | 'web_search_preview_2025_03_11' | 'web_search_2025_08_26';
|
|
3338
|
+
}
|
|
3339
|
+
/**
|
|
3340
|
+
* File search tool configuration for OpenAI response inputs.
|
|
3341
|
+
*/
|
|
3342
|
+
interface OpenAIResponseInputToolFileSearch {
|
|
3343
|
+
vector_store_ids: Array<string>;
|
|
3344
|
+
filters?: {
|
|
3345
|
+
[key: string]: unknown;
|
|
3346
|
+
} | null;
|
|
3347
|
+
max_num_results?: number | null;
|
|
3348
|
+
/**
|
|
3349
|
+
* Options for ranking and filtering search results.
|
|
3350
|
+
*
|
|
3351
|
+
* This class configures how search results are ranked and filtered. You can use
|
|
3352
|
+
* algorithm-based rerankers (weighted, RRF) or neural rerankers. Defaults from
|
|
3353
|
+
* VectorStoresConfig are used when parameters are not provided.
|
|
3354
|
+
*
|
|
3355
|
+
* Examples: # Weighted ranker with custom alpha
|
|
3356
|
+
* SearchRankingOptions(ranker="weighted", alpha=0.7)
|
|
3357
|
+
*
|
|
3358
|
+
* # RRF ranker with custom impact factor
|
|
3359
|
+
* SearchRankingOptions(ranker="rrf", impact_factor=50.0)
|
|
3360
|
+
*
|
|
3361
|
+
* # Use config defaults (just specify ranker type)
|
|
3362
|
+
* SearchRankingOptions(ranker="weighted") # Uses alpha from VectorStoresConfig
|
|
3363
|
+
*
|
|
3364
|
+
* # Score threshold filtering
|
|
3365
|
+
* SearchRankingOptions(ranker="weighted", score_threshold=0.5)
|
|
3366
|
+
*/
|
|
3367
|
+
ranking_options?: OpenAIResponseInputToolFileSearch.RankingOptions | null;
|
|
3368
|
+
type?: 'file_search';
|
|
3369
|
+
}
|
|
3370
|
+
namespace OpenAIResponseInputToolFileSearch {
|
|
3371
|
+
/**
|
|
3372
|
+
* Options for ranking and filtering search results.
|
|
3373
|
+
*
|
|
3374
|
+
* This class configures how search results are ranked and filtered. You can use
|
|
3375
|
+
* algorithm-based rerankers (weighted, RRF) or neural rerankers. Defaults from
|
|
3376
|
+
* VectorStoresConfig are used when parameters are not provided.
|
|
3377
|
+
*
|
|
3378
|
+
* Examples: # Weighted ranker with custom alpha
|
|
3379
|
+
* SearchRankingOptions(ranker="weighted", alpha=0.7)
|
|
3380
|
+
*
|
|
3381
|
+
* # RRF ranker with custom impact factor
|
|
3382
|
+
* SearchRankingOptions(ranker="rrf", impact_factor=50.0)
|
|
3383
|
+
*
|
|
3384
|
+
* # Use config defaults (just specify ranker type)
|
|
3385
|
+
* SearchRankingOptions(ranker="weighted") # Uses alpha from VectorStoresConfig
|
|
3386
|
+
*
|
|
3387
|
+
* # Score threshold filtering
|
|
3388
|
+
* SearchRankingOptions(ranker="weighted", score_threshold=0.5)
|
|
3389
|
+
*/
|
|
3390
|
+
interface RankingOptions {
|
|
3391
|
+
/**
|
|
3392
|
+
* Weight factor for weighted ranker
|
|
3393
|
+
*/
|
|
3394
|
+
alpha?: number | null;
|
|
3395
|
+
/**
|
|
3396
|
+
* Impact factor for RRF algorithm
|
|
3397
|
+
*/
|
|
3398
|
+
impact_factor?: number | null;
|
|
3399
|
+
/**
|
|
3400
|
+
* Model identifier for neural reranker
|
|
3401
|
+
*/
|
|
3402
|
+
model?: string | null;
|
|
3403
|
+
ranker?: string | null;
|
|
3404
|
+
score_threshold?: number | null;
|
|
3405
|
+
/**
|
|
3406
|
+
* Weights for combining vector, keyword, and neural scores. Keys: 'vector',
|
|
3407
|
+
* 'keyword', 'neural'
|
|
3408
|
+
*/
|
|
3409
|
+
weights?: {
|
|
3410
|
+
[key: string]: number;
|
|
3411
|
+
} | null;
|
|
3412
|
+
}
|
|
3413
|
+
}
|
|
3414
|
+
/**
|
|
3415
|
+
* Function tool configuration for OpenAI response inputs.
|
|
3416
|
+
*/
|
|
3417
|
+
interface OpenAIResponseInputToolFunction {
|
|
3418
|
+
name: string;
|
|
3419
|
+
parameters: {
|
|
3420
|
+
[key: string]: unknown;
|
|
3421
|
+
} | null;
|
|
3422
|
+
description?: string | null;
|
|
3423
|
+
strict?: boolean | null;
|
|
3424
|
+
type?: 'function';
|
|
3425
|
+
}
|
|
3426
|
+
/**
|
|
3427
|
+
* Model Context Protocol (MCP) tool configuration for OpenAI response object.
|
|
3428
|
+
*/
|
|
3429
|
+
interface OpenAIResponseToolMcp {
|
|
3430
|
+
server_label: string;
|
|
3431
|
+
/**
|
|
3432
|
+
* Filter configuration for restricting which MCP tools can be used.
|
|
3433
|
+
*/
|
|
3434
|
+
allowed_tools?: Array<string> | OpenAIResponseToolMcp.AllowedToolsFilter | null;
|
|
3435
|
+
type?: 'mcp';
|
|
3436
|
+
}
|
|
3437
|
+
namespace OpenAIResponseToolMcp {
|
|
3438
|
+
/**
|
|
3439
|
+
* Filter configuration for restricting which MCP tools can be used.
|
|
3440
|
+
*/
|
|
3441
|
+
interface AllowedToolsFilter {
|
|
3442
|
+
tool_names?: Array<string> | null;
|
|
3443
|
+
}
|
|
3444
|
+
}
|
|
3445
|
+
/**
|
|
3446
|
+
* Usage information for OpenAI response.
|
|
3447
|
+
*/
|
|
3448
|
+
interface Usage {
|
|
3449
|
+
input_tokens: number;
|
|
3450
|
+
/**
|
|
3451
|
+
* Token details for input tokens in OpenAI response usage.
|
|
3452
|
+
*/
|
|
3453
|
+
input_tokens_details: Usage.InputTokensDetails;
|
|
3454
|
+
output_tokens: number;
|
|
3455
|
+
/**
|
|
3456
|
+
* Token details for output tokens in OpenAI response usage.
|
|
3457
|
+
*/
|
|
3458
|
+
output_tokens_details: Usage.OutputTokensDetails;
|
|
3459
|
+
total_tokens: number;
|
|
3460
|
+
}
|
|
3461
|
+
namespace Usage {
|
|
3462
|
+
/**
|
|
3463
|
+
* Token details for input tokens in OpenAI response usage.
|
|
3464
|
+
*/
|
|
3465
|
+
interface InputTokensDetails {
|
|
3466
|
+
cached_tokens: number;
|
|
3467
|
+
}
|
|
3468
|
+
/**
|
|
3469
|
+
* Token details for output tokens in OpenAI response usage.
|
|
3470
|
+
*/
|
|
3471
|
+
interface OutputTokensDetails {
|
|
3472
|
+
reasoning_tokens: number;
|
|
3473
|
+
}
|
|
3474
|
+
}
|
|
3475
|
+
}
|
|
3476
|
+
/**
|
|
3477
|
+
* Response object confirming deletion of an OpenAI response.
|
|
3478
|
+
*/
|
|
3479
|
+
export interface ResponseDeleteResponse {
|
|
3480
|
+
id: string;
|
|
3481
|
+
deleted?: boolean;
|
|
3482
|
+
object?: 'response';
|
|
3483
|
+
}
|
|
3484
|
+
export type ResponseCreateParams = ResponseCreateParamsNonStreaming | ResponseCreateParamsStreaming;
|
|
3485
|
+
export interface ResponseCreateParamsBase {
|
|
3486
|
+
/**
|
|
3487
|
+
* Input message(s) to create the response.
|
|
3488
|
+
*/
|
|
3489
|
+
input: string | Array<ResponseCreateParams.OpenAIResponseMessageInput | ResponseCreateParams.OpenAIResponseOutputMessageWebSearchToolCall | ResponseCreateParams.OpenAIResponseOutputMessageFileSearchToolCall | ResponseCreateParams.OpenAIResponseOutputMessageFunctionToolCall | ResponseCreateParams.OpenAIResponseOutputMessageMcpCall | ResponseCreateParams.OpenAIResponseOutputMessageMcpListTools | ResponseCreateParams.OpenAIResponseMcpApprovalRequest | ResponseCreateParams.OpenAIResponseOutputMessageReasoningItem | ResponseCreateParams.OpenAIResponseInputFunctionToolCallOutput | ResponseCreateParams.OpenAIResponseMcpApprovalResponse | ResponseCreateParams.OpenAIResponseCompaction>;
|
|
3490
|
+
/**
|
|
3491
|
+
* The underlying LLM used for completions.
|
|
3492
|
+
*/
|
|
3493
|
+
model: string;
|
|
3494
|
+
/**
|
|
3495
|
+
* Whether to run the model response in the background. When true, returns
|
|
3496
|
+
* immediately with status 'queued'.
|
|
3497
|
+
*/
|
|
3498
|
+
background?: boolean;
|
|
3499
|
+
/**
|
|
3500
|
+
* Context management configuration. When set with type 'compaction', automatically
|
|
3501
|
+
* compacts conversation history when token count exceeds the compact_threshold.
|
|
3502
|
+
*/
|
|
3503
|
+
context_management?: Array<ResponseCreateParams.ContextManagement> | null;
|
|
3504
|
+
/**
|
|
3505
|
+
* Optional ID of a conversation to add the response to.
|
|
3506
|
+
*/
|
|
3507
|
+
conversation?: string | null;
|
|
3508
|
+
/**
|
|
3509
|
+
* Penalizes new tokens based on their frequency in the text so far.
|
|
3510
|
+
*/
|
|
3511
|
+
frequency_penalty?: number | null;
|
|
3512
|
+
/**
|
|
3513
|
+
* List of guardrails to apply during response generation.
|
|
3514
|
+
*/
|
|
3515
|
+
guardrails?: Array<string | ResponseCreateParams.ResponseGuardrailSpec> | null;
|
|
3516
|
+
/**
|
|
3517
|
+
* Additional fields to include in the response.
|
|
3518
|
+
*/
|
|
3519
|
+
include?: Array<'web_search_call.action.sources' | 'code_interpreter_call.outputs' | 'computer_call_output.output.image_url' | 'file_search_call.results' | 'message.input_image.image_url' | 'message.output_text.logprobs' | 'reasoning.encrypted_content'>;
|
|
3520
|
+
/**
|
|
3521
|
+
* Instructions to guide the model's behavior.
|
|
3522
|
+
*/
|
|
3523
|
+
instructions?: string | null;
|
|
3524
|
+
/**
|
|
3525
|
+
* Maximum number of inference iterations.
|
|
3526
|
+
*/
|
|
3527
|
+
max_infer_iters?: number | null;
|
|
3528
|
+
/**
|
|
3529
|
+
* Upper bound for the number of tokens that can be generated for a response.
|
|
3530
|
+
*/
|
|
3531
|
+
max_output_tokens?: number | null;
|
|
3532
|
+
/**
|
|
3533
|
+
* Max number of total calls to built-in tools that can be processed in a response.
|
|
3534
|
+
*/
|
|
3535
|
+
max_tool_calls?: number | null;
|
|
3536
|
+
/**
|
|
3537
|
+
* Dictionary of metadata key-value pairs to attach to the response.
|
|
3538
|
+
*/
|
|
3539
|
+
metadata?: {
|
|
3540
|
+
[key: string]: string;
|
|
3541
|
+
} | null;
|
|
3542
|
+
/**
|
|
3543
|
+
* Whether to enable parallel tool calls.
|
|
3544
|
+
*/
|
|
3545
|
+
parallel_tool_calls?: boolean | null;
|
|
3546
|
+
/**
|
|
3547
|
+
* Penalizes new tokens based on whether they appear in the text so far.
|
|
3548
|
+
*/
|
|
3549
|
+
presence_penalty?: number | null;
|
|
3550
|
+
/**
|
|
3551
|
+
* Optional ID of a previous response to continue from.
|
|
3552
|
+
*/
|
|
3553
|
+
previous_response_id?: string | null;
|
|
3554
|
+
/**
|
|
3555
|
+
* OpenAI compatible Prompt object that is used in OpenAI responses.
|
|
3556
|
+
*/
|
|
3557
|
+
prompt?: ResponseCreateParams.Prompt | null;
|
|
3558
|
+
/**
|
|
3559
|
+
* A key to use when reading from or writing to the prompt cache.
|
|
3560
|
+
*/
|
|
3561
|
+
prompt_cache_key?: string | null;
|
|
3562
|
+
/**
|
|
3563
|
+
* Configuration for reasoning effort in OpenAI responses.
|
|
3564
|
+
*
|
|
3565
|
+
* Controls how much reasoning the model performs before generating a response.
|
|
3566
|
+
*/
|
|
3567
|
+
reasoning?: ResponseCreateParams.Reasoning | null;
|
|
3568
|
+
/**
|
|
3569
|
+
* A stable identifier used for safety monitoring and abuse detection.
|
|
3570
|
+
*/
|
|
3571
|
+
safety_identifier?: string | null;
|
|
3572
|
+
/**
|
|
3573
|
+
* The service tier for the request.
|
|
3574
|
+
*/
|
|
3575
|
+
service_tier?: 'auto' | 'default' | 'flex' | 'priority' | null;
|
|
3576
|
+
/**
|
|
3577
|
+
* Whether to store the response in the database.
|
|
3578
|
+
*/
|
|
3579
|
+
store?: boolean;
|
|
3580
|
+
/**
|
|
3581
|
+
* Whether to stream the response.
|
|
3582
|
+
*/
|
|
3583
|
+
stream?: boolean;
|
|
3584
|
+
/**
|
|
3585
|
+
* Options that control streamed response behavior.
|
|
3586
|
+
*/
|
|
3587
|
+
stream_options?: ResponseCreateParams.StreamOptions | null;
|
|
3588
|
+
/**
|
|
3589
|
+
* Sampling temperature.
|
|
3590
|
+
*/
|
|
3591
|
+
temperature?: number | null;
|
|
3592
|
+
/**
|
|
3593
|
+
* Text response configuration for OpenAI responses.
|
|
3594
|
+
*/
|
|
3595
|
+
text?: ResponseCreateParams.Text | null;
|
|
3596
|
+
/**
|
|
3597
|
+
* How the model should select which tool to call (if any).
|
|
3598
|
+
*/
|
|
3599
|
+
tool_choice?: 'auto' | 'required' | 'none' | ResponseCreateParams.OpenAIResponseInputToolChoiceAllowedTools | ResponseCreateParams.OpenAIResponseInputToolChoiceFileSearch | ResponseCreateParams.OpenAIResponseInputToolChoiceWebSearch | ResponseCreateParams.OpenAIResponseInputToolChoiceFunctionTool | ResponseCreateParams.OpenAIResponseInputToolChoiceMcpTool | ResponseCreateParams.OpenAIResponseInputToolChoiceCustomTool | null;
|
|
3600
|
+
/**
|
|
3601
|
+
* List of tools available to the model.
|
|
3602
|
+
*/
|
|
3603
|
+
tools?: Array<ResponseCreateParams.OpenAIResponseInputToolWebSearch | ResponseCreateParams.OpenAIResponseInputToolFileSearch | ResponseCreateParams.OpenAIResponseInputToolFunction | ResponseCreateParams.OpenAIResponseInputToolMcp> | null;
|
|
3604
|
+
/**
|
|
3605
|
+
* The number of most likely tokens to return at each position, along with their
|
|
3606
|
+
* log probabilities.
|
|
3607
|
+
*/
|
|
3608
|
+
top_logprobs?: number | null;
|
|
3609
|
+
/**
|
|
3610
|
+
* Nucleus sampling parameter that controls response diversity (lower values
|
|
3611
|
+
* increase focus).
|
|
3612
|
+
*/
|
|
3613
|
+
top_p?: number | null;
|
|
3614
|
+
/**
|
|
3615
|
+
* Controls how the service truncates input when it exceeds the model context
|
|
3616
|
+
* window.
|
|
3617
|
+
*/
|
|
3618
|
+
truncation?: 'auto' | 'disabled' | null;
|
|
3619
|
+
[k: string]: unknown;
|
|
3620
|
+
}
|
|
3621
|
+
export declare namespace ResponseCreateParams {
|
|
3622
|
+
/**
|
|
3623
|
+
* Corresponds to the various Message types in the Responses API. They are all
|
|
3624
|
+
* under one type because the Responses API gives them all the same "type" value,
|
|
3625
|
+
* and there is no way to tell them apart in certain scenarios.
|
|
3626
|
+
*/
|
|
3627
|
+
interface OpenAIResponseMessageInput {
|
|
3628
|
+
content: string | Array<OpenAIResponseMessageInput.OpenAIResponseInputMessageContentText | OpenAIResponseMessageInput.OpenAIResponseInputMessageContentImage | OpenAIResponseMessageInput.OpenAIResponseInputMessageContentFile> | Array<OpenAIResponseMessageInput.OpenAIResponseOutputMessageContentOutputTextInput | OpenAIResponseMessageInput.OpenAIResponseContentPartRefusal>;
|
|
3629
|
+
role: 'system' | 'developer' | 'user' | 'assistant';
|
|
3630
|
+
id?: string | null;
|
|
3631
|
+
status?: string | null;
|
|
3632
|
+
type?: 'message';
|
|
3633
|
+
}
|
|
3634
|
+
namespace OpenAIResponseMessageInput {
|
|
3635
|
+
/**
|
|
3636
|
+
* Text content for input messages in OpenAI response format.
|
|
3637
|
+
*/
|
|
3638
|
+
interface OpenAIResponseInputMessageContentText {
|
|
3639
|
+
text: string;
|
|
3640
|
+
type?: 'input_text';
|
|
3641
|
+
}
|
|
3642
|
+
/**
|
|
3643
|
+
* Image content for input messages in OpenAI response format.
|
|
3644
|
+
*/
|
|
3645
|
+
interface OpenAIResponseInputMessageContentImage {
|
|
3646
|
+
detail?: 'low' | 'high' | 'auto';
|
|
3647
|
+
file_id?: string | null;
|
|
3648
|
+
image_url?: string | null;
|
|
3649
|
+
type?: 'input_image';
|
|
3650
|
+
}
|
|
3651
|
+
/**
|
|
3652
|
+
* File content for input messages in OpenAI response format.
|
|
3653
|
+
*/
|
|
3654
|
+
interface OpenAIResponseInputMessageContentFile {
|
|
3655
|
+
file_data?: string | null;
|
|
3656
|
+
file_id?: string | null;
|
|
3657
|
+
file_url?: string | null;
|
|
3658
|
+
filename?: string | null;
|
|
3659
|
+
type?: 'input_file';
|
|
3660
|
+
}
|
|
3661
|
+
/**
|
|
3662
|
+
* Text content within an output message of an OpenAI response.
|
|
3663
|
+
*/
|
|
3664
|
+
interface OpenAIResponseOutputMessageContentOutputTextInput {
|
|
3665
|
+
text: string;
|
|
3666
|
+
annotations?: Array<OpenAIResponseOutputMessageContentOutputTextInput.OpenAIResponseAnnotationFileCitation | OpenAIResponseOutputMessageContentOutputTextInput.OpenAIResponseAnnotationCitation | OpenAIResponseOutputMessageContentOutputTextInput.OpenAIResponseAnnotationContainerFileCitation | OpenAIResponseOutputMessageContentOutputTextInput.OpenAIResponseAnnotationFilePath>;
|
|
3667
|
+
logprobs?: Array<OpenAIResponseOutputMessageContentOutputTextInput.Logprob> | null;
|
|
3668
|
+
type?: 'output_text';
|
|
3669
|
+
}
|
|
3670
|
+
namespace OpenAIResponseOutputMessageContentOutputTextInput {
|
|
3671
|
+
/**
|
|
3672
|
+
* File citation annotation for referencing specific files in response content.
|
|
3673
|
+
*/
|
|
3674
|
+
interface OpenAIResponseAnnotationFileCitation {
|
|
3675
|
+
file_id: string;
|
|
3676
|
+
filename: string;
|
|
3677
|
+
index: number;
|
|
3678
|
+
type?: 'file_citation';
|
|
3679
|
+
}
|
|
3680
|
+
/**
|
|
3681
|
+
* URL citation annotation for referencing external web resources.
|
|
3682
|
+
*/
|
|
3683
|
+
interface OpenAIResponseAnnotationCitation {
|
|
3684
|
+
end_index: number;
|
|
3685
|
+
start_index: number;
|
|
3686
|
+
title: string;
|
|
3687
|
+
url: string;
|
|
3688
|
+
type?: 'url_citation';
|
|
3689
|
+
}
|
|
3690
|
+
/**
|
|
3691
|
+
* Container file citation annotation referencing a file within a container.
|
|
3692
|
+
*/
|
|
3693
|
+
interface OpenAIResponseAnnotationContainerFileCitation {
|
|
3694
|
+
container_id: string;
|
|
3695
|
+
end_index: number;
|
|
3696
|
+
file_id: string;
|
|
3697
|
+
filename: string;
|
|
3698
|
+
start_index: number;
|
|
3699
|
+
type?: 'container_file_citation';
|
|
3700
|
+
}
|
|
3701
|
+
/**
|
|
3702
|
+
* File path annotation referencing a generated file in response content.
|
|
3703
|
+
*/
|
|
3704
|
+
interface OpenAIResponseAnnotationFilePath {
|
|
3705
|
+
file_id: string;
|
|
3706
|
+
index: number;
|
|
3707
|
+
type?: 'file_path';
|
|
3708
|
+
}
|
|
3709
|
+
/**
|
|
3710
|
+
* The log probability for a token from an OpenAI-compatible chat completion
|
|
3711
|
+
* response.
|
|
3712
|
+
*/
|
|
3713
|
+
interface Logprob {
|
|
3714
|
+
/**
|
|
3715
|
+
* The token.
|
|
3716
|
+
*/
|
|
3717
|
+
token: string;
|
|
3718
|
+
/**
|
|
3719
|
+
* The log probability of the token.
|
|
3720
|
+
*/
|
|
3721
|
+
logprob: number;
|
|
3722
|
+
/**
|
|
3723
|
+
* The bytes for the token.
|
|
3724
|
+
*/
|
|
3725
|
+
bytes?: Array<number> | null;
|
|
3726
|
+
/**
|
|
3727
|
+
* The top log probabilities for the token.
|
|
3728
|
+
*/
|
|
3729
|
+
top_logprobs?: Array<Logprob.TopLogprob> | null;
|
|
3730
|
+
}
|
|
3731
|
+
namespace Logprob {
|
|
3732
|
+
/**
|
|
3733
|
+
* The top log probability for a token from an OpenAI-compatible chat completion
|
|
3734
|
+
* response.
|
|
3735
|
+
*/
|
|
3736
|
+
interface TopLogprob {
|
|
3737
|
+
/**
|
|
3738
|
+
* The token.
|
|
3739
|
+
*/
|
|
3740
|
+
token: string;
|
|
3741
|
+
/**
|
|
3742
|
+
* The log probability of the token.
|
|
3743
|
+
*/
|
|
3744
|
+
logprob: number;
|
|
3745
|
+
/**
|
|
3746
|
+
* The bytes for the token.
|
|
3747
|
+
*/
|
|
3748
|
+
bytes?: Array<number> | null;
|
|
3749
|
+
}
|
|
3750
|
+
}
|
|
3751
|
+
}
|
|
3752
|
+
/**
|
|
3753
|
+
* Refusal content within a streamed response part.
|
|
3754
|
+
*/
|
|
3755
|
+
interface OpenAIResponseContentPartRefusal {
|
|
3756
|
+
refusal: string;
|
|
3757
|
+
type?: 'refusal';
|
|
3758
|
+
}
|
|
3759
|
+
}
|
|
3760
|
+
/**
|
|
3761
|
+
* Web search tool call output message for OpenAI responses.
|
|
3762
|
+
*/
|
|
3763
|
+
interface OpenAIResponseOutputMessageWebSearchToolCall {
|
|
3764
|
+
id: string;
|
|
3765
|
+
status: string;
|
|
3766
|
+
type?: 'web_search_call';
|
|
3767
|
+
}
|
|
3768
|
+
/**
|
|
3769
|
+
* File search tool call output message for OpenAI responses.
|
|
3770
|
+
*/
|
|
3771
|
+
interface OpenAIResponseOutputMessageFileSearchToolCall {
|
|
3772
|
+
id: string;
|
|
3773
|
+
queries: Array<string>;
|
|
3774
|
+
status: string;
|
|
3775
|
+
results?: Array<OpenAIResponseOutputMessageFileSearchToolCall.Result> | null;
|
|
3776
|
+
type?: 'file_search_call';
|
|
3777
|
+
}
|
|
3778
|
+
namespace OpenAIResponseOutputMessageFileSearchToolCall {
|
|
3779
|
+
/**
|
|
3780
|
+
* Search results returned by the file search operation.
|
|
3781
|
+
*/
|
|
3782
|
+
interface Result {
|
|
3783
|
+
attributes: {
|
|
3784
|
+
[key: string]: unknown;
|
|
3785
|
+
};
|
|
3786
|
+
file_id: string;
|
|
3787
|
+
filename: string;
|
|
3788
|
+
score: number;
|
|
3789
|
+
text: string;
|
|
3790
|
+
}
|
|
3791
|
+
}
|
|
3792
|
+
/**
|
|
3793
|
+
* Function tool call output message for OpenAI responses.
|
|
3794
|
+
*/
|
|
3795
|
+
interface OpenAIResponseOutputMessageFunctionToolCall {
|
|
3796
|
+
arguments: string;
|
|
3797
|
+
call_id: string;
|
|
3798
|
+
name: string;
|
|
3799
|
+
id?: string | null;
|
|
3800
|
+
status?: string | null;
|
|
3801
|
+
type?: 'function_call';
|
|
3802
|
+
}
|
|
3803
|
+
/**
|
|
3804
|
+
* Model Context Protocol (MCP) call output message for OpenAI responses.
|
|
3805
|
+
*/
|
|
3806
|
+
interface OpenAIResponseOutputMessageMcpCall {
|
|
3807
|
+
id: string;
|
|
3808
|
+
arguments: string;
|
|
3809
|
+
name: string;
|
|
3810
|
+
server_label: string;
|
|
3811
|
+
error?: string | null;
|
|
3812
|
+
output?: string | null;
|
|
3813
|
+
type?: 'mcp_call';
|
|
3814
|
+
}
|
|
3815
|
+
/**
|
|
3816
|
+
* MCP list tools output message containing available tools from an MCP server.
|
|
3817
|
+
*/
|
|
3818
|
+
interface OpenAIResponseOutputMessageMcpListTools {
|
|
3819
|
+
id: string;
|
|
3820
|
+
server_label: string;
|
|
3821
|
+
tools: Array<OpenAIResponseOutputMessageMcpListTools.Tool>;
|
|
3822
|
+
type?: 'mcp_list_tools';
|
|
3823
|
+
}
|
|
3824
|
+
namespace OpenAIResponseOutputMessageMcpListTools {
|
|
3825
|
+
/**
|
|
3826
|
+
* Tool definition returned by MCP list tools operation.
|
|
3827
|
+
*/
|
|
3828
|
+
interface Tool {
|
|
3829
|
+
input_schema: {
|
|
3830
|
+
[key: string]: unknown;
|
|
3831
|
+
};
|
|
3832
|
+
name: string;
|
|
3833
|
+
description?: string | null;
|
|
3834
|
+
}
|
|
3835
|
+
}
|
|
3836
|
+
/**
|
|
3837
|
+
* A request for human approval of a tool invocation.
|
|
3838
|
+
*/
|
|
3839
|
+
interface OpenAIResponseMcpApprovalRequest {
|
|
3840
|
+
id: string;
|
|
3841
|
+
arguments: string;
|
|
3842
|
+
name: string;
|
|
3843
|
+
server_label: string;
|
|
3844
|
+
type?: 'mcp_approval_request';
|
|
3845
|
+
}
|
|
3846
|
+
/**
|
|
3847
|
+
* Reasoning output from the model, representing the model's thinking process.
|
|
3848
|
+
*/
|
|
3849
|
+
interface OpenAIResponseOutputMessageReasoningItem {
|
|
3850
|
+
/**
|
|
3851
|
+
* Unique identifier for the reasoning output item.
|
|
3852
|
+
*/
|
|
3853
|
+
id: string;
|
|
3854
|
+
/**
|
|
3855
|
+
* Summary of the reasoning output.
|
|
3856
|
+
*/
|
|
3857
|
+
summary: Array<OpenAIResponseOutputMessageReasoningItem.Summary>;
|
|
3858
|
+
/**
|
|
3859
|
+
* The reasoning content from the model.
|
|
3860
|
+
*/
|
|
3861
|
+
content?: Array<OpenAIResponseOutputMessageReasoningItem.Content> | null;
|
|
3862
|
+
/**
|
|
3863
|
+
* The status of the reasoning output.
|
|
3864
|
+
*/
|
|
3865
|
+
status?: 'in_progress' | 'completed' | 'incomplete' | null;
|
|
3866
|
+
/**
|
|
3867
|
+
* The type identifier, always 'reasoning'.
|
|
3868
|
+
*/
|
|
3869
|
+
type?: 'reasoning';
|
|
3870
|
+
}
|
|
3871
|
+
namespace OpenAIResponseOutputMessageReasoningItem {
|
|
3872
|
+
/**
|
|
3873
|
+
* A summary of reasoning output from the model.
|
|
3874
|
+
*/
|
|
3875
|
+
interface Summary {
|
|
3876
|
+
/**
|
|
3877
|
+
* The summary text of the reasoning output.
|
|
3878
|
+
*/
|
|
3879
|
+
text: string;
|
|
3880
|
+
/**
|
|
3881
|
+
* The type identifier, always 'summary_text'.
|
|
3882
|
+
*/
|
|
3883
|
+
type?: 'summary_text';
|
|
3884
|
+
}
|
|
3885
|
+
/**
|
|
3886
|
+
* Reasoning text from the model.
|
|
3887
|
+
*/
|
|
3888
|
+
interface Content {
|
|
3889
|
+
/**
|
|
3890
|
+
* The reasoning text content from the model.
|
|
3891
|
+
*/
|
|
3892
|
+
text: string;
|
|
3893
|
+
/**
|
|
3894
|
+
* The type identifier, always 'reasoning_text'.
|
|
3895
|
+
*/
|
|
3896
|
+
type?: 'reasoning_text';
|
|
3897
|
+
}
|
|
3898
|
+
}
|
|
3899
|
+
/**
|
|
3900
|
+
* This represents the output of a function call that gets passed back to the
|
|
3901
|
+
* model.
|
|
3902
|
+
*/
|
|
3903
|
+
interface OpenAIResponseInputFunctionToolCallOutput {
|
|
3904
|
+
call_id: string;
|
|
3905
|
+
output: string | Array<OpenAIResponseInputFunctionToolCallOutput.OpenAIResponseInputMessageContentText | OpenAIResponseInputFunctionToolCallOutput.OpenAIResponseInputMessageContentImage | OpenAIResponseInputFunctionToolCallOutput.OpenAIResponseInputMessageContentFile>;
|
|
3906
|
+
id?: string | null;
|
|
3907
|
+
status?: string | null;
|
|
3908
|
+
type?: 'function_call_output';
|
|
3909
|
+
}
|
|
3910
|
+
namespace OpenAIResponseInputFunctionToolCallOutput {
|
|
3911
|
+
/**
|
|
3912
|
+
* Text content for input messages in OpenAI response format.
|
|
3913
|
+
*/
|
|
3914
|
+
interface OpenAIResponseInputMessageContentText {
|
|
3915
|
+
text: string;
|
|
3916
|
+
type?: 'input_text';
|
|
3917
|
+
}
|
|
3918
|
+
/**
|
|
3919
|
+
* Image content for input messages in OpenAI response format.
|
|
3920
|
+
*/
|
|
3921
|
+
interface OpenAIResponseInputMessageContentImage {
|
|
3922
|
+
detail?: 'low' | 'high' | 'auto';
|
|
3923
|
+
file_id?: string | null;
|
|
3924
|
+
image_url?: string | null;
|
|
3925
|
+
type?: 'input_image';
|
|
3926
|
+
}
|
|
3927
|
+
/**
|
|
3928
|
+
* File content for input messages in OpenAI response format.
|
|
3929
|
+
*/
|
|
3930
|
+
interface OpenAIResponseInputMessageContentFile {
|
|
3931
|
+
file_data?: string | null;
|
|
3932
|
+
file_id?: string | null;
|
|
3933
|
+
file_url?: string | null;
|
|
3934
|
+
filename?: string | null;
|
|
3935
|
+
type?: 'input_file';
|
|
3936
|
+
}
|
|
3937
|
+
}
|
|
3938
|
+
/**
|
|
3939
|
+
* A response to an MCP approval request.
|
|
3940
|
+
*/
|
|
3941
|
+
interface OpenAIResponseMcpApprovalResponse {
|
|
3942
|
+
approval_request_id: string;
|
|
3943
|
+
approve: boolean;
|
|
3944
|
+
id?: string | null;
|
|
3945
|
+
reason?: string | null;
|
|
3946
|
+
type?: 'mcp_approval_response';
|
|
3947
|
+
}
|
|
3948
|
+
/**
|
|
3949
|
+
* A compaction item that summarizes prior conversation context.
|
|
3950
|
+
*/
|
|
3951
|
+
interface OpenAIResponseCompaction {
|
|
3952
|
+
encrypted_content: string;
|
|
3953
|
+
id?: string | null;
|
|
3954
|
+
type?: 'compaction';
|
|
3955
|
+
}
|
|
3956
|
+
/**
|
|
3957
|
+
* Configuration for automatic context management during response generation.
|
|
3958
|
+
*/
|
|
3959
|
+
interface ContextManagement {
|
|
3960
|
+
/**
|
|
3961
|
+
* The context management entry type. Currently only 'compaction' is supported.
|
|
3962
|
+
*/
|
|
3963
|
+
type: 'compaction';
|
|
3964
|
+
/**
|
|
3965
|
+
* Token threshold at which compaction should be triggered.
|
|
3966
|
+
*/
|
|
3967
|
+
compact_threshold?: number | null;
|
|
3968
|
+
}
|
|
3969
|
+
/**
|
|
3970
|
+
* Specification for a guardrail to apply during response generation.
|
|
3971
|
+
*/
|
|
3972
|
+
interface ResponseGuardrailSpec {
|
|
3973
|
+
type: string;
|
|
3974
|
+
}
|
|
3975
|
+
/**
|
|
3976
|
+
* OpenAI compatible Prompt object that is used in OpenAI responses.
|
|
3977
|
+
*/
|
|
3978
|
+
interface Prompt {
|
|
3979
|
+
id: string;
|
|
3980
|
+
variables?: {
|
|
3981
|
+
[key: string]: Prompt.OpenAIResponseInputMessageContentText | Prompt.OpenAIResponseInputMessageContentImage | Prompt.OpenAIResponseInputMessageContentFile;
|
|
3982
|
+
} | null;
|
|
3983
|
+
version?: string | null;
|
|
3984
|
+
}
|
|
3985
|
+
namespace Prompt {
|
|
3986
|
+
/**
|
|
3987
|
+
* Text content for input messages in OpenAI response format.
|
|
3988
|
+
*/
|
|
3989
|
+
interface OpenAIResponseInputMessageContentText {
|
|
3990
|
+
text: string;
|
|
3991
|
+
type?: 'input_text';
|
|
3992
|
+
}
|
|
3993
|
+
/**
|
|
3994
|
+
* Image content for input messages in OpenAI response format.
|
|
3995
|
+
*/
|
|
3996
|
+
interface OpenAIResponseInputMessageContentImage {
|
|
3997
|
+
detail?: 'low' | 'high' | 'auto';
|
|
3998
|
+
file_id?: string | null;
|
|
3999
|
+
image_url?: string | null;
|
|
4000
|
+
type?: 'input_image';
|
|
4001
|
+
}
|
|
4002
|
+
/**
|
|
4003
|
+
* File content for input messages in OpenAI response format.
|
|
4004
|
+
*/
|
|
4005
|
+
interface OpenAIResponseInputMessageContentFile {
|
|
4006
|
+
file_data?: string | null;
|
|
4007
|
+
file_id?: string | null;
|
|
4008
|
+
file_url?: string | null;
|
|
4009
|
+
filename?: string | null;
|
|
4010
|
+
type?: 'input_file';
|
|
4011
|
+
}
|
|
4012
|
+
}
|
|
4013
|
+
/**
|
|
4014
|
+
* Configuration for reasoning effort in OpenAI responses.
|
|
4015
|
+
*
|
|
4016
|
+
* Controls how much reasoning the model performs before generating a response.
|
|
4017
|
+
*/
|
|
4018
|
+
interface Reasoning {
|
|
4019
|
+
effort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | null;
|
|
4020
|
+
/**
|
|
4021
|
+
* Summary mode for reasoning output. One of 'auto', 'concise', or 'detailed'.
|
|
4022
|
+
*/
|
|
4023
|
+
summary?: 'auto' | 'concise' | 'detailed' | null;
|
|
4024
|
+
}
|
|
4025
|
+
/**
|
|
4026
|
+
* Options that control streamed response behavior.
|
|
4027
|
+
*/
|
|
4028
|
+
interface StreamOptions {
|
|
4029
|
+
/**
|
|
4030
|
+
* Whether to obfuscate sensitive information in streamed output.
|
|
4031
|
+
*/
|
|
4032
|
+
include_obfuscation?: boolean;
|
|
4033
|
+
}
|
|
4034
|
+
/**
|
|
4035
|
+
* Text response configuration for OpenAI responses.
|
|
4036
|
+
*/
|
|
4037
|
+
interface Text {
|
|
4038
|
+
/**
|
|
4039
|
+
* Configuration for Responses API text format.
|
|
4040
|
+
*/
|
|
4041
|
+
format?: Text.Format | null;
|
|
4042
|
+
verbosity?: 'low' | 'medium' | 'high' | null;
|
|
4043
|
+
}
|
|
4044
|
+
namespace Text {
|
|
4045
|
+
/**
|
|
4046
|
+
* Configuration for Responses API text format.
|
|
4047
|
+
*/
|
|
4048
|
+
interface Format {
|
|
4049
|
+
description?: string | null;
|
|
4050
|
+
name?: string | null;
|
|
4051
|
+
schema?: {
|
|
4052
|
+
[key: string]: unknown;
|
|
4053
|
+
} | null;
|
|
4054
|
+
strict?: boolean | null;
|
|
4055
|
+
type?: 'text' | 'json_schema' | 'json_object';
|
|
4056
|
+
}
|
|
4057
|
+
}
|
|
4058
|
+
/**
|
|
4059
|
+
* Constrains the tools available to the model to a pre-defined set.
|
|
4060
|
+
*/
|
|
4061
|
+
interface OpenAIResponseInputToolChoiceAllowedTools {
|
|
4062
|
+
tools: Array<{
|
|
4063
|
+
[key: string]: string;
|
|
4064
|
+
}>;
|
|
4065
|
+
mode?: 'auto' | 'required';
|
|
4066
|
+
type?: 'allowed_tools';
|
|
4067
|
+
}
|
|
4068
|
+
/**
|
|
4069
|
+
* Indicates that the model should use file search to generate a response.
|
|
4070
|
+
*/
|
|
4071
|
+
interface OpenAIResponseInputToolChoiceFileSearch {
|
|
4072
|
+
type?: 'file_search';
|
|
4073
|
+
}
|
|
4074
|
+
/**
|
|
4075
|
+
* Indicates that the model should use web search to generate a response
|
|
4076
|
+
*/
|
|
4077
|
+
interface OpenAIResponseInputToolChoiceWebSearch {
|
|
4078
|
+
type?: 'web_search' | 'web_search_preview' | 'web_search_preview_2025_03_11' | 'web_search_2025_08_26';
|
|
4079
|
+
}
|
|
4080
|
+
/**
|
|
4081
|
+
* Forces the model to call a specific function.
|
|
4082
|
+
*/
|
|
4083
|
+
interface OpenAIResponseInputToolChoiceFunctionTool {
|
|
4084
|
+
name: string;
|
|
4085
|
+
type?: 'function';
|
|
4086
|
+
}
|
|
4087
|
+
/**
|
|
4088
|
+
* Forces the model to call a specific tool on a remote MCP server
|
|
4089
|
+
*/
|
|
4090
|
+
interface OpenAIResponseInputToolChoiceMcpTool {
|
|
4091
|
+
server_label: string;
|
|
4092
|
+
name?: string | null;
|
|
4093
|
+
type?: 'mcp';
|
|
4094
|
+
}
|
|
4095
|
+
/**
|
|
4096
|
+
* Forces the model to call a custom tool.
|
|
4097
|
+
*/
|
|
4098
|
+
interface OpenAIResponseInputToolChoiceCustomTool {
|
|
4099
|
+
name: string;
|
|
4100
|
+
type?: 'custom';
|
|
4101
|
+
}
|
|
4102
|
+
/**
|
|
4103
|
+
* Web search tool configuration for OpenAI response inputs.
|
|
4104
|
+
*/
|
|
4105
|
+
interface OpenAIResponseInputToolWebSearch {
|
|
4106
|
+
search_context_size?: string | null;
|
|
4107
|
+
type?: 'web_search' | 'web_search_preview' | 'web_search_preview_2025_03_11' | 'web_search_2025_08_26';
|
|
4108
|
+
}
|
|
4109
|
+
/**
|
|
4110
|
+
* File search tool configuration for OpenAI response inputs.
|
|
4111
|
+
*/
|
|
4112
|
+
interface OpenAIResponseInputToolFileSearch {
|
|
4113
|
+
vector_store_ids: Array<string>;
|
|
4114
|
+
filters?: {
|
|
4115
|
+
[key: string]: unknown;
|
|
4116
|
+
} | null;
|
|
4117
|
+
max_num_results?: number | null;
|
|
4118
|
+
/**
|
|
4119
|
+
* Options for ranking and filtering search results.
|
|
4120
|
+
*
|
|
4121
|
+
* This class configures how search results are ranked and filtered. You can use
|
|
4122
|
+
* algorithm-based rerankers (weighted, RRF) or neural rerankers. Defaults from
|
|
4123
|
+
* VectorStoresConfig are used when parameters are not provided.
|
|
4124
|
+
*
|
|
4125
|
+
* Examples: # Weighted ranker with custom alpha
|
|
4126
|
+
* SearchRankingOptions(ranker="weighted", alpha=0.7)
|
|
4127
|
+
*
|
|
4128
|
+
* # RRF ranker with custom impact factor
|
|
4129
|
+
* SearchRankingOptions(ranker="rrf", impact_factor=50.0)
|
|
4130
|
+
*
|
|
4131
|
+
* # Use config defaults (just specify ranker type)
|
|
4132
|
+
* SearchRankingOptions(ranker="weighted") # Uses alpha from VectorStoresConfig
|
|
4133
|
+
*
|
|
4134
|
+
* # Score threshold filtering
|
|
4135
|
+
* SearchRankingOptions(ranker="weighted", score_threshold=0.5)
|
|
4136
|
+
*/
|
|
4137
|
+
ranking_options?: OpenAIResponseInputToolFileSearch.RankingOptions | null;
|
|
4138
|
+
type?: 'file_search';
|
|
4139
|
+
}
|
|
4140
|
+
namespace OpenAIResponseInputToolFileSearch {
|
|
4141
|
+
/**
|
|
4142
|
+
* Options for ranking and filtering search results.
|
|
4143
|
+
*
|
|
4144
|
+
* This class configures how search results are ranked and filtered. You can use
|
|
4145
|
+
* algorithm-based rerankers (weighted, RRF) or neural rerankers. Defaults from
|
|
4146
|
+
* VectorStoresConfig are used when parameters are not provided.
|
|
4147
|
+
*
|
|
4148
|
+
* Examples: # Weighted ranker with custom alpha
|
|
4149
|
+
* SearchRankingOptions(ranker="weighted", alpha=0.7)
|
|
4150
|
+
*
|
|
4151
|
+
* # RRF ranker with custom impact factor
|
|
4152
|
+
* SearchRankingOptions(ranker="rrf", impact_factor=50.0)
|
|
4153
|
+
*
|
|
4154
|
+
* # Use config defaults (just specify ranker type)
|
|
4155
|
+
* SearchRankingOptions(ranker="weighted") # Uses alpha from VectorStoresConfig
|
|
4156
|
+
*
|
|
4157
|
+
* # Score threshold filtering
|
|
4158
|
+
* SearchRankingOptions(ranker="weighted", score_threshold=0.5)
|
|
4159
|
+
*/
|
|
4160
|
+
interface RankingOptions {
|
|
4161
|
+
/**
|
|
4162
|
+
* Weight factor for weighted ranker
|
|
4163
|
+
*/
|
|
4164
|
+
alpha?: number | null;
|
|
4165
|
+
/**
|
|
4166
|
+
* Impact factor for RRF algorithm
|
|
4167
|
+
*/
|
|
4168
|
+
impact_factor?: number | null;
|
|
4169
|
+
/**
|
|
4170
|
+
* Model identifier for neural reranker
|
|
4171
|
+
*/
|
|
4172
|
+
model?: string | null;
|
|
4173
|
+
ranker?: string | null;
|
|
4174
|
+
score_threshold?: number | null;
|
|
4175
|
+
/**
|
|
4176
|
+
* Weights for combining vector, keyword, and neural scores. Keys: 'vector',
|
|
4177
|
+
* 'keyword', 'neural'
|
|
4178
|
+
*/
|
|
4179
|
+
weights?: {
|
|
4180
|
+
[key: string]: number;
|
|
4181
|
+
} | null;
|
|
4182
|
+
}
|
|
4183
|
+
}
|
|
4184
|
+
/**
|
|
4185
|
+
* Function tool configuration for OpenAI response inputs.
|
|
4186
|
+
*/
|
|
4187
|
+
interface OpenAIResponseInputToolFunction {
|
|
4188
|
+
name: string;
|
|
4189
|
+
parameters: {
|
|
4190
|
+
[key: string]: unknown;
|
|
4191
|
+
} | null;
|
|
4192
|
+
description?: string | null;
|
|
4193
|
+
strict?: boolean | null;
|
|
4194
|
+
type?: 'function';
|
|
4195
|
+
}
|
|
4196
|
+
/**
|
|
4197
|
+
* Model Context Protocol (MCP) tool configuration for OpenAI response inputs.
|
|
4198
|
+
*/
|
|
4199
|
+
interface OpenAIResponseInputToolMcp {
|
|
4200
|
+
server_label: string;
|
|
4201
|
+
/**
|
|
4202
|
+
* Filter configuration for restricting which MCP tools can be used.
|
|
4203
|
+
*/
|
|
4204
|
+
allowed_tools?: Array<string> | OpenAIResponseInputToolMcp.AllowedToolsFilter | null;
|
|
4205
|
+
authorization?: string | null;
|
|
4206
|
+
connector_id?: string | null;
|
|
4207
|
+
headers?: {
|
|
4208
|
+
[key: string]: unknown;
|
|
4209
|
+
} | null;
|
|
4210
|
+
/**
|
|
4211
|
+
* Filter configuration for MCP tool approval requirements.
|
|
4212
|
+
*/
|
|
4213
|
+
require_approval?: 'always' | 'never' | OpenAIResponseInputToolMcp.ApprovalFilter;
|
|
4214
|
+
server_url?: string | null;
|
|
4215
|
+
type?: 'mcp';
|
|
4216
|
+
}
|
|
4217
|
+
namespace OpenAIResponseInputToolMcp {
|
|
4218
|
+
/**
|
|
4219
|
+
* Filter configuration for restricting which MCP tools can be used.
|
|
4220
|
+
*/
|
|
4221
|
+
interface AllowedToolsFilter {
|
|
4222
|
+
tool_names?: Array<string> | null;
|
|
4223
|
+
}
|
|
4224
|
+
/**
|
|
4225
|
+
* Filter configuration for MCP tool approval requirements.
|
|
4226
|
+
*/
|
|
4227
|
+
interface ApprovalFilter {
|
|
4228
|
+
always?: Array<string> | null;
|
|
4229
|
+
never?: Array<string> | null;
|
|
4230
|
+
}
|
|
4231
|
+
}
|
|
4232
|
+
type ResponseCreateParamsNonStreaming = ResponsesAPI.ResponseCreateParamsNonStreaming;
|
|
4233
|
+
type ResponseCreateParamsStreaming = ResponsesAPI.ResponseCreateParamsStreaming;
|
|
4234
|
+
}
|
|
4235
|
+
export interface ResponseCreateParamsNonStreaming extends ResponseCreateParamsBase {
|
|
4236
|
+
/**
|
|
4237
|
+
* Whether to stream the response.
|
|
4238
|
+
*/
|
|
4239
|
+
stream?: false;
|
|
4240
|
+
[k: string]: unknown;
|
|
4241
|
+
}
|
|
4242
|
+
export interface ResponseCreateParamsStreaming extends ResponseCreateParamsBase {
|
|
4243
|
+
/**
|
|
4244
|
+
* Whether to stream the response.
|
|
4245
|
+
*/
|
|
4246
|
+
stream: true;
|
|
4247
|
+
[k: string]: unknown;
|
|
4248
|
+
}
|
|
4249
|
+
export interface ResponseListParams extends OpenAICursorPageParams {
|
|
4250
|
+
/**
|
|
4251
|
+
* The model to filter responses by.
|
|
4252
|
+
*/
|
|
4253
|
+
model?: string | null;
|
|
4254
|
+
/**
|
|
4255
|
+
* The order to sort responses by when sorted by created_at ('asc' or 'desc').
|
|
4256
|
+
*/
|
|
4257
|
+
order?: 'asc' | 'desc' | null;
|
|
4258
|
+
}
|
|
4259
|
+
export interface ResponseCompactParams {
|
|
4260
|
+
/**
|
|
4261
|
+
* The model to use for generating the compacted summary.
|
|
4262
|
+
*/
|
|
4263
|
+
model: string;
|
|
4264
|
+
/**
|
|
4265
|
+
* Input message(s) to compact.
|
|
4266
|
+
*/
|
|
4267
|
+
input?: string | Array<ResponseCompactParams.OpenAIResponseMessageInput | ResponseCompactParams.OpenAIResponseOutputMessageWebSearchToolCall | ResponseCompactParams.OpenAIResponseOutputMessageFileSearchToolCall | ResponseCompactParams.OpenAIResponseOutputMessageFunctionToolCall | ResponseCompactParams.OpenAIResponseOutputMessageMcpCall | ResponseCompactParams.OpenAIResponseOutputMessageMcpListTools | ResponseCompactParams.OpenAIResponseMcpApprovalRequest | ResponseCompactParams.OpenAIResponseOutputMessageReasoningItem | ResponseCompactParams.OpenAIResponseInputFunctionToolCallOutput | ResponseCompactParams.OpenAIResponseMcpApprovalResponse | ResponseCompactParams.OpenAIResponseCompaction> | null;
|
|
4268
|
+
/**
|
|
4269
|
+
* Instructions to guide the compaction.
|
|
4270
|
+
*/
|
|
4271
|
+
instructions?: string | null;
|
|
4272
|
+
/**
|
|
4273
|
+
* Whether to enable parallel tool calls. Accepted for compatibility but not used
|
|
4274
|
+
* during compaction.
|
|
4275
|
+
*/
|
|
4276
|
+
parallel_tool_calls?: boolean | null;
|
|
4277
|
+
/**
|
|
4278
|
+
* ID of a previous response whose history to compact.
|
|
4279
|
+
*/
|
|
4280
|
+
previous_response_id?: string | null;
|
|
4281
|
+
/**
|
|
4282
|
+
* A key to use when reading from or writing to the prompt cache.
|
|
4283
|
+
*/
|
|
4284
|
+
prompt_cache_key?: string | null;
|
|
4285
|
+
/**
|
|
4286
|
+
* Configuration for reasoning effort in OpenAI responses.
|
|
4287
|
+
*
|
|
4288
|
+
* Controls how much reasoning the model performs before generating a response.
|
|
4289
|
+
*/
|
|
4290
|
+
reasoning?: ResponseCompactParams.Reasoning | null;
|
|
4291
|
+
/**
|
|
4292
|
+
* Text response configuration for OpenAI responses.
|
|
4293
|
+
*/
|
|
4294
|
+
text?: ResponseCompactParams.Text | null;
|
|
4295
|
+
/**
|
|
4296
|
+
* List of tools available to the model. Accepted for compatibility but not used
|
|
4297
|
+
* during compaction.
|
|
4298
|
+
*/
|
|
4299
|
+
tools?: Array<ResponseCompactParams.OpenAIResponseInputToolWebSearch | ResponseCompactParams.OpenAIResponseInputToolFileSearch | ResponseCompactParams.OpenAIResponseInputToolFunction | ResponseCompactParams.OpenAIResponseInputToolMcp> | null;
|
|
4300
|
+
[k: string]: unknown;
|
|
4301
|
+
}
|
|
4302
|
+
export declare namespace ResponseCompactParams {
|
|
4303
|
+
/**
|
|
4304
|
+
* Corresponds to the various Message types in the Responses API. They are all
|
|
4305
|
+
* under one type because the Responses API gives them all the same "type" value,
|
|
4306
|
+
* and there is no way to tell them apart in certain scenarios.
|
|
4307
|
+
*/
|
|
4308
|
+
interface OpenAIResponseMessageInput {
|
|
4309
|
+
content: string | Array<OpenAIResponseMessageInput.OpenAIResponseInputMessageContentText | OpenAIResponseMessageInput.OpenAIResponseInputMessageContentImage | OpenAIResponseMessageInput.OpenAIResponseInputMessageContentFile> | Array<OpenAIResponseMessageInput.OpenAIResponseOutputMessageContentOutputTextInput | OpenAIResponseMessageInput.OpenAIResponseContentPartRefusal>;
|
|
4310
|
+
role: 'system' | 'developer' | 'user' | 'assistant';
|
|
4311
|
+
id?: string | null;
|
|
4312
|
+
status?: string | null;
|
|
4313
|
+
type?: 'message';
|
|
4314
|
+
}
|
|
4315
|
+
namespace OpenAIResponseMessageInput {
|
|
4316
|
+
/**
|
|
4317
|
+
* Text content for input messages in OpenAI response format.
|
|
4318
|
+
*/
|
|
4319
|
+
interface OpenAIResponseInputMessageContentText {
|
|
4320
|
+
text: string;
|
|
4321
|
+
type?: 'input_text';
|
|
4322
|
+
}
|
|
4323
|
+
/**
|
|
4324
|
+
* Image content for input messages in OpenAI response format.
|
|
4325
|
+
*/
|
|
4326
|
+
interface OpenAIResponseInputMessageContentImage {
|
|
4327
|
+
detail?: 'low' | 'high' | 'auto';
|
|
4328
|
+
file_id?: string | null;
|
|
4329
|
+
image_url?: string | null;
|
|
4330
|
+
type?: 'input_image';
|
|
4331
|
+
}
|
|
4332
|
+
/**
|
|
4333
|
+
* File content for input messages in OpenAI response format.
|
|
4334
|
+
*/
|
|
4335
|
+
interface OpenAIResponseInputMessageContentFile {
|
|
4336
|
+
file_data?: string | null;
|
|
4337
|
+
file_id?: string | null;
|
|
4338
|
+
file_url?: string | null;
|
|
4339
|
+
filename?: string | null;
|
|
4340
|
+
type?: 'input_file';
|
|
4341
|
+
}
|
|
4342
|
+
/**
|
|
4343
|
+
* Text content within an output message of an OpenAI response.
|
|
4344
|
+
*/
|
|
4345
|
+
interface OpenAIResponseOutputMessageContentOutputTextInput {
|
|
4346
|
+
text: string;
|
|
4347
|
+
annotations?: Array<OpenAIResponseOutputMessageContentOutputTextInput.OpenAIResponseAnnotationFileCitation | OpenAIResponseOutputMessageContentOutputTextInput.OpenAIResponseAnnotationCitation | OpenAIResponseOutputMessageContentOutputTextInput.OpenAIResponseAnnotationContainerFileCitation | OpenAIResponseOutputMessageContentOutputTextInput.OpenAIResponseAnnotationFilePath>;
|
|
4348
|
+
logprobs?: Array<OpenAIResponseOutputMessageContentOutputTextInput.Logprob> | null;
|
|
4349
|
+
type?: 'output_text';
|
|
4350
|
+
}
|
|
4351
|
+
namespace OpenAIResponseOutputMessageContentOutputTextInput {
|
|
4352
|
+
/**
|
|
4353
|
+
* File citation annotation for referencing specific files in response content.
|
|
4354
|
+
*/
|
|
4355
|
+
interface OpenAIResponseAnnotationFileCitation {
|
|
4356
|
+
file_id: string;
|
|
4357
|
+
filename: string;
|
|
4358
|
+
index: number;
|
|
4359
|
+
type?: 'file_citation';
|
|
4360
|
+
}
|
|
4361
|
+
/**
|
|
4362
|
+
* URL citation annotation for referencing external web resources.
|
|
4363
|
+
*/
|
|
4364
|
+
interface OpenAIResponseAnnotationCitation {
|
|
4365
|
+
end_index: number;
|
|
4366
|
+
start_index: number;
|
|
4367
|
+
title: string;
|
|
4368
|
+
url: string;
|
|
4369
|
+
type?: 'url_citation';
|
|
4370
|
+
}
|
|
4371
|
+
/**
|
|
4372
|
+
* Container file citation annotation referencing a file within a container.
|
|
4373
|
+
*/
|
|
4374
|
+
interface OpenAIResponseAnnotationContainerFileCitation {
|
|
4375
|
+
container_id: string;
|
|
4376
|
+
end_index: number;
|
|
4377
|
+
file_id: string;
|
|
4378
|
+
filename: string;
|
|
4379
|
+
start_index: number;
|
|
4380
|
+
type?: 'container_file_citation';
|
|
4381
|
+
}
|
|
4382
|
+
/**
|
|
4383
|
+
* File path annotation referencing a generated file in response content.
|
|
4384
|
+
*/
|
|
4385
|
+
interface OpenAIResponseAnnotationFilePath {
|
|
4386
|
+
file_id: string;
|
|
4387
|
+
index: number;
|
|
4388
|
+
type?: 'file_path';
|
|
4389
|
+
}
|
|
4390
|
+
/**
|
|
4391
|
+
* The log probability for a token from an OpenAI-compatible chat completion
|
|
4392
|
+
* response.
|
|
4393
|
+
*/
|
|
4394
|
+
interface Logprob {
|
|
4395
|
+
/**
|
|
4396
|
+
* The token.
|
|
4397
|
+
*/
|
|
4398
|
+
token: string;
|
|
4399
|
+
/**
|
|
4400
|
+
* The log probability of the token.
|
|
4401
|
+
*/
|
|
4402
|
+
logprob: number;
|
|
4403
|
+
/**
|
|
4404
|
+
* The bytes for the token.
|
|
4405
|
+
*/
|
|
4406
|
+
bytes?: Array<number> | null;
|
|
4407
|
+
/**
|
|
4408
|
+
* The top log probabilities for the token.
|
|
4409
|
+
*/
|
|
4410
|
+
top_logprobs?: Array<Logprob.TopLogprob> | null;
|
|
4411
|
+
}
|
|
4412
|
+
namespace Logprob {
|
|
4413
|
+
/**
|
|
4414
|
+
* The top log probability for a token from an OpenAI-compatible chat completion
|
|
4415
|
+
* response.
|
|
4416
|
+
*/
|
|
4417
|
+
interface TopLogprob {
|
|
4418
|
+
/**
|
|
4419
|
+
* The token.
|
|
4420
|
+
*/
|
|
4421
|
+
token: string;
|
|
4422
|
+
/**
|
|
4423
|
+
* The log probability of the token.
|
|
4424
|
+
*/
|
|
4425
|
+
logprob: number;
|
|
4426
|
+
/**
|
|
4427
|
+
* The bytes for the token.
|
|
4428
|
+
*/
|
|
4429
|
+
bytes?: Array<number> | null;
|
|
4430
|
+
}
|
|
4431
|
+
}
|
|
4432
|
+
}
|
|
4433
|
+
/**
|
|
4434
|
+
* Refusal content within a streamed response part.
|
|
4435
|
+
*/
|
|
4436
|
+
interface OpenAIResponseContentPartRefusal {
|
|
4437
|
+
refusal: string;
|
|
4438
|
+
type?: 'refusal';
|
|
4439
|
+
}
|
|
4440
|
+
}
|
|
4441
|
+
/**
|
|
4442
|
+
* Web search tool call output message for OpenAI responses.
|
|
4443
|
+
*/
|
|
4444
|
+
interface OpenAIResponseOutputMessageWebSearchToolCall {
|
|
4445
|
+
id: string;
|
|
4446
|
+
status: string;
|
|
4447
|
+
type?: 'web_search_call';
|
|
4448
|
+
}
|
|
4449
|
+
/**
|
|
4450
|
+
* File search tool call output message for OpenAI responses.
|
|
4451
|
+
*/
|
|
4452
|
+
interface OpenAIResponseOutputMessageFileSearchToolCall {
|
|
4453
|
+
id: string;
|
|
4454
|
+
queries: Array<string>;
|
|
4455
|
+
status: string;
|
|
4456
|
+
results?: Array<OpenAIResponseOutputMessageFileSearchToolCall.Result> | null;
|
|
4457
|
+
type?: 'file_search_call';
|
|
4458
|
+
}
|
|
4459
|
+
namespace OpenAIResponseOutputMessageFileSearchToolCall {
|
|
4460
|
+
/**
|
|
4461
|
+
* Search results returned by the file search operation.
|
|
4462
|
+
*/
|
|
4463
|
+
interface Result {
|
|
4464
|
+
attributes: {
|
|
4465
|
+
[key: string]: unknown;
|
|
4466
|
+
};
|
|
4467
|
+
file_id: string;
|
|
4468
|
+
filename: string;
|
|
4469
|
+
score: number;
|
|
4470
|
+
text: string;
|
|
4471
|
+
}
|
|
4472
|
+
}
|
|
4473
|
+
/**
|
|
4474
|
+
* Function tool call output message for OpenAI responses.
|
|
4475
|
+
*/
|
|
4476
|
+
interface OpenAIResponseOutputMessageFunctionToolCall {
|
|
4477
|
+
arguments: string;
|
|
4478
|
+
call_id: string;
|
|
4479
|
+
name: string;
|
|
4480
|
+
id?: string | null;
|
|
4481
|
+
status?: string | null;
|
|
4482
|
+
type?: 'function_call';
|
|
4483
|
+
}
|
|
4484
|
+
/**
|
|
4485
|
+
* Model Context Protocol (MCP) call output message for OpenAI responses.
|
|
4486
|
+
*/
|
|
4487
|
+
interface OpenAIResponseOutputMessageMcpCall {
|
|
4488
|
+
id: string;
|
|
4489
|
+
arguments: string;
|
|
4490
|
+
name: string;
|
|
4491
|
+
server_label: string;
|
|
4492
|
+
error?: string | null;
|
|
4493
|
+
output?: string | null;
|
|
4494
|
+
type?: 'mcp_call';
|
|
4495
|
+
}
|
|
4496
|
+
/**
|
|
4497
|
+
* MCP list tools output message containing available tools from an MCP server.
|
|
4498
|
+
*/
|
|
4499
|
+
interface OpenAIResponseOutputMessageMcpListTools {
|
|
4500
|
+
id: string;
|
|
4501
|
+
server_label: string;
|
|
4502
|
+
tools: Array<OpenAIResponseOutputMessageMcpListTools.Tool>;
|
|
4503
|
+
type?: 'mcp_list_tools';
|
|
4504
|
+
}
|
|
4505
|
+
namespace OpenAIResponseOutputMessageMcpListTools {
|
|
4506
|
+
/**
|
|
4507
|
+
* Tool definition returned by MCP list tools operation.
|
|
4508
|
+
*/
|
|
4509
|
+
interface Tool {
|
|
4510
|
+
input_schema: {
|
|
4511
|
+
[key: string]: unknown;
|
|
4512
|
+
};
|
|
4513
|
+
name: string;
|
|
4514
|
+
description?: string | null;
|
|
4515
|
+
}
|
|
4516
|
+
}
|
|
4517
|
+
/**
|
|
4518
|
+
* A request for human approval of a tool invocation.
|
|
4519
|
+
*/
|
|
4520
|
+
interface OpenAIResponseMcpApprovalRequest {
|
|
4521
|
+
id: string;
|
|
4522
|
+
arguments: string;
|
|
4523
|
+
name: string;
|
|
4524
|
+
server_label: string;
|
|
4525
|
+
type?: 'mcp_approval_request';
|
|
4526
|
+
}
|
|
4527
|
+
/**
|
|
4528
|
+
* Reasoning output from the model, representing the model's thinking process.
|
|
4529
|
+
*/
|
|
4530
|
+
interface OpenAIResponseOutputMessageReasoningItem {
|
|
4531
|
+
/**
|
|
4532
|
+
* Unique identifier for the reasoning output item.
|
|
4533
|
+
*/
|
|
4534
|
+
id: string;
|
|
4535
|
+
/**
|
|
4536
|
+
* Summary of the reasoning output.
|
|
4537
|
+
*/
|
|
4538
|
+
summary: Array<OpenAIResponseOutputMessageReasoningItem.Summary>;
|
|
4539
|
+
/**
|
|
4540
|
+
* The reasoning content from the model.
|
|
4541
|
+
*/
|
|
4542
|
+
content?: Array<OpenAIResponseOutputMessageReasoningItem.Content> | null;
|
|
4543
|
+
/**
|
|
4544
|
+
* The status of the reasoning output.
|
|
4545
|
+
*/
|
|
4546
|
+
status?: 'in_progress' | 'completed' | 'incomplete' | null;
|
|
4547
|
+
/**
|
|
4548
|
+
* The type identifier, always 'reasoning'.
|
|
4549
|
+
*/
|
|
4550
|
+
type?: 'reasoning';
|
|
4551
|
+
}
|
|
4552
|
+
namespace OpenAIResponseOutputMessageReasoningItem {
|
|
4553
|
+
/**
|
|
4554
|
+
* A summary of reasoning output from the model.
|
|
4555
|
+
*/
|
|
4556
|
+
interface Summary {
|
|
4557
|
+
/**
|
|
4558
|
+
* The summary text of the reasoning output.
|
|
4559
|
+
*/
|
|
4560
|
+
text: string;
|
|
4561
|
+
/**
|
|
4562
|
+
* The type identifier, always 'summary_text'.
|
|
4563
|
+
*/
|
|
4564
|
+
type?: 'summary_text';
|
|
4565
|
+
}
|
|
4566
|
+
/**
|
|
4567
|
+
* Reasoning text from the model.
|
|
4568
|
+
*/
|
|
4569
|
+
interface Content {
|
|
4570
|
+
/**
|
|
4571
|
+
* The reasoning text content from the model.
|
|
4572
|
+
*/
|
|
4573
|
+
text: string;
|
|
4574
|
+
/**
|
|
4575
|
+
* The type identifier, always 'reasoning_text'.
|
|
4576
|
+
*/
|
|
4577
|
+
type?: 'reasoning_text';
|
|
4578
|
+
}
|
|
4579
|
+
}
|
|
4580
|
+
/**
|
|
4581
|
+
* This represents the output of a function call that gets passed back to the
|
|
4582
|
+
* model.
|
|
4583
|
+
*/
|
|
4584
|
+
interface OpenAIResponseInputFunctionToolCallOutput {
|
|
4585
|
+
call_id: string;
|
|
4586
|
+
output: string | Array<OpenAIResponseInputFunctionToolCallOutput.OpenAIResponseInputMessageContentText | OpenAIResponseInputFunctionToolCallOutput.OpenAIResponseInputMessageContentImage | OpenAIResponseInputFunctionToolCallOutput.OpenAIResponseInputMessageContentFile>;
|
|
4587
|
+
id?: string | null;
|
|
4588
|
+
status?: string | null;
|
|
4589
|
+
type?: 'function_call_output';
|
|
4590
|
+
}
|
|
4591
|
+
namespace OpenAIResponseInputFunctionToolCallOutput {
|
|
4592
|
+
/**
|
|
4593
|
+
* Text content for input messages in OpenAI response format.
|
|
4594
|
+
*/
|
|
4595
|
+
interface OpenAIResponseInputMessageContentText {
|
|
4596
|
+
text: string;
|
|
4597
|
+
type?: 'input_text';
|
|
4598
|
+
}
|
|
4599
|
+
/**
|
|
4600
|
+
* Image content for input messages in OpenAI response format.
|
|
4601
|
+
*/
|
|
4602
|
+
interface OpenAIResponseInputMessageContentImage {
|
|
4603
|
+
detail?: 'low' | 'high' | 'auto';
|
|
4604
|
+
file_id?: string | null;
|
|
4605
|
+
image_url?: string | null;
|
|
4606
|
+
type?: 'input_image';
|
|
4607
|
+
}
|
|
4608
|
+
/**
|
|
4609
|
+
* File content for input messages in OpenAI response format.
|
|
4610
|
+
*/
|
|
4611
|
+
interface OpenAIResponseInputMessageContentFile {
|
|
4612
|
+
file_data?: string | null;
|
|
4613
|
+
file_id?: string | null;
|
|
4614
|
+
file_url?: string | null;
|
|
4615
|
+
filename?: string | null;
|
|
4616
|
+
type?: 'input_file';
|
|
4617
|
+
}
|
|
4618
|
+
}
|
|
4619
|
+
/**
|
|
4620
|
+
* A response to an MCP approval request.
|
|
4621
|
+
*/
|
|
4622
|
+
interface OpenAIResponseMcpApprovalResponse {
|
|
4623
|
+
approval_request_id: string;
|
|
4624
|
+
approve: boolean;
|
|
4625
|
+
id?: string | null;
|
|
4626
|
+
reason?: string | null;
|
|
4627
|
+
type?: 'mcp_approval_response';
|
|
4628
|
+
}
|
|
4629
|
+
/**
|
|
4630
|
+
* A compaction item that summarizes prior conversation context.
|
|
4631
|
+
*/
|
|
4632
|
+
interface OpenAIResponseCompaction {
|
|
4633
|
+
encrypted_content: string;
|
|
4634
|
+
id?: string | null;
|
|
4635
|
+
type?: 'compaction';
|
|
4636
|
+
}
|
|
4637
|
+
/**
|
|
4638
|
+
* Configuration for reasoning effort in OpenAI responses.
|
|
4639
|
+
*
|
|
4640
|
+
* Controls how much reasoning the model performs before generating a response.
|
|
4641
|
+
*/
|
|
4642
|
+
interface Reasoning {
|
|
4643
|
+
effort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | null;
|
|
4644
|
+
/**
|
|
4645
|
+
* Summary mode for reasoning output. One of 'auto', 'concise', or 'detailed'.
|
|
4646
|
+
*/
|
|
4647
|
+
summary?: 'auto' | 'concise' | 'detailed' | null;
|
|
4648
|
+
}
|
|
4649
|
+
/**
|
|
4650
|
+
* Text response configuration for OpenAI responses.
|
|
4651
|
+
*/
|
|
4652
|
+
interface Text {
|
|
4653
|
+
/**
|
|
4654
|
+
* Configuration for Responses API text format.
|
|
4655
|
+
*/
|
|
4656
|
+
format?: Text.Format | null;
|
|
4657
|
+
verbosity?: 'low' | 'medium' | 'high' | null;
|
|
4658
|
+
}
|
|
4659
|
+
namespace Text {
|
|
4660
|
+
/**
|
|
4661
|
+
* Configuration for Responses API text format.
|
|
4662
|
+
*/
|
|
4663
|
+
interface Format {
|
|
4664
|
+
description?: string | null;
|
|
4665
|
+
name?: string | null;
|
|
4666
|
+
schema?: {
|
|
4667
|
+
[key: string]: unknown;
|
|
4668
|
+
} | null;
|
|
4669
|
+
strict?: boolean | null;
|
|
4670
|
+
type?: 'text' | 'json_schema' | 'json_object';
|
|
4671
|
+
}
|
|
4672
|
+
}
|
|
4673
|
+
/**
|
|
4674
|
+
* Web search tool configuration for OpenAI response inputs.
|
|
4675
|
+
*/
|
|
4676
|
+
interface OpenAIResponseInputToolWebSearch {
|
|
4677
|
+
search_context_size?: string | null;
|
|
4678
|
+
type?: 'web_search' | 'web_search_preview' | 'web_search_preview_2025_03_11' | 'web_search_2025_08_26';
|
|
4679
|
+
}
|
|
4680
|
+
/**
|
|
4681
|
+
* File search tool configuration for OpenAI response inputs.
|
|
4682
|
+
*/
|
|
4683
|
+
interface OpenAIResponseInputToolFileSearch {
|
|
4684
|
+
vector_store_ids: Array<string>;
|
|
4685
|
+
filters?: {
|
|
4686
|
+
[key: string]: unknown;
|
|
4687
|
+
} | null;
|
|
4688
|
+
max_num_results?: number | null;
|
|
4689
|
+
/**
|
|
4690
|
+
* Options for ranking and filtering search results.
|
|
4691
|
+
*
|
|
4692
|
+
* This class configures how search results are ranked and filtered. You can use
|
|
4693
|
+
* algorithm-based rerankers (weighted, RRF) or neural rerankers. Defaults from
|
|
4694
|
+
* VectorStoresConfig are used when parameters are not provided.
|
|
4695
|
+
*
|
|
4696
|
+
* Examples: # Weighted ranker with custom alpha
|
|
4697
|
+
* SearchRankingOptions(ranker="weighted", alpha=0.7)
|
|
4698
|
+
*
|
|
4699
|
+
* # RRF ranker with custom impact factor
|
|
4700
|
+
* SearchRankingOptions(ranker="rrf", impact_factor=50.0)
|
|
4701
|
+
*
|
|
4702
|
+
* # Use config defaults (just specify ranker type)
|
|
4703
|
+
* SearchRankingOptions(ranker="weighted") # Uses alpha from VectorStoresConfig
|
|
4704
|
+
*
|
|
4705
|
+
* # Score threshold filtering
|
|
4706
|
+
* SearchRankingOptions(ranker="weighted", score_threshold=0.5)
|
|
4707
|
+
*/
|
|
4708
|
+
ranking_options?: OpenAIResponseInputToolFileSearch.RankingOptions | null;
|
|
4709
|
+
type?: 'file_search';
|
|
4710
|
+
}
|
|
4711
|
+
namespace OpenAIResponseInputToolFileSearch {
|
|
4712
|
+
/**
|
|
4713
|
+
* Options for ranking and filtering search results.
|
|
4714
|
+
*
|
|
4715
|
+
* This class configures how search results are ranked and filtered. You can use
|
|
4716
|
+
* algorithm-based rerankers (weighted, RRF) or neural rerankers. Defaults from
|
|
4717
|
+
* VectorStoresConfig are used when parameters are not provided.
|
|
4718
|
+
*
|
|
4719
|
+
* Examples: # Weighted ranker with custom alpha
|
|
4720
|
+
* SearchRankingOptions(ranker="weighted", alpha=0.7)
|
|
4721
|
+
*
|
|
4722
|
+
* # RRF ranker with custom impact factor
|
|
4723
|
+
* SearchRankingOptions(ranker="rrf", impact_factor=50.0)
|
|
4724
|
+
*
|
|
4725
|
+
* # Use config defaults (just specify ranker type)
|
|
4726
|
+
* SearchRankingOptions(ranker="weighted") # Uses alpha from VectorStoresConfig
|
|
4727
|
+
*
|
|
4728
|
+
* # Score threshold filtering
|
|
4729
|
+
* SearchRankingOptions(ranker="weighted", score_threshold=0.5)
|
|
4730
|
+
*/
|
|
4731
|
+
interface RankingOptions {
|
|
4732
|
+
/**
|
|
4733
|
+
* Weight factor for weighted ranker
|
|
4734
|
+
*/
|
|
4735
|
+
alpha?: number | null;
|
|
4736
|
+
/**
|
|
4737
|
+
* Impact factor for RRF algorithm
|
|
4738
|
+
*/
|
|
4739
|
+
impact_factor?: number | null;
|
|
4740
|
+
/**
|
|
4741
|
+
* Model identifier for neural reranker
|
|
4742
|
+
*/
|
|
4743
|
+
model?: string | null;
|
|
4744
|
+
ranker?: string | null;
|
|
4745
|
+
score_threshold?: number | null;
|
|
4746
|
+
/**
|
|
4747
|
+
* Weights for combining vector, keyword, and neural scores. Keys: 'vector',
|
|
4748
|
+
* 'keyword', 'neural'
|
|
4749
|
+
*/
|
|
4750
|
+
weights?: {
|
|
4751
|
+
[key: string]: number;
|
|
4752
|
+
} | null;
|
|
4753
|
+
}
|
|
4754
|
+
}
|
|
4755
|
+
/**
|
|
4756
|
+
* Function tool configuration for OpenAI response inputs.
|
|
4757
|
+
*/
|
|
4758
|
+
interface OpenAIResponseInputToolFunction {
|
|
4759
|
+
name: string;
|
|
4760
|
+
parameters: {
|
|
4761
|
+
[key: string]: unknown;
|
|
4762
|
+
} | null;
|
|
4763
|
+
description?: string | null;
|
|
4764
|
+
strict?: boolean | null;
|
|
4765
|
+
type?: 'function';
|
|
4766
|
+
}
|
|
4767
|
+
/**
|
|
4768
|
+
* Model Context Protocol (MCP) tool configuration for OpenAI response inputs.
|
|
4769
|
+
*/
|
|
4770
|
+
interface OpenAIResponseInputToolMcp {
|
|
4771
|
+
server_label: string;
|
|
4772
|
+
/**
|
|
4773
|
+
* Filter configuration for restricting which MCP tools can be used.
|
|
4774
|
+
*/
|
|
4775
|
+
allowed_tools?: Array<string> | OpenAIResponseInputToolMcp.AllowedToolsFilter | null;
|
|
4776
|
+
authorization?: string | null;
|
|
4777
|
+
connector_id?: string | null;
|
|
4778
|
+
headers?: {
|
|
4779
|
+
[key: string]: unknown;
|
|
4780
|
+
} | null;
|
|
4781
|
+
/**
|
|
4782
|
+
* Filter configuration for MCP tool approval requirements.
|
|
4783
|
+
*/
|
|
4784
|
+
require_approval?: 'always' | 'never' | OpenAIResponseInputToolMcp.ApprovalFilter;
|
|
4785
|
+
server_url?: string | null;
|
|
4786
|
+
type?: 'mcp';
|
|
4787
|
+
}
|
|
4788
|
+
namespace OpenAIResponseInputToolMcp {
|
|
4789
|
+
/**
|
|
4790
|
+
* Filter configuration for restricting which MCP tools can be used.
|
|
4791
|
+
*/
|
|
4792
|
+
interface AllowedToolsFilter {
|
|
4793
|
+
tool_names?: Array<string> | null;
|
|
4794
|
+
}
|
|
4795
|
+
/**
|
|
4796
|
+
* Filter configuration for MCP tool approval requirements.
|
|
4797
|
+
*/
|
|
4798
|
+
interface ApprovalFilter {
|
|
4799
|
+
always?: Array<string> | null;
|
|
4800
|
+
never?: Array<string> | null;
|
|
4801
|
+
}
|
|
4802
|
+
}
|
|
4803
|
+
}
|
|
4804
|
+
export declare namespace Responses {
|
|
4805
|
+
export { type CompactedResponse as CompactedResponse, type ResponseInput as ResponseInput, type ResponseMessage as ResponseMessage, type ResponseObject as ResponseObject, type ResponseObjectStream as ResponseObjectStream, type ResponseOutput as ResponseOutput, type ResponseListResponse as ResponseListResponse, type ResponseDeleteResponse as ResponseDeleteResponse, ResponseListResponsesOpenAICursorPage as ResponseListResponsesOpenAICursorPage, type ResponseCreateParams as ResponseCreateParams, type ResponseCreateParamsNonStreaming as ResponseCreateParamsNonStreaming, type ResponseCreateParamsStreaming as ResponseCreateParamsStreaming, type ResponseListParams as ResponseListParams, type ResponseCompactParams as ResponseCompactParams, };
|
|
4806
|
+
export { InputItems as InputItems, type InputItemListResponse as InputItemListResponse, type InputItemListParams as InputItemListParams, };
|
|
4807
|
+
}
|
|
4808
|
+
//# sourceMappingURL=responses.d.ts.map
|