@superinterface/react 5.1.2 → 5.2.0-beta.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/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/server.d.cts +1 -1
- package/dist/server.d.ts +1 -1
- package/package.json +8 -6
- package/types/index.d.ts +4 -0
- package/types/node_modules/openai/LICENSE +201 -0
- package/types/node_modules/openai/_vendor/partial-json-parser/parser.d.mts +7 -0
- package/types/node_modules/openai/_vendor/partial-json-parser/parser.d.ts +7 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/Options.d.mts +32 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/Options.d.ts +32 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/Refs.d.mts +21 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/Refs.d.ts +21 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/errorMessages.d.mts +12 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/errorMessages.d.ts +12 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/index.d.mts +38 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/index.d.ts +38 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/parseDef.d.mts +38 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/parseDef.d.ts +38 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/any.d.mts +3 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/any.d.ts +3 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/array.d.mts +13 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/array.d.ts +13 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/bigint.d.mts +15 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/bigint.d.ts +15 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/boolean.d.mts +5 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/boolean.d.ts +5 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/branded.d.mts +4 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/branded.d.ts +4 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/catch.d.mts +4 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/catch.d.ts +4 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/date.d.mts +16 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/date.d.ts +16 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/default.d.mts +7 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/default.d.ts +7 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/effects.d.mts +5 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/effects.d.ts +5 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/enum.d.mts +7 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/enum.d.ts +7 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/intersection.d.mts +9 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/intersection.d.ts +9 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/literal.d.mts +10 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/literal.d.ts +10 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/map.d.mts +16 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/map.d.ts +16 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/nativeEnum.d.mts +7 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/nativeEnum.d.ts +7 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/never.d.mts +5 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/never.d.ts +5 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/null.d.mts +6 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/null.d.ts +6 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/nullable.d.mts +11 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/nullable.d.ts +11 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/number.d.mts +14 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/number.d.ts +14 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/object.d.mts +11 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/object.d.ts +11 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/optional.d.mts +5 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/optional.d.ts +5 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/pipeline.d.mts +6 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/pipeline.d.ts +6 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/promise.d.mts +5 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/promise.d.ts +5 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/readonly.d.mts +4 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/readonly.d.ts +4 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/record.d.mts +14 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/record.d.ts +14 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/set.d.mts +14 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/set.d.ts +14 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/string.d.mts +70 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/string.d.ts +70 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/tuple.d.mts +14 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/tuple.d.ts +14 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/undefined.d.mts +5 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/undefined.d.ts +5 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/union.d.mts +24 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/union.d.ts +24 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/unknown.d.mts +3 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/unknown.d.ts +3 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/util.d.mts +4 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/util.d.ts +4 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/zodToJsonSchema.d.mts +11 -0
- package/types/node_modules/openai/_vendor/zod-to-json-schema/zodToJsonSchema.d.ts +11 -0
- package/types/node_modules/openai/api-promise.d.mts +2 -0
- package/types/node_modules/openai/api-promise.d.ts +2 -0
- package/types/node_modules/openai/azure.d.mts +63 -0
- package/types/node_modules/openai/azure.d.ts +63 -0
- package/types/node_modules/openai/beta/realtime/index.d.mts +2 -0
- package/types/node_modules/openai/beta/realtime/index.d.ts +2 -0
- package/types/node_modules/openai/beta/realtime/internal-base.d.mts +45 -0
- package/types/node_modules/openai/beta/realtime/internal-base.d.ts +45 -0
- package/types/node_modules/openai/beta/realtime/websocket.d.mts +36 -0
- package/types/node_modules/openai/beta/realtime/websocket.d.ts +36 -0
- package/types/node_modules/openai/beta/realtime/ws.d.mts +27 -0
- package/types/node_modules/openai/beta/realtime/ws.d.ts +27 -0
- package/types/node_modules/openai/client.d.mts +297 -0
- package/types/node_modules/openai/client.d.ts +297 -0
- package/types/node_modules/openai/core/api-promise.d.mts +49 -0
- package/types/node_modules/openai/core/api-promise.d.ts +49 -0
- package/types/node_modules/openai/core/error.d.mts +59 -0
- package/types/node_modules/openai/core/error.d.ts +59 -0
- package/types/node_modules/openai/core/pagination.d.mts +89 -0
- package/types/node_modules/openai/core/pagination.d.ts +89 -0
- package/types/node_modules/openai/core/resource.d.mts +6 -0
- package/types/node_modules/openai/core/resource.d.ts +6 -0
- package/types/node_modules/openai/core/streaming.d.mts +33 -0
- package/types/node_modules/openai/core/streaming.d.ts +33 -0
- package/types/node_modules/openai/core/uploads.d.mts +3 -0
- package/types/node_modules/openai/core/uploads.d.ts +3 -0
- package/types/node_modules/openai/error.d.mts +2 -0
- package/types/node_modules/openai/error.d.ts +2 -0
- package/types/node_modules/openai/helpers/audio.d.mts +9 -0
- package/types/node_modules/openai/helpers/audio.d.ts +9 -0
- package/types/node_modules/openai/helpers/zod.d.mts +70 -0
- package/types/node_modules/openai/helpers/zod.d.ts +70 -0
- package/types/node_modules/openai/index.d.mts +8 -0
- package/types/node_modules/openai/index.d.ts +8 -0
- package/types/node_modules/openai/internal/builtin-types.d.mts +73 -0
- package/types/node_modules/openai/internal/builtin-types.d.ts +73 -0
- package/types/node_modules/openai/internal/decoders/line.d.mts +17 -0
- package/types/node_modules/openai/internal/decoders/line.d.ts +17 -0
- package/types/node_modules/openai/internal/detect-platform.d.mts +15 -0
- package/types/node_modules/openai/internal/detect-platform.d.ts +15 -0
- package/types/node_modules/openai/internal/errors.d.mts +3 -0
- package/types/node_modules/openai/internal/errors.d.ts +3 -0
- package/types/node_modules/openai/internal/headers.d.mts +20 -0
- package/types/node_modules/openai/internal/headers.d.ts +20 -0
- package/types/node_modules/openai/internal/parse.d.mts +17 -0
- package/types/node_modules/openai/internal/parse.d.ts +17 -0
- package/types/node_modules/openai/internal/qs/formats.d.mts +7 -0
- package/types/node_modules/openai/internal/qs/formats.d.ts +7 -0
- package/types/node_modules/openai/internal/qs/index.d.mts +10 -0
- package/types/node_modules/openai/internal/qs/index.d.ts +10 -0
- package/types/node_modules/openai/internal/qs/stringify.d.mts +3 -0
- package/types/node_modules/openai/internal/qs/stringify.d.ts +3 -0
- package/types/node_modules/openai/internal/qs/types.d.mts +57 -0
- package/types/node_modules/openai/internal/qs/types.d.ts +57 -0
- package/types/node_modules/openai/internal/qs/utils.d.mts +15 -0
- package/types/node_modules/openai/internal/qs/utils.d.ts +15 -0
- package/types/node_modules/openai/internal/request-options.d.mts +78 -0
- package/types/node_modules/openai/internal/request-options.d.ts +78 -0
- package/types/node_modules/openai/internal/shim-types.d.mts +17 -0
- package/types/node_modules/openai/internal/shim-types.d.ts +17 -0
- package/types/node_modules/openai/internal/shims.d.mts +20 -0
- package/types/node_modules/openai/internal/shims.d.ts +20 -0
- package/types/node_modules/openai/internal/stream-utils.d.mts +8 -0
- package/types/node_modules/openai/internal/stream-utils.d.ts +8 -0
- package/types/node_modules/openai/internal/to-file.d.mts +45 -0
- package/types/node_modules/openai/internal/to-file.d.ts +45 -0
- package/types/node_modules/openai/internal/types.d.mts +69 -0
- package/types/node_modules/openai/internal/types.d.ts +69 -0
- package/types/node_modules/openai/internal/uploads.d.mts +42 -0
- package/types/node_modules/openai/internal/uploads.d.ts +42 -0
- package/types/node_modules/openai/internal/utils/base64.d.mts +9 -0
- package/types/node_modules/openai/internal/utils/base64.d.ts +9 -0
- package/types/node_modules/openai/internal/utils/bytes.d.mts +4 -0
- package/types/node_modules/openai/internal/utils/bytes.d.ts +4 -0
- package/types/node_modules/openai/internal/utils/env.d.mts +9 -0
- package/types/node_modules/openai/internal/utils/env.d.ts +9 -0
- package/types/node_modules/openai/internal/utils/log.d.mts +37 -0
- package/types/node_modules/openai/internal/utils/log.d.ts +37 -0
- package/types/node_modules/openai/internal/utils/path.d.mts +15 -0
- package/types/node_modules/openai/internal/utils/path.d.ts +15 -0
- package/types/node_modules/openai/internal/utils/sleep.d.mts +2 -0
- package/types/node_modules/openai/internal/utils/sleep.d.ts +2 -0
- package/types/node_modules/openai/internal/utils/uuid.d.mts +5 -0
- package/types/node_modules/openai/internal/utils/uuid.d.ts +5 -0
- package/types/node_modules/openai/internal/utils/values.d.mts +18 -0
- package/types/node_modules/openai/internal/utils/values.d.ts +18 -0
- package/types/node_modules/openai/internal/utils.d.mts +7 -0
- package/types/node_modules/openai/internal/utils.d.ts +7 -0
- package/types/node_modules/openai/lib/AbstractChatCompletionRunner.d.mts +59 -0
- package/types/node_modules/openai/lib/AbstractChatCompletionRunner.d.ts +59 -0
- package/types/node_modules/openai/lib/AssistantStream.d.mts +60 -0
- package/types/node_modules/openai/lib/AssistantStream.d.ts +60 -0
- package/types/node_modules/openai/lib/ChatCompletionRunner.d.mts +16 -0
- package/types/node_modules/openai/lib/ChatCompletionRunner.d.ts +16 -0
- package/types/node_modules/openai/lib/ChatCompletionStream.d.mts +208 -0
- package/types/node_modules/openai/lib/ChatCompletionStream.d.ts +208 -0
- package/types/node_modules/openai/lib/ChatCompletionStreamingRunner.d.mts +19 -0
- package/types/node_modules/openai/lib/ChatCompletionStreamingRunner.d.ts +19 -0
- package/types/node_modules/openai/lib/EventEmitter.d.mts +45 -0
- package/types/node_modules/openai/lib/EventEmitter.d.ts +45 -0
- package/types/node_modules/openai/lib/EventStream.d.mts +62 -0
- package/types/node_modules/openai/lib/EventStream.d.ts +62 -0
- package/types/node_modules/openai/lib/ResponsesParser.d.mts +36 -0
- package/types/node_modules/openai/lib/ResponsesParser.d.ts +36 -0
- package/types/node_modules/openai/lib/RunnableFunction.d.mts +83 -0
- package/types/node_modules/openai/lib/RunnableFunction.d.ts +83 -0
- package/types/node_modules/openai/lib/Util.d.mts +5 -0
- package/types/node_modules/openai/lib/Util.d.ts +5 -0
- package/types/node_modules/openai/lib/chatCompletionUtils.d.mts +5 -0
- package/types/node_modules/openai/lib/chatCompletionUtils.d.ts +5 -0
- package/types/node_modules/openai/lib/jsonschema.d.mts +106 -0
- package/types/node_modules/openai/lib/jsonschema.d.ts +106 -0
- package/types/node_modules/openai/lib/parser.d.mts +47 -0
- package/types/node_modules/openai/lib/parser.d.ts +47 -0
- package/types/node_modules/openai/lib/responses/EventTypes.d.mts +9 -0
- package/types/node_modules/openai/lib/responses/EventTypes.d.ts +9 -0
- package/types/node_modules/openai/lib/responses/ResponseStream.d.mts +59 -0
- package/types/node_modules/openai/lib/responses/ResponseStream.d.ts +59 -0
- package/types/node_modules/openai/package.json +233 -0
- package/types/node_modules/openai/pagination.d.mts +2 -0
- package/types/node_modules/openai/pagination.d.ts +2 -0
- package/types/node_modules/openai/realtime/index.d.mts +2 -0
- package/types/node_modules/openai/realtime/index.d.ts +2 -0
- package/types/node_modules/openai/realtime/internal-base.d.mts +45 -0
- package/types/node_modules/openai/realtime/internal-base.d.ts +45 -0
- package/types/node_modules/openai/realtime/websocket.d.mts +36 -0
- package/types/node_modules/openai/realtime/websocket.d.ts +36 -0
- package/types/node_modules/openai/realtime/ws.d.mts +27 -0
- package/types/node_modules/openai/realtime/ws.d.ts +27 -0
- package/types/node_modules/openai/resource.d.mts +2 -0
- package/types/node_modules/openai/resource.d.ts +2 -0
- package/types/node_modules/openai/resources/audio/audio.d.mts +26 -0
- package/types/node_modules/openai/resources/audio/audio.d.ts +26 -0
- package/types/node_modules/openai/resources/audio/index.d.mts +5 -0
- package/types/node_modules/openai/resources/audio/index.d.ts +5 -0
- package/types/node_modules/openai/resources/audio/speech.d.mts +64 -0
- package/types/node_modules/openai/resources/audio/speech.d.ts +64 -0
- package/types/node_modules/openai/resources/audio/transcriptions.d.mts +485 -0
- package/types/node_modules/openai/resources/audio/transcriptions.d.ts +485 -0
- package/types/node_modules/openai/resources/audio/translations.d.mts +81 -0
- package/types/node_modules/openai/resources/audio/translations.d.ts +81 -0
- package/types/node_modules/openai/resources/audio.d.mts +2 -0
- package/types/node_modules/openai/resources/audio.d.ts +2 -0
- package/types/node_modules/openai/resources/batches.d.mts +279 -0
- package/types/node_modules/openai/resources/batches.d.ts +279 -0
- package/types/node_modules/openai/resources/beta/assistants.d.mts +1232 -0
- package/types/node_modules/openai/resources/beta/assistants.d.ts +1232 -0
- package/types/node_modules/openai/resources/beta/beta.d.mts +18 -0
- package/types/node_modules/openai/resources/beta/beta.d.ts +18 -0
- package/types/node_modules/openai/resources/beta/index.d.mts +5 -0
- package/types/node_modules/openai/resources/beta/index.d.ts +5 -0
- package/types/node_modules/openai/resources/beta/realtime/index.d.mts +4 -0
- package/types/node_modules/openai/resources/beta/realtime/index.d.ts +4 -0
- package/types/node_modules/openai/resources/beta/realtime/realtime.d.mts +2332 -0
- package/types/node_modules/openai/resources/beta/realtime/realtime.d.ts +2332 -0
- package/types/node_modules/openai/resources/beta/realtime/sessions.d.mts +744 -0
- package/types/node_modules/openai/resources/beta/realtime/sessions.d.ts +744 -0
- package/types/node_modules/openai/resources/beta/realtime/transcription-sessions.d.mts +299 -0
- package/types/node_modules/openai/resources/beta/realtime/transcription-sessions.d.ts +299 -0
- package/types/node_modules/openai/resources/beta/realtime.d.mts +2 -0
- package/types/node_modules/openai/resources/beta/realtime.d.ts +2 -0
- package/types/node_modules/openai/resources/beta/threads/index.d.mts +4 -0
- package/types/node_modules/openai/resources/beta/threads/index.d.ts +4 -0
- package/types/node_modules/openai/resources/beta/threads/messages.d.mts +594 -0
- package/types/node_modules/openai/resources/beta/threads/messages.d.ts +594 -0
- package/types/node_modules/openai/resources/beta/threads/runs/index.d.mts +3 -0
- package/types/node_modules/openai/resources/beta/threads/runs/index.d.ts +3 -0
- package/types/node_modules/openai/resources/beta/threads/runs/runs.d.mts +733 -0
- package/types/node_modules/openai/resources/beta/threads/runs/runs.d.ts +733 -0
- package/types/node_modules/openai/resources/beta/threads/runs/steps.d.mts +615 -0
- package/types/node_modules/openai/resources/beta/threads/runs/steps.d.ts +615 -0
- package/types/node_modules/openai/resources/beta/threads/runs.d.mts +2 -0
- package/types/node_modules/openai/resources/beta/threads/runs.d.ts +2 -0
- package/types/node_modules/openai/resources/beta/threads/threads.d.mts +1044 -0
- package/types/node_modules/openai/resources/beta/threads/threads.d.ts +1044 -0
- package/types/node_modules/openai/resources/beta/threads.d.mts +2 -0
- package/types/node_modules/openai/resources/beta/threads.d.ts +2 -0
- package/types/node_modules/openai/resources/beta.d.mts +2 -0
- package/types/node_modules/openai/resources/beta.d.ts +2 -0
- package/types/node_modules/openai/resources/chat/chat.d.mts +13 -0
- package/types/node_modules/openai/resources/chat/chat.d.ts +13 -0
- package/types/node_modules/openai/resources/chat/completions/completions.d.mts +1627 -0
- package/types/node_modules/openai/resources/chat/completions/completions.d.ts +1627 -0
- package/types/node_modules/openai/resources/chat/completions/index.d.mts +4 -0
- package/types/node_modules/openai/resources/chat/completions/index.d.ts +4 -0
- package/types/node_modules/openai/resources/chat/completions/messages.d.mts +34 -0
- package/types/node_modules/openai/resources/chat/completions/messages.d.ts +34 -0
- package/types/node_modules/openai/resources/chat/completions.d.mts +2 -0
- package/types/node_modules/openai/resources/chat/completions.d.ts +2 -0
- package/types/node_modules/openai/resources/chat/index.d.mts +3 -0
- package/types/node_modules/openai/resources/chat/index.d.ts +3 -0
- package/types/node_modules/openai/resources/chat.d.mts +2 -0
- package/types/node_modules/openai/resources/chat.d.ts +2 -0
- package/types/node_modules/openai/resources/completions.d.mts +329 -0
- package/types/node_modules/openai/resources/completions.d.ts +329 -0
- package/types/node_modules/openai/resources/containers/containers.d.mts +200 -0
- package/types/node_modules/openai/resources/containers/containers.d.ts +200 -0
- package/types/node_modules/openai/resources/containers/files/content.d.mts +16 -0
- package/types/node_modules/openai/resources/containers/files/content.d.ts +16 -0
- package/types/node_modules/openai/resources/containers/files/files.d.mts +148 -0
- package/types/node_modules/openai/resources/containers/files/files.d.ts +148 -0
- package/types/node_modules/openai/resources/containers/files/index.d.mts +3 -0
- package/types/node_modules/openai/resources/containers/files/index.d.ts +3 -0
- package/types/node_modules/openai/resources/containers/files.d.mts +2 -0
- package/types/node_modules/openai/resources/containers/files.d.ts +2 -0
- package/types/node_modules/openai/resources/containers/index.d.mts +3 -0
- package/types/node_modules/openai/resources/containers/index.d.ts +3 -0
- package/types/node_modules/openai/resources/containers.d.mts +2 -0
- package/types/node_modules/openai/resources/containers.d.ts +2 -0
- package/types/node_modules/openai/resources/conversations/conversations.d.mts +176 -0
- package/types/node_modules/openai/resources/conversations/conversations.d.ts +176 -0
- package/types/node_modules/openai/resources/conversations/index.d.mts +3 -0
- package/types/node_modules/openai/resources/conversations/index.d.ts +3 -0
- package/types/node_modules/openai/resources/conversations/items.d.mts +367 -0
- package/types/node_modules/openai/resources/conversations/items.d.ts +367 -0
- package/types/node_modules/openai/resources/conversations.d.mts +2 -0
- package/types/node_modules/openai/resources/conversations.d.ts +2 -0
- package/types/node_modules/openai/resources/embeddings.d.mts +113 -0
- package/types/node_modules/openai/resources/embeddings.d.ts +113 -0
- package/types/node_modules/openai/resources/evals/evals.d.mts +735 -0
- package/types/node_modules/openai/resources/evals/evals.d.ts +735 -0
- package/types/node_modules/openai/resources/evals/index.d.mts +3 -0
- package/types/node_modules/openai/resources/evals/index.d.ts +3 -0
- package/types/node_modules/openai/resources/evals/runs/index.d.mts +3 -0
- package/types/node_modules/openai/resources/evals/runs/index.d.ts +3 -0
- package/types/node_modules/openai/resources/evals/runs/output-items.d.mts +382 -0
- package/types/node_modules/openai/resources/evals/runs/output-items.d.ts +382 -0
- package/types/node_modules/openai/resources/evals/runs/runs.d.mts +2290 -0
- package/types/node_modules/openai/resources/evals/runs/runs.d.ts +2290 -0
- package/types/node_modules/openai/resources/evals/runs.d.mts +2 -0
- package/types/node_modules/openai/resources/evals/runs.d.ts +2 -0
- package/types/node_modules/openai/resources/evals.d.mts +2 -0
- package/types/node_modules/openai/resources/evals.d.ts +2 -0
- package/types/node_modules/openai/resources/files.d.mts +164 -0
- package/types/node_modules/openai/resources/files.d.ts +164 -0
- package/types/node_modules/openai/resources/fine-tuning/alpha/alpha.d.mts +10 -0
- package/types/node_modules/openai/resources/fine-tuning/alpha/alpha.d.ts +10 -0
- package/types/node_modules/openai/resources/fine-tuning/alpha/graders.d.mts +119 -0
- package/types/node_modules/openai/resources/fine-tuning/alpha/graders.d.ts +119 -0
- package/types/node_modules/openai/resources/fine-tuning/alpha/index.d.mts +3 -0
- package/types/node_modules/openai/resources/fine-tuning/alpha/index.d.ts +3 -0
- package/types/node_modules/openai/resources/fine-tuning/alpha.d.mts +2 -0
- package/types/node_modules/openai/resources/fine-tuning/alpha.d.ts +2 -0
- package/types/node_modules/openai/resources/fine-tuning/checkpoints/checkpoints.d.mts +10 -0
- package/types/node_modules/openai/resources/fine-tuning/checkpoints/checkpoints.d.ts +10 -0
- package/types/node_modules/openai/resources/fine-tuning/checkpoints/index.d.mts +3 -0
- package/types/node_modules/openai/resources/fine-tuning/checkpoints/index.d.ts +3 -0
- package/types/node_modules/openai/resources/fine-tuning/checkpoints/permissions.d.mts +160 -0
- package/types/node_modules/openai/resources/fine-tuning/checkpoints/permissions.d.ts +160 -0
- package/types/node_modules/openai/resources/fine-tuning/checkpoints.d.mts +2 -0
- package/types/node_modules/openai/resources/fine-tuning/checkpoints.d.ts +2 -0
- package/types/node_modules/openai/resources/fine-tuning/fine-tuning.d.mts +22 -0
- package/types/node_modules/openai/resources/fine-tuning/fine-tuning.d.ts +22 -0
- package/types/node_modules/openai/resources/fine-tuning/index.d.mts +6 -0
- package/types/node_modules/openai/resources/fine-tuning/index.d.ts +6 -0
- package/types/node_modules/openai/resources/fine-tuning/jobs/checkpoints.d.mts +74 -0
- package/types/node_modules/openai/resources/fine-tuning/jobs/checkpoints.d.ts +74 -0
- package/types/node_modules/openai/resources/fine-tuning/jobs/index.d.mts +3 -0
- package/types/node_modules/openai/resources/fine-tuning/jobs/index.d.ts +3 -0
- package/types/node_modules/openai/resources/fine-tuning/jobs/jobs.d.mts +528 -0
- package/types/node_modules/openai/resources/fine-tuning/jobs/jobs.d.ts +528 -0
- package/types/node_modules/openai/resources/fine-tuning/jobs.d.mts +2 -0
- package/types/node_modules/openai/resources/fine-tuning/jobs.d.ts +2 -0
- package/types/node_modules/openai/resources/fine-tuning/methods.d.mts +120 -0
- package/types/node_modules/openai/resources/fine-tuning/methods.d.ts +120 -0
- package/types/node_modules/openai/resources/fine-tuning.d.mts +2 -0
- package/types/node_modules/openai/resources/fine-tuning.d.ts +2 -0
- package/types/node_modules/openai/resources/graders/grader-models.d.mts +304 -0
- package/types/node_modules/openai/resources/graders/grader-models.d.ts +304 -0
- package/types/node_modules/openai/resources/graders/graders.d.mts +10 -0
- package/types/node_modules/openai/resources/graders/graders.d.ts +10 -0
- package/types/node_modules/openai/resources/graders/index.d.mts +3 -0
- package/types/node_modules/openai/resources/graders/index.d.ts +3 -0
- package/types/node_modules/openai/resources/graders.d.mts +2 -0
- package/types/node_modules/openai/resources/graders.d.ts +2 -0
- package/types/node_modules/openai/resources/images.d.mts +653 -0
- package/types/node_modules/openai/resources/images.d.ts +653 -0
- package/types/node_modules/openai/resources/index.d.mts +22 -0
- package/types/node_modules/openai/resources/index.d.ts +22 -0
- package/types/node_modules/openai/resources/models.d.mts +52 -0
- package/types/node_modules/openai/resources/models.d.ts +52 -0
- package/types/node_modules/openai/resources/moderations.d.mts +295 -0
- package/types/node_modules/openai/resources/moderations.d.ts +295 -0
- package/types/node_modules/openai/resources/realtime/client-secrets.d.mts +594 -0
- package/types/node_modules/openai/resources/realtime/client-secrets.d.ts +594 -0
- package/types/node_modules/openai/resources/realtime/index.d.mts +3 -0
- package/types/node_modules/openai/resources/realtime/index.d.ts +3 -0
- package/types/node_modules/openai/resources/realtime/realtime.d.mts +3828 -0
- package/types/node_modules/openai/resources/realtime/realtime.d.ts +3828 -0
- package/types/node_modules/openai/resources/realtime.d.mts +2 -0
- package/types/node_modules/openai/resources/realtime.d.ts +2 -0
- package/types/node_modules/openai/resources/responses/index.d.mts +3 -0
- package/types/node_modules/openai/resources/responses/index.d.ts +3 -0
- package/types/node_modules/openai/resources/responses/input-items.d.mts +65 -0
- package/types/node_modules/openai/resources/responses/input-items.d.ts +65 -0
- package/types/node_modules/openai/resources/responses/responses.d.mts +4705 -0
- package/types/node_modules/openai/resources/responses/responses.d.ts +4705 -0
- package/types/node_modules/openai/resources/responses.d.mts +2 -0
- package/types/node_modules/openai/resources/responses.d.ts +2 -0
- package/types/node_modules/openai/resources/shared.d.mts +265 -0
- package/types/node_modules/openai/resources/shared.d.ts +265 -0
- package/types/node_modules/openai/resources/uploads/index.d.mts +3 -0
- package/types/node_modules/openai/resources/uploads/index.d.ts +3 -0
- package/types/node_modules/openai/resources/uploads/parts.d.mts +51 -0
- package/types/node_modules/openai/resources/uploads/parts.d.ts +51 -0
- package/types/node_modules/openai/resources/uploads/uploads.d.mts +157 -0
- package/types/node_modules/openai/resources/uploads/uploads.d.ts +157 -0
- package/types/node_modules/openai/resources/uploads.d.mts +2 -0
- package/types/node_modules/openai/resources/uploads.d.ts +2 -0
- package/types/node_modules/openai/resources/vector-stores/file-batches.d.mts +172 -0
- package/types/node_modules/openai/resources/vector-stores/file-batches.d.ts +172 -0
- package/types/node_modules/openai/resources/vector-stores/files.d.mts +231 -0
- package/types/node_modules/openai/resources/vector-stores/files.d.ts +231 -0
- package/types/node_modules/openai/resources/vector-stores/index.d.mts +4 -0
- package/types/node_modules/openai/resources/vector-stores/index.d.ts +4 -0
- package/types/node_modules/openai/resources/vector-stores/vector-stores.d.mts +373 -0
- package/types/node_modules/openai/resources/vector-stores/vector-stores.d.ts +373 -0
- package/types/node_modules/openai/resources/vector-stores.d.mts +2 -0
- package/types/node_modules/openai/resources/vector-stores.d.ts +2 -0
- package/types/node_modules/openai/resources/webhooks.d.mts +587 -0
- package/types/node_modules/openai/resources/webhooks.d.ts +587 -0
- package/types/node_modules/openai/resources.d.mts +2 -0
- package/types/node_modules/openai/resources.d.ts +2 -0
- package/types/node_modules/openai/src/_vendor/zod-to-json-schema/LICENSE +15 -0
- package/types/node_modules/openai/streaming.d.mts +2 -0
- package/types/node_modules/openai/streaming.d.ts +2 -0
- package/types/node_modules/openai/uploads.d.mts +2 -0
- package/types/node_modules/openai/uploads.d.ts +2 -0
- package/types/node_modules/openai/version.d.mts +2 -0
- package/types/node_modules/openai/version.d.ts +2 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Percent-encode everything that isn't safe to have in a path without encoding safe chars.
|
|
3
|
+
*
|
|
4
|
+
* Taken from https://datatracker.ietf.org/doc/html/rfc3986#section-3.3:
|
|
5
|
+
* > unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
|
|
6
|
+
* > sub-delims = "!" / "$" / "&" / "'" / "(" / ")" / "*" / "+" / "," / ";" / "="
|
|
7
|
+
* > pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
|
|
8
|
+
*/
|
|
9
|
+
export declare function encodeURIPath(str: string): string;
|
|
10
|
+
export declare const createPathTagFunction: (pathEncoder?: typeof encodeURIPath) => (statics: readonly string[], ...params: readonly unknown[]) => string;
|
|
11
|
+
/**
|
|
12
|
+
* URI-encodes path params and ensures no unsafe /./ or /../ path segments are introduced.
|
|
13
|
+
*/
|
|
14
|
+
export declare const path: (statics: readonly string[], ...params: readonly unknown[]) => string;
|
|
15
|
+
//# sourceMappingURL=path.d.mts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Percent-encode everything that isn't safe to have in a path without encoding safe chars.
|
|
3
|
+
*
|
|
4
|
+
* Taken from https://datatracker.ietf.org/doc/html/rfc3986#section-3.3:
|
|
5
|
+
* > unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
|
|
6
|
+
* > sub-delims = "!" / "$" / "&" / "'" / "(" / ")" / "*" / "+" / "," / ";" / "="
|
|
7
|
+
* > pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
|
|
8
|
+
*/
|
|
9
|
+
export declare function encodeURIPath(str: string): string;
|
|
10
|
+
export declare const createPathTagFunction: (pathEncoder?: typeof encodeURIPath) => (statics: readonly string[], ...params: readonly unknown[]) => string;
|
|
11
|
+
/**
|
|
12
|
+
* URI-encodes path params and ensures no unsafe /./ or /../ path segments are introduced.
|
|
13
|
+
*/
|
|
14
|
+
export declare const path: (statics: readonly string[], ...params: readonly unknown[]) => string;
|
|
15
|
+
//# sourceMappingURL=path.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const isAbsoluteURL: (url: string) => boolean;
|
|
2
|
+
export declare let isArray: (val: unknown) => val is unknown[];
|
|
3
|
+
export declare let isReadonlyArray: (val: unknown) => val is readonly unknown[];
|
|
4
|
+
/** Returns an object if the given value isn't an object, otherwise returns as-is */
|
|
5
|
+
export declare function maybeObj(x: unknown): object;
|
|
6
|
+
export declare function isEmptyObj(obj: Object | null | undefined): boolean;
|
|
7
|
+
export declare function hasOwn<T extends object = object>(obj: T, key: PropertyKey): key is keyof T;
|
|
8
|
+
export declare function isObj(obj: unknown): obj is Record<string, unknown>;
|
|
9
|
+
export declare const ensurePresent: <T>(value: T | null | undefined) => T;
|
|
10
|
+
export declare const validatePositiveInteger: (name: string, n: unknown) => number;
|
|
11
|
+
export declare const coerceInteger: (value: unknown) => number;
|
|
12
|
+
export declare const coerceFloat: (value: unknown) => number;
|
|
13
|
+
export declare const coerceBoolean: (value: unknown) => boolean;
|
|
14
|
+
export declare const maybeCoerceInteger: (value: unknown) => number | undefined;
|
|
15
|
+
export declare const maybeCoerceFloat: (value: unknown) => number | undefined;
|
|
16
|
+
export declare const maybeCoerceBoolean: (value: unknown) => boolean | undefined;
|
|
17
|
+
export declare const safeJSON: (text: string) => any;
|
|
18
|
+
//# sourceMappingURL=values.d.mts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const isAbsoluteURL: (url: string) => boolean;
|
|
2
|
+
export declare let isArray: (val: unknown) => val is unknown[];
|
|
3
|
+
export declare let isReadonlyArray: (val: unknown) => val is readonly unknown[];
|
|
4
|
+
/** Returns an object if the given value isn't an object, otherwise returns as-is */
|
|
5
|
+
export declare function maybeObj(x: unknown): object;
|
|
6
|
+
export declare function isEmptyObj(obj: Object | null | undefined): boolean;
|
|
7
|
+
export declare function hasOwn<T extends object = object>(obj: T, key: PropertyKey): key is keyof T;
|
|
8
|
+
export declare function isObj(obj: unknown): obj is Record<string, unknown>;
|
|
9
|
+
export declare const ensurePresent: <T>(value: T | null | undefined) => T;
|
|
10
|
+
export declare const validatePositiveInteger: (name: string, n: unknown) => number;
|
|
11
|
+
export declare const coerceInteger: (value: unknown) => number;
|
|
12
|
+
export declare const coerceFloat: (value: unknown) => number;
|
|
13
|
+
export declare const coerceBoolean: (value: unknown) => boolean;
|
|
14
|
+
export declare const maybeCoerceInteger: (value: unknown) => number | undefined;
|
|
15
|
+
export declare const maybeCoerceFloat: (value: unknown) => number | undefined;
|
|
16
|
+
export declare const maybeCoerceBoolean: (value: unknown) => boolean | undefined;
|
|
17
|
+
export declare const safeJSON: (text: string) => any;
|
|
18
|
+
//# sourceMappingURL=values.d.ts.map
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type OpenAI from "../index.mjs";
|
|
2
|
+
import type { RequestOptions } from "../internal/request-options.mjs";
|
|
3
|
+
import type { ChatCompletion, ChatCompletionCreateParams, ChatCompletionMessage, ChatCompletionMessageFunctionToolCall, ChatCompletionMessageParam, ParsedChatCompletion } from "../resources/chat/completions.mjs";
|
|
4
|
+
import type { CompletionUsage } from "../resources/completions.mjs";
|
|
5
|
+
import type { ChatCompletionToolRunnerParams } from "./ChatCompletionRunner.mjs";
|
|
6
|
+
import type { ChatCompletionStreamingToolRunnerParams } from "./ChatCompletionStreamingRunner.mjs";
|
|
7
|
+
import { BaseEvents, EventStream } from "./EventStream.mjs";
|
|
8
|
+
import { type BaseFunctionsArgs } from "./RunnableFunction.mjs";
|
|
9
|
+
export interface RunnerOptions extends RequestOptions {
|
|
10
|
+
/** How many requests to make before canceling. Default 10. */
|
|
11
|
+
maxChatCompletions?: number;
|
|
12
|
+
}
|
|
13
|
+
export declare class AbstractChatCompletionRunner<EventTypes extends AbstractChatCompletionRunnerEvents, ParsedT> extends EventStream<EventTypes> {
|
|
14
|
+
#private;
|
|
15
|
+
protected _chatCompletions: ParsedChatCompletion<ParsedT>[];
|
|
16
|
+
messages: ChatCompletionMessageParam[];
|
|
17
|
+
protected _addChatCompletion(this: AbstractChatCompletionRunner<AbstractChatCompletionRunnerEvents, ParsedT>, chatCompletion: ParsedChatCompletion<ParsedT>): ParsedChatCompletion<ParsedT>;
|
|
18
|
+
protected _addMessage(this: AbstractChatCompletionRunner<AbstractChatCompletionRunnerEvents, ParsedT>, message: ChatCompletionMessageParam, emit?: boolean): void;
|
|
19
|
+
/**
|
|
20
|
+
* @returns a promise that resolves with the final ChatCompletion, or rejects
|
|
21
|
+
* if an error occurred or the stream ended prematurely without producing a ChatCompletion.
|
|
22
|
+
*/
|
|
23
|
+
finalChatCompletion(): Promise<ParsedChatCompletion<ParsedT>>;
|
|
24
|
+
/**
|
|
25
|
+
* @returns a promise that resolves with the content of the final ChatCompletionMessage, or rejects
|
|
26
|
+
* if an error occurred or the stream ended prematurely without producing a ChatCompletionMessage.
|
|
27
|
+
*/
|
|
28
|
+
finalContent(): Promise<string | null>;
|
|
29
|
+
/**
|
|
30
|
+
* @returns a promise that resolves with the the final assistant ChatCompletionMessage response,
|
|
31
|
+
* or rejects if an error occurred or the stream ended prematurely without producing a ChatCompletionMessage.
|
|
32
|
+
*/
|
|
33
|
+
finalMessage(): Promise<ChatCompletionMessage>;
|
|
34
|
+
/**
|
|
35
|
+
* @returns a promise that resolves with the content of the final FunctionCall, or rejects
|
|
36
|
+
* if an error occurred or the stream ended prematurely without producing a ChatCompletionMessage.
|
|
37
|
+
*/
|
|
38
|
+
finalFunctionToolCall(): Promise<ChatCompletionMessageFunctionToolCall.Function | undefined>;
|
|
39
|
+
finalFunctionToolCallResult(): Promise<string | undefined>;
|
|
40
|
+
totalUsage(): Promise<CompletionUsage>;
|
|
41
|
+
allChatCompletions(): ChatCompletion[];
|
|
42
|
+
protected _emitFinal(this: AbstractChatCompletionRunner<AbstractChatCompletionRunnerEvents, ParsedT>): void;
|
|
43
|
+
protected _createChatCompletion(client: OpenAI, params: ChatCompletionCreateParams, options?: RequestOptions): Promise<ParsedChatCompletion<ParsedT>>;
|
|
44
|
+
protected _runChatCompletion(client: OpenAI, params: ChatCompletionCreateParams, options?: RequestOptions): Promise<ChatCompletion>;
|
|
45
|
+
protected _runTools<FunctionsArgs extends BaseFunctionsArgs>(client: OpenAI, params: ChatCompletionToolRunnerParams<FunctionsArgs> | ChatCompletionStreamingToolRunnerParams<FunctionsArgs>, options?: RunnerOptions): Promise<void>;
|
|
46
|
+
}
|
|
47
|
+
export interface AbstractChatCompletionRunnerEvents extends BaseEvents {
|
|
48
|
+
functionToolCall: (functionCall: ChatCompletionMessageFunctionToolCall.Function) => void;
|
|
49
|
+
message: (message: ChatCompletionMessageParam) => void;
|
|
50
|
+
chatCompletion: (completion: ChatCompletion) => void;
|
|
51
|
+
finalContent: (contentSnapshot: string) => void;
|
|
52
|
+
finalMessage: (message: ChatCompletionMessageParam) => void;
|
|
53
|
+
finalChatCompletion: (completion: ChatCompletion) => void;
|
|
54
|
+
finalFunctionToolCall: (functionCall: ChatCompletionMessageFunctionToolCall.Function) => void;
|
|
55
|
+
functionToolCallResult: (content: string) => void;
|
|
56
|
+
finalFunctionToolCallResult: (content: string) => void;
|
|
57
|
+
totalUsage: (usage: CompletionUsage) => void;
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=AbstractChatCompletionRunner.d.mts.map
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type OpenAI from "../index.js";
|
|
2
|
+
import type { RequestOptions } from "../internal/request-options.js";
|
|
3
|
+
import type { ChatCompletion, ChatCompletionCreateParams, ChatCompletionMessage, ChatCompletionMessageFunctionToolCall, ChatCompletionMessageParam, ParsedChatCompletion } from "../resources/chat/completions.js";
|
|
4
|
+
import type { CompletionUsage } from "../resources/completions.js";
|
|
5
|
+
import type { ChatCompletionToolRunnerParams } from "./ChatCompletionRunner.js";
|
|
6
|
+
import type { ChatCompletionStreamingToolRunnerParams } from "./ChatCompletionStreamingRunner.js";
|
|
7
|
+
import { BaseEvents, EventStream } from "./EventStream.js";
|
|
8
|
+
import { type BaseFunctionsArgs } from "./RunnableFunction.js";
|
|
9
|
+
export interface RunnerOptions extends RequestOptions {
|
|
10
|
+
/** How many requests to make before canceling. Default 10. */
|
|
11
|
+
maxChatCompletions?: number;
|
|
12
|
+
}
|
|
13
|
+
export declare class AbstractChatCompletionRunner<EventTypes extends AbstractChatCompletionRunnerEvents, ParsedT> extends EventStream<EventTypes> {
|
|
14
|
+
#private;
|
|
15
|
+
protected _chatCompletions: ParsedChatCompletion<ParsedT>[];
|
|
16
|
+
messages: ChatCompletionMessageParam[];
|
|
17
|
+
protected _addChatCompletion(this: AbstractChatCompletionRunner<AbstractChatCompletionRunnerEvents, ParsedT>, chatCompletion: ParsedChatCompletion<ParsedT>): ParsedChatCompletion<ParsedT>;
|
|
18
|
+
protected _addMessage(this: AbstractChatCompletionRunner<AbstractChatCompletionRunnerEvents, ParsedT>, message: ChatCompletionMessageParam, emit?: boolean): void;
|
|
19
|
+
/**
|
|
20
|
+
* @returns a promise that resolves with the final ChatCompletion, or rejects
|
|
21
|
+
* if an error occurred or the stream ended prematurely without producing a ChatCompletion.
|
|
22
|
+
*/
|
|
23
|
+
finalChatCompletion(): Promise<ParsedChatCompletion<ParsedT>>;
|
|
24
|
+
/**
|
|
25
|
+
* @returns a promise that resolves with the content of the final ChatCompletionMessage, or rejects
|
|
26
|
+
* if an error occurred or the stream ended prematurely without producing a ChatCompletionMessage.
|
|
27
|
+
*/
|
|
28
|
+
finalContent(): Promise<string | null>;
|
|
29
|
+
/**
|
|
30
|
+
* @returns a promise that resolves with the the final assistant ChatCompletionMessage response,
|
|
31
|
+
* or rejects if an error occurred or the stream ended prematurely without producing a ChatCompletionMessage.
|
|
32
|
+
*/
|
|
33
|
+
finalMessage(): Promise<ChatCompletionMessage>;
|
|
34
|
+
/**
|
|
35
|
+
* @returns a promise that resolves with the content of the final FunctionCall, or rejects
|
|
36
|
+
* if an error occurred or the stream ended prematurely without producing a ChatCompletionMessage.
|
|
37
|
+
*/
|
|
38
|
+
finalFunctionToolCall(): Promise<ChatCompletionMessageFunctionToolCall.Function | undefined>;
|
|
39
|
+
finalFunctionToolCallResult(): Promise<string | undefined>;
|
|
40
|
+
totalUsage(): Promise<CompletionUsage>;
|
|
41
|
+
allChatCompletions(): ChatCompletion[];
|
|
42
|
+
protected _emitFinal(this: AbstractChatCompletionRunner<AbstractChatCompletionRunnerEvents, ParsedT>): void;
|
|
43
|
+
protected _createChatCompletion(client: OpenAI, params: ChatCompletionCreateParams, options?: RequestOptions): Promise<ParsedChatCompletion<ParsedT>>;
|
|
44
|
+
protected _runChatCompletion(client: OpenAI, params: ChatCompletionCreateParams, options?: RequestOptions): Promise<ChatCompletion>;
|
|
45
|
+
protected _runTools<FunctionsArgs extends BaseFunctionsArgs>(client: OpenAI, params: ChatCompletionToolRunnerParams<FunctionsArgs> | ChatCompletionStreamingToolRunnerParams<FunctionsArgs>, options?: RunnerOptions): Promise<void>;
|
|
46
|
+
}
|
|
47
|
+
export interface AbstractChatCompletionRunnerEvents extends BaseEvents {
|
|
48
|
+
functionToolCall: (functionCall: ChatCompletionMessageFunctionToolCall.Function) => void;
|
|
49
|
+
message: (message: ChatCompletionMessageParam) => void;
|
|
50
|
+
chatCompletion: (completion: ChatCompletion) => void;
|
|
51
|
+
finalContent: (contentSnapshot: string) => void;
|
|
52
|
+
finalMessage: (message: ChatCompletionMessageParam) => void;
|
|
53
|
+
finalChatCompletion: (completion: ChatCompletion) => void;
|
|
54
|
+
finalFunctionToolCall: (functionCall: ChatCompletionMessageFunctionToolCall.Function) => void;
|
|
55
|
+
functionToolCallResult: (content: string) => void;
|
|
56
|
+
finalFunctionToolCallResult: (content: string) => void;
|
|
57
|
+
totalUsage: (usage: CompletionUsage) => void;
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=AbstractChatCompletionRunner.d.ts.map
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { Message, Text, ImageFile, TextDelta, MessageDelta } from "../resources/beta/threads/messages.mjs";
|
|
2
|
+
import { RequestOptions } from "../internal/request-options.mjs";
|
|
3
|
+
import { Run, RunCreateParamsBase, Runs, RunSubmitToolOutputsParamsBase } from "../resources/beta/threads/runs/runs.mjs";
|
|
4
|
+
import { type ReadableStream } from "../internal/shim-types.mjs";
|
|
5
|
+
import { AssistantStreamEvent } from "../resources/beta/assistants.mjs";
|
|
6
|
+
import { RunStep, RunStepDelta, ToolCall, ToolCallDelta } from "../resources/beta/threads/runs/steps.mjs";
|
|
7
|
+
import { ThreadCreateAndRunParamsBase, Threads } from "../resources/beta/threads/threads.mjs";
|
|
8
|
+
import { BaseEvents, EventStream } from "./EventStream.mjs";
|
|
9
|
+
export interface AssistantStreamEvents extends BaseEvents {
|
|
10
|
+
run: (run: Run) => void;
|
|
11
|
+
messageCreated: (message: Message) => void;
|
|
12
|
+
messageDelta: (message: MessageDelta, snapshot: Message) => void;
|
|
13
|
+
messageDone: (message: Message) => void;
|
|
14
|
+
runStepCreated: (runStep: RunStep) => void;
|
|
15
|
+
runStepDelta: (delta: RunStepDelta, snapshot: Runs.RunStep) => void;
|
|
16
|
+
runStepDone: (runStep: Runs.RunStep, snapshot: Runs.RunStep) => void;
|
|
17
|
+
toolCallCreated: (toolCall: ToolCall) => void;
|
|
18
|
+
toolCallDelta: (delta: ToolCallDelta, snapshot: ToolCall) => void;
|
|
19
|
+
toolCallDone: (toolCall: ToolCall) => void;
|
|
20
|
+
textCreated: (content: Text) => void;
|
|
21
|
+
textDelta: (delta: TextDelta, snapshot: Text) => void;
|
|
22
|
+
textDone: (content: Text, snapshot: Message) => void;
|
|
23
|
+
imageFileDone: (content: ImageFile, snapshot: Message) => void;
|
|
24
|
+
event: (event: AssistantStreamEvent) => void;
|
|
25
|
+
}
|
|
26
|
+
export type ThreadCreateAndRunParamsBaseStream = Omit<ThreadCreateAndRunParamsBase, 'stream'> & {
|
|
27
|
+
stream?: true;
|
|
28
|
+
};
|
|
29
|
+
export type RunCreateParamsBaseStream = Omit<RunCreateParamsBase, 'stream'> & {
|
|
30
|
+
stream?: true;
|
|
31
|
+
};
|
|
32
|
+
export type RunSubmitToolOutputsParamsStream = Omit<RunSubmitToolOutputsParamsBase, 'stream'> & {
|
|
33
|
+
stream?: true;
|
|
34
|
+
};
|
|
35
|
+
export declare class AssistantStream extends EventStream<AssistantStreamEvents> implements AsyncIterable<AssistantStreamEvent> {
|
|
36
|
+
#private;
|
|
37
|
+
[Symbol.asyncIterator](): AsyncIterator<AssistantStreamEvent>;
|
|
38
|
+
static fromReadableStream(stream: ReadableStream): AssistantStream;
|
|
39
|
+
protected _fromReadableStream(readableStream: ReadableStream, options?: RequestOptions): Promise<Run>;
|
|
40
|
+
toReadableStream(): ReadableStream;
|
|
41
|
+
static createToolAssistantStream(runId: string, runs: Runs, params: RunSubmitToolOutputsParamsStream, options: RequestOptions | undefined): AssistantStream;
|
|
42
|
+
protected _createToolAssistantStream(run: Runs, runId: string, params: RunSubmitToolOutputsParamsStream, options?: RequestOptions): Promise<Run>;
|
|
43
|
+
static createThreadAssistantStream(params: ThreadCreateAndRunParamsBaseStream, thread: Threads, options?: RequestOptions): AssistantStream;
|
|
44
|
+
static createAssistantStream(threadId: string, runs: Runs, params: RunCreateParamsBaseStream, options?: RequestOptions): AssistantStream;
|
|
45
|
+
currentEvent(): AssistantStreamEvent | undefined;
|
|
46
|
+
currentRun(): Run | undefined;
|
|
47
|
+
currentMessageSnapshot(): Message | undefined;
|
|
48
|
+
currentRunStepSnapshot(): Runs.RunStep | undefined;
|
|
49
|
+
finalRunSteps(): Promise<Runs.RunStep[]>;
|
|
50
|
+
finalMessages(): Promise<Message[]>;
|
|
51
|
+
finalRun(): Promise<Run>;
|
|
52
|
+
protected _createThreadAssistantStream(thread: Threads, params: ThreadCreateAndRunParamsBase, options?: RequestOptions): Promise<Run>;
|
|
53
|
+
protected _createAssistantStream(run: Runs, threadId: string, params: RunCreateParamsBase, options?: RequestOptions): Promise<Run>;
|
|
54
|
+
static accumulateDelta(acc: Record<string, any>, delta: Record<string, any>): Record<string, any>;
|
|
55
|
+
protected _addRun(run: Run): Run;
|
|
56
|
+
protected _threadAssistantStream(params: ThreadCreateAndRunParamsBase, thread: Threads, options?: RequestOptions): Promise<Run>;
|
|
57
|
+
protected _runAssistantStream(threadId: string, runs: Runs, params: RunCreateParamsBase, options?: RequestOptions): Promise<Run>;
|
|
58
|
+
protected _runToolAssistantStream(runId: string, runs: Runs, params: RunSubmitToolOutputsParamsStream, options?: RequestOptions): Promise<Run>;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=AssistantStream.d.mts.map
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { Message, Text, ImageFile, TextDelta, MessageDelta } from "../resources/beta/threads/messages.js";
|
|
2
|
+
import { RequestOptions } from "../internal/request-options.js";
|
|
3
|
+
import { Run, RunCreateParamsBase, Runs, RunSubmitToolOutputsParamsBase } from "../resources/beta/threads/runs/runs.js";
|
|
4
|
+
import { type ReadableStream } from "../internal/shim-types.js";
|
|
5
|
+
import { AssistantStreamEvent } from "../resources/beta/assistants.js";
|
|
6
|
+
import { RunStep, RunStepDelta, ToolCall, ToolCallDelta } from "../resources/beta/threads/runs/steps.js";
|
|
7
|
+
import { ThreadCreateAndRunParamsBase, Threads } from "../resources/beta/threads/threads.js";
|
|
8
|
+
import { BaseEvents, EventStream } from "./EventStream.js";
|
|
9
|
+
export interface AssistantStreamEvents extends BaseEvents {
|
|
10
|
+
run: (run: Run) => void;
|
|
11
|
+
messageCreated: (message: Message) => void;
|
|
12
|
+
messageDelta: (message: MessageDelta, snapshot: Message) => void;
|
|
13
|
+
messageDone: (message: Message) => void;
|
|
14
|
+
runStepCreated: (runStep: RunStep) => void;
|
|
15
|
+
runStepDelta: (delta: RunStepDelta, snapshot: Runs.RunStep) => void;
|
|
16
|
+
runStepDone: (runStep: Runs.RunStep, snapshot: Runs.RunStep) => void;
|
|
17
|
+
toolCallCreated: (toolCall: ToolCall) => void;
|
|
18
|
+
toolCallDelta: (delta: ToolCallDelta, snapshot: ToolCall) => void;
|
|
19
|
+
toolCallDone: (toolCall: ToolCall) => void;
|
|
20
|
+
textCreated: (content: Text) => void;
|
|
21
|
+
textDelta: (delta: TextDelta, snapshot: Text) => void;
|
|
22
|
+
textDone: (content: Text, snapshot: Message) => void;
|
|
23
|
+
imageFileDone: (content: ImageFile, snapshot: Message) => void;
|
|
24
|
+
event: (event: AssistantStreamEvent) => void;
|
|
25
|
+
}
|
|
26
|
+
export type ThreadCreateAndRunParamsBaseStream = Omit<ThreadCreateAndRunParamsBase, 'stream'> & {
|
|
27
|
+
stream?: true;
|
|
28
|
+
};
|
|
29
|
+
export type RunCreateParamsBaseStream = Omit<RunCreateParamsBase, 'stream'> & {
|
|
30
|
+
stream?: true;
|
|
31
|
+
};
|
|
32
|
+
export type RunSubmitToolOutputsParamsStream = Omit<RunSubmitToolOutputsParamsBase, 'stream'> & {
|
|
33
|
+
stream?: true;
|
|
34
|
+
};
|
|
35
|
+
export declare class AssistantStream extends EventStream<AssistantStreamEvents> implements AsyncIterable<AssistantStreamEvent> {
|
|
36
|
+
#private;
|
|
37
|
+
[Symbol.asyncIterator](): AsyncIterator<AssistantStreamEvent>;
|
|
38
|
+
static fromReadableStream(stream: ReadableStream): AssistantStream;
|
|
39
|
+
protected _fromReadableStream(readableStream: ReadableStream, options?: RequestOptions): Promise<Run>;
|
|
40
|
+
toReadableStream(): ReadableStream;
|
|
41
|
+
static createToolAssistantStream(runId: string, runs: Runs, params: RunSubmitToolOutputsParamsStream, options: RequestOptions | undefined): AssistantStream;
|
|
42
|
+
protected _createToolAssistantStream(run: Runs, runId: string, params: RunSubmitToolOutputsParamsStream, options?: RequestOptions): Promise<Run>;
|
|
43
|
+
static createThreadAssistantStream(params: ThreadCreateAndRunParamsBaseStream, thread: Threads, options?: RequestOptions): AssistantStream;
|
|
44
|
+
static createAssistantStream(threadId: string, runs: Runs, params: RunCreateParamsBaseStream, options?: RequestOptions): AssistantStream;
|
|
45
|
+
currentEvent(): AssistantStreamEvent | undefined;
|
|
46
|
+
currentRun(): Run | undefined;
|
|
47
|
+
currentMessageSnapshot(): Message | undefined;
|
|
48
|
+
currentRunStepSnapshot(): Runs.RunStep | undefined;
|
|
49
|
+
finalRunSteps(): Promise<Runs.RunStep[]>;
|
|
50
|
+
finalMessages(): Promise<Message[]>;
|
|
51
|
+
finalRun(): Promise<Run>;
|
|
52
|
+
protected _createThreadAssistantStream(thread: Threads, params: ThreadCreateAndRunParamsBase, options?: RequestOptions): Promise<Run>;
|
|
53
|
+
protected _createAssistantStream(run: Runs, threadId: string, params: RunCreateParamsBase, options?: RequestOptions): Promise<Run>;
|
|
54
|
+
static accumulateDelta(acc: Record<string, any>, delta: Record<string, any>): Record<string, any>;
|
|
55
|
+
protected _addRun(run: Run): Run;
|
|
56
|
+
protected _threadAssistantStream(params: ThreadCreateAndRunParamsBase, thread: Threads, options?: RequestOptions): Promise<Run>;
|
|
57
|
+
protected _runAssistantStream(threadId: string, runs: Runs, params: RunCreateParamsBase, options?: RequestOptions): Promise<Run>;
|
|
58
|
+
protected _runToolAssistantStream(runId: string, runs: Runs, params: RunSubmitToolOutputsParamsStream, options?: RequestOptions): Promise<Run>;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=AssistantStream.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type ChatCompletionMessageParam, type ChatCompletionCreateParamsNonStreaming } from "../resources/chat/completions.mjs";
|
|
2
|
+
import { type BaseFunctionsArgs, RunnableTools } from "./RunnableFunction.mjs";
|
|
3
|
+
import { AbstractChatCompletionRunner, AbstractChatCompletionRunnerEvents, RunnerOptions } from "./AbstractChatCompletionRunner.mjs";
|
|
4
|
+
import OpenAI from "../index.mjs";
|
|
5
|
+
import { AutoParseableTool } from "../lib/parser.mjs";
|
|
6
|
+
export interface ChatCompletionRunnerEvents extends AbstractChatCompletionRunnerEvents {
|
|
7
|
+
content: (content: string) => void;
|
|
8
|
+
}
|
|
9
|
+
export type ChatCompletionToolRunnerParams<FunctionsArgs extends BaseFunctionsArgs> = Omit<ChatCompletionCreateParamsNonStreaming, 'tools'> & {
|
|
10
|
+
tools: RunnableTools<FunctionsArgs> | AutoParseableTool<any, true>[];
|
|
11
|
+
};
|
|
12
|
+
export declare class ChatCompletionRunner<ParsedT = null> extends AbstractChatCompletionRunner<ChatCompletionRunnerEvents, ParsedT> {
|
|
13
|
+
static runTools<ParsedT>(client: OpenAI, params: ChatCompletionToolRunnerParams<any[]>, options?: RunnerOptions): ChatCompletionRunner<ParsedT>;
|
|
14
|
+
_addMessage(this: ChatCompletionRunner<ParsedT>, message: ChatCompletionMessageParam, emit?: boolean): void;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=ChatCompletionRunner.d.mts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type ChatCompletionMessageParam, type ChatCompletionCreateParamsNonStreaming } from "../resources/chat/completions.js";
|
|
2
|
+
import { type BaseFunctionsArgs, RunnableTools } from "./RunnableFunction.js";
|
|
3
|
+
import { AbstractChatCompletionRunner, AbstractChatCompletionRunnerEvents, RunnerOptions } from "./AbstractChatCompletionRunner.js";
|
|
4
|
+
import OpenAI from "../index.js";
|
|
5
|
+
import { AutoParseableTool } from "../lib/parser.js";
|
|
6
|
+
export interface ChatCompletionRunnerEvents extends AbstractChatCompletionRunnerEvents {
|
|
7
|
+
content: (content: string) => void;
|
|
8
|
+
}
|
|
9
|
+
export type ChatCompletionToolRunnerParams<FunctionsArgs extends BaseFunctionsArgs> = Omit<ChatCompletionCreateParamsNonStreaming, 'tools'> & {
|
|
10
|
+
tools: RunnableTools<FunctionsArgs> | AutoParseableTool<any, true>[];
|
|
11
|
+
};
|
|
12
|
+
export declare class ChatCompletionRunner<ParsedT = null> extends AbstractChatCompletionRunner<ChatCompletionRunnerEvents, ParsedT> {
|
|
13
|
+
static runTools<ParsedT>(client: OpenAI, params: ChatCompletionToolRunnerParams<any[]>, options?: RunnerOptions): ChatCompletionRunner<ParsedT>;
|
|
14
|
+
_addMessage(this: ChatCompletionRunner<ParsedT>, message: ChatCompletionMessageParam, emit?: boolean): void;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=ChatCompletionRunner.d.ts.map
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import OpenAI from "../index.mjs";
|
|
2
|
+
import { RequestOptions } from "../internal/request-options.mjs";
|
|
3
|
+
import { type ReadableStream } from "../internal/shim-types.mjs";
|
|
4
|
+
import { ParsedChatCompletion } from "../resources/chat/completions.mjs";
|
|
5
|
+
import { ChatCompletionTokenLogprob, type ChatCompletion, type ChatCompletionChunk, type ChatCompletionCreateParams, type ChatCompletionCreateParamsBase, type ChatCompletionRole } from "../resources/chat/completions/completions.mjs";
|
|
6
|
+
import { AbstractChatCompletionRunner, type AbstractChatCompletionRunnerEvents } from "./AbstractChatCompletionRunner.mjs";
|
|
7
|
+
export interface ContentDeltaEvent {
|
|
8
|
+
delta: string;
|
|
9
|
+
snapshot: string;
|
|
10
|
+
parsed: unknown | null;
|
|
11
|
+
}
|
|
12
|
+
export interface ContentDoneEvent<ParsedT = null> {
|
|
13
|
+
content: string;
|
|
14
|
+
parsed: ParsedT | null;
|
|
15
|
+
}
|
|
16
|
+
export interface RefusalDeltaEvent {
|
|
17
|
+
delta: string;
|
|
18
|
+
snapshot: string;
|
|
19
|
+
}
|
|
20
|
+
export interface RefusalDoneEvent {
|
|
21
|
+
refusal: string;
|
|
22
|
+
}
|
|
23
|
+
export interface FunctionToolCallArgumentsDeltaEvent {
|
|
24
|
+
name: string;
|
|
25
|
+
index: number;
|
|
26
|
+
arguments: string;
|
|
27
|
+
parsed_arguments: unknown;
|
|
28
|
+
arguments_delta: string;
|
|
29
|
+
}
|
|
30
|
+
export interface FunctionToolCallArgumentsDoneEvent {
|
|
31
|
+
name: string;
|
|
32
|
+
index: number;
|
|
33
|
+
arguments: string;
|
|
34
|
+
parsed_arguments: unknown;
|
|
35
|
+
}
|
|
36
|
+
export interface LogProbsContentDeltaEvent {
|
|
37
|
+
content: Array<ChatCompletionTokenLogprob>;
|
|
38
|
+
snapshot: Array<ChatCompletionTokenLogprob>;
|
|
39
|
+
}
|
|
40
|
+
export interface LogProbsContentDoneEvent {
|
|
41
|
+
content: Array<ChatCompletionTokenLogprob>;
|
|
42
|
+
}
|
|
43
|
+
export interface LogProbsRefusalDeltaEvent {
|
|
44
|
+
refusal: Array<ChatCompletionTokenLogprob>;
|
|
45
|
+
snapshot: Array<ChatCompletionTokenLogprob>;
|
|
46
|
+
}
|
|
47
|
+
export interface LogProbsRefusalDoneEvent {
|
|
48
|
+
refusal: Array<ChatCompletionTokenLogprob>;
|
|
49
|
+
}
|
|
50
|
+
export interface ChatCompletionStreamEvents<ParsedT = null> extends AbstractChatCompletionRunnerEvents {
|
|
51
|
+
content: (contentDelta: string, contentSnapshot: string) => void;
|
|
52
|
+
chunk: (chunk: ChatCompletionChunk, snapshot: ChatCompletionSnapshot) => void;
|
|
53
|
+
'content.delta': (props: ContentDeltaEvent) => void;
|
|
54
|
+
'content.done': (props: ContentDoneEvent<ParsedT>) => void;
|
|
55
|
+
'refusal.delta': (props: RefusalDeltaEvent) => void;
|
|
56
|
+
'refusal.done': (props: RefusalDoneEvent) => void;
|
|
57
|
+
'tool_calls.function.arguments.delta': (props: FunctionToolCallArgumentsDeltaEvent) => void;
|
|
58
|
+
'tool_calls.function.arguments.done': (props: FunctionToolCallArgumentsDoneEvent) => void;
|
|
59
|
+
'logprobs.content.delta': (props: LogProbsContentDeltaEvent) => void;
|
|
60
|
+
'logprobs.content.done': (props: LogProbsContentDoneEvent) => void;
|
|
61
|
+
'logprobs.refusal.delta': (props: LogProbsRefusalDeltaEvent) => void;
|
|
62
|
+
'logprobs.refusal.done': (props: LogProbsRefusalDoneEvent) => void;
|
|
63
|
+
}
|
|
64
|
+
export type ChatCompletionStreamParams = Omit<ChatCompletionCreateParamsBase, 'stream'> & {
|
|
65
|
+
stream?: true;
|
|
66
|
+
};
|
|
67
|
+
export declare class ChatCompletionStream<ParsedT = null> extends AbstractChatCompletionRunner<ChatCompletionStreamEvents<ParsedT>, ParsedT> implements AsyncIterable<ChatCompletionChunk> {
|
|
68
|
+
#private;
|
|
69
|
+
constructor(params: ChatCompletionCreateParams | null);
|
|
70
|
+
get currentChatCompletionSnapshot(): ChatCompletionSnapshot | undefined;
|
|
71
|
+
/**
|
|
72
|
+
* Intended for use on the frontend, consuming a stream produced with
|
|
73
|
+
* `.toReadableStream()` on the backend.
|
|
74
|
+
*
|
|
75
|
+
* Note that messages sent to the model do not appear in `.on('message')`
|
|
76
|
+
* in this context.
|
|
77
|
+
*/
|
|
78
|
+
static fromReadableStream(stream: ReadableStream): ChatCompletionStream<null>;
|
|
79
|
+
static createChatCompletion<ParsedT>(client: OpenAI, params: ChatCompletionStreamParams, options?: RequestOptions): ChatCompletionStream<ParsedT>;
|
|
80
|
+
protected _createChatCompletion(client: OpenAI, params: ChatCompletionCreateParams, options?: RequestOptions): Promise<ParsedChatCompletion<ParsedT>>;
|
|
81
|
+
protected _fromReadableStream(readableStream: ReadableStream, options?: RequestOptions): Promise<ChatCompletion>;
|
|
82
|
+
[Symbol.asyncIterator](this: ChatCompletionStream<ParsedT>): AsyncIterator<ChatCompletionChunk>;
|
|
83
|
+
toReadableStream(): ReadableStream;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Represents a streamed chunk of a chat completion response returned by model,
|
|
87
|
+
* based on the provided input.
|
|
88
|
+
*/
|
|
89
|
+
export interface ChatCompletionSnapshot {
|
|
90
|
+
/**
|
|
91
|
+
* A unique identifier for the chat completion.
|
|
92
|
+
*/
|
|
93
|
+
id: string;
|
|
94
|
+
/**
|
|
95
|
+
* A list of chat completion choices. Can be more than one if `n` is greater
|
|
96
|
+
* than 1.
|
|
97
|
+
*/
|
|
98
|
+
choices: Array<ChatCompletionSnapshot.Choice>;
|
|
99
|
+
/**
|
|
100
|
+
* The Unix timestamp (in seconds) of when the chat completion was created.
|
|
101
|
+
*/
|
|
102
|
+
created: number;
|
|
103
|
+
/**
|
|
104
|
+
* The model to generate the completion.
|
|
105
|
+
*/
|
|
106
|
+
model: string;
|
|
107
|
+
/**
|
|
108
|
+
* This fingerprint represents the backend configuration that the model runs with.
|
|
109
|
+
*
|
|
110
|
+
* Can be used in conjunction with the `seed` request parameter to understand when
|
|
111
|
+
* backend changes have been made that might impact determinism.
|
|
112
|
+
*/
|
|
113
|
+
system_fingerprint?: string;
|
|
114
|
+
}
|
|
115
|
+
export declare namespace ChatCompletionSnapshot {
|
|
116
|
+
interface Choice {
|
|
117
|
+
/**
|
|
118
|
+
* A chat completion delta generated by streamed model responses.
|
|
119
|
+
*/
|
|
120
|
+
message: Choice.Message;
|
|
121
|
+
/**
|
|
122
|
+
* The reason the model stopped generating tokens. This will be `stop` if the model
|
|
123
|
+
* hit a natural stop point or a provided stop sequence, `length` if the maximum
|
|
124
|
+
* number of tokens specified in the request was reached, `content_filter` if
|
|
125
|
+
* content was omitted due to a flag from our content filters, or `function_call`
|
|
126
|
+
* if the model called a function.
|
|
127
|
+
*/
|
|
128
|
+
finish_reason: ChatCompletion.Choice['finish_reason'] | null;
|
|
129
|
+
/**
|
|
130
|
+
* Log probability information for the choice.
|
|
131
|
+
*/
|
|
132
|
+
logprobs: ChatCompletion.Choice.Logprobs | null;
|
|
133
|
+
/**
|
|
134
|
+
* The index of the choice in the list of choices.
|
|
135
|
+
*/
|
|
136
|
+
index: number;
|
|
137
|
+
}
|
|
138
|
+
namespace Choice {
|
|
139
|
+
/**
|
|
140
|
+
* A chat completion delta generated by streamed model responses.
|
|
141
|
+
*/
|
|
142
|
+
interface Message {
|
|
143
|
+
/**
|
|
144
|
+
* The contents of the chunk message.
|
|
145
|
+
*/
|
|
146
|
+
content?: string | null;
|
|
147
|
+
refusal?: string | null;
|
|
148
|
+
parsed?: unknown | null;
|
|
149
|
+
/**
|
|
150
|
+
* The name and arguments of a function that should be called, as generated by the
|
|
151
|
+
* model.
|
|
152
|
+
*/
|
|
153
|
+
function_call?: Message.FunctionCall;
|
|
154
|
+
tool_calls?: Array<Message.ToolCall>;
|
|
155
|
+
/**
|
|
156
|
+
* The role of the author of this message.
|
|
157
|
+
*/
|
|
158
|
+
role?: ChatCompletionRole;
|
|
159
|
+
}
|
|
160
|
+
namespace Message {
|
|
161
|
+
interface ToolCall {
|
|
162
|
+
/**
|
|
163
|
+
* The ID of the tool call.
|
|
164
|
+
*/
|
|
165
|
+
id: string;
|
|
166
|
+
function: ToolCall.Function;
|
|
167
|
+
/**
|
|
168
|
+
* The type of the tool.
|
|
169
|
+
*/
|
|
170
|
+
type: 'function';
|
|
171
|
+
}
|
|
172
|
+
namespace ToolCall {
|
|
173
|
+
interface Function {
|
|
174
|
+
/**
|
|
175
|
+
* The arguments to call the function with, as generated by the model in JSON
|
|
176
|
+
* format. Note that the model does not always generate valid JSON, and may
|
|
177
|
+
* hallucinate parameters not defined by your function schema. Validate the
|
|
178
|
+
* arguments in your code before calling your function.
|
|
179
|
+
*/
|
|
180
|
+
arguments: string;
|
|
181
|
+
parsed_arguments?: unknown;
|
|
182
|
+
/**
|
|
183
|
+
* The name of the function to call.
|
|
184
|
+
*/
|
|
185
|
+
name: string;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* The name and arguments of a function that should be called, as generated by the
|
|
190
|
+
* model.
|
|
191
|
+
*/
|
|
192
|
+
interface FunctionCall {
|
|
193
|
+
/**
|
|
194
|
+
* The arguments to call the function with, as generated by the model in JSON
|
|
195
|
+
* format. Note that the model does not always generate valid JSON, and may
|
|
196
|
+
* hallucinate parameters not defined by your function schema. Validate the
|
|
197
|
+
* arguments in your code before calling your function.
|
|
198
|
+
*/
|
|
199
|
+
arguments?: string;
|
|
200
|
+
/**
|
|
201
|
+
* The name of the function to call.
|
|
202
|
+
*/
|
|
203
|
+
name?: string;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
//# sourceMappingURL=ChatCompletionStream.d.mts.map
|