@tambo-ai/typescript-sdk 0.70.0 → 0.71.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 +17 -0
- package/README.md +117 -48
- 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 +53 -0
- package/bin/migration-config.json +213 -0
- package/client.d.mts +213 -0
- package/client.d.mts.map +1 -0
- package/client.d.ts +213 -0
- package/client.d.ts.map +1 -0
- package/client.js +504 -0
- package/client.js.map +1 -0
- package/client.mjs +500 -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 +56 -0
- package/core/pagination.d.mts.map +1 -0
- package/core/pagination.d.ts +56 -0
- package/core/pagination.d.ts.map +1 -0
- package/core/pagination.js +111 -0
- package/core/pagination.js.map +1 -0
- package/core/pagination.mjs +105 -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 +8 -146
- package/index.d.mts.map +1 -0
- package/index.d.ts +6 -144
- package/index.d.ts.map +1 -1
- package/index.js +21 -155
- package/index.js.map +1 -1
- package/index.mjs +6 -121
- 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 +75 -0
- package/internal/request-options.d.mts.map +1 -0
- package/internal/request-options.d.ts +75 -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 +17 -0
- package/internal/shim-types.d.mts.map +1 -0
- package/internal/shim-types.d.ts +17 -0
- package/internal/shim-types.d.ts.map +1 -0
- package/internal/shim-types.js +4 -0
- package/internal/shim-types.js.map +1 -0
- package/internal/shim-types.mjs +3 -0
- package/internal/shim-types.mjs.map +1 -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 +69 -0
- package/internal/types.d.mts.map +1 -0
- package/internal/types.d.ts +69 -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 +86 -0
- package/internal/utils/log.js.map +1 -0
- package/internal/utils/log.mjs +80 -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 +79 -0
- package/internal/utils/path.js.map +1 -0
- package/internal/utils/path.mjs +74 -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 +18 -0
- package/internal/utils/values.d.mts.map +1 -0
- package/internal/utils/values.d.ts +18 -0
- package/internal/utils/values.d.ts.map +1 -0
- package/internal/utils/values.js +112 -0
- package/internal/utils/values.js.map +1 -0
- package/internal/utils/values.mjs +94 -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/advance-stream.d.mts +5 -0
- package/lib/advance-stream.d.mts.map +1 -0
- package/lib/advance-stream.d.ts +3 -3
- package/lib/advance-stream.d.ts.map +1 -1
- package/lib/advance-stream.js +1 -2
- package/lib/advance-stream.js.map +1 -1
- package/lib/advance-stream.mjs.map +1 -1
- package/package.json +123 -62
- package/pagination.d.mts +2 -0
- package/pagination.d.mts.map +1 -0
- package/pagination.d.ts +1 -19
- package/pagination.d.ts.map +1 -1
- package/pagination.js +3 -43
- package/pagination.js.map +1 -1
- package/pagination.mjs +1 -41
- 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/beta/auth.d.mts +103 -0
- package/resources/beta/auth.d.mts.map +1 -0
- package/resources/beta/auth.d.ts +5 -4
- package/resources/beta/auth.d.ts.map +1 -1
- package/resources/beta/auth.js +3 -2
- package/resources/beta/auth.js.map +1 -1
- package/resources/beta/auth.mjs +3 -2
- package/resources/beta/auth.mjs.map +1 -1
- package/resources/beta/beta.d.mts +22 -0
- package/resources/beta/beta.d.mts.map +1 -0
- package/resources/beta/beta.d.ts +2 -2
- package/resources/beta/beta.d.ts.map +1 -1
- package/resources/beta/beta.js +6 -29
- package/resources/beta/beta.js.map +1 -1
- package/resources/beta/beta.mjs +2 -3
- package/resources/beta/beta.mjs.map +1 -1
- package/resources/beta/index.d.mts +6 -0
- package/resources/beta/index.d.mts.map +1 -0
- package/resources/beta/index.d.ts +1 -1
- package/resources/beta/index.d.ts.map +1 -1
- package/resources/beta/index.js +1 -2
- package/resources/beta/index.js.map +1 -1
- package/resources/beta/index.mjs +1 -1
- package/resources/beta/index.mjs.map +1 -1
- package/resources/beta/projects/api-key.d.mts +43 -0
- package/resources/beta/projects/api-key.d.mts.map +1 -0
- package/resources/beta/projects/api-key.d.ts +10 -6
- package/resources/beta/projects/api-key.d.ts.map +1 -1
- package/resources/beta/projects/api-key.js +7 -5
- package/resources/beta/projects/api-key.js.map +1 -1
- package/resources/beta/projects/api-key.mjs +7 -5
- package/resources/beta/projects/api-key.mjs.map +1 -1
- package/resources/beta/projects/index.d.mts +4 -0
- package/resources/beta/projects/index.d.mts.map +1 -0
- package/resources/beta/projects/index.d.ts +2 -2
- package/resources/beta/projects/index.d.ts.map +1 -1
- package/resources/beta/projects/index.js.map +1 -1
- package/resources/beta/projects/index.mjs +2 -2
- package/resources/beta/projects/index.mjs.map +1 -1
- package/resources/beta/projects/projects.d.mts +71 -0
- package/resources/beta/projects/projects.d.mts.map +1 -0
- package/resources/beta/projects/projects.d.ts +10 -9
- package/resources/beta/projects/projects.d.ts.map +1 -1
- package/resources/beta/projects/projects.js +7 -28
- package/resources/beta/projects/projects.js.map +1 -1
- package/resources/beta/projects/projects.mjs +5 -4
- package/resources/beta/projects/projects.mjs.map +1 -1
- package/resources/beta/projects/provider-key.d.mts +44 -0
- package/resources/beta/projects/provider-key.d.mts.map +1 -0
- package/resources/beta/projects/provider-key.d.ts +10 -6
- package/resources/beta/projects/provider-key.d.ts.map +1 -1
- package/resources/beta/projects/provider-key.js +7 -5
- package/resources/beta/projects/provider-key.js.map +1 -1
- package/resources/beta/projects/provider-key.mjs +7 -5
- package/resources/beta/projects/provider-key.mjs.map +1 -1
- package/resources/beta/projects.d.mts +2 -0
- package/resources/beta/projects.d.mts.map +1 -0
- package/resources/beta/projects.d.ts.map +1 -1
- package/resources/beta/projects.js +2 -15
- package/resources/beta/projects.js.map +1 -1
- package/resources/beta/registry.d.mts +19 -0
- package/resources/beta/registry.d.mts.map +1 -0
- package/resources/beta/registry.d.ts +4 -3
- package/resources/beta/registry.d.ts.map +1 -1
- package/resources/beta/registry.js +3 -2
- package/resources/beta/registry.js.map +1 -1
- package/resources/beta/registry.mjs +3 -2
- package/resources/beta/registry.mjs.map +1 -1
- package/resources/beta/threads/index.d.mts +4 -0
- package/resources/beta/threads/index.d.mts.map +1 -0
- package/resources/beta/threads/index.d.ts +3 -3
- package/resources/beta/threads/index.d.ts.map +1 -1
- package/resources/beta/threads/index.js +1 -2
- package/resources/beta/threads/index.js.map +1 -1
- package/resources/beta/threads/index.mjs +1 -1
- package/resources/beta/threads/index.mjs.map +1 -1
- package/resources/beta/threads/messages.d.mts +108 -0
- package/resources/beta/threads/messages.d.mts.map +1 -0
- package/resources/beta/threads/messages.d.ts +22 -14
- package/resources/beta/threads/messages.d.ts.map +1 -1
- package/resources/beta/threads/messages.js +23 -18
- package/resources/beta/threads/messages.js.map +1 -1
- package/resources/beta/threads/messages.mjs +23 -18
- package/resources/beta/threads/messages.mjs.map +1 -1
- package/resources/beta/threads/suggestions.d.mts +92 -0
- package/resources/beta/threads/suggestions.d.mts.map +1 -0
- package/resources/beta/threads/suggestions.d.ts +20 -9
- package/resources/beta/threads/suggestions.d.ts.map +1 -1
- package/resources/beta/threads/suggestions.js +10 -7
- package/resources/beta/threads/suggestions.js.map +1 -1
- package/resources/beta/threads/suggestions.mjs +10 -7
- package/resources/beta/threads/suggestions.mjs.map +1 -1
- package/resources/beta/threads/threads.d.mts +383 -0
- package/resources/beta/threads/threads.d.mts.map +1 -0
- package/resources/beta/threads/threads.d.ts +20 -23
- package/resources/beta/threads/threads.d.ts.map +1 -1
- package/resources/beta/threads/threads.js +48 -54
- package/resources/beta/threads/threads.js.map +1 -1
- package/resources/beta/threads/threads.mjs +44 -27
- package/resources/beta/threads/threads.mjs.map +1 -1
- package/resources/beta/threads.d.mts +2 -0
- package/resources/beta/threads.d.mts.map +1 -0
- package/resources/beta/threads.d.ts.map +1 -1
- package/resources/beta/threads.js +2 -15
- package/resources/beta/threads.js.map +1 -1
- package/resources/beta.d.mts +2 -0
- package/resources/beta.d.mts.map +1 -0
- package/resources/beta.d.ts.map +1 -1
- package/resources/beta.js +2 -15
- package/resources/beta.js.map +1 -1
- package/resources/index.d.mts +3 -0
- package/resources/index.d.mts.map +1 -0
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +2 -15
- package/resources/index.js.map +1 -1
- package/resources/shared.d.mts +46 -0
- package/resources/shared.d.mts.map +1 -0
- 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 +818 -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 +174 -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 +12 -263
- 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 +91 -0
- package/src/internal/shim-types.ts +26 -0
- package/src/internal/shims.ts +107 -0
- package/src/internal/to-file.ts +154 -0
- package/src/internal/types.ts +95 -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 +127 -0
- package/src/internal/utils/path.ts +88 -0
- package/src/internal/utils/sleep.ts +3 -0
- package/src/internal/utils/uuid.ts +17 -0
- package/src/internal/utils/values.ts +105 -0
- package/src/internal/utils.ts +8 -0
- package/src/lib/advance-stream.ts +5 -6
- package/src/pagination.ts +2 -73
- package/src/resource.ts +2 -11
- package/src/resources/beta/auth.ts +7 -8
- package/src/resources/beta/beta.ts +2 -3
- package/src/resources/beta/index.ts +1 -1
- package/src/resources/beta/projects/api-key.ts +23 -8
- package/src/resources/beta/projects/index.ts +12 -2
- package/src/resources/beta/projects/projects.ts +18 -9
- package/src/resources/beta/projects/provider-key.ts +18 -10
- package/src/resources/beta/registry.ts +6 -4
- package/src/resources/beta/threads/index.ts +3 -1
- package/src/resources/beta/threads/messages.ts +38 -33
- package/src/resources/beta/threads/suggestions.ts +33 -17
- package/src/resources/beta/threads/threads.ts +40 -62
- package/src/tsconfig.json +2 -1
- 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 -255
- package/core.d.ts.map +0 -1
- package/core.js +0 -924
- package/core.js.map +0 -1
- package/core.mjs +0 -892
- 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 -1236
- package/src/shims/node.ts +0 -50
- package/src/shims/web.ts +0 -50
package/src/pagination.ts
CHANGED
|
@@ -1,73 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { AbstractPage, Response, APIClient, FinalRequestOptions, PageInfo } from './core';
|
|
4
|
-
|
|
5
|
-
export interface OffsetAndLimitResponse<Item> {
|
|
6
|
-
items: Array<Item>;
|
|
7
|
-
|
|
8
|
-
total: number;
|
|
9
|
-
|
|
10
|
-
count: number;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export interface OffsetAndLimitParams {
|
|
14
|
-
offset?: number;
|
|
15
|
-
|
|
16
|
-
limit?: number;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export class OffsetAndLimit<Item> extends AbstractPage<Item> implements OffsetAndLimitResponse<Item> {
|
|
20
|
-
items: Array<Item>;
|
|
21
|
-
|
|
22
|
-
total: number;
|
|
23
|
-
|
|
24
|
-
count: number;
|
|
25
|
-
|
|
26
|
-
constructor(
|
|
27
|
-
client: APIClient,
|
|
28
|
-
response: Response,
|
|
29
|
-
body: OffsetAndLimitResponse<Item>,
|
|
30
|
-
options: FinalRequestOptions,
|
|
31
|
-
) {
|
|
32
|
-
super(client, response, body, options);
|
|
33
|
-
|
|
34
|
-
this.items = body.items || [];
|
|
35
|
-
this.total = body.total || 0;
|
|
36
|
-
this.count = body.count || 0;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
getPaginatedItems(): Item[] {
|
|
40
|
-
return this.items ?? [];
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// @deprecated Please use `nextPageInfo()` instead
|
|
44
|
-
nextPageParams(): Partial<OffsetAndLimitParams> | null {
|
|
45
|
-
const info = this.nextPageInfo();
|
|
46
|
-
if (!info) return null;
|
|
47
|
-
if ('params' in info) return info.params;
|
|
48
|
-
const params = Object.fromEntries(info.url.searchParams);
|
|
49
|
-
if (!Object.keys(params).length) return null;
|
|
50
|
-
return params;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
nextPageInfo(): PageInfo | null {
|
|
54
|
-
const offset = (this.options.query as OffsetAndLimitParams).offset ?? 0;
|
|
55
|
-
if (!offset) {
|
|
56
|
-
return null;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
const length = this.getPaginatedItems().length;
|
|
60
|
-
const currentCount = offset + length;
|
|
61
|
-
|
|
62
|
-
const totalCount = this.total;
|
|
63
|
-
if (!totalCount) {
|
|
64
|
-
return null;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
if (currentCount < totalCount) {
|
|
68
|
-
return { params: { offset: currentCount } };
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
return null;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
1
|
+
/** @deprecated Import from ./core/pagination instead */
|
|
2
|
+
export * from './core/pagination';
|
package/src/resource.ts
CHANGED
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import type { TamboAI } from './index';
|
|
4
|
-
|
|
5
|
-
export abstract class APIResource {
|
|
6
|
-
protected _client: TamboAI;
|
|
7
|
-
|
|
8
|
-
constructor(client: TamboAI) {
|
|
9
|
-
this._client = client;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
1
|
+
/** @deprecated Import from ./core/resource instead */
|
|
2
|
+
export * from './core/resource';
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { APIResource } from '../../resource';
|
|
4
|
-
import
|
|
3
|
+
import { APIResource } from '../../core/resource';
|
|
4
|
+
import { APIPromise } from '../../core/api-promise';
|
|
5
|
+
import { buildHeaders } from '../../internal/headers';
|
|
6
|
+
import { RequestOptions } from '../../internal/request-options';
|
|
5
7
|
|
|
6
8
|
export class Auth extends APIResource {
|
|
7
9
|
/**
|
|
@@ -15,10 +17,7 @@ export class Auth extends APIResource {
|
|
|
15
17
|
* });
|
|
16
18
|
* ```
|
|
17
19
|
*/
|
|
18
|
-
getMcpToken(
|
|
19
|
-
body: AuthGetMcpTokenParams,
|
|
20
|
-
options?: Core.RequestOptions,
|
|
21
|
-
): Core.APIPromise<AuthGetMcpTokenResponse> {
|
|
20
|
+
getMcpToken(body: AuthGetMcpTokenParams, options?: RequestOptions): APIPromise<AuthGetMcpTokenResponse> {
|
|
22
21
|
return this._client.post('/auth/mcp-access-token', { body, ...options });
|
|
23
22
|
}
|
|
24
23
|
|
|
@@ -39,11 +38,11 @@ export class Auth extends APIResource {
|
|
|
39
38
|
* });
|
|
40
39
|
* ```
|
|
41
40
|
*/
|
|
42
|
-
getToken(body: AuthGetTokenParams, options?:
|
|
41
|
+
getToken(body: AuthGetTokenParams, options?: RequestOptions): APIPromise<AuthGetTokenResponse> {
|
|
43
42
|
return this._client.post('/oauth/token', {
|
|
44
43
|
body,
|
|
45
44
|
...options,
|
|
46
|
-
headers: { 'Content-Type': 'application/x-www-form-urlencoded',
|
|
45
|
+
headers: buildHeaders([{ 'Content-Type': 'application/x-www-form-urlencoded' }, options?.headers]),
|
|
47
46
|
});
|
|
48
47
|
}
|
|
49
48
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { APIResource } from '../../resource';
|
|
3
|
+
import { APIResource } from '../../core/resource';
|
|
4
4
|
import * as AuthAPI from './auth';
|
|
5
5
|
import {
|
|
6
6
|
Auth,
|
|
@@ -48,7 +48,6 @@ export class Beta extends APIResource {
|
|
|
48
48
|
Beta.Registry = Registry;
|
|
49
49
|
Beta.Projects = Projects;
|
|
50
50
|
Beta.Threads = Threads;
|
|
51
|
-
Beta.ThreadsOffsetAndLimit = ThreadsOffsetAndLimit;
|
|
52
51
|
Beta.Auth = Auth;
|
|
53
52
|
|
|
54
53
|
export declare namespace Beta {
|
|
@@ -70,7 +69,7 @@ export declare namespace Beta {
|
|
|
70
69
|
type ThreadRetrieveResponse as ThreadRetrieveResponse,
|
|
71
70
|
type ThreadAdvanceResponse as ThreadAdvanceResponse,
|
|
72
71
|
type ThreadAdvanceByIDResponse as ThreadAdvanceByIDResponse,
|
|
73
|
-
ThreadsOffsetAndLimit as ThreadsOffsetAndLimit,
|
|
72
|
+
type ThreadsOffsetAndLimit as ThreadsOffsetAndLimit,
|
|
74
73
|
type ThreadCreateParams as ThreadCreateParams,
|
|
75
74
|
type ThreadRetrieveParams as ThreadRetrieveParams,
|
|
76
75
|
type ThreadUpdateParams as ThreadUpdateParams,
|
|
@@ -16,7 +16,6 @@ export {
|
|
|
16
16
|
} from './projects/index';
|
|
17
17
|
export { Registry, type RegistryRetrieveResponse } from './registry';
|
|
18
18
|
export {
|
|
19
|
-
ThreadsOffsetAndLimit,
|
|
20
19
|
Threads,
|
|
21
20
|
type ChatCompletionContentPart,
|
|
22
21
|
type ComponentDecisionV2,
|
|
@@ -32,4 +31,5 @@ export {
|
|
|
32
31
|
type ThreadAdvanceParams,
|
|
33
32
|
type ThreadAdvanceByIDParams,
|
|
34
33
|
type ThreadGenerateNameParams,
|
|
34
|
+
type ThreadsOffsetAndLimit,
|
|
35
35
|
} from './threads/index';
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { APIResource } from '../../../resource';
|
|
4
|
-
import
|
|
3
|
+
import { APIResource } from '../../../core/resource';
|
|
4
|
+
import { APIPromise } from '../../../core/api-promise';
|
|
5
|
+
import { RequestOptions } from '../../../internal/request-options';
|
|
6
|
+
import { path } from '../../../internal/utils/path';
|
|
5
7
|
|
|
6
8
|
export class APIKey extends APIResource {
|
|
7
9
|
/**
|
|
@@ -12,21 +14,26 @@ export class APIKey extends APIResource {
|
|
|
12
14
|
* );
|
|
13
15
|
* ```
|
|
14
16
|
*/
|
|
15
|
-
list(id: string, options?:
|
|
16
|
-
return this._client.get(`/projects/${id}/api-keys`, options);
|
|
17
|
+
list(id: string, options?: RequestOptions): APIPromise<APIKeyListResponse> {
|
|
18
|
+
return this._client.get(path`/projects/${id}/api-keys`, options);
|
|
17
19
|
}
|
|
18
20
|
|
|
19
21
|
/**
|
|
20
22
|
* @example
|
|
21
23
|
* ```ts
|
|
22
24
|
* const apiKey = await client.beta.projects.apiKey.delete(
|
|
23
|
-
* 'id',
|
|
24
25
|
* 'apiKeyId',
|
|
26
|
+
* { id: 'id' },
|
|
25
27
|
* );
|
|
26
28
|
* ```
|
|
27
29
|
*/
|
|
28
|
-
delete(
|
|
29
|
-
|
|
30
|
+
delete(
|
|
31
|
+
apiKeyID: string,
|
|
32
|
+
params: APIKeyDeleteParams,
|
|
33
|
+
options?: RequestOptions,
|
|
34
|
+
): APIPromise<APIKeyDeleteResponse> {
|
|
35
|
+
const { id } = params;
|
|
36
|
+
return this._client.delete(path`/projects/${id}/api-key/${apiKeyID}`, options);
|
|
30
37
|
}
|
|
31
38
|
}
|
|
32
39
|
|
|
@@ -50,6 +57,14 @@ export namespace APIKeyListResponse {
|
|
|
50
57
|
|
|
51
58
|
export type APIKeyDeleteResponse = boolean;
|
|
52
59
|
|
|
60
|
+
export interface APIKeyDeleteParams {
|
|
61
|
+
id: string;
|
|
62
|
+
}
|
|
63
|
+
|
|
53
64
|
export declare namespace APIKey {
|
|
54
|
-
export {
|
|
65
|
+
export {
|
|
66
|
+
type APIKeyListResponse as APIKeyListResponse,
|
|
67
|
+
type APIKeyDeleteResponse as APIKeyDeleteResponse,
|
|
68
|
+
type APIKeyDeleteParams as APIKeyDeleteParams,
|
|
69
|
+
};
|
|
55
70
|
}
|
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
export {
|
|
3
|
+
export {
|
|
4
|
+
APIKey,
|
|
5
|
+
type APIKeyListResponse,
|
|
6
|
+
type APIKeyDeleteResponse,
|
|
7
|
+
type APIKeyDeleteParams,
|
|
8
|
+
} from './api-key';
|
|
4
9
|
export {
|
|
5
10
|
Projects,
|
|
6
11
|
type ProjectRetrieveResponse,
|
|
7
12
|
type ProjectDeleteResponse,
|
|
8
13
|
type ProjectGetCurrentResponse,
|
|
9
14
|
} from './projects';
|
|
10
|
-
export {
|
|
15
|
+
export {
|
|
16
|
+
ProviderKey,
|
|
17
|
+
type ProviderKeyListResponse,
|
|
18
|
+
type ProviderKeyDeleteResponse,
|
|
19
|
+
type ProviderKeyDeleteParams,
|
|
20
|
+
} from './provider-key';
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { APIResource } from '../../../resource';
|
|
4
|
-
import * as Core from '../../../core';
|
|
3
|
+
import { APIResource } from '../../../core/resource';
|
|
5
4
|
import * as APIKeyAPI from './api-key';
|
|
6
|
-
import { APIKey, APIKeyDeleteResponse, APIKeyListResponse } from './api-key';
|
|
5
|
+
import { APIKey, APIKeyDeleteParams, APIKeyDeleteResponse, APIKeyListResponse } from './api-key';
|
|
7
6
|
import * as ProviderKeyAPI from './provider-key';
|
|
8
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
ProviderKey,
|
|
9
|
+
ProviderKeyDeleteParams,
|
|
10
|
+
ProviderKeyDeleteResponse,
|
|
11
|
+
ProviderKeyListResponse,
|
|
12
|
+
} from './provider-key';
|
|
13
|
+
import { APIPromise } from '../../../core/api-promise';
|
|
14
|
+
import { RequestOptions } from '../../../internal/request-options';
|
|
15
|
+
import { path } from '../../../internal/utils/path';
|
|
9
16
|
|
|
10
17
|
export class Projects extends APIResource {
|
|
11
18
|
apiKey: APIKeyAPI.APIKey = new APIKeyAPI.APIKey(this._client);
|
|
@@ -17,8 +24,8 @@ export class Projects extends APIResource {
|
|
|
17
24
|
* const project = await client.beta.projects.retrieve('id');
|
|
18
25
|
* ```
|
|
19
26
|
*/
|
|
20
|
-
retrieve(id: string, options?:
|
|
21
|
-
return this._client.get(`/projects/${id}`, options);
|
|
27
|
+
retrieve(id: string, options?: RequestOptions): APIPromise<ProjectRetrieveResponse> {
|
|
28
|
+
return this._client.get(path`/projects/${id}`, options);
|
|
22
29
|
}
|
|
23
30
|
|
|
24
31
|
/**
|
|
@@ -27,8 +34,8 @@ export class Projects extends APIResource {
|
|
|
27
34
|
* const project = await client.beta.projects.delete('id');
|
|
28
35
|
* ```
|
|
29
36
|
*/
|
|
30
|
-
delete(id: string, options?:
|
|
31
|
-
return this._client.delete(`/projects/${id}`, options);
|
|
37
|
+
delete(id: string, options?: RequestOptions): APIPromise<ProjectDeleteResponse> {
|
|
38
|
+
return this._client.delete(path`/projects/${id}`, options);
|
|
32
39
|
}
|
|
33
40
|
|
|
34
41
|
/**
|
|
@@ -37,7 +44,7 @@ export class Projects extends APIResource {
|
|
|
37
44
|
* const response = await client.beta.projects.getCurrent();
|
|
38
45
|
* ```
|
|
39
46
|
*/
|
|
40
|
-
getCurrent(options?:
|
|
47
|
+
getCurrent(options?: RequestOptions): APIPromise<ProjectGetCurrentResponse> {
|
|
41
48
|
return this._client.get('/projects', options);
|
|
42
49
|
}
|
|
43
50
|
}
|
|
@@ -118,11 +125,13 @@ export declare namespace Projects {
|
|
|
118
125
|
APIKey as APIKey,
|
|
119
126
|
type APIKeyListResponse as APIKeyListResponse,
|
|
120
127
|
type APIKeyDeleteResponse as APIKeyDeleteResponse,
|
|
128
|
+
type APIKeyDeleteParams as APIKeyDeleteParams,
|
|
121
129
|
};
|
|
122
130
|
|
|
123
131
|
export {
|
|
124
132
|
ProviderKey as ProviderKey,
|
|
125
133
|
type ProviderKeyListResponse as ProviderKeyListResponse,
|
|
126
134
|
type ProviderKeyDeleteResponse as ProviderKeyDeleteResponse,
|
|
135
|
+
type ProviderKeyDeleteParams as ProviderKeyDeleteParams,
|
|
127
136
|
};
|
|
128
137
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { APIResource } from '../../../resource';
|
|
4
|
-
import
|
|
3
|
+
import { APIResource } from '../../../core/resource';
|
|
4
|
+
import { APIPromise } from '../../../core/api-promise';
|
|
5
|
+
import { RequestOptions } from '../../../internal/request-options';
|
|
6
|
+
import { path } from '../../../internal/utils/path';
|
|
5
7
|
|
|
6
8
|
export class ProviderKey extends APIResource {
|
|
7
9
|
/**
|
|
@@ -11,8 +13,8 @@ export class ProviderKey extends APIResource {
|
|
|
11
13
|
* await client.beta.projects.providerKey.list('id');
|
|
12
14
|
* ```
|
|
13
15
|
*/
|
|
14
|
-
list(id: string, options?:
|
|
15
|
-
return this._client.get(`/projects/${id}/provider-keys`, options);
|
|
16
|
+
list(id: string, options?: RequestOptions): APIPromise<ProviderKeyListResponse> {
|
|
17
|
+
return this._client.get(path`/projects/${id}/provider-keys`, options);
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
/**
|
|
@@ -20,17 +22,18 @@ export class ProviderKey extends APIResource {
|
|
|
20
22
|
* ```ts
|
|
21
23
|
* const providerKey =
|
|
22
24
|
* await client.beta.projects.providerKey.delete(
|
|
23
|
-
* 'id',
|
|
24
25
|
* 'providerKeyId',
|
|
26
|
+
* { id: 'id' },
|
|
25
27
|
* );
|
|
26
28
|
* ```
|
|
27
29
|
*/
|
|
28
30
|
delete(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
options?:
|
|
32
|
-
):
|
|
33
|
-
|
|
31
|
+
providerKeyID: string,
|
|
32
|
+
params: ProviderKeyDeleteParams,
|
|
33
|
+
options?: RequestOptions,
|
|
34
|
+
): APIPromise<ProviderKeyDeleteResponse> {
|
|
35
|
+
const { id } = params;
|
|
36
|
+
return this._client.delete(path`/projects/${id}/provider-key/${providerKeyID}`, options);
|
|
34
37
|
}
|
|
35
38
|
}
|
|
36
39
|
|
|
@@ -54,9 +57,14 @@ export interface ProviderKeyDeleteResponse {
|
|
|
54
57
|
name: string;
|
|
55
58
|
}
|
|
56
59
|
|
|
60
|
+
export interface ProviderKeyDeleteParams {
|
|
61
|
+
id: string;
|
|
62
|
+
}
|
|
63
|
+
|
|
57
64
|
export declare namespace ProviderKey {
|
|
58
65
|
export {
|
|
59
66
|
type ProviderKeyListResponse as ProviderKeyListResponse,
|
|
60
67
|
type ProviderKeyDeleteResponse as ProviderKeyDeleteResponse,
|
|
68
|
+
type ProviderKeyDeleteParams as ProviderKeyDeleteParams,
|
|
61
69
|
};
|
|
62
70
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { APIResource } from '../../resource';
|
|
4
|
-
import
|
|
3
|
+
import { APIResource } from '../../core/resource';
|
|
4
|
+
import { APIPromise } from '../../core/api-promise';
|
|
5
|
+
import { RequestOptions } from '../../internal/request-options';
|
|
6
|
+
import { path } from '../../internal/utils/path';
|
|
5
7
|
|
|
6
8
|
export class Registry extends APIResource {
|
|
7
9
|
/**
|
|
@@ -12,8 +14,8 @@ export class Registry extends APIResource {
|
|
|
12
14
|
* );
|
|
13
15
|
* ```
|
|
14
16
|
*/
|
|
15
|
-
retrieve(componentname: string, options?:
|
|
16
|
-
return this._client.get(`/registry/${componentname}`, options);
|
|
17
|
+
retrieve(componentname: string, options?: RequestOptions): APIPromise<unknown> {
|
|
18
|
+
return this._client.get(path`/registry/${componentname}`, options);
|
|
17
19
|
}
|
|
18
20
|
}
|
|
19
21
|
|
|
@@ -6,6 +6,7 @@ export {
|
|
|
6
6
|
type MessageListResponse,
|
|
7
7
|
type MessageCreateParams,
|
|
8
8
|
type MessageListParams,
|
|
9
|
+
type MessageDeleteParams,
|
|
9
10
|
type MessageUpdateComponentStateParams,
|
|
10
11
|
} from './messages';
|
|
11
12
|
export {
|
|
@@ -14,10 +15,10 @@ export {
|
|
|
14
15
|
type SuggestionsGenerate,
|
|
15
16
|
type SuggestionListResponse,
|
|
16
17
|
type SuggestionGenerateResponse,
|
|
18
|
+
type SuggestionListParams,
|
|
17
19
|
type SuggestionGenerateParams,
|
|
18
20
|
} from './suggestions';
|
|
19
21
|
export {
|
|
20
|
-
ThreadsOffsetAndLimit,
|
|
21
22
|
Threads,
|
|
22
23
|
type ChatCompletionContentPart,
|
|
23
24
|
type ComponentDecisionV2,
|
|
@@ -33,4 +34,5 @@ export {
|
|
|
33
34
|
type ThreadAdvanceParams,
|
|
34
35
|
type ThreadAdvanceByIDParams,
|
|
35
36
|
type ThreadGenerateNameParams,
|
|
37
|
+
type ThreadsOffsetAndLimit,
|
|
36
38
|
} from './threads';
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { APIResource } from '../../../resource';
|
|
4
|
-
import { isRequestOptions } from '../../../core';
|
|
5
|
-
import * as Core from '../../../core';
|
|
3
|
+
import { APIResource } from '../../../core/resource';
|
|
6
4
|
import * as Shared from '../../shared';
|
|
7
5
|
import * as ThreadsAPI from './threads';
|
|
6
|
+
import { APIPromise } from '../../../core/api-promise';
|
|
7
|
+
import { buildHeaders } from '../../../internal/headers';
|
|
8
|
+
import { RequestOptions } from '../../../internal/request-options';
|
|
9
|
+
import { path } from '../../../internal/utils/path';
|
|
8
10
|
|
|
9
11
|
export class Messages extends APIResource {
|
|
10
12
|
/**
|
|
@@ -16,8 +18,8 @@ export class Messages extends APIResource {
|
|
|
16
18
|
* );
|
|
17
19
|
* ```
|
|
18
20
|
*/
|
|
19
|
-
create(id: string, body: MessageCreateParams, options?:
|
|
20
|
-
return this._client.post(`/threads/${id}/messages`, { body, ...options });
|
|
21
|
+
create(id: string, body: MessageCreateParams, options?: RequestOptions): APIPromise<unknown> {
|
|
22
|
+
return this._client.post(path`/threads/${id}/messages`, { body, ...options });
|
|
21
23
|
}
|
|
22
24
|
|
|
23
25
|
/**
|
|
@@ -29,34 +31,25 @@ export class Messages extends APIResource {
|
|
|
29
31
|
*/
|
|
30
32
|
list(
|
|
31
33
|
id: string,
|
|
32
|
-
query
|
|
33
|
-
options?:
|
|
34
|
-
):
|
|
35
|
-
|
|
36
|
-
list(
|
|
37
|
-
id: string,
|
|
38
|
-
query: MessageListParams | Core.RequestOptions = {},
|
|
39
|
-
options?: Core.RequestOptions,
|
|
40
|
-
): Core.APIPromise<MessageListResponse> {
|
|
41
|
-
if (isRequestOptions(query)) {
|
|
42
|
-
return this.list(id, {}, query);
|
|
43
|
-
}
|
|
44
|
-
return this._client.get(`/threads/${id}/messages`, { query, ...options });
|
|
34
|
+
query: MessageListParams | null | undefined = {},
|
|
35
|
+
options?: RequestOptions,
|
|
36
|
+
): APIPromise<MessageListResponse> {
|
|
37
|
+
return this._client.get(path`/threads/${id}/messages`, { query, ...options });
|
|
45
38
|
}
|
|
46
39
|
|
|
47
40
|
/**
|
|
48
41
|
* @example
|
|
49
42
|
* ```ts
|
|
50
|
-
* await client.beta.threads.messages.delete(
|
|
51
|
-
* 'id',
|
|
52
|
-
*
|
|
53
|
-
* );
|
|
43
|
+
* await client.beta.threads.messages.delete('messageId', {
|
|
44
|
+
* id: 'id',
|
|
45
|
+
* });
|
|
54
46
|
* ```
|
|
55
47
|
*/
|
|
56
|
-
delete(
|
|
57
|
-
|
|
48
|
+
delete(messageID: string, params: MessageDeleteParams, options?: RequestOptions): APIPromise<void> {
|
|
49
|
+
const { id } = params;
|
|
50
|
+
return this._client.delete(path`/threads/${id}/messages/${messageID}`, {
|
|
58
51
|
...options,
|
|
59
|
-
headers: { Accept: '*/*',
|
|
52
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
60
53
|
});
|
|
61
54
|
}
|
|
62
55
|
|
|
@@ -65,19 +58,18 @@ export class Messages extends APIResource {
|
|
|
65
58
|
* ```ts
|
|
66
59
|
* const threadMessage =
|
|
67
60
|
* await client.beta.threads.messages.updateComponentState(
|
|
68
|
-
* 'id',
|
|
69
61
|
* 'messageId',
|
|
70
|
-
* { state: { foo: 'bar' } },
|
|
62
|
+
* { id: 'id', state: { foo: 'bar' } },
|
|
71
63
|
* );
|
|
72
64
|
* ```
|
|
73
65
|
*/
|
|
74
66
|
updateComponentState(
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
return this._client.put(`/threads/${id}/messages/${
|
|
67
|
+
messageID: string,
|
|
68
|
+
params: MessageUpdateComponentStateParams,
|
|
69
|
+
options?: RequestOptions,
|
|
70
|
+
): APIPromise<ThreadsAPI.ThreadMessage> {
|
|
71
|
+
const { id, ...body } = params;
|
|
72
|
+
return this._client.put(path`/threads/${id}/messages/${messageID}/component-state`, { body, ...options });
|
|
81
73
|
}
|
|
82
74
|
}
|
|
83
75
|
|
|
@@ -134,7 +126,19 @@ export interface MessageListParams {
|
|
|
134
126
|
includeInternal?: boolean;
|
|
135
127
|
}
|
|
136
128
|
|
|
129
|
+
export interface MessageDeleteParams {
|
|
130
|
+
id: string;
|
|
131
|
+
}
|
|
132
|
+
|
|
137
133
|
export interface MessageUpdateComponentStateParams {
|
|
134
|
+
/**
|
|
135
|
+
* Path param:
|
|
136
|
+
*/
|
|
137
|
+
id: string;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Body param:
|
|
141
|
+
*/
|
|
138
142
|
state: { [key: string]: unknown };
|
|
139
143
|
}
|
|
140
144
|
|
|
@@ -144,6 +148,7 @@ export declare namespace Messages {
|
|
|
144
148
|
type MessageListResponse as MessageListResponse,
|
|
145
149
|
type MessageCreateParams as MessageCreateParams,
|
|
146
150
|
type MessageListParams as MessageListParams,
|
|
151
|
+
type MessageDeleteParams as MessageDeleteParams,
|
|
147
152
|
type MessageUpdateComponentStateParams as MessageUpdateComponentStateParams,
|
|
148
153
|
};
|
|
149
154
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { APIResource } from '../../../resource';
|
|
4
|
-
import * as Core from '../../../core';
|
|
3
|
+
import { APIResource } from '../../../core/resource';
|
|
5
4
|
import * as Shared from '../../shared';
|
|
5
|
+
import { APIPromise } from '../../../core/api-promise';
|
|
6
|
+
import { RequestOptions } from '../../../internal/request-options';
|
|
7
|
+
import { path } from '../../../internal/utils/path';
|
|
6
8
|
|
|
7
9
|
export class Suggestions extends APIResource {
|
|
8
10
|
/**
|
|
@@ -12,17 +14,18 @@ export class Suggestions extends APIResource {
|
|
|
12
14
|
* ```ts
|
|
13
15
|
* const suggestions =
|
|
14
16
|
* await client.beta.threads.suggestions.list(
|
|
15
|
-
* 'thread_123456789',
|
|
16
17
|
* 'msg_123456789',
|
|
18
|
+
* { id: 'thread_123456789' },
|
|
17
19
|
* );
|
|
18
20
|
* ```
|
|
19
21
|
*/
|
|
20
22
|
list(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
options?:
|
|
24
|
-
):
|
|
25
|
-
|
|
23
|
+
messageID: string,
|
|
24
|
+
params: SuggestionListParams,
|
|
25
|
+
options?: RequestOptions,
|
|
26
|
+
): APIPromise<SuggestionListResponse> {
|
|
27
|
+
const { id } = params;
|
|
28
|
+
return this._client.get(path`/threads/${id}/messages/${messageID}/suggestions`, options);
|
|
26
29
|
}
|
|
27
30
|
|
|
28
31
|
/**
|
|
@@ -32,18 +35,18 @@ export class Suggestions extends APIResource {
|
|
|
32
35
|
* ```ts
|
|
33
36
|
* const suggestions =
|
|
34
37
|
* await client.beta.threads.suggestions.generate(
|
|
35
|
-
* 'thread_123456789',
|
|
36
38
|
* 'msg_123456789',
|
|
39
|
+
* { id: 'thread_123456789' },
|
|
37
40
|
* );
|
|
38
41
|
* ```
|
|
39
42
|
*/
|
|
40
43
|
generate(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
return this._client.post(`/threads/${id}/messages/${
|
|
44
|
+
messageID: string,
|
|
45
|
+
params: SuggestionGenerateParams,
|
|
46
|
+
options?: RequestOptions,
|
|
47
|
+
): APIPromise<SuggestionGenerateResponse> {
|
|
48
|
+
const { id, ...body } = params;
|
|
49
|
+
return this._client.post(path`/threads/${id}/messages/${messageID}/suggestions`, { body, ...options });
|
|
47
50
|
}
|
|
48
51
|
}
|
|
49
52
|
|
|
@@ -90,14 +93,26 @@ export type SuggestionListResponse = Array<Suggestion>;
|
|
|
90
93
|
|
|
91
94
|
export type SuggestionGenerateResponse = Array<Suggestion>;
|
|
92
95
|
|
|
96
|
+
export interface SuggestionListParams {
|
|
97
|
+
/**
|
|
98
|
+
* ID of the thread to get suggestions for
|
|
99
|
+
*/
|
|
100
|
+
id: string;
|
|
101
|
+
}
|
|
102
|
+
|
|
93
103
|
export interface SuggestionGenerateParams {
|
|
94
104
|
/**
|
|
95
|
-
*
|
|
105
|
+
* Path param: ID of the thread to generate suggestions for
|
|
106
|
+
*/
|
|
107
|
+
id: string;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Body param: Available components that can be used with this suggestion
|
|
96
111
|
*/
|
|
97
112
|
availableComponents?: Array<Shared.AvailableComponent>;
|
|
98
113
|
|
|
99
114
|
/**
|
|
100
|
-
* Maximum number of suggestions to generate
|
|
115
|
+
* Body param: Maximum number of suggestions to generate
|
|
101
116
|
*/
|
|
102
117
|
maxSuggestions?: number;
|
|
103
118
|
}
|
|
@@ -108,6 +123,7 @@ export declare namespace Suggestions {
|
|
|
108
123
|
type SuggestionsGenerate as SuggestionsGenerate,
|
|
109
124
|
type SuggestionListResponse as SuggestionListResponse,
|
|
110
125
|
type SuggestionGenerateResponse as SuggestionGenerateResponse,
|
|
126
|
+
type SuggestionListParams as SuggestionListParams,
|
|
111
127
|
type SuggestionGenerateParams as SuggestionGenerateParams,
|
|
112
128
|
};
|
|
113
129
|
}
|