openai 6.44.0 → 6.46.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 +70 -0
- package/README.md +85 -102
- package/_vendor/zod-to-json-schema/parseDef.d.mts.map +1 -1
- package/_vendor/zod-to-json-schema/parseDef.d.ts.map +1 -1
- package/_vendor/zod-to-json-schema/parseDef.js +41 -15
- package/_vendor/zod-to-json-schema/parseDef.js.map +1 -1
- package/_vendor/zod-to-json-schema/parseDef.mjs +41 -15
- package/_vendor/zod-to-json-schema/parseDef.mjs.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/branded.d.mts +1 -1
- package/_vendor/zod-to-json-schema/parsers/branded.d.mts.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/branded.d.ts +1 -1
- package/_vendor/zod-to-json-schema/parsers/branded.d.ts.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/branded.js +2 -2
- package/_vendor/zod-to-json-schema/parsers/branded.js.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/branded.mjs +2 -2
- package/_vendor/zod-to-json-schema/parsers/branded.mjs.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/catch.d.mts +1 -1
- package/_vendor/zod-to-json-schema/parsers/catch.d.mts.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/catch.d.ts +1 -1
- package/_vendor/zod-to-json-schema/parsers/catch.d.ts.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/catch.js +2 -2
- package/_vendor/zod-to-json-schema/parsers/catch.js.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/catch.mjs +2 -2
- package/_vendor/zod-to-json-schema/parsers/catch.mjs.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/default.d.mts +1 -1
- package/_vendor/zod-to-json-schema/parsers/default.d.mts.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/default.d.ts +1 -1
- package/_vendor/zod-to-json-schema/parsers/default.d.ts.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/default.js +2 -2
- package/_vendor/zod-to-json-schema/parsers/default.js.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/default.mjs +2 -2
- package/_vendor/zod-to-json-schema/parsers/default.mjs.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/nullable.d.mts +1 -1
- package/_vendor/zod-to-json-schema/parsers/nullable.d.mts.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/nullable.d.ts +1 -1
- package/_vendor/zod-to-json-schema/parsers/nullable.d.ts.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/nullable.js +2 -2
- package/_vendor/zod-to-json-schema/parsers/nullable.js.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/nullable.mjs +2 -2
- package/_vendor/zod-to-json-schema/parsers/nullable.mjs.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/optional.d.mts +1 -1
- package/_vendor/zod-to-json-schema/parsers/optional.d.mts.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/optional.d.ts +1 -1
- package/_vendor/zod-to-json-schema/parsers/optional.d.ts.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/optional.js +3 -3
- package/_vendor/zod-to-json-schema/parsers/optional.js.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/optional.mjs +3 -3
- package/_vendor/zod-to-json-schema/parsers/optional.mjs.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/pipeline.d.mts +1 -1
- package/_vendor/zod-to-json-schema/parsers/pipeline.d.mts.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/pipeline.d.ts +1 -1
- package/_vendor/zod-to-json-schema/parsers/pipeline.d.ts.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/pipeline.js +3 -3
- package/_vendor/zod-to-json-schema/parsers/pipeline.js.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/pipeline.mjs +3 -3
- package/_vendor/zod-to-json-schema/parsers/pipeline.mjs.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/promise.d.mts +1 -1
- package/_vendor/zod-to-json-schema/parsers/promise.d.mts.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/promise.d.ts +1 -1
- package/_vendor/zod-to-json-schema/parsers/promise.d.ts.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/promise.js +2 -2
- package/_vendor/zod-to-json-schema/parsers/promise.js.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/promise.mjs +2 -2
- package/_vendor/zod-to-json-schema/parsers/promise.mjs.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/readonly.d.mts +1 -1
- package/_vendor/zod-to-json-schema/parsers/readonly.d.mts.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/readonly.d.ts +1 -1
- package/_vendor/zod-to-json-schema/parsers/readonly.d.ts.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/readonly.js +2 -2
- package/_vendor/zod-to-json-schema/parsers/readonly.js.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/readonly.mjs +2 -2
- package/_vendor/zod-to-json-schema/parsers/readonly.mjs.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 +12 -4
- package/auth/workload-identity-auth.js.map +1 -1
- package/auth/workload-identity-auth.mjs +13 -5
- package/auth/workload-identity-auth.mjs.map +1 -1
- package/azure.d.mts +3 -1
- package/azure.d.mts.map +1 -1
- package/azure.d.ts +3 -1
- package/azure.d.ts.map +1 -1
- package/azure.js.map +1 -1
- package/azure.mjs.map +1 -1
- package/beta/realtime/internal-base.d.mts +14 -1
- package/beta/realtime/internal-base.d.mts.map +1 -1
- package/beta/realtime/internal-base.d.ts +14 -1
- package/beta/realtime/internal-base.d.ts.map +1 -1
- package/beta/realtime/internal-base.js +21 -5
- package/beta/realtime/internal-base.js.map +1 -1
- package/beta/realtime/internal-base.mjs +21 -5
- package/beta/realtime/internal-base.mjs.map +1 -1
- package/beta/realtime/websocket.d.mts +3 -5
- package/beta/realtime/websocket.d.mts.map +1 -1
- package/beta/realtime/websocket.d.ts +3 -5
- package/beta/realtime/websocket.d.ts.map +1 -1
- package/beta/realtime/websocket.js +2 -3
- package/beta/realtime/websocket.js.map +1 -1
- package/beta/realtime/websocket.mjs +3 -4
- package/beta/realtime/websocket.mjs.map +1 -1
- package/beta/realtime/ws.d.mts +3 -5
- package/beta/realtime/ws.d.mts.map +1 -1
- package/beta/realtime/ws.d.ts +3 -5
- package/beta/realtime/ws.d.ts.map +1 -1
- package/beta/realtime/ws.js +2 -3
- package/beta/realtime/ws.js.map +1 -1
- package/beta/realtime/ws.mjs +3 -4
- package/beta/realtime/ws.mjs.map +1 -1
- package/client.d.mts +9 -1
- package/client.d.mts.map +1 -1
- package/client.d.ts +9 -1
- package/client.d.ts.map +1 -1
- package/client.js +56 -9
- package/client.js.map +1 -1
- package/client.mjs +56 -9
- package/client.mjs.map +1 -1
- package/helpers/audio.d.mts.map +1 -1
- package/helpers/audio.d.ts.map +1 -1
- package/helpers/audio.js +16 -3
- package/helpers/audio.js.map +1 -1
- package/helpers/audio.mjs +17 -4
- package/helpers/audio.mjs.map +1 -1
- package/helpers/zod.d.mts.map +1 -1
- package/helpers/zod.d.ts.map +1 -1
- package/helpers/zod.js +12 -0
- package/helpers/zod.js.map +1 -1
- package/helpers/zod.mjs +12 -0
- package/helpers/zod.mjs.map +1 -1
- package/internal/bedrock.d.mts +34 -0
- package/internal/bedrock.d.mts.map +1 -0
- package/internal/bedrock.d.ts +34 -0
- package/internal/bedrock.d.ts.map +1 -0
- package/internal/bedrock.js +107 -0
- package/internal/bedrock.js.map +1 -0
- package/internal/bedrock.mjs +99 -0
- package/internal/bedrock.mjs.map +1 -0
- package/internal/provider.d.mts +23 -0
- package/internal/provider.d.mts.map +1 -0
- package/internal/provider.d.ts +23 -0
- package/internal/provider.d.ts.map +1 -0
- package/internal/provider.js +36 -0
- package/internal/provider.js.map +1 -0
- package/internal/provider.mjs +32 -0
- package/internal/provider.mjs.map +1 -0
- package/internal/utils/log.d.mts.map +1 -1
- package/internal/utils/log.d.ts.map +1 -1
- package/internal/utils/log.js +1 -0
- package/internal/utils/log.js.map +1 -1
- package/internal/utils/log.mjs +1 -0
- package/internal/utils/log.mjs.map +1 -1
- package/lib/AbstractChatCompletionRunner.d.mts +15 -4
- package/lib/AbstractChatCompletionRunner.d.mts.map +1 -1
- package/lib/AbstractChatCompletionRunner.d.ts +15 -4
- package/lib/AbstractChatCompletionRunner.d.ts.map +1 -1
- package/lib/AbstractChatCompletionRunner.js +77 -40
- package/lib/AbstractChatCompletionRunner.js.map +1 -1
- package/lib/AbstractChatCompletionRunner.mjs +77 -40
- 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 +5 -25
- package/lib/AssistantStream.js.map +1 -1
- package/lib/AssistantStream.mjs +5 -25
- package/lib/AssistantStream.mjs.map +1 -1
- package/lib/ChatCompletionRunner.js +1 -1
- package/lib/ChatCompletionRunner.js.map +1 -1
- package/lib/ChatCompletionRunner.mjs +1 -1
- package/lib/ChatCompletionRunner.mjs.map +1 -1
- package/lib/ChatCompletionStream.d.mts.map +1 -1
- package/lib/ChatCompletionStream.d.ts.map +1 -1
- package/lib/ChatCompletionStream.js +11 -17
- package/lib/ChatCompletionStream.js.map +1 -1
- package/lib/ChatCompletionStream.mjs +11 -17
- package/lib/ChatCompletionStream.mjs.map +1 -1
- package/lib/ChatCompletionStreamingRunner.js +1 -1
- package/lib/ChatCompletionStreamingRunner.js.map +1 -1
- package/lib/ChatCompletionStreamingRunner.mjs +1 -1
- package/lib/ChatCompletionStreamingRunner.mjs.map +1 -1
- package/lib/EventEmitter.d.mts.map +1 -1
- package/lib/EventEmitter.d.ts.map +1 -1
- package/lib/EventEmitter.js +12 -2
- package/lib/EventEmitter.js.map +1 -1
- package/lib/EventEmitter.mjs +12 -2
- package/lib/EventEmitter.mjs.map +1 -1
- package/lib/EventStream.d.mts +1 -0
- package/lib/EventStream.d.mts.map +1 -1
- package/lib/EventStream.d.ts +1 -0
- package/lib/EventStream.d.ts.map +1 -1
- package/lib/EventStream.js +19 -2
- package/lib/EventStream.js.map +1 -1
- package/lib/EventStream.mjs +19 -2
- 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 +12 -4
- package/lib/ResponsesParser.js.map +1 -1
- package/lib/ResponsesParser.mjs +12 -4
- package/lib/ResponsesParser.mjs.map +1 -1
- package/lib/responses/ResponseAccumulator.d.mts +15 -0
- package/lib/responses/ResponseAccumulator.d.mts.map +1 -0
- package/lib/responses/ResponseAccumulator.d.ts +15 -0
- package/lib/responses/ResponseAccumulator.d.ts.map +1 -0
- package/lib/responses/ResponseAccumulator.js +403 -0
- package/lib/responses/ResponseAccumulator.js.map +1 -0
- package/lib/responses/ResponseAccumulator.mjs +400 -0
- package/lib/responses/ResponseAccumulator.mjs.map +1 -0
- package/lib/responses/ResponseInputItems.d.mts +19 -0
- package/lib/responses/ResponseInputItems.d.mts.map +1 -0
- package/lib/responses/ResponseInputItems.d.ts +19 -0
- package/lib/responses/ResponseInputItems.d.ts.map +1 -0
- package/lib/responses/ResponseInputItems.js +104 -0
- package/lib/responses/ResponseInputItems.js.map +1 -0
- package/lib/responses/ResponseInputItems.mjs +100 -0
- package/lib/responses/ResponseInputItems.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 +5 -90
- package/lib/responses/ResponseStream.js.map +1 -1
- package/lib/responses/ResponseStream.mjs +5 -90
- package/lib/responses/ResponseStream.mjs.map +1 -1
- package/package.json +24 -1
- package/providers/bedrock/aws.d.mts +24 -0
- package/providers/bedrock/aws.d.mts.map +1 -0
- package/providers/bedrock/aws.d.ts +24 -0
- package/providers/bedrock/aws.d.ts.map +1 -0
- package/providers/bedrock/aws.js +170 -0
- package/providers/bedrock/aws.js.map +1 -0
- package/providers/bedrock/aws.mjs +166 -0
- package/providers/bedrock/aws.mjs.map +1 -0
- package/providers/bedrock.d.mts +7 -0
- package/providers/bedrock.d.mts.map +1 -0
- package/providers/bedrock.d.ts +7 -0
- package/providers/bedrock.d.ts.map +1 -0
- package/providers/bedrock.js +26 -0
- package/providers/bedrock.js.map +1 -0
- package/providers/bedrock.mjs +22 -0
- package/providers/bedrock.mjs.map +1 -0
- package/realtime/internal-base.d.mts +28 -1
- package/realtime/internal-base.d.mts.map +1 -1
- package/realtime/internal-base.d.ts +28 -1
- package/realtime/internal-base.d.ts.map +1 -1
- package/realtime/internal-base.js +50 -7
- package/realtime/internal-base.js.map +1 -1
- package/realtime/internal-base.mjs +49 -7
- package/realtime/internal-base.mjs.map +1 -1
- package/realtime/websocket.d.mts +4 -7
- package/realtime/websocket.d.mts.map +1 -1
- package/realtime/websocket.d.ts +4 -7
- package/realtime/websocket.d.ts.map +1 -1
- package/realtime/websocket.js +4 -8
- package/realtime/websocket.js.map +1 -1
- package/realtime/websocket.mjs +5 -9
- package/realtime/websocket.mjs.map +1 -1
- package/realtime/ws.d.mts +4 -7
- package/realtime/ws.d.mts.map +1 -1
- package/realtime/ws.d.ts +4 -7
- package/realtime/ws.d.ts.map +1 -1
- package/realtime/ws.js +4 -8
- package/realtime/ws.js.map +1 -1
- package/realtime/ws.mjs +5 -9
- package/realtime/ws.mjs.map +1 -1
- package/resources/beta/assistants.d.mts +12 -26
- package/resources/beta/assistants.d.mts.map +1 -1
- package/resources/beta/assistants.d.ts +12 -26
- package/resources/beta/assistants.d.ts.map +1 -1
- package/resources/beta/beta.d.mts +6 -1
- package/resources/beta/beta.d.mts.map +1 -1
- package/resources/beta/beta.d.ts +6 -1
- package/resources/beta/beta.d.ts.map +1 -1
- package/resources/beta/beta.js +4 -0
- package/resources/beta/beta.js.map +1 -1
- package/resources/beta/beta.mjs +4 -0
- package/resources/beta/beta.mjs.map +1 -1
- package/resources/beta/index.d.mts +1 -0
- package/resources/beta/index.d.mts.map +1 -1
- package/resources/beta/index.d.ts +1 -0
- package/resources/beta/index.d.ts.map +1 -1
- package/resources/beta/index.js +5 -3
- package/resources/beta/index.js.map +1 -1
- package/resources/beta/index.mjs +1 -0
- package/resources/beta/index.mjs.map +1 -1
- package/resources/beta/responses/index.d.mts +6 -0
- package/resources/beta/responses/index.d.mts.map +1 -0
- package/resources/beta/responses/index.d.ts +6 -0
- package/resources/beta/responses/index.d.ts.map +1 -0
- package/resources/beta/responses/index.js +11 -0
- package/resources/beta/responses/index.js.map +1 -0
- package/resources/beta/responses/index.mjs +5 -0
- package/resources/beta/responses/index.mjs.map +1 -0
- package/resources/beta/responses/input-items.d.mts +69 -0
- package/resources/beta/responses/input-items.d.mts.map +1 -0
- package/resources/beta/responses/input-items.d.ts +69 -0
- package/resources/beta/responses/input-items.d.ts.map +1 -0
- package/resources/beta/responses/input-items.js +37 -0
- package/resources/beta/responses/input-items.js.map +1 -0
- package/resources/beta/responses/input-items.mjs +33 -0
- package/resources/beta/responses/input-items.mjs.map +1 -0
- package/resources/beta/responses/input-tokens.d.mts +191 -0
- package/resources/beta/responses/input-tokens.d.mts.map +1 -0
- package/resources/beta/responses/input-tokens.d.ts +191 -0
- package/resources/beta/responses/input-tokens.d.ts.map +1 -0
- package/resources/beta/responses/input-tokens.js +34 -0
- package/resources/beta/responses/input-tokens.js.map +1 -0
- package/resources/beta/responses/input-tokens.mjs +30 -0
- package/resources/beta/responses/input-tokens.mjs.map +1 -0
- package/resources/beta/responses/internal-base.d.mts +71 -0
- package/resources/beta/responses/internal-base.d.mts.map +1 -0
- package/resources/beta/responses/internal-base.d.ts +71 -0
- package/resources/beta/responses/internal-base.d.ts.map +1 -0
- package/resources/beta/responses/internal-base.js +48 -0
- package/resources/beta/responses/internal-base.js.map +1 -0
- package/resources/beta/responses/internal-base.mjs +42 -0
- package/resources/beta/responses/internal-base.mjs.map +1 -0
- package/resources/beta/responses/responses.d.mts +9985 -0
- package/resources/beta/responses/responses.d.mts.map +1 -0
- package/resources/beta/responses/responses.d.ts +9985 -0
- package/resources/beta/responses/responses.d.ts.map +1 -0
- package/resources/beta/responses/responses.js +121 -0
- package/resources/beta/responses/responses.js.map +1 -0
- package/resources/beta/responses/responses.mjs +116 -0
- package/resources/beta/responses/responses.mjs.map +1 -0
- package/resources/beta/responses/ws-base.d.mts +106 -0
- package/resources/beta/responses/ws-base.d.mts.map +1 -0
- package/resources/beta/responses/ws-base.d.ts +106 -0
- package/resources/beta/responses/ws-base.d.ts.map +1 -0
- package/resources/beta/responses/ws-base.js +476 -0
- package/resources/beta/responses/ws-base.js.map +1 -0
- package/resources/beta/responses/ws-base.mjs +472 -0
- package/resources/beta/responses/ws-base.mjs.map +1 -0
- package/resources/beta/responses/ws.d.mts +13 -0
- package/resources/beta/responses/ws.d.mts.map +1 -0
- package/resources/beta/responses/ws.d.ts +13 -0
- package/resources/beta/responses/ws.d.ts.map +1 -0
- package/resources/beta/responses/ws.js +31 -0
- package/resources/beta/responses/ws.js.map +1 -0
- package/resources/beta/responses/ws.mjs +26 -0
- package/resources/beta/responses/ws.mjs.map +1 -0
- package/resources/beta/responses.d.mts +2 -0
- package/resources/beta/responses.d.mts.map +1 -0
- package/resources/beta/responses.d.ts +2 -0
- package/resources/beta/responses.d.ts.map +1 -0
- package/resources/beta/responses.js +6 -0
- package/resources/beta/responses.js.map +1 -0
- package/resources/beta/responses.mjs +3 -0
- package/resources/beta/responses.mjs.map +1 -0
- package/resources/beta/threads/runs/runs.d.mts +6 -13
- package/resources/beta/threads/runs/runs.d.mts.map +1 -1
- package/resources/beta/threads/runs/runs.d.ts +6 -13
- package/resources/beta/threads/runs/runs.d.ts.map +1 -1
- package/resources/beta/threads/runs/runs.js.map +1 -1
- package/resources/beta/threads/runs/runs.mjs.map +1 -1
- package/resources/chat/completions/completions.d.mts +155 -14
- package/resources/chat/completions/completions.d.mts.map +1 -1
- package/resources/chat/completions/completions.d.ts +155 -14
- 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/completions.d.mts +4 -0
- package/resources/completions.d.mts.map +1 -1
- package/resources/completions.d.ts +4 -0
- package/resources/completions.d.ts.map +1 -1
- package/resources/conversations/conversations.d.mts +19 -0
- package/resources/conversations/conversations.d.mts.map +1 -1
- package/resources/conversations/conversations.d.ts +19 -0
- package/resources/conversations/conversations.d.ts.map +1 -1
- package/resources/conversations/conversations.js.map +1 -1
- package/resources/conversations/conversations.mjs.map +1 -1
- package/resources/conversations/items.d.mts +45 -1
- package/resources/conversations/items.d.mts.map +1 -1
- package/resources/conversations/items.d.ts +45 -1
- package/resources/conversations/items.d.ts.map +1 -1
- package/resources/evals/runs/runs.d.mts +66 -143
- package/resources/evals/runs/runs.d.mts.map +1 -1
- package/resources/evals/runs/runs.d.ts +66 -143
- package/resources/evals/runs/runs.d.ts.map +1 -1
- package/resources/evals/runs/runs.js.map +1 -1
- package/resources/evals/runs/runs.mjs.map +1 -1
- package/resources/graders/grader-models.d.mts +6 -13
- package/resources/graders/grader-models.d.mts.map +1 -1
- package/resources/graders/grader-models.d.ts +6 -13
- package/resources/graders/grader-models.d.ts.map +1 -1
- package/resources/realtime/calls.d.mts +1 -1
- package/resources/realtime/calls.d.mts.map +1 -1
- package/resources/realtime/calls.d.ts +1 -1
- package/resources/realtime/calls.d.ts.map +1 -1
- package/resources/realtime/client-secrets.d.mts +5 -1
- package/resources/realtime/client-secrets.d.mts.map +1 -1
- package/resources/realtime/client-secrets.d.ts +5 -1
- package/resources/realtime/client-secrets.d.ts.map +1 -1
- package/resources/realtime/realtime.d.mts +9 -1
- package/resources/realtime/realtime.d.mts.map +1 -1
- package/resources/realtime/realtime.d.ts +9 -1
- 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/input-tokens.d.mts +7 -1
- package/resources/responses/input-tokens.d.mts.map +1 -1
- package/resources/responses/input-tokens.d.ts +7 -1
- package/resources/responses/input-tokens.d.ts.map +1 -1
- package/resources/responses/responses.d.mts +816 -24
- package/resources/responses/responses.d.mts.map +1 -1
- package/resources/responses/responses.d.ts +816 -24
- package/resources/responses/responses.d.ts.map +1 -1
- package/resources/responses/responses.js +1 -1
- package/resources/responses/responses.js.map +1 -1
- package/resources/responses/responses.mjs +1 -1
- package/resources/responses/responses.mjs.map +1 -1
- package/resources/shared.d.mts +20 -28
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +20 -28
- package/resources/shared.d.ts.map +1 -1
- package/resources/webhooks/webhooks.d.mts +54 -2
- package/resources/webhooks/webhooks.d.mts.map +1 -1
- package/resources/webhooks/webhooks.d.ts +54 -2
- package/resources/webhooks/webhooks.d.ts.map +1 -1
- package/src/_vendor/zod-to-json-schema/parseDef.ts +44 -16
- package/src/_vendor/zod-to-json-schema/parsers/branded.ts +2 -2
- package/src/_vendor/zod-to-json-schema/parsers/catch.ts +2 -2
- package/src/_vendor/zod-to-json-schema/parsers/default.ts +6 -2
- package/src/_vendor/zod-to-json-schema/parsers/nullable.ts +13 -5
- package/src/_vendor/zod-to-json-schema/parsers/optional.ts +14 -6
- package/src/_vendor/zod-to-json-schema/parsers/pipeline.ts +3 -2
- package/src/_vendor/zod-to-json-schema/parsers/promise.ts +6 -2
- package/src/_vendor/zod-to-json-schema/parsers/readonly.ts +2 -2
- package/src/auth/workload-identity-auth.ts +16 -5
- package/src/azure.ts +4 -1
- package/src/beta/realtime/internal-base.ts +43 -5
- package/src/beta/realtime/websocket.ts +10 -7
- package/src/beta/realtime/ws.ts +10 -7
- package/src/client.ts +80 -18
- package/src/helpers/audio.ts +18 -4
- package/src/helpers/zod.ts +16 -0
- package/src/internal/bedrock.ts +153 -0
- package/src/internal/provider.ts +60 -0
- package/src/internal/utils/log.ts +1 -0
- package/src/lib/AbstractChatCompletionRunner.ts +111 -45
- package/src/lib/AssistantStream.ts +5 -21
- package/src/lib/ChatCompletionRunner.ts +1 -1
- package/src/lib/ChatCompletionStream.ts +11 -15
- package/src/lib/ChatCompletionStreamingRunner.ts +1 -1
- package/src/lib/EventEmitter.ts +11 -2
- package/src/lib/EventStream.ts +20 -0
- package/src/lib/ResponsesParser.ts +18 -4
- package/src/lib/responses/ResponseAccumulator.ts +421 -0
- package/src/lib/responses/ResponseInputItems.ts +129 -0
- package/src/lib/responses/ResponseStream.ts +4 -93
- package/src/providers/bedrock/aws.ts +255 -0
- package/src/providers/bedrock.ts +33 -0
- package/src/realtime/internal-base.ts +90 -7
- package/src/realtime/websocket.ts +15 -13
- package/src/realtime/ws.ts +15 -13
- package/src/resources/beta/assistants.ts +12 -26
- package/src/resources/beta/beta.ts +330 -2
- package/src/resources/beta/index.ts +163 -0
- package/src/resources/beta/responses/index.ts +169 -0
- package/src/resources/beta/responses/input-items.ts +105 -0
- package/src/resources/beta/responses/input-tokens.ts +245 -0
- package/src/resources/beta/responses/internal-base.ts +117 -0
- package/src/resources/beta/responses/responses.ts +12632 -0
- package/src/resources/beta/responses/ws-base.ts +615 -0
- package/src/resources/beta/responses/ws.ts +38 -0
- package/src/resources/beta/responses.ts +3 -0
- package/src/resources/beta/threads/runs/runs.ts +6 -13
- package/src/resources/chat/completions/completions.ts +171 -14
- package/src/resources/completions.ts +5 -0
- package/src/resources/conversations/conversations.ts +21 -0
- package/src/resources/conversations/items.ts +56 -0
- package/src/resources/evals/runs/runs.ts +66 -143
- package/src/resources/graders/grader-models.ts +6 -13
- package/src/resources/realtime/calls.ts +2 -0
- package/src/resources/realtime/client-secrets.ts +7 -0
- package/src/resources/realtime/realtime.ts +12 -0
- package/src/resources/responses/input-tokens.ts +8 -0
- package/src/resources/responses/responses.ts +950 -15
- package/src/resources/shared.ts +23 -27
- package/src/resources/webhooks/api.md +1 -0
- package/src/resources/webhooks/webhooks.ts +65 -1
- 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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/resources/beta/responses/index.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Responses = exports.InputTokens = exports.InputItems = void 0;
|
|
5
|
+
var input_items_1 = require("./input-items.js");
|
|
6
|
+
Object.defineProperty(exports, "InputItems", { enumerable: true, get: function () { return input_items_1.InputItems; } });
|
|
7
|
+
var input_tokens_1 = require("./input-tokens.js");
|
|
8
|
+
Object.defineProperty(exports, "InputTokens", { enumerable: true, get: function () { return input_tokens_1.InputTokens; } });
|
|
9
|
+
var responses_1 = require("./responses.js");
|
|
10
|
+
Object.defineProperty(exports, "Responses", { enumerable: true, get: function () { return responses_1.Responses; } });
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/resources/beta/responses/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,gDAAgG;AAAvF,yGAAA,UAAU,OAAA;AACnB,kDAAuG;AAA9F,2GAAA,WAAW,OAAA;AACpB,4CAkKqB;AAjKnB,sGAAA,SAAS,OAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
export { InputItems } from "./input-items.mjs";
|
|
3
|
+
export { InputTokens } from "./input-tokens.mjs";
|
|
4
|
+
export { Responses, } from "./responses.mjs";
|
|
5
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/resources/beta/responses/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,UAAU,EAAuD,0BAAsB;AAChG,OAAO,EAAE,WAAW,EAA4D,2BAAuB;AACvG,OAAO,EACL,SAAS,GAiKV,wBAAoB"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { APIResource } from "../../../core/resource.mjs";
|
|
2
|
+
import * as ResponsesAPI from "./responses.mjs";
|
|
3
|
+
import { BetaResponseItemsPage } from "./responses.mjs";
|
|
4
|
+
import { type CursorPageParams, PagePromise } from "../../../core/pagination.mjs";
|
|
5
|
+
import { RequestOptions } from "../../../internal/request-options.mjs";
|
|
6
|
+
export declare class InputItems extends APIResource {
|
|
7
|
+
/**
|
|
8
|
+
* Returns a list of input items for a given response.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* // Automatically fetches more pages as needed.
|
|
13
|
+
* for await (const betaResponseItem of client.beta.responses.inputItems.list(
|
|
14
|
+
* 'response_id',
|
|
15
|
+
* )) {
|
|
16
|
+
* // ...
|
|
17
|
+
* }
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
list(responseID: string, params?: InputItemListParams | null | undefined, options?: RequestOptions): PagePromise<BetaResponseItemsPage, ResponsesAPI.BetaResponseItem>;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* A list of Response items.
|
|
24
|
+
*/
|
|
25
|
+
export interface BetaResponseItemList {
|
|
26
|
+
/**
|
|
27
|
+
* A list of items used to generate this response.
|
|
28
|
+
*/
|
|
29
|
+
data: Array<ResponsesAPI.BetaResponseItem>;
|
|
30
|
+
/**
|
|
31
|
+
* The ID of the first item in the list.
|
|
32
|
+
*/
|
|
33
|
+
first_id: string;
|
|
34
|
+
/**
|
|
35
|
+
* Whether there are more items available.
|
|
36
|
+
*/
|
|
37
|
+
has_more: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* The ID of the last item in the list.
|
|
40
|
+
*/
|
|
41
|
+
last_id: string;
|
|
42
|
+
/**
|
|
43
|
+
* The type of object returned, must be `list`.
|
|
44
|
+
*/
|
|
45
|
+
object: 'list';
|
|
46
|
+
}
|
|
47
|
+
export interface InputItemListParams extends CursorPageParams {
|
|
48
|
+
/**
|
|
49
|
+
* Query param: Additional fields to include in the response. See the `include`
|
|
50
|
+
* parameter for Response creation above for more information.
|
|
51
|
+
*/
|
|
52
|
+
include?: Array<ResponsesAPI.BetaResponseIncludable>;
|
|
53
|
+
/**
|
|
54
|
+
* Query param: The order to return the input items in. Default is `desc`.
|
|
55
|
+
*
|
|
56
|
+
* - `asc`: Return the input items in ascending order.
|
|
57
|
+
* - `desc`: Return the input items in descending order.
|
|
58
|
+
*/
|
|
59
|
+
order?: 'asc' | 'desc';
|
|
60
|
+
/**
|
|
61
|
+
* Header param: Optional beta features to enable for this request.
|
|
62
|
+
*/
|
|
63
|
+
betas?: Array<'responses_multi_agent=v1'>;
|
|
64
|
+
}
|
|
65
|
+
export declare namespace InputItems {
|
|
66
|
+
export { type BetaResponseItemList as BetaResponseItemList, type InputItemListParams as InputItemListParams, };
|
|
67
|
+
}
|
|
68
|
+
export { type BetaResponseItemsPage };
|
|
69
|
+
//# sourceMappingURL=input-items.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-items.d.mts","sourceRoot":"","sources":["../../../src/resources/beta/responses/input-items.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,mCAA+B;AACrD,OAAO,KAAK,YAAY,wBAAoB;AAC5C,OAAO,EAAE,qBAAqB,EAAE,wBAAoB;AACpD,OAAO,EAAc,KAAK,gBAAgB,EAAE,WAAW,EAAE,qCAAiC;AAE1F,OAAO,EAAE,cAAc,EAAE,8CAA0C;AAGnE,qBAAa,UAAW,SAAQ,WAAW;IACzC;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,UAAU,EAAE,MAAM,EAClB,MAAM,GAAE,mBAAmB,GAAG,IAAI,GAAG,SAAc,EACnD,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,qBAAqB,EAAE,YAAY,CAAC,gBAAgB,CAAC;CAgBrE;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,IAAI,EAAE,KAAK,CAAC,YAAY,CAAC,gBAAgB,CAAC,CAAC;IAE3C;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,mBAAoB,SAAQ,gBAAgB;IAC3D;;;OAGG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,sBAAsB,CAAC,CAAC;IAErD;;;;;OAKG;IACH,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IAEvB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,0BAA0B,CAAC,CAAC;CAC3C;AAED,MAAM,CAAC,OAAO,WAAW,UAAU,CAAC;IAClC,OAAO,EACL,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;CACH;AAED,OAAO,EAAE,KAAK,qBAAqB,EAAE,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { APIResource } from "../../../core/resource.js";
|
|
2
|
+
import * as ResponsesAPI from "./responses.js";
|
|
3
|
+
import { BetaResponseItemsPage } from "./responses.js";
|
|
4
|
+
import { type CursorPageParams, PagePromise } from "../../../core/pagination.js";
|
|
5
|
+
import { RequestOptions } from "../../../internal/request-options.js";
|
|
6
|
+
export declare class InputItems extends APIResource {
|
|
7
|
+
/**
|
|
8
|
+
* Returns a list of input items for a given response.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* // Automatically fetches more pages as needed.
|
|
13
|
+
* for await (const betaResponseItem of client.beta.responses.inputItems.list(
|
|
14
|
+
* 'response_id',
|
|
15
|
+
* )) {
|
|
16
|
+
* // ...
|
|
17
|
+
* }
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
list(responseID: string, params?: InputItemListParams | null | undefined, options?: RequestOptions): PagePromise<BetaResponseItemsPage, ResponsesAPI.BetaResponseItem>;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* A list of Response items.
|
|
24
|
+
*/
|
|
25
|
+
export interface BetaResponseItemList {
|
|
26
|
+
/**
|
|
27
|
+
* A list of items used to generate this response.
|
|
28
|
+
*/
|
|
29
|
+
data: Array<ResponsesAPI.BetaResponseItem>;
|
|
30
|
+
/**
|
|
31
|
+
* The ID of the first item in the list.
|
|
32
|
+
*/
|
|
33
|
+
first_id: string;
|
|
34
|
+
/**
|
|
35
|
+
* Whether there are more items available.
|
|
36
|
+
*/
|
|
37
|
+
has_more: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* The ID of the last item in the list.
|
|
40
|
+
*/
|
|
41
|
+
last_id: string;
|
|
42
|
+
/**
|
|
43
|
+
* The type of object returned, must be `list`.
|
|
44
|
+
*/
|
|
45
|
+
object: 'list';
|
|
46
|
+
}
|
|
47
|
+
export interface InputItemListParams extends CursorPageParams {
|
|
48
|
+
/**
|
|
49
|
+
* Query param: Additional fields to include in the response. See the `include`
|
|
50
|
+
* parameter for Response creation above for more information.
|
|
51
|
+
*/
|
|
52
|
+
include?: Array<ResponsesAPI.BetaResponseIncludable>;
|
|
53
|
+
/**
|
|
54
|
+
* Query param: The order to return the input items in. Default is `desc`.
|
|
55
|
+
*
|
|
56
|
+
* - `asc`: Return the input items in ascending order.
|
|
57
|
+
* - `desc`: Return the input items in descending order.
|
|
58
|
+
*/
|
|
59
|
+
order?: 'asc' | 'desc';
|
|
60
|
+
/**
|
|
61
|
+
* Header param: Optional beta features to enable for this request.
|
|
62
|
+
*/
|
|
63
|
+
betas?: Array<'responses_multi_agent=v1'>;
|
|
64
|
+
}
|
|
65
|
+
export declare namespace InputItems {
|
|
66
|
+
export { type BetaResponseItemList as BetaResponseItemList, type InputItemListParams as InputItemListParams, };
|
|
67
|
+
}
|
|
68
|
+
export { type BetaResponseItemsPage };
|
|
69
|
+
//# sourceMappingURL=input-items.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-items.d.ts","sourceRoot":"","sources":["../../../src/resources/beta/responses/input-items.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,kCAA+B;AACrD,OAAO,KAAK,YAAY,uBAAoB;AAC5C,OAAO,EAAE,qBAAqB,EAAE,uBAAoB;AACpD,OAAO,EAAc,KAAK,gBAAgB,EAAE,WAAW,EAAE,oCAAiC;AAE1F,OAAO,EAAE,cAAc,EAAE,6CAA0C;AAGnE,qBAAa,UAAW,SAAQ,WAAW;IACzC;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,UAAU,EAAE,MAAM,EAClB,MAAM,GAAE,mBAAmB,GAAG,IAAI,GAAG,SAAc,EACnD,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,qBAAqB,EAAE,YAAY,CAAC,gBAAgB,CAAC;CAgBrE;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,IAAI,EAAE,KAAK,CAAC,YAAY,CAAC,gBAAgB,CAAC,CAAC;IAE3C;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,mBAAoB,SAAQ,gBAAgB;IAC3D;;;OAGG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,sBAAsB,CAAC,CAAC;IAErD;;;;;OAKG;IACH,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IAEvB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,0BAA0B,CAAC,CAAC;CAC3C;AAED,MAAM,CAAC,OAAO,WAAW,UAAU,CAAC;IAClC,OAAO,EACL,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;CACH;AAED,OAAO,EAAE,KAAK,qBAAqB,EAAE,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.InputItems = void 0;
|
|
5
|
+
const resource_1 = require("../../../core/resource.js");
|
|
6
|
+
const pagination_1 = require("../../../core/pagination.js");
|
|
7
|
+
const headers_1 = require("../../../internal/headers.js");
|
|
8
|
+
const path_1 = require("../../../internal/utils/path.js");
|
|
9
|
+
class InputItems extends resource_1.APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* Returns a list of input items for a given response.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* // Automatically fetches more pages as needed.
|
|
16
|
+
* for await (const betaResponseItem of client.beta.responses.inputItems.list(
|
|
17
|
+
* 'response_id',
|
|
18
|
+
* )) {
|
|
19
|
+
* // ...
|
|
20
|
+
* }
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
list(responseID, params = {}, options) {
|
|
24
|
+
const { betas, ...query } = params ?? {};
|
|
25
|
+
return this._client.getAPIList((0, path_1.path) `/responses/${responseID}/input_items?beta=true`, (pagination_1.CursorPage), {
|
|
26
|
+
query,
|
|
27
|
+
...options,
|
|
28
|
+
headers: (0, headers_1.buildHeaders)([
|
|
29
|
+
{ ...(betas?.toString() != null ? { 'openai-beta': betas?.toString() } : undefined) },
|
|
30
|
+
options?.headers,
|
|
31
|
+
]),
|
|
32
|
+
__security: { bearerAuth: true },
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.InputItems = InputItems;
|
|
37
|
+
//# sourceMappingURL=input-items.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-items.js","sourceRoot":"","sources":["../../../src/resources/beta/responses/input-items.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAqD;AAGrD,4DAA0F;AAC1F,0DAAyD;AAEzD,0DAAoD;AAEpD,MAAa,UAAW,SAAQ,sBAAW;IACzC;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,UAAkB,EAClB,SAAiD,EAAE,EACnD,OAAwB;QAExB,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,IAAI,EAAE,CAAC;QACzC,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAC5B,IAAA,WAAI,EAAA,cAAc,UAAU,wBAAwB,EACpD,CAAA,uBAAyC,CAAA,EACzC;YACE,KAAK;YACL,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC;gBACpB,EAAE,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE;gBACrF,OAAO,EAAE,OAAO;aACjB,CAAC;YACF,UAAU,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE;SACjC,CACF,CAAC;IACJ,CAAC;CACF;AAlCD,gCAkCC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../../../core/resource.mjs";
|
|
3
|
+
import { CursorPage } from "../../../core/pagination.mjs";
|
|
4
|
+
import { buildHeaders } from "../../../internal/headers.mjs";
|
|
5
|
+
import { path } from "../../../internal/utils/path.mjs";
|
|
6
|
+
export class InputItems extends APIResource {
|
|
7
|
+
/**
|
|
8
|
+
* Returns a list of input items for a given response.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* // Automatically fetches more pages as needed.
|
|
13
|
+
* for await (const betaResponseItem of client.beta.responses.inputItems.list(
|
|
14
|
+
* 'response_id',
|
|
15
|
+
* )) {
|
|
16
|
+
* // ...
|
|
17
|
+
* }
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
list(responseID, params = {}, options) {
|
|
21
|
+
const { betas, ...query } = params ?? {};
|
|
22
|
+
return this._client.getAPIList(path `/responses/${responseID}/input_items?beta=true`, (CursorPage), {
|
|
23
|
+
query,
|
|
24
|
+
...options,
|
|
25
|
+
headers: buildHeaders([
|
|
26
|
+
{ ...(betas?.toString() != null ? { 'openai-beta': betas?.toString() } : undefined) },
|
|
27
|
+
options?.headers,
|
|
28
|
+
]),
|
|
29
|
+
__security: { bearerAuth: true },
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=input-items.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-items.mjs","sourceRoot":"","sources":["../../../src/resources/beta/responses/input-items.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,mCAA+B;AAGrD,OAAO,EAAE,UAAU,EAAsC,qCAAiC;AAC1F,OAAO,EAAE,YAAY,EAAE,sCAAkC;AAEzD,OAAO,EAAE,IAAI,EAAE,yCAAqC;AAEpD,MAAM,OAAO,UAAW,SAAQ,WAAW;IACzC;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,UAAkB,EAClB,SAAiD,EAAE,EACnD,OAAwB;QAExB,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,IAAI,EAAE,CAAC;QACzC,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAC5B,IAAI,CAAA,cAAc,UAAU,wBAAwB,EACpD,CAAA,UAAyC,CAAA,EACzC;YACE,KAAK;YACL,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC;gBACpB,EAAE,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE;gBACrF,OAAO,EAAE,OAAO;aACjB,CAAC;YACF,UAAU,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE;SACjC,CACF,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { APIResource } from "../../../core/resource.mjs";
|
|
2
|
+
import * as ResponsesAPI from "./responses.mjs";
|
|
3
|
+
import { APIPromise } from "../../../core/api-promise.mjs";
|
|
4
|
+
import { RequestOptions } from "../../../internal/request-options.mjs";
|
|
5
|
+
export declare class InputTokens extends APIResource {
|
|
6
|
+
/**
|
|
7
|
+
* Returns input token counts of the request.
|
|
8
|
+
*
|
|
9
|
+
* Returns an object with `object` set to `response.input_tokens` and an
|
|
10
|
+
* `input_tokens` count.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const response =
|
|
15
|
+
* await client.beta.responses.inputTokens.count();
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
count(params?: InputTokenCountParams | null | undefined, options?: RequestOptions): APIPromise<InputTokenCountResponse>;
|
|
19
|
+
}
|
|
20
|
+
export interface InputTokenCountResponse {
|
|
21
|
+
input_tokens: number;
|
|
22
|
+
object: 'response.input_tokens';
|
|
23
|
+
}
|
|
24
|
+
export interface InputTokenCountParams {
|
|
25
|
+
/**
|
|
26
|
+
* Body param: The conversation that this response belongs to. Items from this
|
|
27
|
+
* conversation are prepended to `input_items` for this response request. Input
|
|
28
|
+
* items and output items from this response are automatically added to this
|
|
29
|
+
* conversation after this response completes.
|
|
30
|
+
*/
|
|
31
|
+
conversation?: string | ResponsesAPI.BetaResponseConversationParam | null;
|
|
32
|
+
/**
|
|
33
|
+
* Body param: Text, image, or file inputs to the model, used to generate a
|
|
34
|
+
* response
|
|
35
|
+
*/
|
|
36
|
+
input?: string | Array<ResponsesAPI.BetaResponseInputItem> | null;
|
|
37
|
+
/**
|
|
38
|
+
* Body param: A system (or developer) message inserted into the model's context.
|
|
39
|
+
* When used along with `previous_response_id`, the instructions from a previous
|
|
40
|
+
* response will not be carried over to the next response. This makes it simple to
|
|
41
|
+
* swap out system (or developer) messages in new responses.
|
|
42
|
+
*/
|
|
43
|
+
instructions?: string | null;
|
|
44
|
+
/**
|
|
45
|
+
* Body param: Model ID used to generate the response, like `gpt-4o` or `o3`.
|
|
46
|
+
* OpenAI offers a wide range of models with different capabilities, performance
|
|
47
|
+
* characteristics, and price points. Refer to the
|
|
48
|
+
* [model guide](https://platform.openai.com/docs/models) to browse and compare
|
|
49
|
+
* available models.
|
|
50
|
+
*/
|
|
51
|
+
model?: string | null;
|
|
52
|
+
/**
|
|
53
|
+
* Body param: Whether to allow the model to run tool calls in parallel.
|
|
54
|
+
*/
|
|
55
|
+
parallel_tool_calls?: boolean | null;
|
|
56
|
+
/**
|
|
57
|
+
* Body param: A model-owned style preset to apply to this request. Omit this
|
|
58
|
+
* parameter to use the model's default style. Supported values may expand over
|
|
59
|
+
* time. Values must be at most 64 characters.
|
|
60
|
+
*/
|
|
61
|
+
personality?: (string & {}) | 'friendly' | 'pragmatic';
|
|
62
|
+
/**
|
|
63
|
+
* Body param: The unique ID of the previous response to the model. Use this to
|
|
64
|
+
* create multi-turn conversations. Learn more about
|
|
65
|
+
* [conversation state](https://platform.openai.com/docs/guides/conversation-state).
|
|
66
|
+
* Cannot be used in conjunction with `conversation`.
|
|
67
|
+
*/
|
|
68
|
+
previous_response_id?: string | null;
|
|
69
|
+
/**
|
|
70
|
+
* Body param: **gpt-5 and o-series models only** Configuration options for
|
|
71
|
+
* [reasoning models](https://platform.openai.com/docs/guides/reasoning).
|
|
72
|
+
*/
|
|
73
|
+
reasoning?: InputTokenCountParams.Reasoning | null;
|
|
74
|
+
/**
|
|
75
|
+
* Body param: Configuration options for a text response from the model. Can be
|
|
76
|
+
* plain text or structured JSON data. Learn more:
|
|
77
|
+
*
|
|
78
|
+
* - [Text inputs and outputs](https://platform.openai.com/docs/guides/text)
|
|
79
|
+
* - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs)
|
|
80
|
+
*/
|
|
81
|
+
text?: InputTokenCountParams.Text | null;
|
|
82
|
+
/**
|
|
83
|
+
* Body param: Controls which tool the model should use, if any.
|
|
84
|
+
*/
|
|
85
|
+
tool_choice?: ResponsesAPI.BetaToolChoiceOptions | ResponsesAPI.BetaToolChoiceAllowed | ResponsesAPI.BetaToolChoiceTypes | ResponsesAPI.BetaToolChoiceFunction | ResponsesAPI.BetaToolChoiceMcp | ResponsesAPI.BetaToolChoiceCustom | InputTokenCountParams.BetaSpecificProgrammaticToolCallingParam | ResponsesAPI.BetaToolChoiceApplyPatch | ResponsesAPI.BetaToolChoiceShell | null;
|
|
86
|
+
/**
|
|
87
|
+
* Body param: An array of tools the model may call while generating a response.
|
|
88
|
+
* You can specify which tool to use by setting the `tool_choice` parameter.
|
|
89
|
+
*/
|
|
90
|
+
tools?: Array<ResponsesAPI.BetaTool> | null;
|
|
91
|
+
/**
|
|
92
|
+
* @deprecated Body param: The truncation strategy to use for the model response. -
|
|
93
|
+
* `auto`: If the input to this Response exceeds the model's context window size,
|
|
94
|
+
* the model will truncate the response to fit the context window by dropping items
|
|
95
|
+
* from the beginning of the conversation. - `disabled` (default): If the input
|
|
96
|
+
* size will exceed the context window size for a model, the request will fail with
|
|
97
|
+
* a 400 error.
|
|
98
|
+
*/
|
|
99
|
+
truncation?: 'auto' | 'disabled';
|
|
100
|
+
/**
|
|
101
|
+
* Header param: Optional beta features to enable for this request.
|
|
102
|
+
*/
|
|
103
|
+
betas?: Array<'responses_multi_agent=v1'>;
|
|
104
|
+
}
|
|
105
|
+
export declare namespace InputTokenCountParams {
|
|
106
|
+
/**
|
|
107
|
+
* **gpt-5 and o-series models only** Configuration options for
|
|
108
|
+
* [reasoning models](https://platform.openai.com/docs/guides/reasoning).
|
|
109
|
+
*/
|
|
110
|
+
interface Reasoning {
|
|
111
|
+
/**
|
|
112
|
+
* Controls which reasoning items are rendered back to the model on later turns.
|
|
113
|
+
* When returned on a response, this is the effective reasoning context mode used
|
|
114
|
+
* for the response.
|
|
115
|
+
*/
|
|
116
|
+
context?: 'auto' | 'current_turn' | 'all_turns' | null;
|
|
117
|
+
/**
|
|
118
|
+
* Constrains effort on reasoning for reasoning models. Currently supported values
|
|
119
|
+
* are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. Reducing
|
|
120
|
+
* reasoning effort can result in faster responses and fewer tokens used on
|
|
121
|
+
* reasoning in a response. Not all reasoning models support every value. See the
|
|
122
|
+
* [reasoning guide](https://platform.openai.com/docs/guides/reasoning) for
|
|
123
|
+
* model-specific support.
|
|
124
|
+
*/
|
|
125
|
+
effort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | null;
|
|
126
|
+
/**
|
|
127
|
+
* @deprecated **Deprecated:** use `summary` instead.
|
|
128
|
+
*
|
|
129
|
+
* A summary of the reasoning performed by the model. This can be useful for
|
|
130
|
+
* debugging and understanding the model's reasoning process. One of `auto`,
|
|
131
|
+
* `concise`, or `detailed`.
|
|
132
|
+
*/
|
|
133
|
+
generate_summary?: 'auto' | 'concise' | 'detailed' | null;
|
|
134
|
+
/**
|
|
135
|
+
* Controls the reasoning execution mode for the request.
|
|
136
|
+
*
|
|
137
|
+
* When returned on a response, this is the effective execution mode.
|
|
138
|
+
*/
|
|
139
|
+
mode?: (string & {}) | 'standard' | 'pro';
|
|
140
|
+
/**
|
|
141
|
+
* A summary of the reasoning performed by the model. This can be useful for
|
|
142
|
+
* debugging and understanding the model's reasoning process. One of `auto`,
|
|
143
|
+
* `concise`, or `detailed`.
|
|
144
|
+
*
|
|
145
|
+
* `concise` is supported for `computer-use-preview` models and all reasoning
|
|
146
|
+
* models after `gpt-5`.
|
|
147
|
+
*/
|
|
148
|
+
summary?: 'auto' | 'concise' | 'detailed' | null;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Configuration options for a text response from the model. Can be plain text or
|
|
152
|
+
* structured JSON data. Learn more:
|
|
153
|
+
*
|
|
154
|
+
* - [Text inputs and outputs](https://platform.openai.com/docs/guides/text)
|
|
155
|
+
* - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs)
|
|
156
|
+
*/
|
|
157
|
+
interface Text {
|
|
158
|
+
/**
|
|
159
|
+
* An object specifying the format that the model must output.
|
|
160
|
+
*
|
|
161
|
+
* Configuring `{ "type": "json_schema" }` enables Structured Outputs, which
|
|
162
|
+
* ensures the model will match your supplied JSON schema. Learn more in the
|
|
163
|
+
* [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs).
|
|
164
|
+
*
|
|
165
|
+
* The default format is `{ "type": "text" }` with no additional options.
|
|
166
|
+
*
|
|
167
|
+
* **Not recommended for gpt-4o and newer models:**
|
|
168
|
+
*
|
|
169
|
+
* Setting to `{ "type": "json_object" }` enables the older JSON mode, which
|
|
170
|
+
* ensures the message the model generates is valid JSON. Using `json_schema` is
|
|
171
|
+
* preferred for models that support it.
|
|
172
|
+
*/
|
|
173
|
+
format?: ResponsesAPI.BetaResponseFormatTextConfig;
|
|
174
|
+
/**
|
|
175
|
+
* Constrains the verbosity of the model's response. Lower values will result in
|
|
176
|
+
* more concise responses, while higher values will result in more verbose
|
|
177
|
+
* responses. Currently supported values are `low`, `medium`, and `high`.
|
|
178
|
+
*/
|
|
179
|
+
verbosity?: 'low' | 'medium' | 'high' | null;
|
|
180
|
+
}
|
|
181
|
+
interface BetaSpecificProgrammaticToolCallingParam {
|
|
182
|
+
/**
|
|
183
|
+
* The tool to call. Always `programmatic_tool_calling`.
|
|
184
|
+
*/
|
|
185
|
+
type: 'programmatic_tool_calling';
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
export declare namespace InputTokens {
|
|
189
|
+
export { type InputTokenCountResponse as InputTokenCountResponse, type InputTokenCountParams as InputTokenCountParams, };
|
|
190
|
+
}
|
|
191
|
+
//# sourceMappingURL=input-tokens.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-tokens.d.mts","sourceRoot":"","sources":["../../../src/resources/beta/responses/input-tokens.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,mCAA+B;AACrD,OAAO,KAAK,YAAY,wBAAoB;AAC5C,OAAO,EAAE,UAAU,EAAE,sCAAkC;AAEvD,OAAO,EAAE,cAAc,EAAE,8CAA0C;AAEnE,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;;OAWG;IACH,KAAK,CACH,MAAM,GAAE,qBAAqB,GAAG,IAAI,GAAG,SAAc,EACrD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,uBAAuB,CAAC;CAYvC;AAED,MAAM,WAAW,uBAAuB;IACtC,YAAY,EAAE,MAAM,CAAC;IAErB,MAAM,EAAE,uBAAuB,CAAC;CACjC;AAED,MAAM,WAAW,qBAAqB;IACpC;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,YAAY,CAAC,6BAA6B,GAAG,IAAI,CAAC;IAE1E;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,YAAY,CAAC,qBAAqB,CAAC,GAAG,IAAI,CAAC;IAElE;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE7B;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEtB;;OAEG;IACH,mBAAmB,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAErC;;;;OAIG;IACH,WAAW,CAAC,EAAE,CAAC,MAAM,GAAG,EAAE,CAAC,GAAG,UAAU,GAAG,WAAW,CAAC;IAEvD;;;;;OAKG;IACH,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAErC;;;OAGG;IACH,SAAS,CAAC,EAAE,qBAAqB,CAAC,SAAS,GAAG,IAAI,CAAC;IAEnD;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,qBAAqB,CAAC,IAAI,GAAG,IAAI,CAAC;IAEzC;;OAEG;IACH,WAAW,CAAC,EACR,YAAY,CAAC,qBAAqB,GAClC,YAAY,CAAC,qBAAqB,GAClC,YAAY,CAAC,mBAAmB,GAChC,YAAY,CAAC,sBAAsB,GACnC,YAAY,CAAC,iBAAiB,GAC9B,YAAY,CAAC,oBAAoB,GACjC,qBAAqB,CAAC,wCAAwC,GAC9D,YAAY,CAAC,wBAAwB,GACrC,YAAY,CAAC,mBAAmB,GAChC,IAAI,CAAC;IAET;;;OAGG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC;IAE5C;;;;;;;OAOG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;IAEjC;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,0BAA0B,CAAC,CAAC;CAC3C;AAED,yBAAiB,qBAAqB,CAAC;IACrC;;;OAGG;IACH,UAAiB,SAAS;QACxB;;;;WAIG;QACH,OAAO,CAAC,EAAE,MAAM,GAAG,cAAc,GAAG,WAAW,GAAG,IAAI,CAAC;QAEvD;;;;;;;WAOG;QACH,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,IAAI,CAAC;QAEjF;;;;;;WAMG;QACH,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,GAAG,IAAI,CAAC;QAE1D;;;;WAIG;QACH,IAAI,CAAC,EAAE,CAAC,MAAM,GAAG,EAAE,CAAC,GAAG,UAAU,GAAG,KAAK,CAAC;QAE1C;;;;;;;WAOG;QACH,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,GAAG,IAAI,CAAC;KAClD;IAED;;;;;;OAMG;IACH,UAAiB,IAAI;QACnB;;;;;;;;;;;;;;WAcG;QACH,MAAM,CAAC,EAAE,YAAY,CAAC,4BAA4B,CAAC;QAEnD;;;;WAIG;QACH,SAAS,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,IAAI,CAAC;KAC9C;IAED,UAAiB,wCAAwC;QACvD;;WAEG;QACH,IAAI,EAAE,2BAA2B,CAAC;KACnC;CACF;AAED,MAAM,CAAC,OAAO,WAAW,WAAW,CAAC;IACnC,OAAO,EACL,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,qBAAqB,IAAI,qBAAqB,GACpD,CAAC;CACH"}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { APIResource } from "../../../core/resource.js";
|
|
2
|
+
import * as ResponsesAPI from "./responses.js";
|
|
3
|
+
import { APIPromise } from "../../../core/api-promise.js";
|
|
4
|
+
import { RequestOptions } from "../../../internal/request-options.js";
|
|
5
|
+
export declare class InputTokens extends APIResource {
|
|
6
|
+
/**
|
|
7
|
+
* Returns input token counts of the request.
|
|
8
|
+
*
|
|
9
|
+
* Returns an object with `object` set to `response.input_tokens` and an
|
|
10
|
+
* `input_tokens` count.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const response =
|
|
15
|
+
* await client.beta.responses.inputTokens.count();
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
count(params?: InputTokenCountParams | null | undefined, options?: RequestOptions): APIPromise<InputTokenCountResponse>;
|
|
19
|
+
}
|
|
20
|
+
export interface InputTokenCountResponse {
|
|
21
|
+
input_tokens: number;
|
|
22
|
+
object: 'response.input_tokens';
|
|
23
|
+
}
|
|
24
|
+
export interface InputTokenCountParams {
|
|
25
|
+
/**
|
|
26
|
+
* Body param: The conversation that this response belongs to. Items from this
|
|
27
|
+
* conversation are prepended to `input_items` for this response request. Input
|
|
28
|
+
* items and output items from this response are automatically added to this
|
|
29
|
+
* conversation after this response completes.
|
|
30
|
+
*/
|
|
31
|
+
conversation?: string | ResponsesAPI.BetaResponseConversationParam | null;
|
|
32
|
+
/**
|
|
33
|
+
* Body param: Text, image, or file inputs to the model, used to generate a
|
|
34
|
+
* response
|
|
35
|
+
*/
|
|
36
|
+
input?: string | Array<ResponsesAPI.BetaResponseInputItem> | null;
|
|
37
|
+
/**
|
|
38
|
+
* Body param: A system (or developer) message inserted into the model's context.
|
|
39
|
+
* When used along with `previous_response_id`, the instructions from a previous
|
|
40
|
+
* response will not be carried over to the next response. This makes it simple to
|
|
41
|
+
* swap out system (or developer) messages in new responses.
|
|
42
|
+
*/
|
|
43
|
+
instructions?: string | null;
|
|
44
|
+
/**
|
|
45
|
+
* Body param: Model ID used to generate the response, like `gpt-4o` or `o3`.
|
|
46
|
+
* OpenAI offers a wide range of models with different capabilities, performance
|
|
47
|
+
* characteristics, and price points. Refer to the
|
|
48
|
+
* [model guide](https://platform.openai.com/docs/models) to browse and compare
|
|
49
|
+
* available models.
|
|
50
|
+
*/
|
|
51
|
+
model?: string | null;
|
|
52
|
+
/**
|
|
53
|
+
* Body param: Whether to allow the model to run tool calls in parallel.
|
|
54
|
+
*/
|
|
55
|
+
parallel_tool_calls?: boolean | null;
|
|
56
|
+
/**
|
|
57
|
+
* Body param: A model-owned style preset to apply to this request. Omit this
|
|
58
|
+
* parameter to use the model's default style. Supported values may expand over
|
|
59
|
+
* time. Values must be at most 64 characters.
|
|
60
|
+
*/
|
|
61
|
+
personality?: (string & {}) | 'friendly' | 'pragmatic';
|
|
62
|
+
/**
|
|
63
|
+
* Body param: The unique ID of the previous response to the model. Use this to
|
|
64
|
+
* create multi-turn conversations. Learn more about
|
|
65
|
+
* [conversation state](https://platform.openai.com/docs/guides/conversation-state).
|
|
66
|
+
* Cannot be used in conjunction with `conversation`.
|
|
67
|
+
*/
|
|
68
|
+
previous_response_id?: string | null;
|
|
69
|
+
/**
|
|
70
|
+
* Body param: **gpt-5 and o-series models only** Configuration options for
|
|
71
|
+
* [reasoning models](https://platform.openai.com/docs/guides/reasoning).
|
|
72
|
+
*/
|
|
73
|
+
reasoning?: InputTokenCountParams.Reasoning | null;
|
|
74
|
+
/**
|
|
75
|
+
* Body param: Configuration options for a text response from the model. Can be
|
|
76
|
+
* plain text or structured JSON data. Learn more:
|
|
77
|
+
*
|
|
78
|
+
* - [Text inputs and outputs](https://platform.openai.com/docs/guides/text)
|
|
79
|
+
* - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs)
|
|
80
|
+
*/
|
|
81
|
+
text?: InputTokenCountParams.Text | null;
|
|
82
|
+
/**
|
|
83
|
+
* Body param: Controls which tool the model should use, if any.
|
|
84
|
+
*/
|
|
85
|
+
tool_choice?: ResponsesAPI.BetaToolChoiceOptions | ResponsesAPI.BetaToolChoiceAllowed | ResponsesAPI.BetaToolChoiceTypes | ResponsesAPI.BetaToolChoiceFunction | ResponsesAPI.BetaToolChoiceMcp | ResponsesAPI.BetaToolChoiceCustom | InputTokenCountParams.BetaSpecificProgrammaticToolCallingParam | ResponsesAPI.BetaToolChoiceApplyPatch | ResponsesAPI.BetaToolChoiceShell | null;
|
|
86
|
+
/**
|
|
87
|
+
* Body param: An array of tools the model may call while generating a response.
|
|
88
|
+
* You can specify which tool to use by setting the `tool_choice` parameter.
|
|
89
|
+
*/
|
|
90
|
+
tools?: Array<ResponsesAPI.BetaTool> | null;
|
|
91
|
+
/**
|
|
92
|
+
* @deprecated Body param: The truncation strategy to use for the model response. -
|
|
93
|
+
* `auto`: If the input to this Response exceeds the model's context window size,
|
|
94
|
+
* the model will truncate the response to fit the context window by dropping items
|
|
95
|
+
* from the beginning of the conversation. - `disabled` (default): If the input
|
|
96
|
+
* size will exceed the context window size for a model, the request will fail with
|
|
97
|
+
* a 400 error.
|
|
98
|
+
*/
|
|
99
|
+
truncation?: 'auto' | 'disabled';
|
|
100
|
+
/**
|
|
101
|
+
* Header param: Optional beta features to enable for this request.
|
|
102
|
+
*/
|
|
103
|
+
betas?: Array<'responses_multi_agent=v1'>;
|
|
104
|
+
}
|
|
105
|
+
export declare namespace InputTokenCountParams {
|
|
106
|
+
/**
|
|
107
|
+
* **gpt-5 and o-series models only** Configuration options for
|
|
108
|
+
* [reasoning models](https://platform.openai.com/docs/guides/reasoning).
|
|
109
|
+
*/
|
|
110
|
+
interface Reasoning {
|
|
111
|
+
/**
|
|
112
|
+
* Controls which reasoning items are rendered back to the model on later turns.
|
|
113
|
+
* When returned on a response, this is the effective reasoning context mode used
|
|
114
|
+
* for the response.
|
|
115
|
+
*/
|
|
116
|
+
context?: 'auto' | 'current_turn' | 'all_turns' | null;
|
|
117
|
+
/**
|
|
118
|
+
* Constrains effort on reasoning for reasoning models. Currently supported values
|
|
119
|
+
* are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. Reducing
|
|
120
|
+
* reasoning effort can result in faster responses and fewer tokens used on
|
|
121
|
+
* reasoning in a response. Not all reasoning models support every value. See the
|
|
122
|
+
* [reasoning guide](https://platform.openai.com/docs/guides/reasoning) for
|
|
123
|
+
* model-specific support.
|
|
124
|
+
*/
|
|
125
|
+
effort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | null;
|
|
126
|
+
/**
|
|
127
|
+
* @deprecated **Deprecated:** use `summary` instead.
|
|
128
|
+
*
|
|
129
|
+
* A summary of the reasoning performed by the model. This can be useful for
|
|
130
|
+
* debugging and understanding the model's reasoning process. One of `auto`,
|
|
131
|
+
* `concise`, or `detailed`.
|
|
132
|
+
*/
|
|
133
|
+
generate_summary?: 'auto' | 'concise' | 'detailed' | null;
|
|
134
|
+
/**
|
|
135
|
+
* Controls the reasoning execution mode for the request.
|
|
136
|
+
*
|
|
137
|
+
* When returned on a response, this is the effective execution mode.
|
|
138
|
+
*/
|
|
139
|
+
mode?: (string & {}) | 'standard' | 'pro';
|
|
140
|
+
/**
|
|
141
|
+
* A summary of the reasoning performed by the model. This can be useful for
|
|
142
|
+
* debugging and understanding the model's reasoning process. One of `auto`,
|
|
143
|
+
* `concise`, or `detailed`.
|
|
144
|
+
*
|
|
145
|
+
* `concise` is supported for `computer-use-preview` models and all reasoning
|
|
146
|
+
* models after `gpt-5`.
|
|
147
|
+
*/
|
|
148
|
+
summary?: 'auto' | 'concise' | 'detailed' | null;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Configuration options for a text response from the model. Can be plain text or
|
|
152
|
+
* structured JSON data. Learn more:
|
|
153
|
+
*
|
|
154
|
+
* - [Text inputs and outputs](https://platform.openai.com/docs/guides/text)
|
|
155
|
+
* - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs)
|
|
156
|
+
*/
|
|
157
|
+
interface Text {
|
|
158
|
+
/**
|
|
159
|
+
* An object specifying the format that the model must output.
|
|
160
|
+
*
|
|
161
|
+
* Configuring `{ "type": "json_schema" }` enables Structured Outputs, which
|
|
162
|
+
* ensures the model will match your supplied JSON schema. Learn more in the
|
|
163
|
+
* [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs).
|
|
164
|
+
*
|
|
165
|
+
* The default format is `{ "type": "text" }` with no additional options.
|
|
166
|
+
*
|
|
167
|
+
* **Not recommended for gpt-4o and newer models:**
|
|
168
|
+
*
|
|
169
|
+
* Setting to `{ "type": "json_object" }` enables the older JSON mode, which
|
|
170
|
+
* ensures the message the model generates is valid JSON. Using `json_schema` is
|
|
171
|
+
* preferred for models that support it.
|
|
172
|
+
*/
|
|
173
|
+
format?: ResponsesAPI.BetaResponseFormatTextConfig;
|
|
174
|
+
/**
|
|
175
|
+
* Constrains the verbosity of the model's response. Lower values will result in
|
|
176
|
+
* more concise responses, while higher values will result in more verbose
|
|
177
|
+
* responses. Currently supported values are `low`, `medium`, and `high`.
|
|
178
|
+
*/
|
|
179
|
+
verbosity?: 'low' | 'medium' | 'high' | null;
|
|
180
|
+
}
|
|
181
|
+
interface BetaSpecificProgrammaticToolCallingParam {
|
|
182
|
+
/**
|
|
183
|
+
* The tool to call. Always `programmatic_tool_calling`.
|
|
184
|
+
*/
|
|
185
|
+
type: 'programmatic_tool_calling';
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
export declare namespace InputTokens {
|
|
189
|
+
export { type InputTokenCountResponse as InputTokenCountResponse, type InputTokenCountParams as InputTokenCountParams, };
|
|
190
|
+
}
|
|
191
|
+
//# sourceMappingURL=input-tokens.d.ts.map
|