openai 7.5.0 → 7.6.0
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 +105 -0
- package/README.md +46 -2
- package/auth/index.d.mts +1 -1
- package/auth/index.d.mts.map +1 -1
- package/auth/index.d.ts +1 -1
- package/auth/index.d.ts.map +1 -1
- package/auth/index.js.map +1 -1
- package/auth/index.mjs.map +1 -1
- package/auth/subject-token-providers.d.mts.map +1 -1
- package/auth/subject-token-providers.d.ts.map +1 -1
- package/auth/subject-token-providers.js +176 -4
- package/auth/subject-token-providers.js.map +1 -1
- package/auth/subject-token-providers.mjs +176 -4
- package/auth/subject-token-providers.mjs.map +1 -1
- package/auth/types.d.mts +17 -0
- package/auth/types.d.mts.map +1 -1
- package/auth/types.d.ts +17 -0
- package/auth/types.d.ts.map +1 -1
- package/auth/workload-identity-auth.d.mts.map +1 -1
- package/auth/workload-identity-auth.d.ts.map +1 -1
- package/auth/workload-identity-auth.js +80 -7
- package/auth/workload-identity-auth.js.map +1 -1
- package/auth/workload-identity-auth.mjs +80 -7
- package/auth/workload-identity-auth.mjs.map +1 -1
- package/auth/x509-transport.d.mts +5 -0
- package/auth/x509-transport.d.mts.map +1 -0
- package/auth/x509-transport.d.ts +5 -0
- package/auth/x509-transport.d.ts.map +1 -0
- package/auth/x509-transport.js +39 -0
- package/auth/x509-transport.js.map +1 -0
- package/auth/x509-transport.mjs +36 -0
- package/auth/x509-transport.mjs.map +1 -0
- package/azure.d.mts +11 -2
- package/azure.d.mts.map +1 -1
- package/azure.d.ts +11 -2
- package/azure.d.ts.map +1 -1
- package/azure.js +7 -1
- package/azure.js.map +1 -1
- package/azure.mjs +7 -1
- package/azure.mjs.map +1 -1
- package/bedrock.d.mts +6 -2
- package/bedrock.d.mts.map +1 -1
- package/bedrock.d.ts +6 -2
- package/bedrock.d.ts.map +1 -1
- package/bedrock.js +34 -4
- package/bedrock.js.map +1 -1
- package/bedrock.mjs +35 -5
- package/bedrock.mjs.map +1 -1
- package/beta/realtime/internal-base.d.mts +2 -0
- package/beta/realtime/internal-base.d.mts.map +1 -1
- package/beta/realtime/internal-base.d.ts +2 -0
- package/beta/realtime/internal-base.d.ts.map +1 -1
- package/beta/realtime/internal-base.js +15 -0
- package/beta/realtime/internal-base.js.map +1 -1
- package/beta/realtime/internal-base.mjs +14 -0
- package/beta/realtime/internal-base.mjs.map +1 -1
- package/beta/realtime/websocket.d.mts +11 -5
- package/beta/realtime/websocket.d.mts.map +1 -1
- package/beta/realtime/websocket.d.ts +11 -5
- package/beta/realtime/websocket.d.ts.map +1 -1
- package/beta/realtime/websocket.js +106 -31
- package/beta/realtime/websocket.js.map +1 -1
- package/beta/realtime/websocket.mjs +107 -32
- package/beta/realtime/websocket.mjs.map +1 -1
- package/beta/realtime/ws.d.mts +0 -2
- package/beta/realtime/ws.d.mts.map +1 -1
- package/beta/realtime/ws.d.ts +0 -2
- package/beta/realtime/ws.d.ts.map +1 -1
- package/beta/realtime/ws.js +24 -5
- package/beta/realtime/ws.js.map +1 -1
- package/beta/realtime/ws.mjs +25 -6
- package/beta/realtime/ws.mjs.map +1 -1
- package/client.d.mts +17 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +17 -2
- package/client.d.ts.map +1 -1
- package/client.js +422 -70
- package/client.js.map +1 -1
- package/client.mjs +423 -71
- package/client.mjs.map +1 -1
- package/core/EventEmitter.d.mts.map +1 -1
- package/core/EventEmitter.d.ts.map +1 -1
- package/core/EventEmitter.js +67 -9
- package/core/EventEmitter.js.map +1 -1
- package/core/EventEmitter.mjs +68 -10
- package/core/EventEmitter.mjs.map +1 -1
- package/core/streaming.d.mts +1 -0
- package/core/streaming.d.mts.map +1 -1
- package/core/streaming.d.ts +1 -0
- package/core/streaming.d.ts.map +1 -1
- package/core/streaming.js +58 -19
- package/core/streaming.js.map +1 -1
- package/core/streaming.mjs +58 -19
- package/core/streaming.mjs.map +1 -1
- package/helpers/audio.d.mts +5 -5
- package/helpers/audio.d.mts.map +1 -1
- package/helpers/audio.d.ts +5 -5
- package/helpers/audio.d.ts.map +1 -1
- package/helpers/audio.js +93 -22
- package/helpers/audio.js.map +1 -1
- package/helpers/audio.mjs +93 -22
- package/helpers/audio.mjs.map +1 -1
- package/helpers/standard-schema.d.mts.map +1 -1
- package/helpers/standard-schema.d.ts.map +1 -1
- package/helpers/standard-schema.js +34 -14
- package/helpers/standard-schema.js.map +1 -1
- package/helpers/standard-schema.mjs +35 -15
- package/helpers/standard-schema.mjs.map +1 -1
- package/helpers/zod-v3-strict-schema.d.mts +7 -0
- package/helpers/zod-v3-strict-schema.d.mts.map +1 -0
- package/helpers/zod-v3-strict-schema.d.ts +7 -0
- package/helpers/zod-v3-strict-schema.d.ts.map +1 -0
- package/helpers/zod-v3-strict-schema.js +403 -0
- package/helpers/zod-v3-strict-schema.js.map +1 -0
- package/helpers/zod-v3-strict-schema.mjs +399 -0
- package/helpers/zod-v3-strict-schema.mjs.map +1 -0
- package/helpers/zod.d.mts.map +1 -1
- package/helpers/zod.d.ts.map +1 -1
- package/helpers/zod.js +11 -3
- package/helpers/zod.js.map +1 -1
- package/helpers/zod.mjs +12 -4
- package/helpers/zod.mjs.map +1 -1
- package/index.d.mts +1 -1
- package/index.d.mts.map +1 -1
- package/index.d.ts +1 -1
- package/index.d.ts.map +1 -1
- package/index.js.map +1 -1
- package/index.mjs.map +1 -1
- package/internal/assistant-stream-delta.d.mts.map +1 -1
- package/internal/assistant-stream-delta.d.ts.map +1 -1
- package/internal/assistant-stream-delta.js +28 -8
- package/internal/assistant-stream-delta.js.map +1 -1
- package/internal/assistant-stream-delta.mjs +28 -8
- package/internal/assistant-stream-delta.mjs.map +1 -1
- package/internal/auth/x509-token-exchange.d.mts +16 -0
- package/internal/auth/x509-token-exchange.d.mts.map +1 -0
- package/internal/auth/x509-token-exchange.d.ts +16 -0
- package/internal/auth/x509-token-exchange.d.ts.map +1 -0
- package/internal/auth/x509-token-exchange.js +246 -0
- package/internal/auth/x509-token-exchange.js.map +1 -0
- package/internal/auth/x509-token-exchange.mjs +243 -0
- package/internal/auth/x509-token-exchange.mjs.map +1 -0
- package/internal/auth/x509-transport-capability.d.mts +37 -0
- package/internal/auth/x509-transport-capability.d.mts.map +1 -0
- package/internal/auth/x509-transport-capability.d.ts +37 -0
- package/internal/auth/x509-transport-capability.d.ts.map +1 -0
- package/internal/auth/x509-transport-capability.js +169 -0
- package/internal/auth/x509-transport-capability.js.map +1 -0
- package/internal/auth/x509-transport-capability.mjs +164 -0
- package/internal/auth/x509-transport-capability.mjs.map +1 -0
- package/internal/auth/x509-transport-registry.d.mts +63 -0
- package/internal/auth/x509-transport-registry.d.mts.map +1 -0
- package/internal/auth/x509-transport-registry.d.ts +63 -0
- package/internal/auth/x509-transport-registry.d.ts.map +1 -0
- package/internal/auth/x509-transport-registry.js +53 -0
- package/internal/auth/x509-transport-registry.js.map +1 -0
- package/internal/auth/x509-transport-registry.mjs +48 -0
- package/internal/auth/x509-transport-registry.mjs.map +1 -0
- package/internal/auth/x509-transport-state-browser.d.mts +21 -0
- package/internal/auth/x509-transport-state-browser.d.mts.map +1 -0
- package/internal/auth/x509-transport-state-browser.d.ts +21 -0
- package/internal/auth/x509-transport-state-browser.d.ts.map +1 -0
- package/internal/auth/x509-transport-state-browser.js +30 -0
- package/internal/auth/x509-transport-state-browser.js.map +1 -0
- package/internal/auth/x509-transport-state-browser.mjs +27 -0
- package/internal/auth/x509-transport-state-browser.mjs.map +1 -0
- package/internal/auth/x509-transport-state.cjs +30 -0
- package/internal/auth/x509-transport-state.cjs.map +1 -0
- package/internal/auth/x509-transport-state.d.cts +21 -0
- package/internal/auth/x509-transport-state.d.cts.map +1 -0
- package/internal/auth/x509-workload-identity-auth.d.mts +128 -0
- package/internal/auth/x509-workload-identity-auth.d.mts.map +1 -0
- package/internal/auth/x509-workload-identity-auth.d.ts +128 -0
- package/internal/auth/x509-workload-identity-auth.d.ts.map +1 -0
- package/internal/auth/x509-workload-identity-auth.js +767 -0
- package/internal/auth/x509-workload-identity-auth.js.map +1 -0
- package/internal/auth/x509-workload-identity-auth.mjs +757 -0
- package/internal/auth/x509-workload-identity-auth.mjs.map +1 -0
- package/internal/bedrock.d.mts +2 -0
- package/internal/bedrock.d.mts.map +1 -1
- package/internal/bedrock.d.ts +2 -0
- package/internal/bedrock.d.ts.map +1 -1
- package/internal/bedrock.js +169 -5
- package/internal/bedrock.js.map +1 -1
- package/internal/bedrock.mjs +168 -5
- package/internal/bedrock.mjs.map +1 -1
- package/internal/data-residency.d.mts +12 -0
- package/internal/data-residency.d.mts.map +1 -0
- package/internal/data-residency.d.ts +12 -0
- package/internal/data-residency.d.ts.map +1 -0
- package/internal/data-residency.js +34 -0
- package/internal/data-residency.js.map +1 -0
- package/internal/data-residency.mjs +30 -0
- package/internal/data-residency.mjs.map +1 -0
- package/internal/multipart-encoding.d.mts +8 -0
- package/internal/multipart-encoding.d.mts.map +1 -0
- package/internal/multipart-encoding.d.ts +8 -0
- package/internal/multipart-encoding.d.ts.map +1 -0
- package/internal/multipart-encoding.js +51 -0
- package/internal/multipart-encoding.js.map +1 -0
- package/internal/multipart-encoding.mjs +48 -0
- package/internal/multipart-encoding.mjs.map +1 -0
- package/internal/qs/utils.d.mts.map +1 -1
- package/internal/qs/utils.d.ts.map +1 -1
- package/internal/qs/utils.js +307 -10
- package/internal/qs/utils.js.map +1 -1
- package/internal/qs/utils.mjs +307 -10
- package/internal/qs/utils.mjs.map +1 -1
- package/internal/request-options.d.mts +7 -0
- package/internal/request-options.d.mts.map +1 -1
- package/internal/request-options.d.ts +7 -0
- package/internal/request-options.d.ts.map +1 -1
- package/internal/request-options.js +43 -1
- package/internal/request-options.js.map +1 -1
- package/internal/request-options.mjs +42 -1
- package/internal/request-options.mjs.map +1 -1
- package/internal/responses/canonical-output-text.js +3 -3
- package/internal/responses/canonical-output-text.js.map +1 -1
- package/internal/responses/canonical-output-text.mjs +3 -3
- package/internal/responses/canonical-output-text.mjs.map +1 -1
- package/internal/responses/response-accumulator.d.mts +1 -1
- package/internal/responses/response-accumulator.d.mts.map +1 -1
- package/internal/responses/response-accumulator.d.ts +1 -1
- package/internal/responses/response-accumulator.d.ts.map +1 -1
- package/internal/responses/response-accumulator.js +331 -25
- package/internal/responses/response-accumulator.js.map +1 -1
- package/internal/responses/response-accumulator.mjs +331 -25
- package/internal/responses/response-accumulator.mjs.map +1 -1
- package/internal/tslib.js +6 -0
- package/internal/tslib.mjs +6 -1
- package/internal/uploads.d.mts +10 -6
- package/internal/uploads.d.mts.map +1 -1
- package/internal/uploads.d.ts +10 -6
- package/internal/uploads.d.ts.map +1 -1
- package/internal/uploads.js +65 -24
- package/internal/uploads.js.map +1 -1
- package/internal/uploads.mjs +65 -24
- package/internal/uploads.mjs.map +1 -1
- package/internal/utils/env.d.mts.map +1 -1
- package/internal/utils/env.d.ts.map +1 -1
- package/internal/utils/env.js +9 -4
- package/internal/utils/env.js.map +1 -1
- package/internal/utils/env.mjs +9 -4
- package/internal/utils/env.mjs.map +1 -1
- package/internal/ws.d.mts.map +1 -1
- package/internal/ws.d.ts.map +1 -1
- package/internal/ws.js +23 -1
- package/internal/ws.js.map +1 -1
- package/internal/ws.mjs +23 -1
- package/internal/ws.mjs.map +1 -1
- package/lib/AbstractChatCompletionRunner.d.mts.map +1 -1
- package/lib/AbstractChatCompletionRunner.d.ts.map +1 -1
- package/lib/AbstractChatCompletionRunner.js +32 -7
- package/lib/AbstractChatCompletionRunner.js.map +1 -1
- package/lib/AbstractChatCompletionRunner.mjs +34 -9
- package/lib/AbstractChatCompletionRunner.mjs.map +1 -1
- package/lib/AssistantStream.d.mts.map +1 -1
- package/lib/AssistantStream.d.ts.map +1 -1
- package/lib/AssistantStream.js +211 -23
- package/lib/AssistantStream.js.map +1 -1
- package/lib/AssistantStream.mjs +211 -23
- package/lib/AssistantStream.mjs.map +1 -1
- package/lib/ChatCompletionStream.d.mts +1 -1
- package/lib/ChatCompletionStream.d.mts.map +1 -1
- package/lib/ChatCompletionStream.d.ts +1 -1
- package/lib/ChatCompletionStream.d.ts.map +1 -1
- package/lib/ChatCompletionStream.js +1118 -67
- package/lib/ChatCompletionStream.js.map +1 -1
- package/lib/ChatCompletionStream.mjs +1119 -68
- package/lib/ChatCompletionStream.mjs.map +1 -1
- package/lib/EventEmitter.d.mts.map +1 -1
- package/lib/EventEmitter.d.ts.map +1 -1
- package/lib/EventEmitter.js +67 -9
- package/lib/EventEmitter.js.map +1 -1
- package/lib/EventEmitter.mjs +68 -10
- package/lib/EventEmitter.mjs.map +1 -1
- package/lib/EventStream.d.mts +4 -0
- package/lib/EventStream.d.mts.map +1 -1
- package/lib/EventStream.d.ts +4 -0
- package/lib/EventStream.d.ts.map +1 -1
- package/lib/EventStream.js +1096 -11
- package/lib/EventStream.js.map +1 -1
- package/lib/EventStream.mjs +1097 -12
- package/lib/EventStream.mjs.map +1 -1
- package/lib/ResponsesParser.d.mts.map +1 -1
- package/lib/ResponsesParser.d.ts.map +1 -1
- package/lib/ResponsesParser.js +1 -1
- package/lib/ResponsesParser.js.map +1 -1
- package/lib/ResponsesParser.mjs +1 -1
- package/lib/ResponsesParser.mjs.map +1 -1
- package/lib/Util.d.mts +2 -0
- package/lib/Util.d.mts.map +1 -1
- package/lib/Util.d.ts +2 -0
- package/lib/Util.d.ts.map +1 -1
- package/lib/Util.js +7 -4
- package/lib/Util.js.map +1 -1
- package/lib/Util.mjs +7 -4
- package/lib/Util.mjs.map +1 -1
- package/lib/assistant-run-polling.d.mts +12 -0
- package/lib/assistant-run-polling.d.mts.map +1 -0
- package/lib/assistant-run-polling.d.ts +12 -0
- package/lib/assistant-run-polling.d.ts.map +1 -0
- package/lib/assistant-run-polling.js +17 -0
- package/lib/assistant-run-polling.js.map +1 -0
- package/lib/assistant-run-polling.mjs +14 -0
- package/lib/assistant-run-polling.mjs.map +1 -0
- package/lib/embeddings.d.mts +18 -0
- package/lib/embeddings.d.mts.map +1 -0
- package/lib/embeddings.d.ts +18 -0
- package/lib/embeddings.d.ts.map +1 -0
- package/lib/embeddings.js +50 -0
- package/lib/embeddings.js.map +1 -0
- package/lib/embeddings.mjs +47 -0
- package/lib/embeddings.mjs.map +1 -0
- package/lib/file-processing.d.mts +10 -0
- package/lib/file-processing.d.mts.map +1 -0
- package/lib/file-processing.d.ts +10 -0
- package/lib/file-processing.d.ts.map +1 -0
- package/lib/file-processing.js +30 -0
- package/lib/file-processing.js.map +1 -0
- package/lib/file-processing.mjs +27 -0
- package/lib/file-processing.mjs.map +1 -0
- package/lib/parser.d.mts.map +1 -1
- package/lib/parser.d.ts.map +1 -1
- package/lib/parser.js +16 -4
- package/lib/parser.js.map +1 -1
- package/lib/parser.mjs +16 -4
- package/lib/parser.mjs.map +1 -1
- package/lib/polling.d.mts +20 -0
- package/lib/polling.d.mts.map +1 -0
- package/lib/polling.d.ts +20 -0
- package/lib/polling.d.ts.map +1 -0
- package/lib/polling.js +130 -0
- package/lib/polling.js.map +1 -0
- package/lib/polling.mjs +127 -0
- package/lib/polling.mjs.map +1 -0
- package/lib/responses/ResponseStream.d.mts.map +1 -1
- package/lib/responses/ResponseStream.d.ts.map +1 -1
- package/lib/responses/ResponseStream.js +21 -11
- package/lib/responses/ResponseStream.js.map +1 -1
- package/lib/responses/ResponseStream.mjs +21 -11
- package/lib/responses/ResponseStream.mjs.map +1 -1
- package/lib/vector-store-polling.d.mts +22 -0
- package/lib/vector-store-polling.d.mts.map +1 -0
- package/lib/vector-store-polling.d.ts +22 -0
- package/lib/vector-store-polling.d.ts.map +1 -0
- package/lib/vector-store-polling.js +24 -0
- package/lib/vector-store-polling.js.map +1 -0
- package/lib/vector-store-polling.mjs +20 -0
- package/lib/vector-store-polling.mjs.map +1 -0
- package/lib/vector-store-upload.d.mts +17 -0
- package/lib/vector-store-upload.d.mts.map +1 -0
- package/lib/vector-store-upload.d.ts +17 -0
- package/lib/vector-store-upload.d.ts.map +1 -0
- package/lib/vector-store-upload.js +37 -0
- package/lib/vector-store-upload.js.map +1 -0
- package/lib/vector-store-upload.mjs +34 -0
- package/lib/vector-store-upload.mjs.map +1 -0
- package/lib/webhook-signature.d.mts +15 -0
- package/lib/webhook-signature.d.mts.map +1 -0
- package/lib/webhook-signature.d.ts +15 -0
- package/lib/webhook-signature.d.ts.map +1 -0
- package/lib/webhook-signature.js +125 -0
- package/lib/webhook-signature.js.map +1 -0
- package/lib/webhook-signature.mjs +121 -0
- package/lib/webhook-signature.mjs.map +1 -0
- package/package.json +14 -1
- package/realtime/internal-base.d.mts +2 -0
- package/realtime/internal-base.d.mts.map +1 -1
- package/realtime/internal-base.d.ts +2 -0
- package/realtime/internal-base.d.ts.map +1 -1
- package/realtime/internal-base.js +15 -0
- package/realtime/internal-base.js.map +1 -1
- package/realtime/internal-base.mjs +14 -0
- package/realtime/internal-base.mjs.map +1 -1
- package/realtime/websocket.d.mts +3 -2
- package/realtime/websocket.d.mts.map +1 -1
- package/realtime/websocket.d.ts +3 -2
- package/realtime/websocket.d.ts.map +1 -1
- package/realtime/websocket.js +90 -26
- package/realtime/websocket.js.map +1 -1
- package/realtime/websocket.mjs +91 -27
- package/realtime/websocket.mjs.map +1 -1
- package/realtime/ws.d.mts.map +1 -1
- package/realtime/ws.d.ts.map +1 -1
- package/realtime/ws.js +9 -1
- package/realtime/ws.js.map +1 -1
- package/realtime/ws.mjs +10 -2
- package/realtime/ws.mjs.map +1 -1
- package/resources/admin/organization/index.d.mts +2 -2
- package/resources/admin/organization/index.d.mts.map +1 -1
- package/resources/admin/organization/index.d.ts +2 -2
- package/resources/admin/organization/index.d.ts.map +1 -1
- package/resources/admin/organization/index.js.map +1 -1
- package/resources/admin/organization/index.mjs.map +1 -1
- package/resources/admin/organization/organization.d.mts +4 -4
- package/resources/admin/organization/organization.d.mts.map +1 -1
- package/resources/admin/organization/organization.d.ts +4 -4
- package/resources/admin/organization/organization.d.ts.map +1 -1
- package/resources/admin/organization/organization.js.map +1 -1
- package/resources/admin/organization/organization.mjs.map +1 -1
- package/resources/admin/organization/projects/index.d.mts +1 -1
- package/resources/admin/organization/projects/index.d.mts.map +1 -1
- package/resources/admin/organization/projects/index.d.ts +1 -1
- package/resources/admin/organization/projects/index.d.ts.map +1 -1
- package/resources/admin/organization/projects/index.js.map +1 -1
- package/resources/admin/organization/projects/index.mjs.map +1 -1
- package/resources/admin/organization/projects/projects.d.mts +22 -5
- package/resources/admin/organization/projects/projects.d.mts.map +1 -1
- package/resources/admin/organization/projects/projects.d.ts +22 -5
- package/resources/admin/organization/projects/projects.d.ts.map +1 -1
- package/resources/admin/organization/projects/projects.js.map +1 -1
- package/resources/admin/organization/projects/projects.mjs.map +1 -1
- package/resources/admin/organization/usage.d.mts +62 -1
- package/resources/admin/organization/usage.d.mts.map +1 -1
- package/resources/admin/organization/usage.d.ts +62 -1
- package/resources/admin/organization/usage.d.ts.map +1 -1
- package/resources/admin/organization/usage.js.map +1 -1
- package/resources/admin/organization/usage.mjs.map +1 -1
- package/resources/beta/responses/internal-base.d.mts.map +1 -1
- package/resources/beta/responses/internal-base.d.ts.map +1 -1
- package/resources/beta/responses/internal-base.js +2 -0
- package/resources/beta/responses/internal-base.js.map +1 -1
- package/resources/beta/responses/internal-base.mjs +2 -0
- package/resources/beta/responses/internal-base.mjs.map +1 -1
- package/resources/beta/responses/responses.d.mts +9 -12
- package/resources/beta/responses/responses.d.mts.map +1 -1
- package/resources/beta/responses/responses.d.ts +9 -12
- package/resources/beta/responses/responses.d.ts.map +1 -1
- package/resources/beta/responses/responses.js.map +1 -1
- package/resources/beta/responses/responses.mjs.map +1 -1
- package/resources/beta/threads/runs/index.d.mts +1 -1
- package/resources/beta/threads/runs/index.d.mts.map +1 -1
- package/resources/beta/threads/runs/index.d.ts +1 -1
- package/resources/beta/threads/runs/index.d.ts.map +1 -1
- package/resources/beta/threads/runs/runs.d.mts.map +1 -1
- package/resources/beta/threads/runs/runs.d.ts.map +1 -1
- package/resources/beta/threads/runs/runs.js +2 -43
- package/resources/beta/threads/runs/runs.js.map +1 -1
- package/resources/beta/threads/runs/runs.mjs +2 -43
- package/resources/beta/threads/runs/runs.mjs.map +1 -1
- package/resources/chat/completions/completions.d.mts +6 -0
- package/resources/chat/completions/completions.d.mts.map +1 -1
- package/resources/chat/completions/completions.d.ts +6 -0
- package/resources/chat/completions/completions.d.ts.map +1 -1
- package/resources/chat/completions/completions.js.map +1 -1
- package/resources/chat/completions/completions.mjs.map +1 -1
- package/resources/embeddings.d.mts.map +1 -1
- package/resources/embeddings.d.ts.map +1 -1
- package/resources/embeddings.js +2 -36
- package/resources/embeddings.js.map +1 -1
- package/resources/embeddings.mjs +2 -36
- package/resources/embeddings.mjs.map +1 -1
- package/resources/files.d.mts.map +1 -1
- package/resources/files.d.ts.map +1 -1
- package/resources/files.js +2 -15
- package/resources/files.js.map +1 -1
- package/resources/files.mjs +2 -15
- package/resources/files.mjs.map +1 -1
- package/resources/images.d.mts +12 -22
- package/resources/images.d.mts.map +1 -1
- package/resources/images.d.ts +12 -22
- package/resources/images.d.ts.map +1 -1
- package/resources/realtime/calls.d.mts +23 -1
- package/resources/realtime/calls.d.mts.map +1 -1
- package/resources/realtime/calls.d.ts +23 -1
- package/resources/realtime/calls.d.ts.map +1 -1
- package/resources/realtime/calls.js +24 -0
- package/resources/realtime/calls.js.map +1 -1
- package/resources/realtime/calls.mjs +24 -0
- package/resources/realtime/calls.mjs.map +1 -1
- package/resources/realtime/index.d.mts +1 -1
- package/resources/realtime/index.d.mts.map +1 -1
- package/resources/realtime/index.d.ts +1 -1
- package/resources/realtime/index.d.ts.map +1 -1
- package/resources/realtime/index.js.map +1 -1
- package/resources/realtime/index.mjs +1 -1
- package/resources/realtime/index.mjs.map +1 -1
- package/resources/realtime/realtime.d.mts +5 -4
- package/resources/realtime/realtime.d.mts.map +1 -1
- package/resources/realtime/realtime.d.ts +5 -4
- package/resources/realtime/realtime.d.ts.map +1 -1
- package/resources/realtime/realtime.js.map +1 -1
- package/resources/realtime/realtime.mjs.map +1 -1
- package/resources/responses/internal-base.d.mts.map +1 -1
- package/resources/responses/internal-base.d.ts.map +1 -1
- package/resources/responses/internal-base.js +2 -0
- package/resources/responses/internal-base.js.map +1 -1
- package/resources/responses/internal-base.mjs +2 -0
- package/resources/responses/internal-base.mjs.map +1 -1
- package/resources/responses/responses.d.mts +9 -12
- package/resources/responses/responses.d.mts.map +1 -1
- package/resources/responses/responses.d.ts +9 -12
- package/resources/responses/responses.d.ts.map +1 -1
- package/resources/responses/responses.js.map +1 -1
- package/resources/responses/responses.mjs.map +1 -1
- package/resources/vector-stores/file-batches.d.mts.map +1 -1
- package/resources/vector-stores/file-batches.d.ts.map +1 -1
- package/resources/vector-stores/file-batches.js +4 -61
- package/resources/vector-stores/file-batches.js.map +1 -1
- package/resources/vector-stores/file-batches.mjs +4 -61
- package/resources/vector-stores/file-batches.mjs.map +1 -1
- package/resources/vector-stores/files.d.mts +1 -1
- package/resources/vector-stores/files.d.mts.map +1 -1
- package/resources/vector-stores/files.d.ts +1 -1
- package/resources/vector-stores/files.d.ts.map +1 -1
- package/resources/vector-stores/files.js +2 -35
- package/resources/vector-stores/files.js.map +1 -1
- package/resources/vector-stores/files.mjs +2 -35
- package/resources/vector-stores/files.mjs.map +1 -1
- package/resources/webhooks/webhooks.d.mts.map +1 -1
- package/resources/webhooks/webhooks.d.ts.map +1 -1
- package/resources/webhooks/webhooks.js +5 -43
- package/resources/webhooks/webhooks.js.map +1 -1
- package/resources/webhooks/webhooks.mjs +5 -43
- package/resources/webhooks/webhooks.mjs.map +1 -1
- package/src/auth/index.ts +6 -1
- package/src/auth/subject-token-providers.ts +196 -4
- package/src/auth/types.ts +24 -0
- package/src/auth/workload-identity-auth.ts +104 -7
- package/src/auth/x509-transport.ts +49 -0
- package/src/azure.ts +22 -1
- package/src/bedrock.ts +49 -5
- package/src/beta/realtime/internal-base.ts +15 -0
- package/src/beta/realtime/websocket.ts +148 -40
- package/src/beta/realtime/ws.ts +31 -13
- package/src/client.ts +536 -92
- package/src/core/EventEmitter.ts +91 -7
- package/src/core/streaming.ts +71 -20
- package/src/helpers/audio.ts +93 -22
- package/src/helpers/standard-schema.ts +50 -16
- package/src/helpers/zod-v3-strict-schema.ts +514 -0
- package/src/helpers/zod.ts +17 -4
- package/src/index.ts +1 -1
- package/src/internal/assistant-stream-delta.ts +33 -10
- package/src/internal/auth/x509-token-exchange.ts +310 -0
- package/src/internal/auth/x509-transport-capability.ts +219 -0
- package/src/internal/auth/x509-transport-registry.ts +118 -0
- package/src/internal/auth/x509-transport-state-browser.ts +36 -0
- package/src/internal/auth/x509-transport-state.cts +36 -0
- package/src/internal/auth/x509-workload-identity-auth.ts +958 -0
- package/src/internal/bedrock.ts +182 -5
- package/src/internal/data-residency.ts +44 -0
- package/src/internal/multipart-encoding.ts +53 -0
- package/src/internal/qs/utils.ts +375 -13
- package/src/internal/request-options.ts +52 -1
- package/src/internal/responses/canonical-output-text.ts +3 -3
- package/src/internal/responses/response-accumulator.ts +411 -24
- package/src/internal/uploads.ts +81 -26
- package/src/internal/utils/env.ts +9 -5
- package/src/internal/ws.ts +24 -3
- package/src/lib/AbstractChatCompletionRunner.ts +33 -6
- package/src/lib/AssistantStream.ts +262 -22
- package/src/lib/ChatCompletionStream.ts +1467 -103
- package/src/lib/EventEmitter.ts +91 -7
- package/src/lib/EventStream.ts +1483 -10
- package/src/lib/ResponsesParser.ts +4 -1
- package/src/lib/Util.ts +7 -5
- package/src/lib/assistant-run-polling.ts +27 -0
- package/src/lib/embeddings.ts +65 -0
- package/src/lib/file-processing.ts +36 -0
- package/src/lib/parser.ts +19 -4
- package/src/lib/polling.ts +144 -0
- package/src/lib/responses/ResponseStream.ts +22 -10
- package/src/lib/vector-store-polling.ts +46 -0
- package/src/lib/vector-store-upload.ts +53 -0
- package/src/lib/webhook-signature.ts +164 -0
- package/src/realtime/internal-base.ts +15 -0
- package/src/realtime/websocket.ts +130 -27
- package/src/realtime/ws.ts +15 -2
- package/src/resources/admin/organization/index.ts +2 -0
- package/src/resources/admin/organization/organization.ts +4 -0
- package/src/resources/admin/organization/projects/index.ts +1 -0
- package/src/resources/admin/organization/projects/projects.ts +37 -4
- package/src/resources/admin/organization/usage.ts +83 -0
- package/src/resources/beta/responses/internal-base.ts +2 -0
- package/src/resources/beta/responses/responses.ts +9 -12
- package/src/resources/beta/threads/runs/index.ts +1 -1
- package/src/resources/beta/threads/runs/runs.ts +2 -45
- package/src/resources/chat/completions/completions.ts +7 -0
- package/src/resources/embeddings.ts +2 -42
- package/src/resources/files.ts +2 -19
- package/src/resources/images.ts +12 -22
- package/src/resources/realtime/api.md +1 -0
- package/src/resources/realtime/calls.ts +46 -0
- package/src/resources/realtime/index.ts +7 -1
- package/src/resources/realtime/realtime.ts +5 -3
- package/src/resources/responses/internal-base.ts +2 -0
- package/src/resources/responses/responses.ts +9 -12
- package/src/resources/vector-stores/file-batches.ts +8 -77
- package/src/resources/vector-stores/files.ts +3 -43
- package/src/resources/webhooks/webhooks.ts +5 -61
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Castiron. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../../../core/resource';
|
|
4
|
+
import * as UsageAPI from './usage';
|
|
4
5
|
import { APIPromise } from '../../../core/api-promise';
|
|
5
6
|
import { RequestOptions } from '../../../internal/request-options';
|
|
6
7
|
|
|
@@ -233,6 +234,21 @@ export class Usage extends APIResource {
|
|
|
233
234
|
}
|
|
234
235
|
}
|
|
235
236
|
|
|
237
|
+
/**
|
|
238
|
+
* The unit of the `quantity` value. If no single supported unit applies to the
|
|
239
|
+
* result, this field is `null`.
|
|
240
|
+
*/
|
|
241
|
+
export type CostQuantityUnit =
|
|
242
|
+
| (string & {})
|
|
243
|
+
| 'tokens'
|
|
244
|
+
| '1000_tokens'
|
|
245
|
+
| 'duration_seconds'
|
|
246
|
+
| 'duration_minutes'
|
|
247
|
+
| 'duration_hours'
|
|
248
|
+
| 'gibibyte_hours'
|
|
249
|
+
| 'images'
|
|
250
|
+
| 'characters';
|
|
251
|
+
|
|
236
252
|
export interface UsageAudioSpeechesResponse {
|
|
237
253
|
data: Array<UsageAudioSpeechesResponse.Data>;
|
|
238
254
|
|
|
@@ -763,6 +779,12 @@ export namespace UsageAudioSpeechesResponse {
|
|
|
763
779
|
* result.
|
|
764
780
|
*/
|
|
765
781
|
quantity?: number | null;
|
|
782
|
+
|
|
783
|
+
/**
|
|
784
|
+
* The unit of the `quantity` value. If no single supported unit applies to the
|
|
785
|
+
* result, this field is `null`.
|
|
786
|
+
*/
|
|
787
|
+
quantity_unit?: UsageAPI.CostQuantityUnit | null;
|
|
766
788
|
}
|
|
767
789
|
|
|
768
790
|
export namespace OrganizationCostsResult {
|
|
@@ -1314,6 +1336,12 @@ export namespace UsageAudioTranscriptionsResponse {
|
|
|
1314
1336
|
* result.
|
|
1315
1337
|
*/
|
|
1316
1338
|
quantity?: number | null;
|
|
1339
|
+
|
|
1340
|
+
/**
|
|
1341
|
+
* The unit of the `quantity` value. If no single supported unit applies to the
|
|
1342
|
+
* result, this field is `null`.
|
|
1343
|
+
*/
|
|
1344
|
+
quantity_unit?: UsageAPI.CostQuantityUnit | null;
|
|
1317
1345
|
}
|
|
1318
1346
|
|
|
1319
1347
|
export namespace OrganizationCostsResult {
|
|
@@ -1865,6 +1893,12 @@ export namespace UsageCodeInterpreterSessionsResponse {
|
|
|
1865
1893
|
* result.
|
|
1866
1894
|
*/
|
|
1867
1895
|
quantity?: number | null;
|
|
1896
|
+
|
|
1897
|
+
/**
|
|
1898
|
+
* The unit of the `quantity` value. If no single supported unit applies to the
|
|
1899
|
+
* result, this field is `null`.
|
|
1900
|
+
*/
|
|
1901
|
+
quantity_unit?: UsageAPI.CostQuantityUnit | null;
|
|
1868
1902
|
}
|
|
1869
1903
|
|
|
1870
1904
|
export namespace OrganizationCostsResult {
|
|
@@ -2416,6 +2450,12 @@ export namespace UsageCompletionsResponse {
|
|
|
2416
2450
|
* result.
|
|
2417
2451
|
*/
|
|
2418
2452
|
quantity?: number | null;
|
|
2453
|
+
|
|
2454
|
+
/**
|
|
2455
|
+
* The unit of the `quantity` value. If no single supported unit applies to the
|
|
2456
|
+
* result, this field is `null`.
|
|
2457
|
+
*/
|
|
2458
|
+
quantity_unit?: UsageAPI.CostQuantityUnit | null;
|
|
2419
2459
|
}
|
|
2420
2460
|
|
|
2421
2461
|
export namespace OrganizationCostsResult {
|
|
@@ -2967,6 +3007,12 @@ export namespace UsageCostsResponse {
|
|
|
2967
3007
|
* result.
|
|
2968
3008
|
*/
|
|
2969
3009
|
quantity?: number | null;
|
|
3010
|
+
|
|
3011
|
+
/**
|
|
3012
|
+
* The unit of the `quantity` value. If no single supported unit applies to the
|
|
3013
|
+
* result, this field is `null`.
|
|
3014
|
+
*/
|
|
3015
|
+
quantity_unit?: UsageAPI.CostQuantityUnit | null;
|
|
2970
3016
|
}
|
|
2971
3017
|
|
|
2972
3018
|
export namespace OrganizationCostsResult {
|
|
@@ -3518,6 +3564,12 @@ export namespace UsageEmbeddingsResponse {
|
|
|
3518
3564
|
* result.
|
|
3519
3565
|
*/
|
|
3520
3566
|
quantity?: number | null;
|
|
3567
|
+
|
|
3568
|
+
/**
|
|
3569
|
+
* The unit of the `quantity` value. If no single supported unit applies to the
|
|
3570
|
+
* result, this field is `null`.
|
|
3571
|
+
*/
|
|
3572
|
+
quantity_unit?: UsageAPI.CostQuantityUnit | null;
|
|
3521
3573
|
}
|
|
3522
3574
|
|
|
3523
3575
|
export namespace OrganizationCostsResult {
|
|
@@ -4069,6 +4121,12 @@ export namespace UsageFileSearchCallsResponse {
|
|
|
4069
4121
|
* result.
|
|
4070
4122
|
*/
|
|
4071
4123
|
quantity?: number | null;
|
|
4124
|
+
|
|
4125
|
+
/**
|
|
4126
|
+
* The unit of the `quantity` value. If no single supported unit applies to the
|
|
4127
|
+
* result, this field is `null`.
|
|
4128
|
+
*/
|
|
4129
|
+
quantity_unit?: UsageAPI.CostQuantityUnit | null;
|
|
4072
4130
|
}
|
|
4073
4131
|
|
|
4074
4132
|
export namespace OrganizationCostsResult {
|
|
@@ -4620,6 +4678,12 @@ export namespace UsageImagesResponse {
|
|
|
4620
4678
|
* result.
|
|
4621
4679
|
*/
|
|
4622
4680
|
quantity?: number | null;
|
|
4681
|
+
|
|
4682
|
+
/**
|
|
4683
|
+
* The unit of the `quantity` value. If no single supported unit applies to the
|
|
4684
|
+
* result, this field is `null`.
|
|
4685
|
+
*/
|
|
4686
|
+
quantity_unit?: UsageAPI.CostQuantityUnit | null;
|
|
4623
4687
|
}
|
|
4624
4688
|
|
|
4625
4689
|
export namespace OrganizationCostsResult {
|
|
@@ -5171,6 +5235,12 @@ export namespace UsageModerationsResponse {
|
|
|
5171
5235
|
* result.
|
|
5172
5236
|
*/
|
|
5173
5237
|
quantity?: number | null;
|
|
5238
|
+
|
|
5239
|
+
/**
|
|
5240
|
+
* The unit of the `quantity` value. If no single supported unit applies to the
|
|
5241
|
+
* result, this field is `null`.
|
|
5242
|
+
*/
|
|
5243
|
+
quantity_unit?: UsageAPI.CostQuantityUnit | null;
|
|
5174
5244
|
}
|
|
5175
5245
|
|
|
5176
5246
|
export namespace OrganizationCostsResult {
|
|
@@ -5722,6 +5792,12 @@ export namespace UsageVectorStoresResponse {
|
|
|
5722
5792
|
* result.
|
|
5723
5793
|
*/
|
|
5724
5794
|
quantity?: number | null;
|
|
5795
|
+
|
|
5796
|
+
/**
|
|
5797
|
+
* The unit of the `quantity` value. If no single supported unit applies to the
|
|
5798
|
+
* result, this field is `null`.
|
|
5799
|
+
*/
|
|
5800
|
+
quantity_unit?: UsageAPI.CostQuantityUnit | null;
|
|
5725
5801
|
}
|
|
5726
5802
|
|
|
5727
5803
|
export namespace OrganizationCostsResult {
|
|
@@ -6273,6 +6349,12 @@ export namespace UsageWebSearchCallsResponse {
|
|
|
6273
6349
|
* result.
|
|
6274
6350
|
*/
|
|
6275
6351
|
quantity?: number | null;
|
|
6352
|
+
|
|
6353
|
+
/**
|
|
6354
|
+
* The unit of the `quantity` value. If no single supported unit applies to the
|
|
6355
|
+
* result, this field is `null`.
|
|
6356
|
+
*/
|
|
6357
|
+
quantity_unit?: UsageAPI.CostQuantityUnit | null;
|
|
6276
6358
|
}
|
|
6277
6359
|
|
|
6278
6360
|
export namespace OrganizationCostsResult {
|
|
@@ -6929,6 +7011,7 @@ export interface UsageWebSearchCallsParams {
|
|
|
6929
7011
|
|
|
6930
7012
|
export declare namespace Usage {
|
|
6931
7013
|
export {
|
|
7014
|
+
type CostQuantityUnit as CostQuantityUnit,
|
|
6932
7015
|
type UsageAudioSpeechesResponse as UsageAudioSpeechesResponse,
|
|
6933
7016
|
type UsageAudioTranscriptionsResponse as UsageAudioTranscriptionsResponse,
|
|
6934
7017
|
type UsageCodeInterpreterSessionsResponse as UsageCodeInterpreterSessionsResponse,
|
|
@@ -4,6 +4,7 @@ import * as ResponsesAPI from './responses';
|
|
|
4
4
|
import { OpenAI } from '../../../client';
|
|
5
5
|
import { EventEmitter } from '../../../core/EventEmitter';
|
|
6
6
|
import { OpenAIError } from '../../../core/error';
|
|
7
|
+
import { assertX509WebSocketSupported } from '../../../internal/auth/x509-workload-identity-auth';
|
|
7
8
|
|
|
8
9
|
import type { RawWebSocketData, ReconnectingEvent, UnsentMessage } from '../../../internal/ws';
|
|
9
10
|
|
|
@@ -100,6 +101,7 @@ export abstract class ResponsesEmitter extends EventEmitter<WebSocketEvents> {
|
|
|
100
101
|
}
|
|
101
102
|
|
|
102
103
|
export function buildURL(client: OpenAI, parameters: Record<string, unknown>): URL {
|
|
104
|
+
assertX509WebSocketSupported(client);
|
|
103
105
|
const { ...query } = parameters;
|
|
104
106
|
const endpoint = '/responses';
|
|
105
107
|
const url = new URL(client.buildURL(endpoint, query, undefined));
|
|
@@ -12438,18 +12438,13 @@ export namespace BetaTool {
|
|
|
12438
12438
|
action?: 'generate' | 'edit' | 'auto';
|
|
12439
12439
|
|
|
12440
12440
|
/**
|
|
12441
|
-
* Allows to set transparency for the background of the generated image(s).
|
|
12442
|
-
*
|
|
12443
|
-
*
|
|
12444
|
-
* When `auto` is used, the model will automatically determine the best background
|
|
12445
|
-
* for the image.
|
|
12441
|
+
* Allows to set transparency for the background of the generated image(s). Must be
|
|
12442
|
+
* one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used,
|
|
12443
|
+
* the model will automatically determine the best background for the image.
|
|
12446
12444
|
*
|
|
12447
|
-
*
|
|
12448
|
-
*
|
|
12449
|
-
*
|
|
12450
|
-
*
|
|
12451
|
-
* If `transparent`, the output format needs to support transparency, so it should
|
|
12452
|
-
* be set to either `png` (default value) or `webp`.
|
|
12445
|
+
* Transparent backgrounds are available for supported GPT Image models. For
|
|
12446
|
+
* `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in preview. When
|
|
12447
|
+
* using `transparent`, set the output format to `png` or `webp`.
|
|
12453
12448
|
*/
|
|
12454
12449
|
background?: 'transparent' | 'opaque' | 'auto';
|
|
12455
12450
|
|
|
@@ -12468,7 +12463,9 @@ export namespace BetaTool {
|
|
|
12468
12463
|
input_image_mask?: ImageGeneration.InputImageMask;
|
|
12469
12464
|
|
|
12470
12465
|
/**
|
|
12471
|
-
* The image generation model to use.
|
|
12466
|
+
* The image generation model to use. One of `gpt-image-1`, `gpt-image-1-mini`,
|
|
12467
|
+
* `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, or
|
|
12468
|
+
* `chatgpt-image-latest`. Default: `gpt-image-1`.
|
|
12472
12469
|
*/
|
|
12473
12470
|
model?:
|
|
12474
12471
|
| (string & {})
|
|
@@ -34,10 +34,10 @@ export {
|
|
|
34
34
|
type FunctionToolCallDelta,
|
|
35
35
|
type MessageCreationStepDetails,
|
|
36
36
|
type RunStep,
|
|
37
|
-
type RunStepInclude,
|
|
38
37
|
type RunStepDelta,
|
|
39
38
|
type RunStepDeltaEvent,
|
|
40
39
|
type RunStepDeltaMessageDelta,
|
|
40
|
+
type RunStepInclude,
|
|
41
41
|
type ToolCall,
|
|
42
42
|
type ToolCallDelta,
|
|
43
43
|
type ToolCallDeltaObject,
|
|
@@ -37,7 +37,7 @@ import { Stream } from '../../../../core/streaming';
|
|
|
37
37
|
import { buildHeaders } from '../../../../internal/headers';
|
|
38
38
|
import { RequestOptions } from '../../../../internal/request-options';
|
|
39
39
|
import { AssistantStream, RunCreateParamsBaseStream } from '../../../../lib/AssistantStream';
|
|
40
|
-
import {
|
|
40
|
+
import { pollAssistantRun } from '../../../../lib/assistant-run-polling';
|
|
41
41
|
import { RunSubmitToolOutputsParamsStream } from '../../../../lib/AssistantStream';
|
|
42
42
|
import { path } from '../../../../internal/utils/path';
|
|
43
43
|
|
|
@@ -180,50 +180,7 @@ export class Runs extends APIResource {
|
|
|
180
180
|
params: RunRetrieveParams,
|
|
181
181
|
options?: RequestOptions & { pollIntervalMs?: number },
|
|
182
182
|
): Promise<Run> {
|
|
183
|
-
|
|
184
|
-
options?.headers,
|
|
185
|
-
{
|
|
186
|
-
'X-Stainless-Poll-Helper': 'true',
|
|
187
|
-
'X-Stainless-Custom-Poll-Interval': options?.pollIntervalMs?.toString() ?? undefined,
|
|
188
|
-
},
|
|
189
|
-
]);
|
|
190
|
-
|
|
191
|
-
while (true) {
|
|
192
|
-
const { data: run, response } = await this.retrieve(runId, params, {
|
|
193
|
-
...options,
|
|
194
|
-
headers: { ...options?.headers, ...headers },
|
|
195
|
-
}).withResponse();
|
|
196
|
-
|
|
197
|
-
switch (run.status) {
|
|
198
|
-
//If we are in any sort of intermediate state we poll
|
|
199
|
-
case 'queued':
|
|
200
|
-
case 'in_progress':
|
|
201
|
-
case 'cancelling':
|
|
202
|
-
let sleepInterval = 5000;
|
|
203
|
-
|
|
204
|
-
if (options?.pollIntervalMs) {
|
|
205
|
-
sleepInterval = options.pollIntervalMs;
|
|
206
|
-
} else {
|
|
207
|
-
const headerInterval = response.headers.get('openai-poll-after-ms');
|
|
208
|
-
if (headerInterval) {
|
|
209
|
-
const headerIntervalMs = parseInt(headerInterval);
|
|
210
|
-
if (!isNaN(headerIntervalMs)) {
|
|
211
|
-
sleepInterval = headerIntervalMs;
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
await sleep(sleepInterval);
|
|
216
|
-
break;
|
|
217
|
-
//We return the run in any terminal state.
|
|
218
|
-
case 'requires_action':
|
|
219
|
-
case 'incomplete':
|
|
220
|
-
case 'cancelled':
|
|
221
|
-
case 'completed':
|
|
222
|
-
case 'failed':
|
|
223
|
-
case 'expired':
|
|
224
|
-
return run;
|
|
225
|
-
}
|
|
226
|
-
}
|
|
183
|
+
return await pollAssistantRun(this, runId, params, options);
|
|
227
184
|
}
|
|
228
185
|
|
|
229
186
|
/**
|
|
@@ -842,6 +842,13 @@ export interface ChatCompletionChunk {
|
|
|
842
842
|
*/
|
|
843
843
|
moderation?: ChatCompletionChunk.Moderation | null;
|
|
844
844
|
|
|
845
|
+
/**
|
|
846
|
+
* An obfuscation string added to normalize the size of streamed chunks as a
|
|
847
|
+
* mitigation to certain side-channel attacks. The field is included by default and
|
|
848
|
+
* omitted when `stream_options.include_obfuscation` is `false`.
|
|
849
|
+
*/
|
|
850
|
+
obfuscation?: string;
|
|
851
|
+
|
|
845
852
|
/**
|
|
846
853
|
* Specifies the processing type used for serving the request.
|
|
847
854
|
*
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { APIResource } from '../core/resource';
|
|
4
4
|
import { APIPromise } from '../core/api-promise';
|
|
5
5
|
import { RequestOptions } from '../internal/request-options';
|
|
6
|
-
import {
|
|
6
|
+
import { createEmbedding } from '../lib/embeddings';
|
|
7
7
|
|
|
8
8
|
type Base64EmbeddingResponse = Omit<CreateEmbeddingResponse, 'data'> & {
|
|
9
9
|
data: Array<Omit<Embedding, 'embedding'> & { embedding: string }>;
|
|
@@ -34,47 +34,7 @@ export class Embeddings extends APIResource {
|
|
|
34
34
|
body: EmbeddingCreateParams,
|
|
35
35
|
options?: RequestOptions,
|
|
36
36
|
): APIPromise<CreateEmbeddingResponse | Base64EmbeddingResponse> {
|
|
37
|
-
|
|
38
|
-
// No encoding_format specified, defaulting to base64 for performance reasons
|
|
39
|
-
// See https://github.com/openai/openai-node/pull/1312
|
|
40
|
-
let encoding_format: EmbeddingCreateParams['encoding_format'] = hasUserProvidedEncodingFormat
|
|
41
|
-
? body.encoding_format
|
|
42
|
-
: 'base64';
|
|
43
|
-
|
|
44
|
-
if (hasUserProvidedEncodingFormat) {
|
|
45
|
-
loggerFor(this._client).debug('embeddings/user defined encoding_format:', body.encoding_format);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
const response: APIPromise<CreateEmbeddingResponse> = this._client.post('/embeddings', {
|
|
49
|
-
body: {
|
|
50
|
-
...body,
|
|
51
|
-
encoding_format: encoding_format as EmbeddingCreateParams['encoding_format'],
|
|
52
|
-
},
|
|
53
|
-
...options,
|
|
54
|
-
__security: { bearerAuth: true },
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
// if the user specified an encoding_format, return the response as-is
|
|
58
|
-
if (hasUserProvidedEncodingFormat) {
|
|
59
|
-
return response;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
// in this stage, we are sure the user did not specify an encoding_format
|
|
63
|
-
// and we defaulted to base64 for performance reasons
|
|
64
|
-
// we are sure then that the response is base64 encoded, let's decode it
|
|
65
|
-
// the returned result will be a float32 array since this is OpenAI API's default encoding
|
|
66
|
-
loggerFor(this._client).debug('embeddings/decoding base64 embeddings from base64');
|
|
67
|
-
|
|
68
|
-
return (response as APIPromise<CreateEmbeddingResponse>)._thenUnwrap((response) => {
|
|
69
|
-
if (response && response.data) {
|
|
70
|
-
response.data.forEach((embeddingBase64Obj) => {
|
|
71
|
-
const embeddingBase64Str = embeddingBase64Obj.embedding as unknown as string;
|
|
72
|
-
embeddingBase64Obj.embedding = toFloat32Array(embeddingBase64Str);
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
return response;
|
|
77
|
-
});
|
|
37
|
+
return createEmbedding(this._client, body, options);
|
|
78
38
|
}
|
|
79
39
|
}
|
|
80
40
|
|
package/src/resources/files.ts
CHANGED
|
@@ -6,9 +6,8 @@ import { CursorPage, type CursorPageParams, PagePromise } from '../core/paginati
|
|
|
6
6
|
import { type Uploadable } from '../core/uploads';
|
|
7
7
|
import { buildHeaders } from '../internal/headers';
|
|
8
8
|
import { RequestOptions } from '../internal/request-options';
|
|
9
|
-
import { sleep } from '../internal/utils/sleep';
|
|
10
|
-
import { APIConnectionTimeoutError } from '../error';
|
|
11
9
|
import { multipartFormRequestOptions } from '../internal/uploads';
|
|
10
|
+
import { waitForFileProcessing } from '../lib/file-processing';
|
|
12
11
|
import { path } from '../internal/utils/path';
|
|
13
12
|
|
|
14
13
|
/**
|
|
@@ -98,23 +97,7 @@ export class Files extends APIResource {
|
|
|
98
97
|
id: string,
|
|
99
98
|
{ pollInterval = 5000, maxWait = 30 * 60 * 1000 }: { pollInterval?: number; maxWait?: number } = {},
|
|
100
99
|
): Promise<FileObject> {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
const start = Date.now();
|
|
104
|
-
let file = await this.retrieve(id);
|
|
105
|
-
|
|
106
|
-
while (!file.status || !TERMINAL_STATES.has(file.status)) {
|
|
107
|
-
await sleep(pollInterval);
|
|
108
|
-
|
|
109
|
-
file = await this.retrieve(id);
|
|
110
|
-
if (Date.now() - start > maxWait) {
|
|
111
|
-
throw new APIConnectionTimeoutError({
|
|
112
|
-
message: `Giving up on waiting for file ${id} to finish processing after ${maxWait} milliseconds.`,
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
return file;
|
|
100
|
+
return await waitForFileProcessing(this, id, pollInterval, maxWait);
|
|
118
101
|
}
|
|
119
102
|
}
|
|
120
103
|
|
package/src/resources/images.ts
CHANGED
|
@@ -584,18 +584,13 @@ export interface ImageEditParamsBase {
|
|
|
584
584
|
prompt: string;
|
|
585
585
|
|
|
586
586
|
/**
|
|
587
|
-
* Allows to set transparency for the background of the generated image(s).
|
|
588
|
-
*
|
|
589
|
-
*
|
|
590
|
-
* When `auto` is used, the model will automatically determine the best background
|
|
591
|
-
* for the image.
|
|
587
|
+
* Allows to set transparency for the background of the generated image(s). Must be
|
|
588
|
+
* one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used,
|
|
589
|
+
* the model will automatically determine the best background for the image.
|
|
592
590
|
*
|
|
593
|
-
*
|
|
594
|
-
*
|
|
595
|
-
*
|
|
596
|
-
*
|
|
597
|
-
* If `transparent`, the output format needs to support transparency, so it should
|
|
598
|
-
* be set to either `png` (default value) or `webp`.
|
|
591
|
+
* Transparent backgrounds are available for supported GPT Image models. For
|
|
592
|
+
* `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in preview. When
|
|
593
|
+
* using `transparent`, set the output format to `png` or `webp`.
|
|
599
594
|
*/
|
|
600
595
|
background?: 'transparent' | 'opaque' | 'auto' | null;
|
|
601
596
|
|
|
@@ -730,18 +725,13 @@ export interface ImageGenerateParamsBase {
|
|
|
730
725
|
prompt: string;
|
|
731
726
|
|
|
732
727
|
/**
|
|
733
|
-
* Allows to set transparency for the background of the generated image(s).
|
|
734
|
-
*
|
|
735
|
-
*
|
|
736
|
-
* When `auto` is used, the model will automatically determine the best background
|
|
737
|
-
* for the image.
|
|
738
|
-
*
|
|
739
|
-
* `gpt-image-2` and `gpt-image-2-2026-04-21` do not support transparent
|
|
740
|
-
* backgrounds. Requests with `background` set to `transparent` will return an
|
|
741
|
-
* error for these models; use `opaque` or `auto` instead.
|
|
728
|
+
* Allows to set transparency for the background of the generated image(s). Must be
|
|
729
|
+
* one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used,
|
|
730
|
+
* the model will automatically determine the best background for the image.
|
|
742
731
|
*
|
|
743
|
-
*
|
|
744
|
-
*
|
|
732
|
+
* Transparent backgrounds are available for supported GPT Image models. For
|
|
733
|
+
* `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in preview. When
|
|
734
|
+
* using `transparent`, set the output format to `png` or `webp`.
|
|
745
735
|
*/
|
|
746
736
|
background?: 'transparent' | 'opaque' | 'auto' | null;
|
|
747
737
|
|
|
@@ -139,6 +139,7 @@ Methods:
|
|
|
139
139
|
|
|
140
140
|
Methods:
|
|
141
141
|
|
|
142
|
+
- <code title="post /realtime/calls">client.realtime.calls.<a href="./src/resources/realtime/calls.ts">create</a>({ ...params }) -> Response</code>
|
|
142
143
|
- <code title="post /realtime/calls/{call_id}/accept">client.realtime.calls.<a href="./src/resources/realtime/calls.ts">accept</a>(callID, { ...params }) -> void</code>
|
|
143
144
|
- <code title="post /realtime/calls/{call_id}/hangup">client.realtime.calls.<a href="./src/resources/realtime/calls.ts">hangup</a>(callID) -> void</code>
|
|
144
145
|
- <code title="post /realtime/calls/{call_id}/refer">client.realtime.calls.<a href="./src/resources/realtime/calls.ts">refer</a>(callID, { ...params }) -> void</code>
|
|
@@ -7,8 +7,41 @@ import { APIPromise } from '../../core/api-promise';
|
|
|
7
7
|
import { buildHeaders } from '../../internal/headers';
|
|
8
8
|
import { RequestOptions } from '../../internal/request-options';
|
|
9
9
|
import { path } from '../../internal/utils/path';
|
|
10
|
+
import { encodedMultipartFormRequestOptions } from '../../internal/multipart-encoding';
|
|
10
11
|
|
|
11
12
|
export class Calls extends APIResource {
|
|
13
|
+
/**
|
|
14
|
+
* Create a new Realtime API call over WebRTC and receive the SDP answer needed to
|
|
15
|
+
* complete the peer connection.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* await client.realtime.calls.create({
|
|
20
|
+
* sdp: 'sdp',
|
|
21
|
+
* });
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
create(body: CallCreateParams, options?: RequestOptions): APIPromise<Response> {
|
|
25
|
+
return this._client.post(
|
|
26
|
+
'/realtime/calls',
|
|
27
|
+
encodedMultipartFormRequestOptions(
|
|
28
|
+
{
|
|
29
|
+
body,
|
|
30
|
+
...options,
|
|
31
|
+
headers: buildHeaders([{ Accept: 'application/sdp' }, options?.headers]),
|
|
32
|
+
__security: { bearerAuth: true },
|
|
33
|
+
__binaryResponse: true,
|
|
34
|
+
},
|
|
35
|
+
this._client,
|
|
36
|
+
{
|
|
37
|
+
sdp: { content_type: 'application/sdp', json: false },
|
|
38
|
+
session: { content_type: 'application/json', json: true },
|
|
39
|
+
},
|
|
40
|
+
'sdp',
|
|
41
|
+
),
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
12
45
|
/**
|
|
13
46
|
* Accept an incoming SIP call and configure the realtime session that will handle
|
|
14
47
|
* it.
|
|
@@ -86,6 +119,18 @@ export class Calls extends APIResource {
|
|
|
86
119
|
}
|
|
87
120
|
}
|
|
88
121
|
|
|
122
|
+
export interface CallCreateParams {
|
|
123
|
+
/**
|
|
124
|
+
* WebRTC Session Description Protocol (SDP) offer generated by the caller.
|
|
125
|
+
*/
|
|
126
|
+
sdp: string;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Realtime session object configuration.
|
|
130
|
+
*/
|
|
131
|
+
session?: RealtimeAPI.RealtimeSessionCreateRequest;
|
|
132
|
+
}
|
|
133
|
+
|
|
89
134
|
export interface CallAcceptParams {
|
|
90
135
|
/**
|
|
91
136
|
* The type of session to create. Always `realtime` for the Realtime API.
|
|
@@ -240,6 +285,7 @@ export interface CallRejectParams {
|
|
|
240
285
|
|
|
241
286
|
export declare namespace Calls {
|
|
242
287
|
export {
|
|
288
|
+
type CallCreateParams as CallCreateParams,
|
|
243
289
|
type CallAcceptParams as CallAcceptParams,
|
|
244
290
|
type CallReferParams as CallReferParams,
|
|
245
291
|
type CallRejectParams as CallRejectParams,
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Castiron. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
export {
|
|
3
|
+
export {
|
|
4
|
+
Calls,
|
|
5
|
+
type CallCreateParams,
|
|
6
|
+
type CallAcceptParams,
|
|
7
|
+
type CallReferParams,
|
|
8
|
+
type CallRejectParams,
|
|
9
|
+
} from './calls';
|
|
4
10
|
export {
|
|
5
11
|
ClientSecrets,
|
|
6
12
|
type RealtimeSessionCreateResponse,
|
|
@@ -5,7 +5,7 @@ import * as RealtimeAPI from './realtime';
|
|
|
5
5
|
import * as Shared from '../shared';
|
|
6
6
|
import * as TranscriptionsAPI from '../audio/transcriptions';
|
|
7
7
|
import * as CallsAPI from './calls';
|
|
8
|
-
import { CallAcceptParams, CallReferParams, CallRejectParams, Calls } from './calls';
|
|
8
|
+
import { CallAcceptParams, CallCreateParams, CallReferParams, CallRejectParams, Calls } from './calls';
|
|
9
9
|
import * as ClientSecretsAPI from './client-secrets';
|
|
10
10
|
import {
|
|
11
11
|
ClientSecretCreateParams,
|
|
@@ -3850,8 +3850,9 @@ export interface RealtimeTranslationInputTranscriptDeltaEvent {
|
|
|
3850
3850
|
}
|
|
3851
3851
|
|
|
3852
3852
|
/**
|
|
3853
|
-
* Returned when translated output audio is available.
|
|
3854
|
-
*
|
|
3853
|
+
* Returned when translated output audio is available. The `delta` contains a PCM16
|
|
3854
|
+
* audio chunk whose length can vary. Clients should decode and queue the complete
|
|
3855
|
+
* delta instead of assuming a fixed byte or sample count.
|
|
3855
3856
|
*/
|
|
3856
3857
|
export interface RealtimeTranslationOutputAudioDeltaEvent {
|
|
3857
3858
|
/**
|
|
@@ -5569,6 +5570,7 @@ export declare namespace Realtime {
|
|
|
5569
5570
|
|
|
5570
5571
|
export {
|
|
5571
5572
|
Calls as Calls,
|
|
5573
|
+
type CallCreateParams as CallCreateParams,
|
|
5572
5574
|
type CallAcceptParams as CallAcceptParams,
|
|
5573
5575
|
type CallReferParams as CallReferParams,
|
|
5574
5576
|
type CallRejectParams as CallRejectParams,
|
|
@@ -4,6 +4,7 @@ import * as ResponsesAPI from './responses';
|
|
|
4
4
|
import { OpenAI } from '../../client';
|
|
5
5
|
import { EventEmitter } from '../../core/EventEmitter';
|
|
6
6
|
import { OpenAIError } from '../../core/error';
|
|
7
|
+
import { assertX509WebSocketSupported } from '../../internal/auth/x509-workload-identity-auth';
|
|
7
8
|
|
|
8
9
|
import type { RawWebSocketData, ReconnectingEvent, UnsentMessage } from '../../internal/ws';
|
|
9
10
|
|
|
@@ -96,6 +97,7 @@ export abstract class ResponsesEmitter extends EventEmitter<WebSocketEvents> {
|
|
|
96
97
|
}
|
|
97
98
|
|
|
98
99
|
export function buildURL(client: OpenAI, parameters: Record<string, unknown>): URL {
|
|
100
|
+
assertX509WebSocketSupported(client);
|
|
99
101
|
const { ...query } = parameters;
|
|
100
102
|
const endpoint = '/responses';
|
|
101
103
|
const url = new URL(client.buildURL(endpoint, query, undefined));
|
|
@@ -9336,18 +9336,13 @@ export namespace Tool {
|
|
|
9336
9336
|
action?: 'generate' | 'edit' | 'auto';
|
|
9337
9337
|
|
|
9338
9338
|
/**
|
|
9339
|
-
* Allows to set transparency for the background of the generated image(s).
|
|
9340
|
-
*
|
|
9341
|
-
*
|
|
9342
|
-
* When `auto` is used, the model will automatically determine the best background
|
|
9343
|
-
* for the image.
|
|
9339
|
+
* Allows to set transparency for the background of the generated image(s). Must be
|
|
9340
|
+
* one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used,
|
|
9341
|
+
* the model will automatically determine the best background for the image.
|
|
9344
9342
|
*
|
|
9345
|
-
*
|
|
9346
|
-
*
|
|
9347
|
-
*
|
|
9348
|
-
*
|
|
9349
|
-
* If `transparent`, the output format needs to support transparency, so it should
|
|
9350
|
-
* be set to either `png` (default value) or `webp`.
|
|
9343
|
+
* Transparent backgrounds are available for supported GPT Image models. For
|
|
9344
|
+
* `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in preview. When
|
|
9345
|
+
* using `transparent`, set the output format to `png` or `webp`.
|
|
9351
9346
|
*/
|
|
9352
9347
|
background?: 'transparent' | 'opaque' | 'auto';
|
|
9353
9348
|
|
|
@@ -9366,7 +9361,9 @@ export namespace Tool {
|
|
|
9366
9361
|
input_image_mask?: ImageGeneration.InputImageMask;
|
|
9367
9362
|
|
|
9368
9363
|
/**
|
|
9369
|
-
* The image generation model to use.
|
|
9364
|
+
* The image generation model to use. One of `gpt-image-1`, `gpt-image-1-mini`,
|
|
9365
|
+
* `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, or
|
|
9366
|
+
* `chatgpt-image-latest`. Default: `gpt-image-1`.
|
|
9370
9367
|
*/
|
|
9371
9368
|
model?:
|
|
9372
9369
|
| (string & {})
|