openai 4.53.2 → 4.55.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 +29 -0
- package/README.md +2 -2
- package/_vendor/partial-json-parser/parser.d.ts +3 -0
- package/_vendor/partial-json-parser/parser.d.ts.map +1 -0
- package/_vendor/partial-json-parser/parser.js +226 -0
- package/_vendor/partial-json-parser/parser.js.map +1 -0
- package/_vendor/partial-json-parser/parser.mjs +223 -0
- package/_vendor/partial-json-parser/parser.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/Options.d.ts +32 -0
- package/_vendor/zod-to-json-schema/Options.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/Options.js +36 -0
- package/_vendor/zod-to-json-schema/Options.js.map +1 -0
- package/_vendor/zod-to-json-schema/Options.mjs +32 -0
- package/_vendor/zod-to-json-schema/Options.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/Refs.d.ts +15 -0
- package/_vendor/zod-to-json-schema/Refs.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/Refs.js +26 -0
- package/_vendor/zod-to-json-schema/Refs.js.map +1 -0
- package/_vendor/zod-to-json-schema/Refs.mjs +22 -0
- package/_vendor/zod-to-json-schema/Refs.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/errorMessages.d.ts +12 -0
- package/_vendor/zod-to-json-schema/errorMessages.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/errorMessages.js +20 -0
- package/_vendor/zod-to-json-schema/errorMessages.js.map +1 -0
- package/_vendor/zod-to-json-schema/errorMessages.mjs +15 -0
- package/_vendor/zod-to-json-schema/errorMessages.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/index.d.ts +38 -0
- package/_vendor/zod-to-json-schema/index.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/index.js +54 -0
- package/_vendor/zod-to-json-schema/index.js.map +1 -0
- package/_vendor/zod-to-json-schema/index.mjs +38 -0
- package/_vendor/zod-to-json-schema/index.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/parseDef.d.ts +38 -0
- package/_vendor/zod-to-json-schema/parseDef.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/parseDef.js +168 -0
- package/_vendor/zod-to-json-schema/parseDef.js.map +1 -0
- package/_vendor/zod-to-json-schema/parseDef.mjs +164 -0
- package/_vendor/zod-to-json-schema/parseDef.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/any.d.ts +3 -0
- package/_vendor/zod-to-json-schema/parsers/any.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/any.js +8 -0
- package/_vendor/zod-to-json-schema/parsers/any.js.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/any.mjs +4 -0
- package/_vendor/zod-to-json-schema/parsers/any.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/array.d.ts +13 -0
- package/_vendor/zod-to-json-schema/parsers/array.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/array.js +30 -0
- package/_vendor/zod-to-json-schema/parsers/array.js.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/array.mjs +26 -0
- package/_vendor/zod-to-json-schema/parsers/array.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/bigint.d.ts +15 -0
- package/_vendor/zod-to-json-schema/parsers/bigint.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/bigint.js +54 -0
- package/_vendor/zod-to-json-schema/parsers/bigint.js.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/bigint.mjs +50 -0
- package/_vendor/zod-to-json-schema/parsers/bigint.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/boolean.d.ts +5 -0
- package/_vendor/zod-to-json-schema/parsers/boolean.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/boolean.js +10 -0
- package/_vendor/zod-to-json-schema/parsers/boolean.js.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/boolean.mjs +6 -0
- package/_vendor/zod-to-json-schema/parsers/boolean.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/branded.d.ts +4 -0
- package/_vendor/zod-to-json-schema/parsers/branded.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/branded.js +9 -0
- package/_vendor/zod-to-json-schema/parsers/branded.js.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/branded.mjs +5 -0
- package/_vendor/zod-to-json-schema/parsers/branded.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/catch.d.ts +4 -0
- package/_vendor/zod-to-json-schema/parsers/catch.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/catch.js +9 -0
- package/_vendor/zod-to-json-schema/parsers/catch.js.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/catch.mjs +5 -0
- package/_vendor/zod-to-json-schema/parsers/catch.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/date.d.ts +16 -0
- package/_vendor/zod-to-json-schema/parsers/date.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/date.js +51 -0
- package/_vendor/zod-to-json-schema/parsers/date.js.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/date.mjs +47 -0
- package/_vendor/zod-to-json-schema/parsers/date.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/default.d.ts +7 -0
- package/_vendor/zod-to-json-schema/parsers/default.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/default.js +12 -0
- package/_vendor/zod-to-json-schema/parsers/default.js.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/default.mjs +8 -0
- package/_vendor/zod-to-json-schema/parsers/default.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/effects.d.ts +5 -0
- package/_vendor/zod-to-json-schema/parsers/effects.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/effects.js +9 -0
- package/_vendor/zod-to-json-schema/parsers/effects.js.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/effects.mjs +5 -0
- package/_vendor/zod-to-json-schema/parsers/effects.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/enum.d.ts +7 -0
- package/_vendor/zod-to-json-schema/parsers/enum.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/enum.js +11 -0
- package/_vendor/zod-to-json-schema/parsers/enum.js.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/enum.mjs +7 -0
- package/_vendor/zod-to-json-schema/parsers/enum.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/intersection.d.ts +9 -0
- package/_vendor/zod-to-json-schema/parsers/intersection.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/intersection.js +54 -0
- package/_vendor/zod-to-json-schema/parsers/intersection.js.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/intersection.mjs +50 -0
- package/_vendor/zod-to-json-schema/parsers/intersection.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/literal.d.ts +10 -0
- package/_vendor/zod-to-json-schema/parsers/literal.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/literal.js +26 -0
- package/_vendor/zod-to-json-schema/parsers/literal.js.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/literal.mjs +22 -0
- package/_vendor/zod-to-json-schema/parsers/literal.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/map.d.ts +16 -0
- package/_vendor/zod-to-json-schema/parsers/map.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/map.js +30 -0
- package/_vendor/zod-to-json-schema/parsers/map.js.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/map.mjs +26 -0
- package/_vendor/zod-to-json-schema/parsers/map.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/nativeEnum.d.ts +7 -0
- package/_vendor/zod-to-json-schema/parsers/nativeEnum.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/nativeEnum.js +21 -0
- package/_vendor/zod-to-json-schema/parsers/nativeEnum.js.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/nativeEnum.mjs +17 -0
- package/_vendor/zod-to-json-schema/parsers/nativeEnum.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/never.d.ts +5 -0
- package/_vendor/zod-to-json-schema/parsers/never.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/never.js +10 -0
- package/_vendor/zod-to-json-schema/parsers/never.js.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/never.mjs +6 -0
- package/_vendor/zod-to-json-schema/parsers/never.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/null.d.ts +6 -0
- package/_vendor/zod-to-json-schema/parsers/null.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/null.js +15 -0
- package/_vendor/zod-to-json-schema/parsers/null.js.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/null.mjs +11 -0
- package/_vendor/zod-to-json-schema/parsers/null.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/nullable.d.ts +11 -0
- package/_vendor/zod-to-json-schema/parsers/nullable.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/nullable.js +35 -0
- package/_vendor/zod-to-json-schema/parsers/nullable.js.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/nullable.mjs +31 -0
- package/_vendor/zod-to-json-schema/parsers/nullable.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/number.d.ts +14 -0
- package/_vendor/zod-to-json-schema/parsers/number.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/number.js +57 -0
- package/_vendor/zod-to-json-schema/parsers/number.js.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/number.mjs +53 -0
- package/_vendor/zod-to-json-schema/parsers/number.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/object.d.ts +11 -0
- package/_vendor/zod-to-json-schema/parsers/object.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/object.js +51 -0
- package/_vendor/zod-to-json-schema/parsers/object.js.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/object.mjs +47 -0
- package/_vendor/zod-to-json-schema/parsers/object.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/optional.d.ts +5 -0
- package/_vendor/zod-to-json-schema/parsers/optional.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/optional.js +25 -0
- package/_vendor/zod-to-json-schema/parsers/optional.js.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/optional.mjs +21 -0
- package/_vendor/zod-to-json-schema/parsers/optional.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/pipeline.d.ts +6 -0
- package/_vendor/zod-to-json-schema/parsers/pipeline.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/pipeline.js +25 -0
- package/_vendor/zod-to-json-schema/parsers/pipeline.js.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/pipeline.mjs +21 -0
- package/_vendor/zod-to-json-schema/parsers/pipeline.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/promise.d.ts +5 -0
- package/_vendor/zod-to-json-schema/parsers/promise.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/promise.js +9 -0
- package/_vendor/zod-to-json-schema/parsers/promise.js.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/promise.mjs +5 -0
- package/_vendor/zod-to-json-schema/parsers/promise.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/readonly.d.ts +4 -0
- package/_vendor/zod-to-json-schema/parsers/readonly.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/readonly.js +9 -0
- package/_vendor/zod-to-json-schema/parsers/readonly.js.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/readonly.mjs +5 -0
- package/_vendor/zod-to-json-schema/parsers/readonly.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/record.d.ts +14 -0
- package/_vendor/zod-to-json-schema/parsers/record.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/record.js +50 -0
- package/_vendor/zod-to-json-schema/parsers/record.js.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/record.mjs +46 -0
- package/_vendor/zod-to-json-schema/parsers/record.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/set.d.ts +14 -0
- package/_vendor/zod-to-json-schema/parsers/set.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/set.js +25 -0
- package/_vendor/zod-to-json-schema/parsers/set.js.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/set.mjs +21 -0
- package/_vendor/zod-to-json-schema/parsers/set.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/string.d.ts +70 -0
- package/_vendor/zod-to-json-schema/parsers/string.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/string.js +316 -0
- package/_vendor/zod-to-json-schema/parsers/string.js.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/string.mjs +312 -0
- package/_vendor/zod-to-json-schema/parsers/string.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/tuple.d.ts +14 -0
- package/_vendor/zod-to-json-schema/parsers/tuple.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/tuple.js +37 -0
- package/_vendor/zod-to-json-schema/parsers/tuple.js.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/tuple.mjs +33 -0
- package/_vendor/zod-to-json-schema/parsers/tuple.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/undefined.d.ts +5 -0
- package/_vendor/zod-to-json-schema/parsers/undefined.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/undefined.js +10 -0
- package/_vendor/zod-to-json-schema/parsers/undefined.js.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/undefined.mjs +6 -0
- package/_vendor/zod-to-json-schema/parsers/undefined.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/union.d.ts +24 -0
- package/_vendor/zod-to-json-schema/parsers/union.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/union.js +77 -0
- package/_vendor/zod-to-json-schema/parsers/union.js.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/union.mjs +73 -0
- package/_vendor/zod-to-json-schema/parsers/union.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/unknown.d.ts +3 -0
- package/_vendor/zod-to-json-schema/parsers/unknown.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/unknown.js +8 -0
- package/_vendor/zod-to-json-schema/parsers/unknown.js.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/unknown.mjs +4 -0
- package/_vendor/zod-to-json-schema/parsers/unknown.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/zodToJsonSchema.d.ts +11 -0
- package/_vendor/zod-to-json-schema/zodToJsonSchema.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/zodToJsonSchema.js +53 -0
- package/_vendor/zod-to-json-schema/zodToJsonSchema.js.map +1 -0
- package/_vendor/zod-to-json-schema/zodToJsonSchema.mjs +50 -0
- package/_vendor/zod-to-json-schema/zodToJsonSchema.mjs.map +1 -0
- package/error.d.ts +6 -0
- package/error.d.ts.map +1 -1
- package/error.js +13 -1
- package/error.js.map +1 -1
- package/error.mjs +10 -0
- package/error.mjs.map +1 -1
- package/helpers/zod.d.ts +57 -0
- package/helpers/zod.d.ts.map +1 -0
- package/helpers/zod.js +79 -0
- package/helpers/zod.js.map +1 -0
- package/helpers/zod.mjs +74 -0
- package/helpers/zod.mjs.map +1 -0
- package/index.d.mts +8 -0
- package/index.d.ts +8 -0
- package/index.d.ts.map +1 -1
- package/index.js +1 -0
- package/index.js.map +1 -1
- package/index.mjs +1 -0
- package/index.mjs.map +1 -1
- package/lib/AbstractChatCompletionRunner.d.ts +15 -68
- package/lib/AbstractChatCompletionRunner.d.ts.map +1 -1
- package/lib/AbstractChatCompletionRunner.js +47 -200
- package/lib/AbstractChatCompletionRunner.js.map +1 -1
- package/lib/AbstractChatCompletionRunner.mjs +48 -201
- package/lib/AbstractChatCompletionRunner.mjs.map +1 -1
- package/lib/AssistantStream.d.ts +10 -6
- package/lib/AssistantStream.d.ts.map +1 -1
- package/lib/AssistantStream.js +18 -6
- package/lib/AssistantStream.js.map +1 -1
- package/lib/AssistantStream.mjs +18 -6
- package/lib/AssistantStream.mjs.map +1 -1
- package/lib/ChatCompletionRunner.d.ts +8 -6
- package/lib/ChatCompletionRunner.d.ts.map +1 -1
- package/lib/ChatCompletionRunner.js +4 -4
- package/lib/ChatCompletionRunner.js.map +1 -1
- package/lib/ChatCompletionRunner.mjs +4 -4
- package/lib/ChatCompletionRunner.mjs.map +1 -1
- package/lib/ChatCompletionStream.d.ts +71 -12
- package/lib/ChatCompletionStream.d.ts.map +1 -1
- package/lib/ChatCompletionStream.js +233 -42
- package/lib/ChatCompletionStream.js.map +1 -1
- package/lib/ChatCompletionStream.mjs +234 -43
- package/lib/ChatCompletionStream.mjs.map +1 -1
- package/lib/ChatCompletionStreamingRunner.d.ts +8 -6
- package/lib/ChatCompletionStreamingRunner.d.ts.map +1 -1
- package/lib/ChatCompletionStreamingRunner.js +9 -7
- package/lib/ChatCompletionStreamingRunner.js.map +1 -1
- package/lib/ChatCompletionStreamingRunner.mjs +9 -7
- package/lib/ChatCompletionStreamingRunner.mjs.map +1 -1
- package/lib/EventStream.d.ts +63 -0
- package/lib/EventStream.d.ts.map +1 -0
- package/lib/EventStream.js +200 -0
- package/lib/EventStream.js.map +1 -0
- package/lib/EventStream.mjs +196 -0
- package/lib/EventStream.mjs.map +1 -0
- package/lib/RunnableFunction.d.ts +4 -2
- package/lib/RunnableFunction.d.ts.map +1 -1
- package/lib/RunnableFunction.js.map +1 -1
- package/lib/RunnableFunction.mjs.map +1 -1
- package/lib/parser.d.ts +37 -0
- package/lib/parser.d.ts.map +1 -0
- package/lib/parser.js +133 -0
- package/lib/parser.js.map +1 -0
- package/lib/parser.mjs +121 -0
- package/lib/parser.mjs.map +1 -0
- package/package.json +10 -2
- package/resources/audio/audio.d.ts +4 -0
- package/resources/audio/audio.d.ts.map +1 -1
- package/resources/audio/audio.js.map +1 -1
- package/resources/audio/audio.mjs.map +1 -1
- package/resources/audio/index.d.ts +2 -2
- package/resources/audio/index.d.ts.map +1 -1
- package/resources/audio/index.js.map +1 -1
- package/resources/audio/index.mjs.map +1 -1
- package/resources/audio/speech.d.ts +3 -1
- package/resources/audio/speech.d.ts.map +1 -1
- package/resources/audio/speech.js.map +1 -1
- package/resources/audio/speech.mjs.map +1 -1
- package/resources/audio/transcriptions.d.ts +2 -1
- package/resources/audio/transcriptions.d.ts.map +1 -1
- package/resources/audio/transcriptions.js.map +1 -1
- package/resources/audio/transcriptions.mjs.map +1 -1
- package/resources/audio/translations.d.ts +2 -1
- package/resources/audio/translations.d.ts.map +1 -1
- package/resources/audio/translations.js.map +1 -1
- package/resources/audio/translations.mjs.map +1 -1
- package/resources/beta/assistants.d.ts +19 -3
- package/resources/beta/assistants.d.ts.map +1 -1
- package/resources/beta/assistants.js.map +1 -1
- package/resources/beta/assistants.mjs.map +1 -1
- package/resources/beta/beta.d.ts +0 -1
- package/resources/beta/beta.d.ts.map +1 -1
- package/resources/beta/beta.js.map +1 -1
- package/resources/beta/beta.mjs.map +1 -1
- package/resources/beta/chat/completions.d.ts +25 -5
- package/resources/beta/chat/completions.d.ts.map +1 -1
- package/resources/beta/chat/completions.js +17 -5
- package/resources/beta/chat/completions.js.map +1 -1
- package/resources/beta/chat/completions.mjs +17 -5
- package/resources/beta/chat/completions.mjs.map +1 -1
- package/resources/beta/index.d.ts +1 -1
- package/resources/beta/index.d.ts.map +1 -1
- package/resources/beta/index.js.map +1 -1
- package/resources/beta/index.mjs.map +1 -1
- package/resources/beta/threads/index.d.ts +2 -2
- package/resources/beta/threads/index.d.ts.map +1 -1
- package/resources/beta/threads/index.js.map +1 -1
- package/resources/beta/threads/index.mjs.map +1 -1
- package/resources/beta/threads/messages.d.ts +28 -2
- package/resources/beta/threads/messages.d.ts.map +1 -1
- package/resources/beta/threads/messages.js.map +1 -1
- package/resources/beta/threads/messages.mjs.map +1 -1
- package/resources/beta/threads/runs/runs.d.ts +12 -1
- 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/beta/threads/threads.d.ts +22 -8
- package/resources/beta/threads/threads.d.ts.map +1 -1
- package/resources/beta/threads/threads.js.map +1 -1
- package/resources/beta/threads/threads.mjs.map +1 -1
- package/resources/beta/vector-stores/files.d.ts +1 -1
- package/resources/beta/vector-stores/files.d.ts.map +1 -1
- package/resources/chat/chat.d.ts +2 -1
- package/resources/chat/chat.d.ts.map +1 -1
- package/resources/chat/chat.js.map +1 -1
- package/resources/chat/chat.mjs.map +1 -1
- package/resources/chat/completions.d.ts +37 -26
- package/resources/chat/completions.d.ts.map +1 -1
- package/resources/chat/completions.js.map +1 -1
- package/resources/chat/completions.mjs.map +1 -1
- package/resources/chat/index.d.ts +1 -1
- package/resources/chat/index.d.ts.map +1 -1
- package/resources/chat/index.js.map +1 -1
- package/resources/chat/index.mjs.map +1 -1
- package/resources/fine-tuning/jobs/jobs.d.ts +3 -3
- package/resources/fine-tuning/jobs/jobs.d.ts.map +1 -1
- package/resources/images.d.ts +5 -3
- package/resources/images.d.ts.map +1 -1
- package/resources/images.js.map +1 -1
- package/resources/images.mjs.map +1 -1
- package/resources/index.d.ts +3 -3
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/moderations.d.ts +3 -1
- package/resources/moderations.d.ts.map +1 -1
- package/resources/moderations.js.map +1 -1
- package/resources/moderations.mjs.map +1 -1
- package/resources/shared.d.ts +53 -0
- package/resources/shared.d.ts.map +1 -1
- package/src/_vendor/partial-json-parser/README.md +3 -0
- package/src/_vendor/partial-json-parser/parser.ts +264 -0
- package/src/_vendor/zod-to-json-schema/Options.ts +73 -0
- package/src/_vendor/zod-to-json-schema/Refs.ts +39 -0
- package/src/_vendor/zod-to-json-schema/errorMessages.ts +31 -0
- package/src/_vendor/zod-to-json-schema/index.ts +37 -0
- package/src/_vendor/zod-to-json-schema/parseDef.ts +231 -0
- package/src/_vendor/zod-to-json-schema/parsers/any.ts +5 -0
- package/src/_vendor/zod-to-json-schema/parsers/array.ts +36 -0
- package/src/_vendor/zod-to-json-schema/parsers/bigint.ts +60 -0
- package/src/_vendor/zod-to-json-schema/parsers/boolean.ts +9 -0
- package/src/_vendor/zod-to-json-schema/parsers/branded.ts +7 -0
- package/src/_vendor/zod-to-json-schema/parsers/catch.ts +7 -0
- package/src/_vendor/zod-to-json-schema/parsers/date.ts +83 -0
- package/src/_vendor/zod-to-json-schema/parsers/default.ts +10 -0
- package/src/_vendor/zod-to-json-schema/parsers/effects.ts +7 -0
- package/src/_vendor/zod-to-json-schema/parsers/enum.ts +13 -0
- package/src/_vendor/zod-to-json-schema/parsers/intersection.ts +64 -0
- package/src/_vendor/zod-to-json-schema/parsers/literal.ts +37 -0
- package/src/_vendor/zod-to-json-schema/parsers/map.ts +42 -0
- package/src/_vendor/zod-to-json-schema/parsers/nativeEnum.ts +27 -0
- package/src/_vendor/zod-to-json-schema/parsers/never.ts +9 -0
- package/src/_vendor/zod-to-json-schema/parsers/null.ts +16 -0
- package/src/_vendor/zod-to-json-schema/parsers/nullable.ts +49 -0
- package/src/_vendor/zod-to-json-schema/parsers/number.ts +62 -0
- package/src/_vendor/zod-to-json-schema/parsers/object.ts +63 -0
- package/src/_vendor/zod-to-json-schema/parsers/optional.ts +25 -0
- package/src/_vendor/zod-to-json-schema/parsers/pipeline.ts +28 -0
- package/src/_vendor/zod-to-json-schema/parsers/promise.ts +7 -0
- package/src/_vendor/zod-to-json-schema/parsers/readonly.ts +7 -0
- package/src/_vendor/zod-to-json-schema/parsers/record.ts +73 -0
- package/src/_vendor/zod-to-json-schema/parsers/set.ts +36 -0
- package/src/_vendor/zod-to-json-schema/parsers/string.ts +400 -0
- package/src/_vendor/zod-to-json-schema/parsers/tuple.ts +54 -0
- package/src/_vendor/zod-to-json-schema/parsers/undefined.ts +9 -0
- package/src/_vendor/zod-to-json-schema/parsers/union.ts +119 -0
- package/src/_vendor/zod-to-json-schema/parsers/unknown.ts +5 -0
- package/src/_vendor/zod-to-json-schema/zodToJsonSchema.ts +91 -0
- package/src/error.ts +12 -0
- package/src/helpers/zod.ts +102 -0
- package/src/index.ts +8 -0
- package/src/lib/AbstractChatCompletionRunner.ts +72 -258
- package/src/lib/AssistantStream.ts +47 -19
- package/src/lib/ChatCompletionRunner.ts +16 -12
- package/src/lib/ChatCompletionStream.ts +423 -47
- package/src/lib/ChatCompletionStreamingRunner.ts +19 -15
- package/src/lib/{AbstractAssistantStreamRunner.ts → EventStream.ts} +37 -138
- package/src/lib/RunnableFunction.ts +4 -2
- package/src/lib/parser.ts +235 -0
- package/src/resources/audio/audio.ts +5 -0
- package/src/resources/audio/index.ts +2 -2
- package/src/resources/audio/speech.ts +4 -1
- package/src/resources/audio/transcriptions.ts +2 -1
- package/src/resources/audio/translations.ts +2 -1
- package/src/resources/beta/assistants.ts +19 -26
- package/src/resources/beta/beta.ts +0 -1
- package/src/resources/beta/chat/completions.ts +77 -27
- package/src/resources/beta/index.ts +0 -1
- package/src/resources/beta/threads/index.ts +2 -1
- package/src/resources/beta/threads/messages.ts +41 -2
- package/src/resources/beta/threads/runs/runs.ts +12 -25
- package/src/resources/beta/threads/threads.ts +26 -32
- package/src/resources/beta/vector-stores/files.ts +1 -1
- package/src/resources/chat/chat.ts +2 -0
- package/src/resources/chat/completions.ts +47 -27
- package/src/resources/chat/index.ts +1 -0
- package/src/resources/fine-tuning/jobs/jobs.ts +3 -3
- package/src/resources/images.ts +6 -3
- package/src/resources/index.ts +9 -2
- package/src/resources/moderations.ts +4 -1
- package/src/resources/shared.ts +62 -0
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
- package/lib/AbstractAssistantStreamRunner.d.ts +0 -74
- package/lib/AbstractAssistantStreamRunner.d.ts.map +0 -1
- package/lib/AbstractAssistantStreamRunner.js +0 -246
- package/lib/AbstractAssistantStreamRunner.js.map +0 -1
- package/lib/AbstractAssistantStreamRunner.mjs +0 -242
- package/lib/AbstractAssistantStreamRunner.mjs.map +0 -1
- package/lib/ChatCompletionRunFunctions.test.d.ts +0 -2
- package/lib/ChatCompletionRunFunctions.test.d.ts.map +0 -1
- package/lib/ChatCompletionRunFunctions.test.js +0 -2177
- package/lib/ChatCompletionRunFunctions.test.js.map +0 -1
- package/lib/ChatCompletionRunFunctions.test.mjs +0 -2172
- package/lib/ChatCompletionRunFunctions.test.mjs.map +0 -1
- package/src/lib/ChatCompletionRunFunctions.test.ts +0 -2328
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { APIResource } from '../../resource';
|
|
4
4
|
import * as Core from '../../core';
|
|
5
5
|
import * as TranscriptionsAPI from './transcriptions';
|
|
6
|
+
import * as AudioAPI from './audio';
|
|
6
7
|
|
|
7
8
|
export class Transcriptions extends APIResource {
|
|
8
9
|
/**
|
|
@@ -35,7 +36,7 @@ export interface TranscriptionCreateParams {
|
|
|
35
36
|
* ID of the model to use. Only `whisper-1` (which is powered by our open source
|
|
36
37
|
* Whisper V2 model) is currently available.
|
|
37
38
|
*/
|
|
38
|
-
model: (string & {}) |
|
|
39
|
+
model: (string & {}) | AudioAPI.AudioModel;
|
|
39
40
|
|
|
40
41
|
/**
|
|
41
42
|
* The language of the input audio. Supplying the input language in
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { APIResource } from '../../resource';
|
|
4
4
|
import * as Core from '../../core';
|
|
5
5
|
import * as TranslationsAPI from './translations';
|
|
6
|
+
import * as AudioAPI from './audio';
|
|
6
7
|
|
|
7
8
|
export class Translations extends APIResource {
|
|
8
9
|
/**
|
|
@@ -28,7 +29,7 @@ export interface TranslationCreateParams {
|
|
|
28
29
|
* ID of the model to use. Only `whisper-1` (which is powered by our open source
|
|
29
30
|
* Whisper V2 model) is currently available.
|
|
30
31
|
*/
|
|
31
|
-
model: (string & {}) |
|
|
32
|
+
model: (string & {}) | AudioAPI.AudioModel;
|
|
32
33
|
|
|
33
34
|
/**
|
|
34
35
|
* An optional text to guide the model's style or continue a previous audio
|
|
@@ -5,6 +5,7 @@ import { isRequestOptions } from '../../core';
|
|
|
5
5
|
import * as Core from '../../core';
|
|
6
6
|
import * as AssistantsAPI from './assistants';
|
|
7
7
|
import * as Shared from '../shared';
|
|
8
|
+
import * as ChatAPI from '../chat/chat';
|
|
8
9
|
import * as MessagesAPI from './threads/messages';
|
|
9
10
|
import * as ThreadsAPI from './threads/threads';
|
|
10
11
|
import * as RunsAPI from './threads/runs/runs';
|
|
@@ -148,6 +149,11 @@ export interface Assistant {
|
|
|
148
149
|
* [GPT-4 Turbo](https://platform.openai.com/docs/models/gpt-4-turbo-and-gpt-4),
|
|
149
150
|
* and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.
|
|
150
151
|
*
|
|
152
|
+
* Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured
|
|
153
|
+
* Outputs which guarantees the model will match your supplied JSON schema. Learn
|
|
154
|
+
* more in the
|
|
155
|
+
* [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs).
|
|
156
|
+
*
|
|
151
157
|
* Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the
|
|
152
158
|
* message the model generates is valid JSON.
|
|
153
159
|
*
|
|
@@ -647,8 +653,8 @@ export namespace FileSearchTool {
|
|
|
647
653
|
export interface FileSearch {
|
|
648
654
|
/**
|
|
649
655
|
* The maximum number of results the file search tool should output. The default is
|
|
650
|
-
* 20 for gpt-4
|
|
651
|
-
* and 50 inclusive.
|
|
656
|
+
* 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between
|
|
657
|
+
* 1 and 50 inclusive.
|
|
652
658
|
*
|
|
653
659
|
* Note that the file search tool may output fewer than `max_num_results` results.
|
|
654
660
|
* See the
|
|
@@ -1053,30 +1059,7 @@ export interface AssistantCreateParams {
|
|
|
1053
1059
|
* [Model overview](https://platform.openai.com/docs/models/overview) for
|
|
1054
1060
|
* descriptions of them.
|
|
1055
1061
|
*/
|
|
1056
|
-
model:
|
|
1057
|
-
| (string & {})
|
|
1058
|
-
| 'gpt-4o'
|
|
1059
|
-
| 'gpt-4o-2024-05-13'
|
|
1060
|
-
| 'gpt-4o-mini'
|
|
1061
|
-
| 'gpt-4o-mini-2024-07-18'
|
|
1062
|
-
| 'gpt-4-turbo'
|
|
1063
|
-
| 'gpt-4-turbo-2024-04-09'
|
|
1064
|
-
| 'gpt-4-0125-preview'
|
|
1065
|
-
| 'gpt-4-turbo-preview'
|
|
1066
|
-
| 'gpt-4-1106-preview'
|
|
1067
|
-
| 'gpt-4-vision-preview'
|
|
1068
|
-
| 'gpt-4'
|
|
1069
|
-
| 'gpt-4-0314'
|
|
1070
|
-
| 'gpt-4-0613'
|
|
1071
|
-
| 'gpt-4-32k'
|
|
1072
|
-
| 'gpt-4-32k-0314'
|
|
1073
|
-
| 'gpt-4-32k-0613'
|
|
1074
|
-
| 'gpt-3.5-turbo'
|
|
1075
|
-
| 'gpt-3.5-turbo-16k'
|
|
1076
|
-
| 'gpt-3.5-turbo-0613'
|
|
1077
|
-
| 'gpt-3.5-turbo-1106'
|
|
1078
|
-
| 'gpt-3.5-turbo-0125'
|
|
1079
|
-
| 'gpt-3.5-turbo-16k-0613';
|
|
1062
|
+
model: (string & {}) | ChatAPI.ChatModel;
|
|
1080
1063
|
|
|
1081
1064
|
/**
|
|
1082
1065
|
* The description of the assistant. The maximum length is 512 characters.
|
|
@@ -1108,6 +1091,11 @@ export interface AssistantCreateParams {
|
|
|
1108
1091
|
* [GPT-4 Turbo](https://platform.openai.com/docs/models/gpt-4-turbo-and-gpt-4),
|
|
1109
1092
|
* and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.
|
|
1110
1093
|
*
|
|
1094
|
+
* Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured
|
|
1095
|
+
* Outputs which guarantees the model will match your supplied JSON schema. Learn
|
|
1096
|
+
* more in the
|
|
1097
|
+
* [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs).
|
|
1098
|
+
*
|
|
1111
1099
|
* Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the
|
|
1112
1100
|
* message the model generates is valid JSON.
|
|
1113
1101
|
*
|
|
@@ -1300,6 +1288,11 @@ export interface AssistantUpdateParams {
|
|
|
1300
1288
|
* [GPT-4 Turbo](https://platform.openai.com/docs/models/gpt-4-turbo-and-gpt-4),
|
|
1301
1289
|
* and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.
|
|
1302
1290
|
*
|
|
1291
|
+
* Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured
|
|
1292
|
+
* Outputs which guarantees the model will match your supplied JSON schema. Learn
|
|
1293
|
+
* more in the
|
|
1294
|
+
* [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs).
|
|
1295
|
+
*
|
|
1303
1296
|
* Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the
|
|
1304
1297
|
* message the model generates is valid JSON.
|
|
1305
1298
|
*
|
|
@@ -39,7 +39,6 @@ export namespace Beta {
|
|
|
39
39
|
export import AssistantUpdateParams = AssistantsAPI.AssistantUpdateParams;
|
|
40
40
|
export import AssistantListParams = AssistantsAPI.AssistantListParams;
|
|
41
41
|
export import Threads = ThreadsAPI.Threads;
|
|
42
|
-
export import AssistantResponseFormat = ThreadsAPI.AssistantResponseFormat;
|
|
43
42
|
export import AssistantResponseFormatOption = ThreadsAPI.AssistantResponseFormatOption;
|
|
44
43
|
export import AssistantToolChoice = ThreadsAPI.AssistantToolChoice;
|
|
45
44
|
export import AssistantToolChoiceFunction = ThreadsAPI.AssistantToolChoiceFunction;
|
|
@@ -26,35 +26,82 @@ export { ChatCompletionToolRunnerParams } from '../../../lib/ChatCompletionRunne
|
|
|
26
26
|
import { ChatCompletionStreamingToolRunnerParams } from '../../../lib/ChatCompletionStreamingRunner';
|
|
27
27
|
export { ChatCompletionStreamingToolRunnerParams } from '../../../lib/ChatCompletionStreamingRunner';
|
|
28
28
|
import { ChatCompletionStream, type ChatCompletionStreamParams } from '../../../lib/ChatCompletionStream';
|
|
29
|
+
import {
|
|
30
|
+
ChatCompletion,
|
|
31
|
+
ChatCompletionCreateParamsNonStreaming,
|
|
32
|
+
ChatCompletionMessage,
|
|
33
|
+
ChatCompletionMessageToolCall,
|
|
34
|
+
} from '../../chat/completions';
|
|
35
|
+
import { ExtractParsedContentFromParams, parseChatCompletion, validateInputTools } from '../../../lib/parser';
|
|
29
36
|
export { ChatCompletionStream, type ChatCompletionStreamParams } from '../../../lib/ChatCompletionStream';
|
|
30
37
|
|
|
38
|
+
export interface ParsedFunction extends ChatCompletionMessageToolCall.Function {
|
|
39
|
+
parsed_arguments?: unknown;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface ParsedFunctionToolCall extends ChatCompletionMessageToolCall {
|
|
43
|
+
function: ParsedFunction;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface ParsedChatCompletionMessage<ParsedT> extends ChatCompletionMessage {
|
|
47
|
+
parsed: ParsedT | null;
|
|
48
|
+
tool_calls: Array<ParsedFunctionToolCall>;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface ParsedChoice<ParsedT> extends ChatCompletion.Choice {
|
|
52
|
+
message: ParsedChatCompletionMessage<ParsedT>;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface ParsedChatCompletion<ParsedT> extends ChatCompletion {
|
|
56
|
+
choices: Array<ParsedChoice<ParsedT>>;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export type ChatCompletionParseParams = ChatCompletionCreateParamsNonStreaming;
|
|
60
|
+
|
|
31
61
|
export class Completions extends APIResource {
|
|
62
|
+
async parse<Params extends ChatCompletionParseParams, ParsedT = ExtractParsedContentFromParams<Params>>(
|
|
63
|
+
body: Params,
|
|
64
|
+
options?: Core.RequestOptions,
|
|
65
|
+
): Promise<ParsedChatCompletion<ParsedT>> {
|
|
66
|
+
validateInputTools(body.tools);
|
|
67
|
+
|
|
68
|
+
const completion = await this._client.chat.completions.create(body, {
|
|
69
|
+
...options,
|
|
70
|
+
headers: {
|
|
71
|
+
...options?.headers,
|
|
72
|
+
'X-Stainless-Helper-Method': 'beta.chat.completions.parse',
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
return parseChatCompletion(completion, body);
|
|
77
|
+
}
|
|
78
|
+
|
|
32
79
|
/**
|
|
33
80
|
* @deprecated - use `runTools` instead.
|
|
34
81
|
*/
|
|
35
82
|
runFunctions<FunctionsArgs extends BaseFunctionsArgs>(
|
|
36
83
|
body: ChatCompletionFunctionRunnerParams<FunctionsArgs>,
|
|
37
84
|
options?: Core.RequestOptions,
|
|
38
|
-
): ChatCompletionRunner
|
|
85
|
+
): ChatCompletionRunner<null>;
|
|
39
86
|
runFunctions<FunctionsArgs extends BaseFunctionsArgs>(
|
|
40
87
|
body: ChatCompletionStreamingFunctionRunnerParams<FunctionsArgs>,
|
|
41
88
|
options?: Core.RequestOptions,
|
|
42
|
-
): ChatCompletionStreamingRunner
|
|
89
|
+
): ChatCompletionStreamingRunner<null>;
|
|
43
90
|
runFunctions<FunctionsArgs extends BaseFunctionsArgs>(
|
|
44
91
|
body:
|
|
45
92
|
| ChatCompletionFunctionRunnerParams<FunctionsArgs>
|
|
46
93
|
| ChatCompletionStreamingFunctionRunnerParams<FunctionsArgs>,
|
|
47
94
|
options?: Core.RequestOptions,
|
|
48
|
-
): ChatCompletionRunner | ChatCompletionStreamingRunner {
|
|
95
|
+
): ChatCompletionRunner<null> | ChatCompletionStreamingRunner<null> {
|
|
49
96
|
if (body.stream) {
|
|
50
97
|
return ChatCompletionStreamingRunner.runFunctions(
|
|
51
|
-
this._client
|
|
98
|
+
this._client,
|
|
52
99
|
body as ChatCompletionStreamingFunctionRunnerParams<FunctionsArgs>,
|
|
53
100
|
options,
|
|
54
101
|
);
|
|
55
102
|
}
|
|
56
103
|
return ChatCompletionRunner.runFunctions(
|
|
57
|
-
this._client
|
|
104
|
+
this._client,
|
|
58
105
|
body as ChatCompletionFunctionRunnerParams<FunctionsArgs>,
|
|
59
106
|
options,
|
|
60
107
|
);
|
|
@@ -69,38 +116,41 @@ export class Completions extends APIResource {
|
|
|
69
116
|
* For more details and examples, see
|
|
70
117
|
* [the docs](https://github.com/openai/openai-node#automated-function-calls)
|
|
71
118
|
*/
|
|
72
|
-
runTools<
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
): ChatCompletionRunner
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
119
|
+
runTools<
|
|
120
|
+
Params extends ChatCompletionToolRunnerParams<any>,
|
|
121
|
+
ParsedT = ExtractParsedContentFromParams<Params>,
|
|
122
|
+
>(body: Params, options?: Core.RequestOptions): ChatCompletionRunner<ParsedT>;
|
|
123
|
+
|
|
124
|
+
runTools<
|
|
125
|
+
Params extends ChatCompletionStreamingToolRunnerParams<any>,
|
|
126
|
+
ParsedT = ExtractParsedContentFromParams<Params>,
|
|
127
|
+
>(body: Params, options?: Core.RequestOptions): ChatCompletionStreamingRunner<ParsedT>;
|
|
128
|
+
|
|
129
|
+
runTools<
|
|
130
|
+
Params extends ChatCompletionToolRunnerParams<any> | ChatCompletionStreamingToolRunnerParams<any>,
|
|
131
|
+
ParsedT = ExtractParsedContentFromParams<Params>,
|
|
132
|
+
>(
|
|
133
|
+
body: Params,
|
|
84
134
|
options?: Core.RequestOptions,
|
|
85
|
-
): ChatCompletionRunner | ChatCompletionStreamingRunner {
|
|
135
|
+
): ChatCompletionRunner<ParsedT> | ChatCompletionStreamingRunner<ParsedT> {
|
|
86
136
|
if (body.stream) {
|
|
87
137
|
return ChatCompletionStreamingRunner.runTools(
|
|
88
|
-
this._client
|
|
89
|
-
body as ChatCompletionStreamingToolRunnerParams<
|
|
138
|
+
this._client,
|
|
139
|
+
body as ChatCompletionStreamingToolRunnerParams<any>,
|
|
90
140
|
options,
|
|
91
141
|
);
|
|
92
142
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
body as ChatCompletionToolRunnerParams<FunctionsArgs>,
|
|
96
|
-
options,
|
|
97
|
-
);
|
|
143
|
+
|
|
144
|
+
return ChatCompletionRunner.runTools(this._client, body as ChatCompletionToolRunnerParams<any>, options);
|
|
98
145
|
}
|
|
99
146
|
|
|
100
147
|
/**
|
|
101
148
|
* Creates a chat completion stream
|
|
102
149
|
*/
|
|
103
|
-
stream
|
|
104
|
-
|
|
150
|
+
stream<Params extends ChatCompletionStreamParams, ParsedT = ExtractParsedContentFromParams<Params>>(
|
|
151
|
+
body: Params,
|
|
152
|
+
options?: Core.RequestOptions,
|
|
153
|
+
): ChatCompletionStream<ParsedT> {
|
|
154
|
+
return ChatCompletionStream.createChatCompletion(this._client, body, options);
|
|
105
155
|
}
|
|
106
156
|
}
|
|
@@ -22,6 +22,8 @@ export {
|
|
|
22
22
|
MessageDeleted,
|
|
23
23
|
MessageDelta,
|
|
24
24
|
MessageDeltaEvent,
|
|
25
|
+
RefusalContentBlock,
|
|
26
|
+
RefusalDeltaBlock,
|
|
25
27
|
Text,
|
|
26
28
|
TextContentBlock,
|
|
27
29
|
TextContentBlockParam,
|
|
@@ -34,7 +36,6 @@ export {
|
|
|
34
36
|
Messages,
|
|
35
37
|
} from './messages';
|
|
36
38
|
export {
|
|
37
|
-
AssistantResponseFormat,
|
|
38
39
|
AssistantResponseFormatOption,
|
|
39
40
|
AssistantToolChoice,
|
|
40
41
|
AssistantToolChoiceFunction,
|
|
@@ -481,13 +481,21 @@ export namespace Message {
|
|
|
481
481
|
* References an image [File](https://platform.openai.com/docs/api-reference/files)
|
|
482
482
|
* in the content of a message.
|
|
483
483
|
*/
|
|
484
|
-
export type MessageContent =
|
|
484
|
+
export type MessageContent =
|
|
485
|
+
| ImageFileContentBlock
|
|
486
|
+
| ImageURLContentBlock
|
|
487
|
+
| TextContentBlock
|
|
488
|
+
| RefusalContentBlock;
|
|
485
489
|
|
|
486
490
|
/**
|
|
487
491
|
* References an image [File](https://platform.openai.com/docs/api-reference/files)
|
|
488
492
|
* in the content of a message.
|
|
489
493
|
*/
|
|
490
|
-
export type MessageContentDelta =
|
|
494
|
+
export type MessageContentDelta =
|
|
495
|
+
| ImageFileDeltaBlock
|
|
496
|
+
| TextDeltaBlock
|
|
497
|
+
| RefusalDeltaBlock
|
|
498
|
+
| ImageURLDeltaBlock;
|
|
491
499
|
|
|
492
500
|
/**
|
|
493
501
|
* References an image [File](https://platform.openai.com/docs/api-reference/files)
|
|
@@ -539,6 +547,35 @@ export interface MessageDeltaEvent {
|
|
|
539
547
|
object: 'thread.message.delta';
|
|
540
548
|
}
|
|
541
549
|
|
|
550
|
+
/**
|
|
551
|
+
* The refusal content generated by the assistant.
|
|
552
|
+
*/
|
|
553
|
+
export interface RefusalContentBlock {
|
|
554
|
+
refusal: string;
|
|
555
|
+
|
|
556
|
+
/**
|
|
557
|
+
* Always `refusal`.
|
|
558
|
+
*/
|
|
559
|
+
type: 'refusal';
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
/**
|
|
563
|
+
* The refusal content that is part of a message.
|
|
564
|
+
*/
|
|
565
|
+
export interface RefusalDeltaBlock {
|
|
566
|
+
/**
|
|
567
|
+
* The index of the refusal part in the message.
|
|
568
|
+
*/
|
|
569
|
+
index: number;
|
|
570
|
+
|
|
571
|
+
/**
|
|
572
|
+
* Always `refusal`.
|
|
573
|
+
*/
|
|
574
|
+
type: 'refusal';
|
|
575
|
+
|
|
576
|
+
refusal?: string;
|
|
577
|
+
}
|
|
578
|
+
|
|
542
579
|
export interface Text {
|
|
543
580
|
annotations: Array<Annotation>;
|
|
544
581
|
|
|
@@ -707,6 +744,8 @@ export namespace Messages {
|
|
|
707
744
|
export import MessageDeleted = MessagesAPI.MessageDeleted;
|
|
708
745
|
export import MessageDelta = MessagesAPI.MessageDelta;
|
|
709
746
|
export import MessageDeltaEvent = MessagesAPI.MessageDeltaEvent;
|
|
747
|
+
export import RefusalContentBlock = MessagesAPI.RefusalContentBlock;
|
|
748
|
+
export import RefusalDeltaBlock = MessagesAPI.RefusalDeltaBlock;
|
|
710
749
|
export import Text = MessagesAPI.Text;
|
|
711
750
|
export import TextContentBlock = MessagesAPI.TextContentBlock;
|
|
712
751
|
export import TextContentBlockParam = MessagesAPI.TextContentBlockParam;
|
|
@@ -9,6 +9,7 @@ import { sleep } from '../../../../core';
|
|
|
9
9
|
import { RunSubmitToolOutputsParamsStream } from '../../../../lib/AssistantStream';
|
|
10
10
|
import * as RunsAPI from './runs';
|
|
11
11
|
import * as AssistantsAPI from '../../assistants';
|
|
12
|
+
import * as ChatAPI from '../../../chat/chat';
|
|
12
13
|
import * as MessagesAPI from '../messages';
|
|
13
14
|
import * as ThreadsAPI from '../threads';
|
|
14
15
|
import * as StepsAPI from './steps';
|
|
@@ -421,6 +422,11 @@ export interface Run {
|
|
|
421
422
|
* [GPT-4 Turbo](https://platform.openai.com/docs/models/gpt-4-turbo-and-gpt-4),
|
|
422
423
|
* and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.
|
|
423
424
|
*
|
|
425
|
+
* Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured
|
|
426
|
+
* Outputs which guarantees the model will match your supplied JSON schema. Learn
|
|
427
|
+
* more in the
|
|
428
|
+
* [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs).
|
|
429
|
+
*
|
|
424
430
|
* Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the
|
|
425
431
|
* message the model generates is valid JSON.
|
|
426
432
|
*
|
|
@@ -668,31 +674,7 @@ export interface RunCreateParamsBase {
|
|
|
668
674
|
* model associated with the assistant. If not, the model associated with the
|
|
669
675
|
* assistant will be used.
|
|
670
676
|
*/
|
|
671
|
-
model?:
|
|
672
|
-
| (string & {})
|
|
673
|
-
| 'gpt-4o'
|
|
674
|
-
| 'gpt-4o-2024-05-13'
|
|
675
|
-
| 'gpt-4o-mini'
|
|
676
|
-
| 'gpt-4o-mini-2024-07-18'
|
|
677
|
-
| 'gpt-4-turbo'
|
|
678
|
-
| 'gpt-4-turbo-2024-04-09'
|
|
679
|
-
| 'gpt-4-0125-preview'
|
|
680
|
-
| 'gpt-4-turbo-preview'
|
|
681
|
-
| 'gpt-4-1106-preview'
|
|
682
|
-
| 'gpt-4-vision-preview'
|
|
683
|
-
| 'gpt-4'
|
|
684
|
-
| 'gpt-4-0314'
|
|
685
|
-
| 'gpt-4-0613'
|
|
686
|
-
| 'gpt-4-32k'
|
|
687
|
-
| 'gpt-4-32k-0314'
|
|
688
|
-
| 'gpt-4-32k-0613'
|
|
689
|
-
| 'gpt-3.5-turbo'
|
|
690
|
-
| 'gpt-3.5-turbo-16k'
|
|
691
|
-
| 'gpt-3.5-turbo-0613'
|
|
692
|
-
| 'gpt-3.5-turbo-1106'
|
|
693
|
-
| 'gpt-3.5-turbo-0125'
|
|
694
|
-
| 'gpt-3.5-turbo-16k-0613'
|
|
695
|
-
| null;
|
|
677
|
+
model?: (string & {}) | ChatAPI.ChatModel | null;
|
|
696
678
|
|
|
697
679
|
/**
|
|
698
680
|
* Whether to enable
|
|
@@ -707,6 +689,11 @@ export interface RunCreateParamsBase {
|
|
|
707
689
|
* [GPT-4 Turbo](https://platform.openai.com/docs/models/gpt-4-turbo-and-gpt-4),
|
|
708
690
|
* and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.
|
|
709
691
|
*
|
|
692
|
+
* Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured
|
|
693
|
+
* Outputs which guarantees the model will match your supplied JSON schema. Learn
|
|
694
|
+
* more in the
|
|
695
|
+
* [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs).
|
|
696
|
+
*
|
|
710
697
|
* Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the
|
|
711
698
|
* message the model generates is valid JSON.
|
|
712
699
|
*
|
|
@@ -6,7 +6,9 @@ import { AssistantStream, ThreadCreateAndRunParamsBaseStream } from '../../../li
|
|
|
6
6
|
import { APIPromise } from '../../../core';
|
|
7
7
|
import * as Core from '../../../core';
|
|
8
8
|
import * as ThreadsAPI from './threads';
|
|
9
|
+
import * as Shared from '../../shared';
|
|
9
10
|
import * as AssistantsAPI from '../assistants';
|
|
11
|
+
import * as ChatAPI from '../../chat/chat';
|
|
10
12
|
import * as MessagesAPI from './messages';
|
|
11
13
|
import * as RunsAPI from './runs/runs';
|
|
12
14
|
import { Stream } from '../../../streaming';
|
|
@@ -117,15 +119,16 @@ export class Threads extends APIResource {
|
|
|
117
119
|
}
|
|
118
120
|
|
|
119
121
|
/**
|
|
120
|
-
|
|
121
|
-
*
|
|
122
|
-
*
|
|
122
|
+
<<<<<<< HEAD
|
|
123
|
+
* An object describing the expected output of the model. If `json_object` or
|
|
124
|
+
* `json_schema`, only `function` type `tools` are allowed to be passed to the Run.
|
|
125
|
+
* If `text` the model can return text or any value needed.
|
|
123
126
|
*/
|
|
124
127
|
export interface AssistantResponseFormat {
|
|
125
128
|
/**
|
|
126
|
-
* Must be one of `text` or `
|
|
129
|
+
* Must be one of `text`, `json_object` or `json_schema`.
|
|
127
130
|
*/
|
|
128
|
-
type?: 'text' | 'json_object';
|
|
131
|
+
type?: 'text' | 'json_object' | 'json_schema';
|
|
129
132
|
}
|
|
130
133
|
|
|
131
134
|
/**
|
|
@@ -134,6 +137,11 @@ export interface AssistantResponseFormat {
|
|
|
134
137
|
* [GPT-4 Turbo](https://platform.openai.com/docs/models/gpt-4-turbo-and-gpt-4),
|
|
135
138
|
* and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.
|
|
136
139
|
*
|
|
140
|
+
* Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured
|
|
141
|
+
* Outputs which guarantees the model will match your supplied JSON schema. Learn
|
|
142
|
+
* more in the
|
|
143
|
+
* [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs).
|
|
144
|
+
*
|
|
137
145
|
* Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the
|
|
138
146
|
* message the model generates is valid JSON.
|
|
139
147
|
*
|
|
@@ -145,7 +153,11 @@ export interface AssistantResponseFormat {
|
|
|
145
153
|
* indicates the generation exceeded `max_tokens` or the conversation exceeded the
|
|
146
154
|
* max context length.
|
|
147
155
|
*/
|
|
148
|
-
export type AssistantResponseFormatOption =
|
|
156
|
+
export type AssistantResponseFormatOption =
|
|
157
|
+
| 'auto'
|
|
158
|
+
| Shared.ResponseFormatText
|
|
159
|
+
| Shared.ResponseFormatJSONObject
|
|
160
|
+
| Shared.ResponseFormatJSONSchema;
|
|
149
161
|
|
|
150
162
|
/**
|
|
151
163
|
* Specifies a tool the model should use. Use to force the model to call a specific
|
|
@@ -545,31 +557,7 @@ export interface ThreadCreateAndRunParamsBase {
|
|
|
545
557
|
* model associated with the assistant. If not, the model associated with the
|
|
546
558
|
* assistant will be used.
|
|
547
559
|
*/
|
|
548
|
-
model?:
|
|
549
|
-
| (string & {})
|
|
550
|
-
| 'gpt-4o'
|
|
551
|
-
| 'gpt-4o-2024-05-13'
|
|
552
|
-
| 'gpt-4o-mini'
|
|
553
|
-
| 'gpt-4o-mini-2024-07-18'
|
|
554
|
-
| 'gpt-4-turbo'
|
|
555
|
-
| 'gpt-4-turbo-2024-04-09'
|
|
556
|
-
| 'gpt-4-0125-preview'
|
|
557
|
-
| 'gpt-4-turbo-preview'
|
|
558
|
-
| 'gpt-4-1106-preview'
|
|
559
|
-
| 'gpt-4-vision-preview'
|
|
560
|
-
| 'gpt-4'
|
|
561
|
-
| 'gpt-4-0314'
|
|
562
|
-
| 'gpt-4-0613'
|
|
563
|
-
| 'gpt-4-32k'
|
|
564
|
-
| 'gpt-4-32k-0314'
|
|
565
|
-
| 'gpt-4-32k-0613'
|
|
566
|
-
| 'gpt-3.5-turbo'
|
|
567
|
-
| 'gpt-3.5-turbo-16k'
|
|
568
|
-
| 'gpt-3.5-turbo-0613'
|
|
569
|
-
| 'gpt-3.5-turbo-1106'
|
|
570
|
-
| 'gpt-3.5-turbo-0125'
|
|
571
|
-
| 'gpt-3.5-turbo-16k-0613'
|
|
572
|
-
| null;
|
|
560
|
+
model?: (string & {}) | ChatAPI.ChatModel | null;
|
|
573
561
|
|
|
574
562
|
/**
|
|
575
563
|
* Whether to enable
|
|
@@ -584,6 +572,11 @@ export interface ThreadCreateAndRunParamsBase {
|
|
|
584
572
|
* [GPT-4 Turbo](https://platform.openai.com/docs/models/gpt-4-turbo-and-gpt-4),
|
|
585
573
|
* and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.
|
|
586
574
|
*
|
|
575
|
+
* Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured
|
|
576
|
+
* Outputs which guarantees the model will match your supplied JSON schema. Learn
|
|
577
|
+
* more in the
|
|
578
|
+
* [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs).
|
|
579
|
+
*
|
|
587
580
|
* Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the
|
|
588
581
|
* message the model generates is valid JSON.
|
|
589
582
|
*
|
|
@@ -1587,7 +1580,6 @@ export namespace ThreadCreateAndRunStreamParams {
|
|
|
1587
1580
|
}
|
|
1588
1581
|
|
|
1589
1582
|
export namespace Threads {
|
|
1590
|
-
export import AssistantResponseFormat = ThreadsAPI.AssistantResponseFormat;
|
|
1591
1583
|
export import AssistantResponseFormatOption = ThreadsAPI.AssistantResponseFormatOption;
|
|
1592
1584
|
export import AssistantToolChoice = ThreadsAPI.AssistantToolChoice;
|
|
1593
1585
|
export import AssistantToolChoiceFunction = ThreadsAPI.AssistantToolChoiceFunction;
|
|
@@ -1641,6 +1633,8 @@ export namespace Threads {
|
|
|
1641
1633
|
export import MessageDeleted = MessagesAPI.MessageDeleted;
|
|
1642
1634
|
export import MessageDelta = MessagesAPI.MessageDelta;
|
|
1643
1635
|
export import MessageDeltaEvent = MessagesAPI.MessageDeltaEvent;
|
|
1636
|
+
export import RefusalContentBlock = MessagesAPI.RefusalContentBlock;
|
|
1637
|
+
export import RefusalDeltaBlock = MessagesAPI.RefusalDeltaBlock;
|
|
1644
1638
|
export import Text = MessagesAPI.Text;
|
|
1645
1639
|
export import TextContentBlock = MessagesAPI.TextContentBlock;
|
|
1646
1640
|
export import TextContentBlockParam = MessagesAPI.TextContentBlockParam;
|
|
@@ -232,7 +232,7 @@ export namespace VectorStoreFile {
|
|
|
232
232
|
/**
|
|
233
233
|
* One of `server_error` or `rate_limit_exceeded`.
|
|
234
234
|
*/
|
|
235
|
-
code: '
|
|
235
|
+
code: 'server_error' | 'unsupported_file' | 'invalid_file';
|
|
236
236
|
|
|
237
237
|
/**
|
|
238
238
|
* A human-readable description of the error.
|
|
@@ -10,6 +10,7 @@ export class Chat extends APIResource {
|
|
|
10
10
|
|
|
11
11
|
export type ChatModel =
|
|
12
12
|
| 'gpt-4o'
|
|
13
|
+
| 'gpt-4o-2024-08-06'
|
|
13
14
|
| 'gpt-4o-2024-05-13'
|
|
14
15
|
| 'gpt-4o-mini'
|
|
15
16
|
| 'gpt-4o-mini-2024-07-18'
|
|
@@ -41,6 +42,7 @@ export namespace Chat {
|
|
|
41
42
|
export import ChatCompletionChunk = CompletionsAPI.ChatCompletionChunk;
|
|
42
43
|
export import ChatCompletionContentPart = CompletionsAPI.ChatCompletionContentPart;
|
|
43
44
|
export import ChatCompletionContentPartImage = CompletionsAPI.ChatCompletionContentPartImage;
|
|
45
|
+
export import ChatCompletionContentPartRefusal = CompletionsAPI.ChatCompletionContentPartRefusal;
|
|
44
46
|
export import ChatCompletionContentPartText = CompletionsAPI.ChatCompletionContentPartText;
|
|
45
47
|
export import ChatCompletionFunctionCallOption = CompletionsAPI.ChatCompletionFunctionCallOption;
|
|
46
48
|
export import ChatCompletionFunctionMessageParam = CompletionsAPI.ChatCompletionFunctionMessageParam;
|