@mixedbread/sdk 0.3.0 → 0.5.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 +51 -0
- package/README.md +110 -37
- package/api-promise.d.mts +2 -0
- package/api-promise.d.mts.map +1 -0
- package/api-promise.d.ts +2 -0
- package/api-promise.d.ts.map +1 -0
- package/api-promise.js +6 -0
- package/api-promise.js.map +1 -0
- package/api-promise.mjs +2 -0
- package/api-promise.mjs.map +1 -0
- package/bin/cli +52 -0
- package/bin/migration-config.json +73 -0
- package/client.d.mts +261 -0
- package/client.d.mts.map +1 -0
- package/client.d.ts +261 -0
- package/client.d.ts.map +1 -0
- package/client.js +535 -0
- package/client.js.map +1 -0
- package/client.mjs +531 -0
- package/client.mjs.map +1 -0
- package/core/api-promise.d.mts +46 -0
- package/core/api-promise.d.mts.map +1 -0
- package/core/api-promise.d.ts +46 -0
- package/core/api-promise.d.ts.map +1 -0
- package/core/api-promise.js +74 -0
- package/core/api-promise.js.map +1 -0
- package/core/api-promise.mjs +70 -0
- package/core/api-promise.mjs.map +1 -0
- package/core/error.d.mts +46 -0
- package/core/error.d.mts.map +1 -0
- package/core/error.d.ts +46 -0
- package/core/error.d.ts.map +1 -0
- package/core/error.js +113 -0
- package/core/error.js.map +1 -0
- package/core/error.mjs +97 -0
- package/core/error.mjs.map +1 -0
- package/core/pagination.d.mts +66 -0
- package/core/pagination.d.mts.map +1 -0
- package/core/pagination.d.ts +66 -0
- package/core/pagination.d.ts.map +1 -0
- package/core/pagination.js +110 -0
- package/core/pagination.js.map +1 -0
- package/core/pagination.mjs +104 -0
- package/core/pagination.mjs.map +1 -0
- package/core/resource.d.mts +6 -0
- package/core/resource.d.mts.map +1 -0
- package/core/resource.d.ts +6 -0
- package/core/resource.d.ts.map +1 -0
- package/core/resource.js +11 -0
- package/core/resource.js.map +1 -0
- package/core/resource.mjs +7 -0
- package/core/resource.mjs.map +1 -0
- package/core/uploads.d.mts +3 -0
- package/core/uploads.d.mts.map +1 -0
- package/core/uploads.d.ts +3 -0
- package/core/uploads.d.ts.map +1 -0
- package/core/uploads.js +6 -0
- package/core/uploads.js.map +1 -0
- package/core/uploads.mjs +2 -0
- package/core/uploads.mjs.map +1 -0
- package/error.d.mts +2 -0
- package/error.d.mts.map +1 -0
- package/error.d.ts +1 -46
- package/error.d.ts.map +1 -1
- package/error.js +3 -110
- package/error.js.map +1 -1
- package/error.mjs +1 -96
- package/error.mjs.map +1 -1
- package/index.d.mts +7 -169
- package/index.d.mts.map +1 -0
- package/index.d.ts +6 -168
- package/index.d.ts.map +1 -1
- package/index.js +14 -157
- package/index.js.map +1 -1
- package/index.mjs +6 -130
- package/index.mjs.map +1 -1
- package/internal/builtin-types.d.mts +73 -0
- package/internal/builtin-types.d.mts.map +1 -0
- package/internal/builtin-types.d.ts +73 -0
- package/internal/builtin-types.d.ts.map +1 -0
- package/internal/builtin-types.js +4 -0
- package/internal/builtin-types.js.map +1 -0
- package/internal/builtin-types.mjs +3 -0
- package/internal/builtin-types.mjs.map +1 -0
- package/internal/detect-platform.d.mts +15 -0
- package/internal/detect-platform.d.mts.map +1 -0
- package/internal/detect-platform.d.ts +15 -0
- package/internal/detect-platform.d.ts.map +1 -0
- package/internal/detect-platform.js +162 -0
- package/internal/detect-platform.js.map +1 -0
- package/internal/detect-platform.mjs +157 -0
- package/internal/detect-platform.mjs.map +1 -0
- package/internal/errors.d.mts +3 -0
- package/internal/errors.d.mts.map +1 -0
- package/internal/errors.d.ts +3 -0
- package/internal/errors.d.ts.map +1 -0
- package/internal/errors.js +41 -0
- package/internal/errors.js.map +1 -0
- package/internal/errors.mjs +36 -0
- package/internal/errors.mjs.map +1 -0
- package/internal/headers.d.mts +20 -0
- package/internal/headers.d.mts.map +1 -0
- package/internal/headers.d.ts +20 -0
- package/internal/headers.d.ts.map +1 -0
- package/internal/headers.js +79 -0
- package/internal/headers.js.map +1 -0
- package/internal/headers.mjs +74 -0
- package/internal/headers.mjs.map +1 -0
- package/internal/parse.d.mts +12 -0
- package/internal/parse.d.mts.map +1 -0
- package/internal/parse.d.ts +12 -0
- package/internal/parse.d.ts.map +1 -0
- package/internal/parse.js +35 -0
- package/internal/parse.js.map +1 -0
- package/internal/parse.mjs +32 -0
- package/internal/parse.mjs.map +1 -0
- package/internal/request-options.d.mts +32 -0
- package/internal/request-options.d.mts.map +1 -0
- package/internal/request-options.d.ts +32 -0
- package/internal/request-options.d.ts.map +1 -0
- package/internal/request-options.js +14 -0
- package/internal/request-options.js.map +1 -0
- package/internal/request-options.mjs +10 -0
- package/internal/request-options.mjs.map +1 -0
- package/internal/shim-types.d.mts +28 -0
- package/internal/shim-types.d.ts +28 -0
- package/internal/shims.d.mts +20 -0
- package/internal/shims.d.mts.map +1 -0
- package/internal/shims.d.ts +20 -0
- package/internal/shims.d.ts.map +1 -0
- package/internal/shims.js +92 -0
- package/internal/shims.js.map +1 -0
- package/internal/shims.mjs +85 -0
- package/internal/shims.mjs.map +1 -0
- package/internal/to-file.d.mts +45 -0
- package/internal/to-file.d.mts.map +1 -0
- package/internal/to-file.d.ts +45 -0
- package/internal/to-file.d.ts.map +1 -0
- package/internal/to-file.js +91 -0
- package/internal/to-file.js.map +1 -0
- package/internal/to-file.mjs +88 -0
- package/internal/to-file.mjs.map +1 -0
- package/internal/tslib.js +81 -0
- package/internal/tslib.mjs +17 -0
- package/internal/types.d.mts +67 -0
- package/internal/types.d.mts.map +1 -0
- package/internal/types.d.ts +67 -0
- package/internal/types.d.ts.map +1 -0
- package/internal/types.js +4 -0
- package/internal/types.js.map +1 -0
- package/internal/types.mjs +3 -0
- package/internal/types.mjs.map +1 -0
- package/internal/uploads.d.mts +42 -0
- package/internal/uploads.d.mts.map +1 -0
- package/internal/uploads.d.ts +42 -0
- package/internal/uploads.d.ts.map +1 -0
- package/internal/uploads.js +141 -0
- package/internal/uploads.js.map +1 -0
- package/internal/uploads.mjs +131 -0
- package/internal/uploads.mjs.map +1 -0
- package/internal/utils/base64.d.mts +3 -0
- package/internal/utils/base64.d.mts.map +1 -0
- package/internal/utils/base64.d.ts +3 -0
- package/internal/utils/base64.d.ts.map +1 -0
- package/internal/utils/base64.js +38 -0
- package/internal/utils/base64.js.map +1 -0
- package/internal/utils/base64.mjs +33 -0
- package/internal/utils/base64.mjs.map +1 -0
- package/internal/utils/bytes.d.mts +4 -0
- package/internal/utils/bytes.d.mts.map +1 -0
- package/internal/utils/bytes.d.ts +4 -0
- package/internal/utils/bytes.d.ts.map +1 -0
- package/internal/utils/bytes.js +31 -0
- package/internal/utils/bytes.js.map +1 -0
- package/internal/utils/bytes.mjs +26 -0
- package/internal/utils/bytes.mjs.map +1 -0
- package/internal/utils/env.d.mts +9 -0
- package/internal/utils/env.d.mts.map +1 -0
- package/internal/utils/env.d.ts +9 -0
- package/internal/utils/env.d.ts.map +1 -0
- package/internal/utils/env.js +22 -0
- package/internal/utils/env.js.map +1 -0
- package/internal/utils/env.mjs +18 -0
- package/internal/utils/env.mjs.map +1 -0
- package/internal/utils/log.d.mts +37 -0
- package/internal/utils/log.d.mts.map +1 -0
- package/internal/utils/log.d.ts +37 -0
- package/internal/utils/log.d.ts.map +1 -0
- package/internal/utils/log.js +85 -0
- package/internal/utils/log.js.map +1 -0
- package/internal/utils/log.mjs +79 -0
- package/internal/utils/log.mjs.map +1 -0
- package/internal/utils/path.d.mts +15 -0
- package/internal/utils/path.d.mts.map +1 -0
- package/internal/utils/path.d.ts +15 -0
- package/internal/utils/path.d.ts.map +1 -0
- package/internal/utils/path.js +58 -0
- package/internal/utils/path.js.map +1 -0
- package/internal/utils/path.mjs +53 -0
- package/internal/utils/path.mjs.map +1 -0
- package/internal/utils/sleep.d.mts +2 -0
- package/internal/utils/sleep.d.mts.map +1 -0
- package/internal/utils/sleep.d.ts +2 -0
- package/internal/utils/sleep.d.ts.map +1 -0
- package/internal/utils/sleep.js +7 -0
- package/internal/utils/sleep.js.map +1 -0
- package/internal/utils/sleep.mjs +3 -0
- package/internal/utils/sleep.mjs.map +1 -0
- package/internal/utils/uuid.d.mts +5 -0
- package/internal/utils/uuid.d.mts.map +1 -0
- package/internal/utils/uuid.d.ts +5 -0
- package/internal/utils/uuid.d.ts.map +1 -0
- package/internal/utils/uuid.js +19 -0
- package/internal/utils/uuid.js.map +1 -0
- package/internal/utils/uuid.mjs +15 -0
- package/internal/utils/uuid.mjs.map +1 -0
- package/internal/utils/values.d.mts +16 -0
- package/internal/utils/values.d.mts.map +1 -0
- package/internal/utils/values.d.ts +16 -0
- package/internal/utils/values.d.ts.map +1 -0
- package/internal/utils/values.js +109 -0
- package/internal/utils/values.js.map +1 -0
- package/internal/utils/values.mjs +92 -0
- package/internal/utils/values.mjs.map +1 -0
- package/internal/utils.d.mts +7 -0
- package/internal/utils.d.mts.map +1 -0
- package/internal/utils.d.ts +7 -0
- package/internal/utils.d.ts.map +1 -0
- package/internal/utils.js +11 -0
- package/internal/utils.js.map +1 -0
- package/internal/utils.mjs +8 -0
- package/internal/utils.mjs.map +1 -0
- package/lib/polling.d.mts +48 -0
- package/lib/polling.d.mts.map +1 -0
- package/lib/polling.d.ts.map +1 -1
- package/lib/polling.js +1 -3
- package/lib/polling.js.map +1 -1
- package/lib/polling.mjs +0 -1
- package/lib/polling.mjs.map +1 -1
- package/package.json +129 -64
- package/pagination.d.mts +2 -0
- package/pagination.d.mts.map +1 -0
- package/pagination.d.ts +1 -29
- package/pagination.d.ts.map +1 -1
- package/pagination.js +3 -42
- package/pagination.js.map +1 -1
- package/pagination.mjs +1 -40
- package/pagination.mjs.map +1 -1
- package/resource.d.mts +2 -0
- package/resource.d.mts.map +1 -0
- package/resource.d.ts +1 -5
- package/resource.d.ts.map +1 -1
- package/resource.js +3 -8
- package/resource.js.map +1 -1
- package/resource.mjs +1 -6
- package/resource.mjs.map +1 -1
- package/resources/embeddings.d.mts +55 -0
- package/resources/embeddings.d.mts.map +1 -0
- package/resources/embeddings.d.ts +13 -3
- package/resources/embeddings.d.ts.map +1 -1
- package/resources/embeddings.js +10 -1
- package/resources/embeddings.js.map +1 -1
- package/resources/embeddings.mjs +10 -1
- package/resources/embeddings.mjs.map +1 -1
- package/resources/extractions/content.d.mts +80 -0
- package/resources/extractions/content.d.mts.map +1 -0
- package/resources/extractions/content.d.ts +51 -4
- package/resources/extractions/content.d.ts.map +1 -1
- package/resources/extractions/content.js +1 -1
- package/resources/extractions/content.js.map +1 -1
- package/resources/extractions/content.mjs +1 -1
- package/resources/extractions/content.mjs.map +1 -1
- package/resources/extractions/extractions.d.mts +18 -0
- package/resources/extractions/extractions.d.mts.map +1 -0
- package/resources/extractions/extractions.d.ts +1 -1
- package/resources/extractions/extractions.d.ts.map +1 -1
- package/resources/extractions/extractions.js +5 -27
- package/resources/extractions/extractions.js.map +1 -1
- package/resources/extractions/extractions.mjs +1 -1
- package/resources/extractions/index.d.mts +5 -0
- package/resources/extractions/index.d.mts.map +1 -0
- package/resources/extractions/index.d.ts.map +1 -1
- package/resources/extractions/jobs.d.mts +85 -0
- package/resources/extractions/jobs.d.mts.map +1 -0
- package/resources/extractions/jobs.d.ts +5 -4
- package/resources/extractions/jobs.d.ts.map +1 -1
- package/resources/extractions/jobs.js +4 -3
- package/resources/extractions/jobs.js.map +1 -1
- package/resources/extractions/jobs.mjs +4 -3
- package/resources/extractions/jobs.mjs.map +1 -1
- package/resources/extractions/schema.d.mts +86 -0
- package/resources/extractions/schema.d.mts.map +1 -0
- package/resources/extractions/schema.d.ts +6 -5
- package/resources/extractions/schema.d.ts.map +1 -1
- package/resources/extractions/schema.js +1 -1
- package/resources/extractions/schema.js.map +1 -1
- package/resources/extractions/schema.mjs +1 -1
- package/resources/extractions/schema.mjs.map +1 -1
- package/resources/extractions.d.mts +2 -0
- package/resources/extractions.d.mts.map +1 -0
- package/resources/extractions.d.ts.map +1 -1
- package/resources/extractions.js +2 -15
- package/resources/extractions.js.map +1 -1
- package/resources/files.d.mts +124 -0
- package/resources/files.d.mts.map +1 -0
- package/resources/files.d.ts +15 -16
- package/resources/files.d.ts.map +1 -1
- package/resources/files.js +24 -46
- package/resources/files.js.map +1 -1
- package/resources/files.mjs +23 -21
- package/resources/files.mjs.map +1 -1
- package/resources/index.d.mts +8 -0
- package/resources/index.d.mts.map +1 -0
- package/resources/index.d.ts +2 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -18
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +2 -2
- package/resources/index.mjs.map +1 -1
- package/resources/parsing/index.d.mts +3 -0
- package/resources/parsing/index.d.mts.map +1 -0
- package/resources/parsing/index.d.ts +1 -1
- package/resources/parsing/index.d.ts.map +1 -1
- package/resources/parsing/index.js +1 -2
- package/resources/parsing/index.js.map +1 -1
- package/resources/parsing/index.mjs +1 -1
- package/resources/parsing/index.mjs.map +1 -1
- package/resources/parsing/jobs.d.mts +293 -0
- package/resources/parsing/jobs.d.mts.map +1 -0
- package/resources/parsing/jobs.d.ts +21 -18
- package/resources/parsing/jobs.d.ts.map +1 -1
- package/resources/parsing/jobs.js +20 -42
- package/resources/parsing/jobs.js.map +1 -1
- package/resources/parsing/jobs.mjs +17 -16
- package/resources/parsing/jobs.mjs.map +1 -1
- package/resources/parsing/parsing.d.mts +10 -0
- package/resources/parsing/parsing.d.mts.map +1 -0
- package/resources/parsing/parsing.d.ts +2 -2
- package/resources/parsing/parsing.d.ts.map +1 -1
- package/resources/parsing/parsing.js +3 -26
- package/resources/parsing/parsing.js.map +1 -1
- package/resources/parsing/parsing.mjs +2 -3
- package/resources/parsing/parsing.mjs.map +1 -1
- package/resources/parsing.d.mts +2 -0
- package/resources/parsing.d.mts.map +1 -0
- package/resources/parsing.d.ts.map +1 -1
- package/resources/parsing.js +2 -15
- package/resources/parsing.js.map +1 -1
- package/resources/shared.d.mts +49 -0
- package/resources/shared.d.mts.map +1 -0
- package/resources/top-level.d.mts +188 -0
- package/resources/top-level.d.mts.map +1 -0
- package/resources/top-level.d.ts +6 -2
- package/resources/top-level.d.ts.map +1 -1
- package/resources/vector-stores/files.d.mts +303 -0
- package/resources/vector-stores/files.d.mts.map +1 -0
- package/resources/vector-stores/files.d.ts +27 -16
- package/resources/vector-stores/files.d.ts.map +1 -1
- package/resources/vector-stores/files.js +25 -47
- package/resources/vector-stores/files.js.map +1 -1
- package/resources/vector-stores/files.mjs +22 -21
- package/resources/vector-stores/files.mjs.map +1 -1
- package/resources/vector-stores/index.d.mts +3 -0
- package/resources/vector-stores/index.d.mts.map +1 -0
- package/resources/vector-stores/index.d.ts +2 -2
- package/resources/vector-stores/index.d.ts.map +1 -1
- package/resources/vector-stores/index.js +1 -3
- package/resources/vector-stores/index.js.map +1 -1
- package/resources/vector-stores/index.mjs +2 -2
- package/resources/vector-stores/index.mjs.map +1 -1
- package/resources/vector-stores/vector-stores.d.mts +440 -0
- package/resources/vector-stores/vector-stores.d.mts.map +1 -0
- package/resources/vector-stores/vector-stores.d.ts +31 -20
- package/resources/vector-stores/vector-stores.d.ts.map +1 -1
- package/resources/vector-stores/vector-stores.js +20 -43
- package/resources/vector-stores/vector-stores.js.map +1 -1
- package/resources/vector-stores/vector-stores.mjs +18 -18
- package/resources/vector-stores/vector-stores.mjs.map +1 -1
- package/resources/vector-stores.d.mts +2 -0
- package/resources/vector-stores.d.mts.map +1 -0
- package/resources/vector-stores.d.ts.map +1 -1
- package/resources/vector-stores.js +2 -15
- package/resources/vector-stores.js.map +1 -1
- package/resources.d.mts +2 -0
- package/resources.d.mts.map +1 -0
- package/resources.d.ts.map +1 -1
- package/resources.js +2 -15
- package/resources.js.map +1 -1
- package/src/api-promise.ts +2 -0
- package/src/client.ts +900 -0
- package/src/core/README.md +3 -0
- package/src/core/api-promise.ts +92 -0
- package/src/core/error.ts +130 -0
- package/src/core/pagination.ts +183 -0
- package/src/core/resource.ts +11 -0
- package/src/core/uploads.ts +2 -0
- package/src/error.ts +2 -130
- package/src/index.ts +6 -330
- package/src/internal/README.md +3 -0
- package/src/internal/builtin-types.ts +93 -0
- package/src/internal/detect-platform.ts +196 -0
- package/src/internal/errors.ts +33 -0
- package/src/internal/headers.ts +97 -0
- package/src/internal/parse.ts +50 -0
- package/src/internal/request-options.ts +37 -0
- package/src/internal/shim-types.d.ts +28 -0
- package/src/internal/shims.ts +107 -0
- package/src/internal/to-file.ts +154 -0
- package/src/internal/types.ts +92 -0
- package/src/internal/uploads.ts +187 -0
- package/src/internal/utils/base64.ts +40 -0
- package/src/internal/utils/bytes.ts +32 -0
- package/src/internal/utils/env.ts +18 -0
- package/src/internal/utils/log.ts +126 -0
- package/src/internal/utils/path.ts +65 -0
- package/src/internal/utils/sleep.ts +3 -0
- package/src/internal/utils/uuid.ts +17 -0
- package/src/internal/utils/values.ts +102 -0
- package/src/internal/utils.ts +8 -0
- package/src/lib/polling.ts +0 -1
- package/src/pagination.ts +2 -82
- package/src/resource.ts +2 -11
- package/src/resources/embeddings.ts +14 -4
- package/src/resources/extractions/content.ts +57 -4
- package/src/resources/extractions/extractions.ts +1 -1
- package/src/resources/extractions/jobs.ts +7 -5
- package/src/resources/extractions/schema.ts +6 -5
- package/src/resources/files.ts +30 -34
- package/src/resources/index.ts +2 -2
- package/src/resources/parsing/index.ts +1 -1
- package/src/resources/parsing/jobs.ts +29 -33
- package/src/resources/parsing/parsing.ts +2 -3
- package/src/resources/top-level.ts +13 -4
- package/src/resources/vector-stores/files.ts +51 -49
- package/src/resources/vector-stores/index.ts +4 -2
- package/src/resources/vector-stores/vector-stores.ts +45 -40
- package/src/tsconfig.json +2 -2
- package/src/uploads.ts +2 -255
- package/src/version.ts +1 -1
- package/uploads.d.mts +2 -0
- package/uploads.d.mts.map +1 -0
- package/uploads.d.ts +1 -74
- package/uploads.d.ts.map +1 -1
- package/uploads.js +3 -168
- package/uploads.js.map +1 -1
- package/uploads.mjs +1 -157
- package/uploads.mjs.map +1 -1
- package/version.d.mts +2 -0
- package/version.d.mts.map +1 -0
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
- package/_shims/MultipartBody.d.ts +0 -9
- package/_shims/MultipartBody.d.ts.map +0 -1
- package/_shims/MultipartBody.js +0 -16
- package/_shims/MultipartBody.js.map +0 -1
- package/_shims/MultipartBody.mjs +0 -12
- package/_shims/MultipartBody.mjs.map +0 -1
- package/_shims/README.md +0 -46
- package/_shims/auto/runtime-bun.d.ts +0 -5
- package/_shims/auto/runtime-bun.d.ts.map +0 -1
- package/_shims/auto/runtime-bun.js +0 -21
- package/_shims/auto/runtime-bun.js.map +0 -1
- package/_shims/auto/runtime-bun.mjs +0 -2
- package/_shims/auto/runtime-bun.mjs.map +0 -1
- package/_shims/auto/runtime-node.d.ts +0 -5
- package/_shims/auto/runtime-node.d.ts.map +0 -1
- package/_shims/auto/runtime-node.js +0 -21
- package/_shims/auto/runtime-node.js.map +0 -1
- package/_shims/auto/runtime-node.mjs +0 -2
- package/_shims/auto/runtime-node.mjs.map +0 -1
- package/_shims/auto/runtime.d.ts +0 -5
- package/_shims/auto/runtime.d.ts.map +0 -1
- package/_shims/auto/runtime.js +0 -21
- package/_shims/auto/runtime.js.map +0 -1
- package/_shims/auto/runtime.mjs +0 -2
- package/_shims/auto/runtime.mjs.map +0 -1
- package/_shims/auto/types-node.d.ts +0 -5
- package/_shims/auto/types-node.d.ts.map +0 -1
- package/_shims/auto/types-node.js +0 -21
- package/_shims/auto/types-node.js.map +0 -1
- package/_shims/auto/types-node.mjs +0 -2
- package/_shims/auto/types-node.mjs.map +0 -1
- package/_shims/auto/types.d.ts +0 -101
- package/_shims/auto/types.js +0 -3
- package/_shims/auto/types.mjs +0 -3
- package/_shims/bun-runtime.d.ts +0 -6
- package/_shims/bun-runtime.d.ts.map +0 -1
- package/_shims/bun-runtime.js +0 -14
- package/_shims/bun-runtime.js.map +0 -1
- package/_shims/bun-runtime.mjs +0 -10
- package/_shims/bun-runtime.mjs.map +0 -1
- package/_shims/index.d.ts +0 -83
- package/_shims/index.js +0 -17
- package/_shims/index.mjs +0 -11
- package/_shims/manual-types.d.ts +0 -12
- package/_shims/manual-types.js +0 -3
- package/_shims/manual-types.mjs +0 -3
- package/_shims/node-runtime.d.ts +0 -3
- package/_shims/node-runtime.d.ts.map +0 -1
- package/_shims/node-runtime.js +0 -89
- package/_shims/node-runtime.js.map +0 -1
- package/_shims/node-runtime.mjs +0 -56
- package/_shims/node-runtime.mjs.map +0 -1
- package/_shims/node-types.d.ts +0 -42
- package/_shims/node-types.js +0 -3
- package/_shims/node-types.mjs +0 -3
- package/_shims/registry.d.ts +0 -37
- package/_shims/registry.d.ts.map +0 -1
- package/_shims/registry.js +0 -41
- package/_shims/registry.js.map +0 -1
- package/_shims/registry.mjs +0 -37
- package/_shims/registry.mjs.map +0 -1
- package/_shims/web-runtime.d.ts +0 -5
- package/_shims/web-runtime.d.ts.map +0 -1
- package/_shims/web-runtime.js +0 -78
- package/_shims/web-runtime.js.map +0 -1
- package/_shims/web-runtime.mjs +0 -71
- package/_shims/web-runtime.mjs.map +0 -1
- package/_shims/web-types.d.ts +0 -83
- package/_shims/web-types.js +0 -3
- package/_shims/web-types.mjs +0 -3
- package/core.d.ts +0 -252
- package/core.d.ts.map +0 -1
- package/core.js +0 -917
- package/core.js.map +0 -1
- package/core.mjs +0 -885
- package/core.mjs.map +0 -1
- package/shims/node.d.ts +0 -30
- package/shims/node.d.ts.map +0 -1
- package/shims/node.js +0 -31
- package/shims/node.js.map +0 -1
- package/shims/node.mjs +0 -5
- package/shims/node.mjs.map +0 -1
- package/shims/web.d.ts +0 -26
- package/shims/web.d.ts.map +0 -1
- package/shims/web.js +0 -31
- package/shims/web.js.map +0 -1
- package/shims/web.mjs +0 -5
- package/shims/web.mjs.map +0 -1
- package/src/_shims/MultipartBody.ts +0 -9
- package/src/_shims/README.md +0 -46
- package/src/_shims/auto/runtime-bun.ts +0 -4
- package/src/_shims/auto/runtime-node.ts +0 -4
- package/src/_shims/auto/runtime.ts +0 -4
- package/src/_shims/auto/types-node.ts +0 -4
- package/src/_shims/auto/types.d.ts +0 -101
- package/src/_shims/auto/types.js +0 -3
- package/src/_shims/auto/types.mjs +0 -3
- package/src/_shims/bun-runtime.ts +0 -14
- package/src/_shims/index.d.ts +0 -83
- package/src/_shims/index.js +0 -17
- package/src/_shims/index.mjs +0 -11
- package/src/_shims/manual-types.d.ts +0 -12
- package/src/_shims/manual-types.js +0 -3
- package/src/_shims/manual-types.mjs +0 -3
- package/src/_shims/node-runtime.ts +0 -81
- package/src/_shims/node-types.d.ts +0 -42
- package/src/_shims/node-types.js +0 -3
- package/src/_shims/node-types.mjs +0 -3
- package/src/_shims/registry.ts +0 -67
- package/src/_shims/web-runtime.ts +0 -103
- package/src/_shims/web-types.d.ts +0 -83
- package/src/_shims/web-types.js +0 -3
- package/src/_shims/web-types.mjs +0 -3
- package/src/core.ts +0 -1227
- package/src/shims/node.ts +0 -50
- package/src/shims/web.ts +0 -50
package/client.d.mts
ADDED
@@ -0,0 +1,261 @@
|
|
1
|
+
import type { RequestInit, RequestInfo } from "./internal/builtin-types.mjs";
|
2
|
+
import type { PromiseOrValue, MergedRequestInit, FinalizedRequestInit } from "./internal/types.mjs";
|
3
|
+
import { type Logger, type LogLevel } from "./internal/utils/log.mjs";
|
4
|
+
export type { Logger, LogLevel } from "./internal/utils/log.mjs";
|
5
|
+
import * as Opts from "./internal/request-options.mjs";
|
6
|
+
import * as Errors from "./core/error.mjs";
|
7
|
+
import * as Pagination from "./core/pagination.mjs";
|
8
|
+
import { type LimitOffsetParams, LimitOffsetResponse } from "./core/pagination.mjs";
|
9
|
+
import * as Uploads from "./core/uploads.mjs";
|
10
|
+
import * as API from "./resources/index.mjs";
|
11
|
+
import * as TopLevelAPI from "./resources/top-level.mjs";
|
12
|
+
import { EmbedParams, Embedding, EmbeddingCreateResponse, InfoResponse, MultiEncodingEmbedding, RerankParams, RerankResponse } from "./resources/top-level.mjs";
|
13
|
+
import { APIPromise } from "./core/api-promise.mjs";
|
14
|
+
import { type Fetch } from "./internal/builtin-types.mjs";
|
15
|
+
import { HeadersLike, NullableHeaders } from "./internal/headers.mjs";
|
16
|
+
import { FinalRequestOptions, RequestOptions } from "./internal/request-options.mjs";
|
17
|
+
import { EmbeddingCreateParams, Embeddings } from "./resources/embeddings.mjs";
|
18
|
+
import { FileCreateParams, FileDeleteResponse, FileListParams, FileObject, FileObjectsLimitOffset, FileUpdateParams, Files } from "./resources/files.mjs";
|
19
|
+
import { Extractions } from "./resources/extractions/extractions.mjs";
|
20
|
+
import { Parsing } from "./resources/parsing/parsing.mjs";
|
21
|
+
import { ExpiresAfter, FileCounts, ScoredVectorStoreChunk, VectorStore, VectorStoreChunkSearchOptions, VectorStoreCreateParams, VectorStoreDeleteResponse, VectorStoreFileSearchOptions, VectorStoreListParams, VectorStoreQuestionAnsweringParams, VectorStoreQuestionAnsweringResponse, VectorStoreSearchParams, VectorStoreSearchResponse, VectorStoreUpdateParams, VectorStores, VectorStoresLimitOffset } from "./resources/vector-stores/vector-stores.mjs";
|
22
|
+
declare const environments: {
|
23
|
+
production: string;
|
24
|
+
local: string;
|
25
|
+
};
|
26
|
+
type Environment = keyof typeof environments;
|
27
|
+
export interface ClientOptions {
|
28
|
+
/**
|
29
|
+
* Api key to authenticate with Mixedbread
|
30
|
+
*/
|
31
|
+
apiKey?: string | undefined;
|
32
|
+
/**
|
33
|
+
* Specifies the environment to use for the API.
|
34
|
+
*
|
35
|
+
* Each environment maps to a different base URL:
|
36
|
+
* - `production` corresponds to `https://api.mixedbread.com`
|
37
|
+
* - `local` corresponds to `http://127.0.0.1:8000`
|
38
|
+
*/
|
39
|
+
environment?: Environment | undefined;
|
40
|
+
/**
|
41
|
+
* Override the default base URL for the API, e.g., "https://api.example.com/v2/"
|
42
|
+
*
|
43
|
+
* Defaults to process.env['MIXEDBREAD_BASE_URL'].
|
44
|
+
*/
|
45
|
+
baseURL?: string | null | undefined;
|
46
|
+
/**
|
47
|
+
* The maximum amount of time (in milliseconds) that the client should wait for a response
|
48
|
+
* from the server before timing out a single request.
|
49
|
+
*
|
50
|
+
* Note that request timeouts are retried by default, so in a worst-case scenario you may wait
|
51
|
+
* much longer than this timeout before the promise succeeds or fails.
|
52
|
+
*/
|
53
|
+
timeout?: number | undefined;
|
54
|
+
/**
|
55
|
+
* Additional `RequestInit` options to be passed to `fetch` calls.
|
56
|
+
* Properties will be overridden by per-request `fetchOptions`.
|
57
|
+
*/
|
58
|
+
fetchOptions?: MergedRequestInit | undefined;
|
59
|
+
/**
|
60
|
+
* Specify a custom `fetch` function implementation.
|
61
|
+
*
|
62
|
+
* If not provided, we expect that `fetch` is defined globally.
|
63
|
+
*/
|
64
|
+
fetch?: Fetch | undefined;
|
65
|
+
/**
|
66
|
+
* The maximum number of times that the client will retry a request in case of a
|
67
|
+
* temporary failure, like a network error or a 5XX error from the server.
|
68
|
+
*
|
69
|
+
* @default 2
|
70
|
+
*/
|
71
|
+
maxRetries?: number | undefined;
|
72
|
+
/**
|
73
|
+
* Default headers to include with every request to the API.
|
74
|
+
*
|
75
|
+
* These can be removed in individual requests by explicitly setting the
|
76
|
+
* header to `null` in request options.
|
77
|
+
*/
|
78
|
+
defaultHeaders?: HeadersLike | undefined;
|
79
|
+
/**
|
80
|
+
* Default query parameters to include with every request to the API.
|
81
|
+
*
|
82
|
+
* These can be removed in individual requests by explicitly setting the
|
83
|
+
* param to `undefined` in request options.
|
84
|
+
*/
|
85
|
+
defaultQuery?: Record<string, string | undefined> | undefined;
|
86
|
+
/**
|
87
|
+
* Set the log level.
|
88
|
+
*
|
89
|
+
* Defaults to process.env['MIXEDBREAD_LOG'] or 'warn' if it isn't set.
|
90
|
+
*/
|
91
|
+
logLevel?: LogLevel | undefined;
|
92
|
+
/**
|
93
|
+
* Set the logger.
|
94
|
+
*
|
95
|
+
* Defaults to globalThis.console.
|
96
|
+
*/
|
97
|
+
logger?: Logger | undefined;
|
98
|
+
}
|
99
|
+
/**
|
100
|
+
* API Client for interfacing with the Mixedbread API.
|
101
|
+
*/
|
102
|
+
export declare class Mixedbread {
|
103
|
+
#private;
|
104
|
+
apiKey: string;
|
105
|
+
baseURL: string;
|
106
|
+
maxRetries: number;
|
107
|
+
timeout: number;
|
108
|
+
logger: Logger | undefined;
|
109
|
+
logLevel: LogLevel | undefined;
|
110
|
+
fetchOptions: MergedRequestInit | undefined;
|
111
|
+
private fetch;
|
112
|
+
protected idempotencyHeader?: string;
|
113
|
+
private _options;
|
114
|
+
/**
|
115
|
+
* API Client for interfacing with the Mixedbread API.
|
116
|
+
*
|
117
|
+
* @param {string | undefined} [opts.apiKey=process.env['MXBAI_API_KEY'] ?? undefined]
|
118
|
+
* @param {Environment} [opts.environment=production] - Specifies the environment URL to use for the API.
|
119
|
+
* @param {string} [opts.baseURL=process.env['MIXEDBREAD_BASE_URL'] ?? https://api.mixedbread.com] - Override the default base URL for the API.
|
120
|
+
* @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
|
121
|
+
* @param {MergedRequestInit} [opts.fetchOptions] - Additional `RequestInit` options to be passed to `fetch` calls.
|
122
|
+
* @param {Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
|
123
|
+
* @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.
|
124
|
+
* @param {HeadersLike} opts.defaultHeaders - Default headers to include with every request to the API.
|
125
|
+
* @param {Record<string, string | undefined>} opts.defaultQuery - Default query parameters to include with every request to the API.
|
126
|
+
*/
|
127
|
+
constructor({ baseURL, apiKey, ...opts }?: ClientOptions);
|
128
|
+
/**
|
129
|
+
* Create a new client instance re-using the same options given to the current client with optional overriding.
|
130
|
+
*/
|
131
|
+
withOptions(options: Partial<ClientOptions>): this;
|
132
|
+
/**
|
133
|
+
* Create embeddings for text or images using the specified model, encoding format,
|
134
|
+
* and normalization.
|
135
|
+
*
|
136
|
+
* Args: params: The parameters for creating embeddings.
|
137
|
+
*
|
138
|
+
* Returns: EmbeddingCreateResponse: The response containing the embeddings.
|
139
|
+
*
|
140
|
+
* @example
|
141
|
+
* ```ts
|
142
|
+
* const embeddingCreateResponse = await client.embed({
|
143
|
+
* model: 'mixedbread-ai/mxbai-embed-large-v1',
|
144
|
+
* input: 'x',
|
145
|
+
* });
|
146
|
+
* ```
|
147
|
+
*/
|
148
|
+
embed(body: TopLevelAPI.EmbedParams, options?: RequestOptions): APIPromise<TopLevelAPI.EmbeddingCreateResponse>;
|
149
|
+
/**
|
150
|
+
* Returns service information, including name and version.
|
151
|
+
*
|
152
|
+
* Returns: InfoResponse: A response containing the service name and version.
|
153
|
+
*
|
154
|
+
* @example
|
155
|
+
* ```ts
|
156
|
+
* const response = await client.info();
|
157
|
+
* ```
|
158
|
+
*/
|
159
|
+
info(options?: RequestOptions): APIPromise<TopLevelAPI.InfoResponse>;
|
160
|
+
/**
|
161
|
+
* Rerank different kind of documents for a given query.
|
162
|
+
*
|
163
|
+
* Args: params: RerankParams: The parameters for reranking.
|
164
|
+
*
|
165
|
+
* Returns: RerankResponse: The reranked documents for the input query.
|
166
|
+
*
|
167
|
+
* @example
|
168
|
+
* ```ts
|
169
|
+
* const response = await client.rerank({
|
170
|
+
* query:
|
171
|
+
* 'What are the key features of the Mixedbread embedding model?',
|
172
|
+
* input: ['Document 1', 'Document 2'],
|
173
|
+
* });
|
174
|
+
* ```
|
175
|
+
*/
|
176
|
+
rerank(body: TopLevelAPI.RerankParams, options?: RequestOptions): APIPromise<TopLevelAPI.RerankResponse>;
|
177
|
+
protected defaultQuery(): Record<string, string | undefined> | undefined;
|
178
|
+
protected validateHeaders({ values, nulls }: NullableHeaders): void;
|
179
|
+
protected authHeaders(opts: FinalRequestOptions): NullableHeaders | undefined;
|
180
|
+
/**
|
181
|
+
* Basic re-implementation of `qs.stringify` for primitive types.
|
182
|
+
*/
|
183
|
+
protected stringifyQuery(query: Record<string, unknown>): string;
|
184
|
+
private getUserAgent;
|
185
|
+
protected defaultIdempotencyKey(): string;
|
186
|
+
protected makeStatusError(status: number, error: Object, message: string | undefined, headers: Headers): Errors.APIError;
|
187
|
+
buildURL(path: string, query: Record<string, unknown> | null | undefined): string;
|
188
|
+
/**
|
189
|
+
* Used as a callback for mutating the given `FinalRequestOptions` object.
|
190
|
+
*/
|
191
|
+
protected prepareOptions(options: FinalRequestOptions): Promise<void>;
|
192
|
+
/**
|
193
|
+
* Used as a callback for mutating the given `RequestInit` object.
|
194
|
+
*
|
195
|
+
* This is useful for cases where you want to add certain headers based off of
|
196
|
+
* the request properties, e.g. `method` or `url`.
|
197
|
+
*/
|
198
|
+
protected prepareRequest(request: RequestInit, { url, options }: {
|
199
|
+
url: string;
|
200
|
+
options: FinalRequestOptions;
|
201
|
+
}): Promise<void>;
|
202
|
+
get<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp>;
|
203
|
+
post<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp>;
|
204
|
+
patch<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp>;
|
205
|
+
put<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp>;
|
206
|
+
delete<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp>;
|
207
|
+
private methodRequest;
|
208
|
+
request<Rsp>(options: PromiseOrValue<FinalRequestOptions>, remainingRetries?: number | null): APIPromise<Rsp>;
|
209
|
+
private makeRequest;
|
210
|
+
getAPIList<Item, PageClass extends Pagination.AbstractPage<Item> = Pagination.AbstractPage<Item>>(path: string, Page: new (...args: any[]) => PageClass, opts?: RequestOptions): Pagination.PagePromise<PageClass, Item>;
|
211
|
+
requestAPIList<Item = unknown, PageClass extends Pagination.AbstractPage<Item> = Pagination.AbstractPage<Item>>(Page: new (...args: ConstructorParameters<typeof Pagination.AbstractPage>) => PageClass, options: FinalRequestOptions): Pagination.PagePromise<PageClass, Item>;
|
212
|
+
fetchWithTimeout(url: RequestInfo, init: RequestInit | undefined, ms: number, controller: AbortController): Promise<Response>;
|
213
|
+
private shouldRetry;
|
214
|
+
private retryRequest;
|
215
|
+
private calculateDefaultRetryTimeoutMillis;
|
216
|
+
buildRequest(inputOptions: FinalRequestOptions, { retryCount }?: {
|
217
|
+
retryCount?: number;
|
218
|
+
}): {
|
219
|
+
req: FinalizedRequestInit;
|
220
|
+
url: string;
|
221
|
+
timeout: number;
|
222
|
+
};
|
223
|
+
private buildHeaders;
|
224
|
+
private buildBody;
|
225
|
+
static Mixedbread: typeof Mixedbread;
|
226
|
+
static DEFAULT_TIMEOUT: number;
|
227
|
+
static MixedbreadError: typeof Errors.MixedbreadError;
|
228
|
+
static APIError: typeof Errors.APIError;
|
229
|
+
static APIConnectionError: typeof Errors.APIConnectionError;
|
230
|
+
static APIConnectionTimeoutError: typeof Errors.APIConnectionTimeoutError;
|
231
|
+
static APIUserAbortError: typeof Errors.APIUserAbortError;
|
232
|
+
static NotFoundError: typeof Errors.NotFoundError;
|
233
|
+
static ConflictError: typeof Errors.ConflictError;
|
234
|
+
static RateLimitError: typeof Errors.RateLimitError;
|
235
|
+
static BadRequestError: typeof Errors.BadRequestError;
|
236
|
+
static AuthenticationError: typeof Errors.AuthenticationError;
|
237
|
+
static InternalServerError: typeof Errors.InternalServerError;
|
238
|
+
static PermissionDeniedError: typeof Errors.PermissionDeniedError;
|
239
|
+
static UnprocessableEntityError: typeof Errors.UnprocessableEntityError;
|
240
|
+
static toFile: typeof Uploads.toFile;
|
241
|
+
vectorStores: API.VectorStores;
|
242
|
+
parsing: API.Parsing;
|
243
|
+
files: API.Files;
|
244
|
+
extractions: API.Extractions;
|
245
|
+
embeddings: API.Embeddings;
|
246
|
+
}
|
247
|
+
export declare namespace Mixedbread {
|
248
|
+
export type RequestOptions = Opts.RequestOptions;
|
249
|
+
export import LimitOffset = Pagination.LimitOffset;
|
250
|
+
export { type LimitOffsetParams as LimitOffsetParams, type LimitOffsetResponse as LimitOffsetResponse };
|
251
|
+
export { type Embedding as Embedding, type EmbeddingCreateResponse as EmbeddingCreateResponse, type MultiEncodingEmbedding as MultiEncodingEmbedding, type InfoResponse as InfoResponse, type RerankResponse as RerankResponse, type EmbedParams as EmbedParams, type RerankParams as RerankParams, };
|
252
|
+
export { VectorStores as VectorStores, type ExpiresAfter as ExpiresAfter, type FileCounts as FileCounts, type ScoredVectorStoreChunk as ScoredVectorStoreChunk, type VectorStore as VectorStore, type VectorStoreChunkSearchOptions as VectorStoreChunkSearchOptions, type VectorStoreFileSearchOptions as VectorStoreFileSearchOptions, type VectorStoreDeleteResponse as VectorStoreDeleteResponse, type VectorStoreQuestionAnsweringResponse as VectorStoreQuestionAnsweringResponse, type VectorStoreSearchResponse as VectorStoreSearchResponse, type VectorStoresLimitOffset as VectorStoresLimitOffset, type VectorStoreCreateParams as VectorStoreCreateParams, type VectorStoreUpdateParams as VectorStoreUpdateParams, type VectorStoreListParams as VectorStoreListParams, type VectorStoreQuestionAnsweringParams as VectorStoreQuestionAnsweringParams, type VectorStoreSearchParams as VectorStoreSearchParams, };
|
253
|
+
export { Parsing as Parsing };
|
254
|
+
export { Files as Files, type FileObject as FileObject, type FileDeleteResponse as FileDeleteResponse, type FileObjectsLimitOffset as FileObjectsLimitOffset, type FileCreateParams as FileCreateParams, type FileUpdateParams as FileUpdateParams, type FileListParams as FileListParams, };
|
255
|
+
export { Extractions as Extractions };
|
256
|
+
export { Embeddings as Embeddings, type EmbeddingCreateParams as EmbeddingCreateParams };
|
257
|
+
export type SearchFilter = API.SearchFilter;
|
258
|
+
export type SearchFilterCondition = API.SearchFilterCondition;
|
259
|
+
export type Usage = API.Usage;
|
260
|
+
}
|
261
|
+
//# sourceMappingURL=client.d.mts.map
|
package/client.d.mts.map
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"client.d.mts","sourceRoot":"","sources":["src/client.ts"],"names":[],"mappings":"OAEO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAY;OAC3C,KAAK,EAAc,cAAc,EAAE,iBAAiB,EAAE,oBAAoB,EAAE;OAI5E,EAAE,KAAK,MAAM,EAAE,KAAK,QAAQ,EAAiB;YACxC,EAAE,MAAM,EAAE,QAAQ,EAAE;O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AE,OAAO,IAAI,OAAO,EAAE,CAAC;IAE9B,OAAO,EACL,KAAK,IAAI,KAAK,EACd,KAAK,UAAU,IAAI,UAAU,EAC7B,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,cAAc,IAAI,cAAc,GACtC,CAAC;IAEF,OAAO,EAAE,WAAW,IAAI,WAAW,EAAE,CAAC;IAEtC,OAAO,EAAE,UAAU,IAAI,UAAU,EAAE,KAAK,qBAAqB,IAAI,qBAAqB,EAAE,CAAC;IAEzF,MAAM,MAAM,YAAY,GAAG,GAAG,CAAC,YAAY,CAAC;IAC5C,MAAM,MAAM,qBAAqB,GAAG,GAAG,CAAC,qBAAqB,CAAC;IAC9D,MAAM,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC;CAC/B"}
|
package/client.d.ts
ADDED
@@ -0,0 +1,261 @@
|
|
1
|
+
import type { RequestInit, RequestInfo } from "./internal/builtin-types.js";
|
2
|
+
import type { PromiseOrValue, MergedRequestInit, FinalizedRequestInit } from "./internal/types.js";
|
3
|
+
import { type Logger, type LogLevel } from "./internal/utils/log.js";
|
4
|
+
export type { Logger, LogLevel } from "./internal/utils/log.js";
|
5
|
+
import * as Opts from "./internal/request-options.js";
|
6
|
+
import * as Errors from "./core/error.js";
|
7
|
+
import * as Pagination from "./core/pagination.js";
|
8
|
+
import { type LimitOffsetParams, LimitOffsetResponse } from "./core/pagination.js";
|
9
|
+
import * as Uploads from "./core/uploads.js";
|
10
|
+
import * as API from "./resources/index.js";
|
11
|
+
import * as TopLevelAPI from "./resources/top-level.js";
|
12
|
+
import { EmbedParams, Embedding, EmbeddingCreateResponse, InfoResponse, MultiEncodingEmbedding, RerankParams, RerankResponse } from "./resources/top-level.js";
|
13
|
+
import { APIPromise } from "./core/api-promise.js";
|
14
|
+
import { type Fetch } from "./internal/builtin-types.js";
|
15
|
+
import { HeadersLike, NullableHeaders } from "./internal/headers.js";
|
16
|
+
import { FinalRequestOptions, RequestOptions } from "./internal/request-options.js";
|
17
|
+
import { EmbeddingCreateParams, Embeddings } from "./resources/embeddings.js";
|
18
|
+
import { FileCreateParams, FileDeleteResponse, FileListParams, FileObject, FileObjectsLimitOffset, FileUpdateParams, Files } from "./resources/files.js";
|
19
|
+
import { Extractions } from "./resources/extractions/extractions.js";
|
20
|
+
import { Parsing } from "./resources/parsing/parsing.js";
|
21
|
+
import { ExpiresAfter, FileCounts, ScoredVectorStoreChunk, VectorStore, VectorStoreChunkSearchOptions, VectorStoreCreateParams, VectorStoreDeleteResponse, VectorStoreFileSearchOptions, VectorStoreListParams, VectorStoreQuestionAnsweringParams, VectorStoreQuestionAnsweringResponse, VectorStoreSearchParams, VectorStoreSearchResponse, VectorStoreUpdateParams, VectorStores, VectorStoresLimitOffset } from "./resources/vector-stores/vector-stores.js";
|
22
|
+
declare const environments: {
|
23
|
+
production: string;
|
24
|
+
local: string;
|
25
|
+
};
|
26
|
+
type Environment = keyof typeof environments;
|
27
|
+
export interface ClientOptions {
|
28
|
+
/**
|
29
|
+
* Api key to authenticate with Mixedbread
|
30
|
+
*/
|
31
|
+
apiKey?: string | undefined;
|
32
|
+
/**
|
33
|
+
* Specifies the environment to use for the API.
|
34
|
+
*
|
35
|
+
* Each environment maps to a different base URL:
|
36
|
+
* - `production` corresponds to `https://api.mixedbread.com`
|
37
|
+
* - `local` corresponds to `http://127.0.0.1:8000`
|
38
|
+
*/
|
39
|
+
environment?: Environment | undefined;
|
40
|
+
/**
|
41
|
+
* Override the default base URL for the API, e.g., "https://api.example.com/v2/"
|
42
|
+
*
|
43
|
+
* Defaults to process.env['MIXEDBREAD_BASE_URL'].
|
44
|
+
*/
|
45
|
+
baseURL?: string | null | undefined;
|
46
|
+
/**
|
47
|
+
* The maximum amount of time (in milliseconds) that the client should wait for a response
|
48
|
+
* from the server before timing out a single request.
|
49
|
+
*
|
50
|
+
* Note that request timeouts are retried by default, so in a worst-case scenario you may wait
|
51
|
+
* much longer than this timeout before the promise succeeds or fails.
|
52
|
+
*/
|
53
|
+
timeout?: number | undefined;
|
54
|
+
/**
|
55
|
+
* Additional `RequestInit` options to be passed to `fetch` calls.
|
56
|
+
* Properties will be overridden by per-request `fetchOptions`.
|
57
|
+
*/
|
58
|
+
fetchOptions?: MergedRequestInit | undefined;
|
59
|
+
/**
|
60
|
+
* Specify a custom `fetch` function implementation.
|
61
|
+
*
|
62
|
+
* If not provided, we expect that `fetch` is defined globally.
|
63
|
+
*/
|
64
|
+
fetch?: Fetch | undefined;
|
65
|
+
/**
|
66
|
+
* The maximum number of times that the client will retry a request in case of a
|
67
|
+
* temporary failure, like a network error or a 5XX error from the server.
|
68
|
+
*
|
69
|
+
* @default 2
|
70
|
+
*/
|
71
|
+
maxRetries?: number | undefined;
|
72
|
+
/**
|
73
|
+
* Default headers to include with every request to the API.
|
74
|
+
*
|
75
|
+
* These can be removed in individual requests by explicitly setting the
|
76
|
+
* header to `null` in request options.
|
77
|
+
*/
|
78
|
+
defaultHeaders?: HeadersLike | undefined;
|
79
|
+
/**
|
80
|
+
* Default query parameters to include with every request to the API.
|
81
|
+
*
|
82
|
+
* These can be removed in individual requests by explicitly setting the
|
83
|
+
* param to `undefined` in request options.
|
84
|
+
*/
|
85
|
+
defaultQuery?: Record<string, string | undefined> | undefined;
|
86
|
+
/**
|
87
|
+
* Set the log level.
|
88
|
+
*
|
89
|
+
* Defaults to process.env['MIXEDBREAD_LOG'] or 'warn' if it isn't set.
|
90
|
+
*/
|
91
|
+
logLevel?: LogLevel | undefined;
|
92
|
+
/**
|
93
|
+
* Set the logger.
|
94
|
+
*
|
95
|
+
* Defaults to globalThis.console.
|
96
|
+
*/
|
97
|
+
logger?: Logger | undefined;
|
98
|
+
}
|
99
|
+
/**
|
100
|
+
* API Client for interfacing with the Mixedbread API.
|
101
|
+
*/
|
102
|
+
export declare class Mixedbread {
|
103
|
+
#private;
|
104
|
+
apiKey: string;
|
105
|
+
baseURL: string;
|
106
|
+
maxRetries: number;
|
107
|
+
timeout: number;
|
108
|
+
logger: Logger | undefined;
|
109
|
+
logLevel: LogLevel | undefined;
|
110
|
+
fetchOptions: MergedRequestInit | undefined;
|
111
|
+
private fetch;
|
112
|
+
protected idempotencyHeader?: string;
|
113
|
+
private _options;
|
114
|
+
/**
|
115
|
+
* API Client for interfacing with the Mixedbread API.
|
116
|
+
*
|
117
|
+
* @param {string | undefined} [opts.apiKey=process.env['MXBAI_API_KEY'] ?? undefined]
|
118
|
+
* @param {Environment} [opts.environment=production] - Specifies the environment URL to use for the API.
|
119
|
+
* @param {string} [opts.baseURL=process.env['MIXEDBREAD_BASE_URL'] ?? https://api.mixedbread.com] - Override the default base URL for the API.
|
120
|
+
* @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
|
121
|
+
* @param {MergedRequestInit} [opts.fetchOptions] - Additional `RequestInit` options to be passed to `fetch` calls.
|
122
|
+
* @param {Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
|
123
|
+
* @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.
|
124
|
+
* @param {HeadersLike} opts.defaultHeaders - Default headers to include with every request to the API.
|
125
|
+
* @param {Record<string, string | undefined>} opts.defaultQuery - Default query parameters to include with every request to the API.
|
126
|
+
*/
|
127
|
+
constructor({ baseURL, apiKey, ...opts }?: ClientOptions);
|
128
|
+
/**
|
129
|
+
* Create a new client instance re-using the same options given to the current client with optional overriding.
|
130
|
+
*/
|
131
|
+
withOptions(options: Partial<ClientOptions>): this;
|
132
|
+
/**
|
133
|
+
* Create embeddings for text or images using the specified model, encoding format,
|
134
|
+
* and normalization.
|
135
|
+
*
|
136
|
+
* Args: params: The parameters for creating embeddings.
|
137
|
+
*
|
138
|
+
* Returns: EmbeddingCreateResponse: The response containing the embeddings.
|
139
|
+
*
|
140
|
+
* @example
|
141
|
+
* ```ts
|
142
|
+
* const embeddingCreateResponse = await client.embed({
|
143
|
+
* model: 'mixedbread-ai/mxbai-embed-large-v1',
|
144
|
+
* input: 'x',
|
145
|
+
* });
|
146
|
+
* ```
|
147
|
+
*/
|
148
|
+
embed(body: TopLevelAPI.EmbedParams, options?: RequestOptions): APIPromise<TopLevelAPI.EmbeddingCreateResponse>;
|
149
|
+
/**
|
150
|
+
* Returns service information, including name and version.
|
151
|
+
*
|
152
|
+
* Returns: InfoResponse: A response containing the service name and version.
|
153
|
+
*
|
154
|
+
* @example
|
155
|
+
* ```ts
|
156
|
+
* const response = await client.info();
|
157
|
+
* ```
|
158
|
+
*/
|
159
|
+
info(options?: RequestOptions): APIPromise<TopLevelAPI.InfoResponse>;
|
160
|
+
/**
|
161
|
+
* Rerank different kind of documents for a given query.
|
162
|
+
*
|
163
|
+
* Args: params: RerankParams: The parameters for reranking.
|
164
|
+
*
|
165
|
+
* Returns: RerankResponse: The reranked documents for the input query.
|
166
|
+
*
|
167
|
+
* @example
|
168
|
+
* ```ts
|
169
|
+
* const response = await client.rerank({
|
170
|
+
* query:
|
171
|
+
* 'What are the key features of the Mixedbread embedding model?',
|
172
|
+
* input: ['Document 1', 'Document 2'],
|
173
|
+
* });
|
174
|
+
* ```
|
175
|
+
*/
|
176
|
+
rerank(body: TopLevelAPI.RerankParams, options?: RequestOptions): APIPromise<TopLevelAPI.RerankResponse>;
|
177
|
+
protected defaultQuery(): Record<string, string | undefined> | undefined;
|
178
|
+
protected validateHeaders({ values, nulls }: NullableHeaders): void;
|
179
|
+
protected authHeaders(opts: FinalRequestOptions): NullableHeaders | undefined;
|
180
|
+
/**
|
181
|
+
* Basic re-implementation of `qs.stringify` for primitive types.
|
182
|
+
*/
|
183
|
+
protected stringifyQuery(query: Record<string, unknown>): string;
|
184
|
+
private getUserAgent;
|
185
|
+
protected defaultIdempotencyKey(): string;
|
186
|
+
protected makeStatusError(status: number, error: Object, message: string | undefined, headers: Headers): Errors.APIError;
|
187
|
+
buildURL(path: string, query: Record<string, unknown> | null | undefined): string;
|
188
|
+
/**
|
189
|
+
* Used as a callback for mutating the given `FinalRequestOptions` object.
|
190
|
+
*/
|
191
|
+
protected prepareOptions(options: FinalRequestOptions): Promise<void>;
|
192
|
+
/**
|
193
|
+
* Used as a callback for mutating the given `RequestInit` object.
|
194
|
+
*
|
195
|
+
* This is useful for cases where you want to add certain headers based off of
|
196
|
+
* the request properties, e.g. `method` or `url`.
|
197
|
+
*/
|
198
|
+
protected prepareRequest(request: RequestInit, { url, options }: {
|
199
|
+
url: string;
|
200
|
+
options: FinalRequestOptions;
|
201
|
+
}): Promise<void>;
|
202
|
+
get<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp>;
|
203
|
+
post<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp>;
|
204
|
+
patch<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp>;
|
205
|
+
put<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp>;
|
206
|
+
delete<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp>;
|
207
|
+
private methodRequest;
|
208
|
+
request<Rsp>(options: PromiseOrValue<FinalRequestOptions>, remainingRetries?: number | null): APIPromise<Rsp>;
|
209
|
+
private makeRequest;
|
210
|
+
getAPIList<Item, PageClass extends Pagination.AbstractPage<Item> = Pagination.AbstractPage<Item>>(path: string, Page: new (...args: any[]) => PageClass, opts?: RequestOptions): Pagination.PagePromise<PageClass, Item>;
|
211
|
+
requestAPIList<Item = unknown, PageClass extends Pagination.AbstractPage<Item> = Pagination.AbstractPage<Item>>(Page: new (...args: ConstructorParameters<typeof Pagination.AbstractPage>) => PageClass, options: FinalRequestOptions): Pagination.PagePromise<PageClass, Item>;
|
212
|
+
fetchWithTimeout(url: RequestInfo, init: RequestInit | undefined, ms: number, controller: AbortController): Promise<Response>;
|
213
|
+
private shouldRetry;
|
214
|
+
private retryRequest;
|
215
|
+
private calculateDefaultRetryTimeoutMillis;
|
216
|
+
buildRequest(inputOptions: FinalRequestOptions, { retryCount }?: {
|
217
|
+
retryCount?: number;
|
218
|
+
}): {
|
219
|
+
req: FinalizedRequestInit;
|
220
|
+
url: string;
|
221
|
+
timeout: number;
|
222
|
+
};
|
223
|
+
private buildHeaders;
|
224
|
+
private buildBody;
|
225
|
+
static Mixedbread: typeof Mixedbread;
|
226
|
+
static DEFAULT_TIMEOUT: number;
|
227
|
+
static MixedbreadError: typeof Errors.MixedbreadError;
|
228
|
+
static APIError: typeof Errors.APIError;
|
229
|
+
static APIConnectionError: typeof Errors.APIConnectionError;
|
230
|
+
static APIConnectionTimeoutError: typeof Errors.APIConnectionTimeoutError;
|
231
|
+
static APIUserAbortError: typeof Errors.APIUserAbortError;
|
232
|
+
static NotFoundError: typeof Errors.NotFoundError;
|
233
|
+
static ConflictError: typeof Errors.ConflictError;
|
234
|
+
static RateLimitError: typeof Errors.RateLimitError;
|
235
|
+
static BadRequestError: typeof Errors.BadRequestError;
|
236
|
+
static AuthenticationError: typeof Errors.AuthenticationError;
|
237
|
+
static InternalServerError: typeof Errors.InternalServerError;
|
238
|
+
static PermissionDeniedError: typeof Errors.PermissionDeniedError;
|
239
|
+
static UnprocessableEntityError: typeof Errors.UnprocessableEntityError;
|
240
|
+
static toFile: typeof Uploads.toFile;
|
241
|
+
vectorStores: API.VectorStores;
|
242
|
+
parsing: API.Parsing;
|
243
|
+
files: API.Files;
|
244
|
+
extractions: API.Extractions;
|
245
|
+
embeddings: API.Embeddings;
|
246
|
+
}
|
247
|
+
export declare namespace Mixedbread {
|
248
|
+
export type RequestOptions = Opts.RequestOptions;
|
249
|
+
export import LimitOffset = Pagination.LimitOffset;
|
250
|
+
export { type LimitOffsetParams as LimitOffsetParams, type LimitOffsetResponse as LimitOffsetResponse };
|
251
|
+
export { type Embedding as Embedding, type EmbeddingCreateResponse as EmbeddingCreateResponse, type MultiEncodingEmbedding as MultiEncodingEmbedding, type InfoResponse as InfoResponse, type RerankResponse as RerankResponse, type EmbedParams as EmbedParams, type RerankParams as RerankParams, };
|
252
|
+
export { VectorStores as VectorStores, type ExpiresAfter as ExpiresAfter, type FileCounts as FileCounts, type ScoredVectorStoreChunk as ScoredVectorStoreChunk, type VectorStore as VectorStore, type VectorStoreChunkSearchOptions as VectorStoreChunkSearchOptions, type VectorStoreFileSearchOptions as VectorStoreFileSearchOptions, type VectorStoreDeleteResponse as VectorStoreDeleteResponse, type VectorStoreQuestionAnsweringResponse as VectorStoreQuestionAnsweringResponse, type VectorStoreSearchResponse as VectorStoreSearchResponse, type VectorStoresLimitOffset as VectorStoresLimitOffset, type VectorStoreCreateParams as VectorStoreCreateParams, type VectorStoreUpdateParams as VectorStoreUpdateParams, type VectorStoreListParams as VectorStoreListParams, type VectorStoreQuestionAnsweringParams as VectorStoreQuestionAnsweringParams, type VectorStoreSearchParams as VectorStoreSearchParams, };
|
253
|
+
export { Parsing as Parsing };
|
254
|
+
export { Files as Files, type FileObject as FileObject, type FileDeleteResponse as FileDeleteResponse, type FileObjectsLimitOffset as FileObjectsLimitOffset, type FileCreateParams as FileCreateParams, type FileUpdateParams as FileUpdateParams, type FileListParams as FileListParams, };
|
255
|
+
export { Extractions as Extractions };
|
256
|
+
export { Embeddings as Embeddings, type EmbeddingCreateParams as EmbeddingCreateParams };
|
257
|
+
export type SearchFilter = API.SearchFilter;
|
258
|
+
export type SearchFilterCondition = API.SearchFilterCondition;
|
259
|
+
export type Usage = API.Usage;
|
260
|
+
}
|
261
|
+
//# sourceMappingURL=client.d.ts.map
|
package/client.d.ts.map
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["src/client.ts"],"names":[],"mappings":"OAEO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAY;OAC3C,KAAK,EAAc,cAAc,EAAE,iBAAiB,EAAE,oBAAoB,EAAE;OAI5E,EAAE,KAAK,MAAM,EAAE,KAAK,QAA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