notdiamond 1.1.3 → 2.0.0-rc1
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 +54 -0
- package/LICENSE +201 -0
- package/README.md +449 -105
- 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/client.d.mts +206 -0
- package/client.d.mts.map +1 -0
- package/client.d.ts +206 -0
- package/client.d.ts.map +1 -0
- package/client.js +479 -0
- package/client.js.map +1 -0
- package/client.mjs +475 -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/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 +2 -0
- package/error.d.ts.map +1 -0
- package/error.js +6 -0
- package/error.js.map +1 -0
- package/error.mjs +2 -0
- package/error.mjs.map +1 -0
- package/index.d.mts +6 -0
- package/index.d.mts.map +1 -0
- package/index.d.ts +6 -0
- package/index.d.ts.map +1 -0
- package/index.js +30 -0
- package/index.js.map +1 -0
- package/index.mjs +7 -0
- package/index.mjs.map +1 -0
- 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/qs/formats.d.mts +7 -0
- package/internal/qs/formats.d.mts.map +1 -0
- package/internal/qs/formats.d.ts +7 -0
- package/internal/qs/formats.d.ts.map +1 -0
- package/internal/qs/formats.js +13 -0
- package/internal/qs/formats.js.map +1 -0
- package/internal/qs/formats.mjs +9 -0
- package/internal/qs/formats.mjs.map +1 -0
- package/internal/qs/index.d.mts +10 -0
- package/internal/qs/index.d.mts.map +1 -0
- package/internal/qs/index.d.ts +10 -0
- package/internal/qs/index.d.ts.map +1 -0
- package/internal/qs/index.js +14 -0
- package/internal/qs/index.js.map +1 -0
- package/internal/qs/index.mjs +10 -0
- package/internal/qs/index.mjs.map +1 -0
- package/internal/qs/stringify.d.mts +3 -0
- package/internal/qs/stringify.d.mts.map +1 -0
- package/internal/qs/stringify.d.ts +3 -0
- package/internal/qs/stringify.d.ts.map +1 -0
- package/internal/qs/stringify.js +277 -0
- package/internal/qs/stringify.js.map +1 -0
- package/internal/qs/stringify.mjs +274 -0
- package/internal/qs/stringify.mjs.map +1 -0
- package/internal/qs/types.d.mts +57 -0
- package/internal/qs/types.d.mts.map +1 -0
- package/internal/qs/types.d.ts +57 -0
- package/internal/qs/types.d.ts.map +1 -0
- package/internal/qs/types.js +3 -0
- package/internal/qs/types.js.map +1 -0
- package/internal/qs/types.mjs +2 -0
- package/internal/qs/types.mjs.map +1 -0
- package/internal/qs/utils.d.mts +15 -0
- package/internal/qs/utils.d.mts.map +1 -0
- package/internal/qs/utils.d.ts +15 -0
- package/internal/qs/utils.d.ts.map +1 -0
- package/internal/qs/utils.js +230 -0
- package/internal/qs/utils.js.map +1 -0
- package/internal/qs/utils.mjs +217 -0
- package/internal/qs/utils.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 +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 +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/package.json +131 -124
- package/resource.d.mts +2 -0
- package/resource.d.mts.map +1 -0
- package/resource.d.ts +2 -0
- package/resource.d.ts.map +1 -0
- package/resource.js +6 -0
- package/resource.js.map +1 -0
- package/resource.mjs +2 -0
- package/resource.mjs.map +1 -0
- package/resources/admin.d.mts +4 -0
- package/resources/admin.d.mts.map +1 -0
- package/resources/admin.d.ts +4 -0
- package/resources/admin.d.ts.map +1 -0
- package/resources/admin.js +9 -0
- package/resources/admin.js.map +1 -0
- package/resources/admin.mjs +5 -0
- package/resources/admin.mjs.map +1 -0
- package/resources/index.d.mts +7 -0
- package/resources/index.d.mts.map +1 -0
- package/resources/index.d.ts +7 -0
- package/resources/index.d.ts.map +1 -0
- package/resources/index.js +17 -0
- package/resources/index.js.map +1 -0
- package/resources/index.mjs +8 -0
- package/resources/index.mjs.map +1 -0
- package/resources/models.d.mts +85 -0
- package/resources/models.d.mts.map +1 -0
- package/resources/models.d.ts +85 -0
- package/resources/models.d.ts.map +1 -0
- package/resources/models.js +44 -0
- package/resources/models.js.map +1 -0
- package/resources/models.mjs +40 -0
- package/resources/models.mjs.map +1 -0
- package/resources/preferences.d.mts +111 -0
- package/resources/preferences.d.mts.map +1 -0
- package/resources/preferences.d.ts +111 -0
- package/resources/preferences.d.ts.map +1 -0
- package/resources/preferences.js +92 -0
- package/resources/preferences.js.map +1 -0
- package/resources/preferences.mjs +88 -0
- package/resources/preferences.mjs.map +1 -0
- package/resources/prompt-adaptation.d.mts +574 -0
- package/resources/prompt-adaptation.d.mts.map +1 -0
- package/resources/prompt-adaptation.d.ts +574 -0
- package/resources/prompt-adaptation.d.ts.map +1 -0
- package/resources/prompt-adaptation.js +289 -0
- package/resources/prompt-adaptation.js.map +1 -0
- package/resources/prompt-adaptation.mjs +285 -0
- package/resources/prompt-adaptation.mjs.map +1 -0
- package/resources/report.d.mts +245 -0
- package/resources/report.d.mts.map +1 -0
- package/resources/report.d.ts +245 -0
- package/resources/report.d.ts.map +1 -0
- package/resources/report.js +86 -0
- package/resources/report.js.map +1 -0
- package/resources/report.mjs +82 -0
- package/resources/report.mjs.map +1 -0
- package/resources/routing.d.mts +391 -0
- package/resources/routing.d.mts.map +1 -0
- package/resources/routing.d.ts +391 -0
- package/resources/routing.d.ts.map +1 -0
- package/resources/routing.js +163 -0
- package/resources/routing.js.map +1 -0
- package/resources/routing.mjs +159 -0
- package/resources/routing.mjs.map +1 -0
- package/resources.d.mts +2 -0
- package/resources.d.mts.map +1 -0
- package/resources.d.ts +2 -0
- package/resources.d.ts.map +1 -0
- package/resources.js +5 -0
- package/resources.js.map +1 -0
- package/resources.mjs +2 -0
- package/resources.mjs.map +1 -0
- package/src/api-promise.ts +2 -0
- package/src/client.ts +842 -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/resource.ts +11 -0
- package/src/core/uploads.ts +2 -0
- package/src/error.ts +2 -0
- package/src/index.ts +22 -0
- 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/qs/LICENSE.md +13 -0
- package/src/internal/qs/README.md +3 -0
- package/src/internal/qs/formats.ts +10 -0
- package/src/internal/qs/index.ts +13 -0
- package/src/internal/qs/stringify.ts +385 -0
- package/src/internal/qs/types.ts +71 -0
- package/src/internal/qs/utils.ts +265 -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 +126 -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/.keep +4 -0
- package/src/resource.ts +2 -0
- package/src/resources/admin.ts +5 -0
- package/src/resources/index.ts +44 -0
- package/src/resources/models.ts +110 -0
- package/src/resources/preferences.ts +158 -0
- package/src/resources/prompt-adaptation.ts +700 -0
- package/src/resources/report.ts +300 -0
- package/src/resources/routing.ts +476 -0
- package/src/resources.ts +1 -0
- package/src/tsconfig.json +11 -0
- package/src/uploads.ts +2 -0
- package/src/version.ts +1 -0
- package/uploads.d.mts +2 -0
- package/uploads.d.mts.map +1 -0
- package/uploads.d.ts +2 -0
- package/uploads.d.ts.map +1 -0
- package/uploads.js +6 -0
- package/uploads.js.map +1 -0
- package/uploads.mjs +2 -0
- package/uploads.mjs.map +1 -0
- package/version.d.mts +2 -0
- package/version.d.mts.map +1 -0
- package/version.d.ts +2 -0
- package/version.d.ts.map +1 -0
- package/version.js +5 -0
- package/version.js.map +1 -0
- package/version.mjs +2 -0
- package/version.mjs.map +1 -0
- package/LICENCE +0 -21
package/README.md
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Not Diamond TypeScript API Library
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[>)](https://npmjs.org/package/notdiamond) 
|
|
4
|
+
|
|
5
|
+
This library provides convenient access to the Not Diamond REST API from server-side TypeScript or JavaScript.
|
|
6
|
+
|
|
7
|
+
The REST API documentation can be found on [docs.notdiamond.ai](https://docs.notdiamond.ai). The full API of this library can be found in [api.md](api.md).
|
|
8
|
+
|
|
9
|
+
It is generated with [Stainless](https://www.stainless.com/).
|
|
4
10
|
|
|
5
11
|
## Installation
|
|
6
12
|
|
|
@@ -8,135 +14,473 @@ This library provides convenient access to the NotDiamond model routing API from
|
|
|
8
14
|
npm install notdiamond
|
|
9
15
|
```
|
|
10
16
|
|
|
11
|
-
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
The full API of this library can be found in [api.md](api.md).
|
|
20
|
+
|
|
21
|
+
<!-- prettier-ignore -->
|
|
22
|
+
```js
|
|
23
|
+
import NotDiamond from 'notdiamond';
|
|
24
|
+
|
|
25
|
+
const client = new NotDiamond({
|
|
26
|
+
apiKey: process.env['NOT_DIAMOND_API_KEY'], // This is the default and can be omitted
|
|
27
|
+
environment: 'staging', // defaults to 'production'
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const response = await client.routing.selectModel({
|
|
31
|
+
llm_providers: [
|
|
32
|
+
{ model: 'gpt-4o', provider: 'openai' },
|
|
33
|
+
{ model: 'claude-3-5-sonnet-20241022', provider: 'anthropic' },
|
|
34
|
+
{ model: 'gemini-1.5-pro', provider: 'google' },
|
|
35
|
+
],
|
|
36
|
+
messages: [
|
|
37
|
+
{ role: 'system', content: 'You are a helpful assistant.' },
|
|
38
|
+
{ role: 'user', content: 'Explain quantum computing in simple terms' },
|
|
39
|
+
],
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
console.log(response.providers);
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Request & Response types
|
|
12
46
|
|
|
47
|
+
This library includes TypeScript definitions for all request params and response fields. You may import and use them like so:
|
|
48
|
+
|
|
49
|
+
<!-- prettier-ignore -->
|
|
13
50
|
```ts
|
|
14
|
-
import
|
|
51
|
+
import NotDiamond from 'notdiamond';
|
|
52
|
+
|
|
53
|
+
const client = new NotDiamond({
|
|
54
|
+
apiKey: process.env['NOT_DIAMOND_API_KEY'], // This is the default and can be omitted
|
|
55
|
+
environment: 'staging', // defaults to 'production'
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
const params: NotDiamond.RoutingSelectModelParams = {
|
|
59
|
+
llm_providers: [
|
|
60
|
+
{ model: 'gpt-4o', provider: 'openai' },
|
|
61
|
+
{ model: 'claude-3-5-sonnet-20241022', provider: 'anthropic' },
|
|
62
|
+
{ model: 'gemini-1.5-pro', provider: 'google' },
|
|
63
|
+
],
|
|
64
|
+
messages: [
|
|
65
|
+
{ role: 'system', content: 'You are a helpful assistant.' },
|
|
66
|
+
{ role: 'user', content: 'Explain quantum computing in simple terms' },
|
|
67
|
+
],
|
|
68
|
+
};
|
|
69
|
+
const response: NotDiamond.RoutingSelectModelResponse = await client.routing.selectModel(params);
|
|
15
70
|
```
|
|
16
71
|
|
|
17
|
-
|
|
72
|
+
Documentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.
|
|
73
|
+
|
|
74
|
+
## File uploads
|
|
75
|
+
|
|
76
|
+
Request parameters that correspond to file uploads can be passed in many different forms:
|
|
18
77
|
|
|
19
|
-
|
|
78
|
+
- `File` (or an object with the same structure)
|
|
79
|
+
- a `fetch` `Response` (or an object with the same structure)
|
|
80
|
+
- an `fs.ReadStream`
|
|
81
|
+
- the return value of our `toFile` helper
|
|
20
82
|
|
|
21
|
-
|
|
83
|
+
```ts
|
|
84
|
+
import fs from 'fs';
|
|
85
|
+
import NotDiamond, { toFile } from 'notdiamond';
|
|
86
|
+
|
|
87
|
+
const client = new NotDiamond();
|
|
88
|
+
|
|
89
|
+
// If you have access to Node `fs` we recommend using `fs.createReadStream()`:
|
|
90
|
+
await client.routing.createSurveyResponse({
|
|
91
|
+
constraint_priorities: 'constraint_priorities',
|
|
92
|
+
email: 'email',
|
|
93
|
+
llm_providers: 'llm_providers',
|
|
94
|
+
use_case_desc: 'use_case_desc',
|
|
95
|
+
user_id: 'user_id',
|
|
96
|
+
'x-token': 'x-token',
|
|
97
|
+
dataset_file: fs.createReadStream('/path/to/file'),
|
|
98
|
+
});
|
|
22
99
|
|
|
23
|
-
|
|
100
|
+
// Or if you have the web `File` API you can pass a `File` instance:
|
|
101
|
+
await client.routing.createSurveyResponse({
|
|
102
|
+
constraint_priorities: 'constraint_priorities',
|
|
103
|
+
email: 'email',
|
|
104
|
+
llm_providers: 'llm_providers',
|
|
105
|
+
use_case_desc: 'use_case_desc',
|
|
106
|
+
user_id: 'user_id',
|
|
107
|
+
'x-token': 'x-token',
|
|
108
|
+
dataset_file: new File(['my bytes'], 'file'),
|
|
109
|
+
});
|
|
24
110
|
|
|
25
|
-
|
|
26
|
-
|
|
111
|
+
// You can also pass a `fetch` `Response`:
|
|
112
|
+
await client.routing.createSurveyResponse({
|
|
113
|
+
constraint_priorities: 'constraint_priorities',
|
|
114
|
+
email: 'email',
|
|
115
|
+
llm_providers: 'llm_providers',
|
|
116
|
+
use_case_desc: 'use_case_desc',
|
|
117
|
+
user_id: 'user_id',
|
|
118
|
+
'x-token': 'x-token',
|
|
119
|
+
dataset_file: await fetch('https://somesite/file'),
|
|
120
|
+
});
|
|
27
121
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
122
|
+
// Finally, if none of the above are convenient, you can use our `toFile` helper:
|
|
123
|
+
await client.routing.createSurveyResponse({
|
|
124
|
+
constraint_priorities: 'constraint_priorities',
|
|
125
|
+
email: 'email',
|
|
126
|
+
llm_providers: 'llm_providers',
|
|
127
|
+
use_case_desc: 'use_case_desc',
|
|
128
|
+
user_id: 'user_id',
|
|
129
|
+
'x-token': 'x-token',
|
|
130
|
+
dataset_file: await toFile(Buffer.from('my bytes'), 'file'),
|
|
131
|
+
});
|
|
132
|
+
await client.routing.createSurveyResponse({
|
|
133
|
+
constraint_priorities: 'constraint_priorities',
|
|
134
|
+
email: 'email',
|
|
135
|
+
llm_providers: 'llm_providers',
|
|
136
|
+
use_case_desc: 'use_case_desc',
|
|
137
|
+
user_id: 'user_id',
|
|
138
|
+
'x-token': 'x-token',
|
|
139
|
+
dataset_file: await toFile(new Uint8Array([0, 1, 2]), 'file'),
|
|
31
140
|
});
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## Handling errors
|
|
32
144
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
{
|
|
145
|
+
When the library is unable to connect to the API,
|
|
146
|
+
or if the API returns a non-success status code (i.e., 4xx or 5xx response),
|
|
147
|
+
a subclass of `APIError` will be thrown:
|
|
148
|
+
|
|
149
|
+
<!-- prettier-ignore -->
|
|
150
|
+
```ts
|
|
151
|
+
const response = await client.routing
|
|
152
|
+
.selectModel({
|
|
153
|
+
llm_providers: [
|
|
154
|
+
{ model: 'gpt-4o', provider: 'openai' },
|
|
155
|
+
{ model: 'claude-3-5-sonnet-20241022', provider: 'anthropic' },
|
|
156
|
+
{ model: 'gemini-1.5-pro', provider: 'google' },
|
|
43
157
|
],
|
|
44
|
-
|
|
45
|
-
|
|
158
|
+
messages: [
|
|
159
|
+
{ role: 'system', content: 'You are a helpful assistant.' },
|
|
160
|
+
{ role: 'user', content: 'Explain quantum computing in simple terms' },
|
|
161
|
+
],
|
|
162
|
+
})
|
|
163
|
+
.catch(async (err) => {
|
|
164
|
+
if (err instanceof NotDiamond.APIError) {
|
|
165
|
+
console.log(err.status); // 400
|
|
166
|
+
console.log(err.name); // BadRequestError
|
|
167
|
+
console.log(err.headers); // {server: 'nginx', ...}
|
|
168
|
+
} else {
|
|
169
|
+
throw err;
|
|
170
|
+
}
|
|
46
171
|
});
|
|
172
|
+
```
|
|
47
173
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
174
|
+
Error codes are as follows:
|
|
175
|
+
|
|
176
|
+
| Status Code | Error Type |
|
|
177
|
+
| ----------- | -------------------------- |
|
|
178
|
+
| 400 | `BadRequestError` |
|
|
179
|
+
| 401 | `AuthenticationError` |
|
|
180
|
+
| 403 | `PermissionDeniedError` |
|
|
181
|
+
| 404 | `NotFoundError` |
|
|
182
|
+
| 422 | `UnprocessableEntityError` |
|
|
183
|
+
| 429 | `RateLimitError` |
|
|
184
|
+
| >=500 | `InternalServerError` |
|
|
185
|
+
| N/A | `APIConnectionError` |
|
|
186
|
+
|
|
187
|
+
### Retries
|
|
188
|
+
|
|
189
|
+
Certain errors will be automatically retried 2 times by default, with a short exponential backoff.
|
|
190
|
+
Connection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,
|
|
191
|
+
429 Rate Limit, and >=500 Internal errors will all be retried by default.
|
|
192
|
+
|
|
193
|
+
You can use the `maxRetries` option to configure or disable this:
|
|
194
|
+
|
|
195
|
+
<!-- prettier-ignore -->
|
|
196
|
+
```js
|
|
197
|
+
// Configure the default for all requests:
|
|
198
|
+
const client = new NotDiamond({
|
|
199
|
+
maxRetries: 0, // default is 2
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
// Or, configure per-request:
|
|
203
|
+
await client.routing.selectModel({ llm_providers: [{ model: 'gpt-4o', provider: 'openai' }, { model: 'claude-3-5-sonnet-20241022', provider: 'anthropic' }, { model: 'gemini-1.5-pro', provider: 'google' }], messages: [{ role: 'system', content: 'You are a helpful assistant.' }, { role: 'user', content: 'Explain quantum computing in simple terms' }] }, {
|
|
204
|
+
maxRetries: 5,
|
|
205
|
+
});
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### Timeouts
|
|
209
|
+
|
|
210
|
+
Requests time out after 1 minute by default. You can configure this with a `timeout` option:
|
|
211
|
+
|
|
212
|
+
<!-- prettier-ignore -->
|
|
213
|
+
```ts
|
|
214
|
+
// Configure the default for all requests:
|
|
215
|
+
const client = new NotDiamond({
|
|
216
|
+
timeout: 20 * 1000, // 20 seconds (default is 1 minute)
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
// Override per-request:
|
|
220
|
+
await client.routing.selectModel({ llm_providers: [{ model: 'gpt-4o', provider: 'openai' }, { model: 'claude-3-5-sonnet-20241022', provider: 'anthropic' }, { model: 'gemini-1.5-pro', provider: 'google' }], messages: [{ role: 'system', content: 'You are a helpful assistant.' }, { role: 'user', content: 'Explain quantum computing in simple terms' }] }, {
|
|
221
|
+
timeout: 5 * 1000,
|
|
222
|
+
});
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
On timeout, an `APIConnectionTimeoutError` is thrown.
|
|
226
|
+
|
|
227
|
+
Note that requests which time out will be [retried twice by default](#retries).
|
|
228
|
+
|
|
229
|
+
## Advanced Usage
|
|
230
|
+
|
|
231
|
+
### Accessing raw Response data (e.g., headers)
|
|
232
|
+
|
|
233
|
+
The "raw" `Response` returned by `fetch()` can be accessed through the `.asResponse()` method on the `APIPromise` type that all methods return.
|
|
234
|
+
This method returns as soon as the headers for a successful response are received and does not consume the response body, so you are free to write custom parsing or streaming logic.
|
|
235
|
+
|
|
236
|
+
You can also use the `.withResponse()` method to get the raw `Response` along with the parsed data.
|
|
237
|
+
Unlike `.asResponse()` this method consumes the body, returning once it is parsed.
|
|
238
|
+
|
|
239
|
+
<!-- prettier-ignore -->
|
|
240
|
+
```ts
|
|
241
|
+
const client = new NotDiamond();
|
|
242
|
+
|
|
243
|
+
const response = await client.routing
|
|
244
|
+
.selectModel({
|
|
245
|
+
llm_providers: [
|
|
246
|
+
{ model: 'gpt-4o', provider: 'openai' },
|
|
247
|
+
{ model: 'claude-3-5-sonnet-20241022', provider: 'anthropic' },
|
|
248
|
+
{ model: 'gemini-1.5-pro', provider: 'google' },
|
|
100
249
|
],
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
250
|
+
messages: [
|
|
251
|
+
{ role: 'system', content: 'You are a helpful assistant.' },
|
|
252
|
+
{ role: 'user', content: 'Explain quantum computing in simple terms' },
|
|
253
|
+
],
|
|
254
|
+
})
|
|
255
|
+
.asResponse();
|
|
256
|
+
console.log(response.headers.get('X-My-Header'));
|
|
257
|
+
console.log(response.statusText); // access the underlying Response object
|
|
258
|
+
|
|
259
|
+
const { data: response, response: raw } = await client.routing
|
|
260
|
+
.selectModel({
|
|
261
|
+
llm_providers: [
|
|
262
|
+
{ model: 'gpt-4o', provider: 'openai' },
|
|
263
|
+
{ model: 'claude-3-5-sonnet-20241022', provider: 'anthropic' },
|
|
264
|
+
{ model: 'gemini-1.5-pro', provider: 'google' },
|
|
265
|
+
],
|
|
266
|
+
messages: [
|
|
267
|
+
{ role: 'system', content: 'You are a helpful assistant.' },
|
|
268
|
+
{ role: 'user', content: 'Explain quantum computing in simple terms' },
|
|
269
|
+
],
|
|
270
|
+
})
|
|
271
|
+
.withResponse();
|
|
272
|
+
console.log(raw.headers.get('X-My-Header'));
|
|
273
|
+
console.log(response.providers);
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
### Logging
|
|
277
|
+
|
|
278
|
+
> [!IMPORTANT]
|
|
279
|
+
> All log messages are intended for debugging only. The format and content of log messages
|
|
280
|
+
> may change between releases.
|
|
281
|
+
|
|
282
|
+
#### Log levels
|
|
108
283
|
|
|
109
|
-
|
|
110
|
-
console.error('Error:', result.detail);
|
|
111
|
-
return;
|
|
112
|
-
}
|
|
284
|
+
The log level can be configured in two ways:
|
|
113
285
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}
|
|
286
|
+
1. Via the `NOT_DIAMOND_LOG` environment variable
|
|
287
|
+
2. Using the `logLevel` client option (overrides the environment variable if set)
|
|
117
288
|
|
|
118
|
-
|
|
289
|
+
```ts
|
|
290
|
+
import NotDiamond from 'notdiamond';
|
|
291
|
+
|
|
292
|
+
const client = new NotDiamond({
|
|
293
|
+
logLevel: 'debug', // Show all log messages
|
|
294
|
+
});
|
|
119
295
|
```
|
|
120
296
|
|
|
121
|
-
|
|
297
|
+
Available log levels, from most to least verbose:
|
|
298
|
+
|
|
299
|
+
- `'debug'` - Show debug messages, info, warnings, and errors
|
|
300
|
+
- `'info'` - Show info messages, warnings, and errors
|
|
301
|
+
- `'warn'` - Show warnings and errors (default)
|
|
302
|
+
- `'error'` - Show only errors
|
|
303
|
+
- `'off'` - Disable all logging
|
|
304
|
+
|
|
305
|
+
At the `'debug'` level, all HTTP requests and responses are logged, including headers and bodies.
|
|
306
|
+
Some authentication-related headers are redacted, but sensitive data in request and response bodies
|
|
307
|
+
may still be visible.
|
|
308
|
+
|
|
309
|
+
#### Custom logger
|
|
310
|
+
|
|
311
|
+
By default, this library logs to `globalThis.console`. You can also provide a custom logger.
|
|
312
|
+
Most logging libraries are supported, including [pino](https://www.npmjs.com/package/pino), [winston](https://www.npmjs.com/package/winston), [bunyan](https://www.npmjs.com/package/bunyan), [consola](https://www.npmjs.com/package/consola), [signale](https://www.npmjs.com/package/signale), and [@std/log](https://jsr.io/@std/log). If your logger doesn't work, please open an issue.
|
|
313
|
+
|
|
314
|
+
When providing a custom logger, the `logLevel` option still controls which messages are emitted, messages
|
|
315
|
+
below the configured level will not be sent to your logger.
|
|
316
|
+
|
|
317
|
+
```ts
|
|
318
|
+
import NotDiamond from 'notdiamond';
|
|
319
|
+
import pino from 'pino';
|
|
320
|
+
|
|
321
|
+
const logger = pino();
|
|
322
|
+
|
|
323
|
+
const client = new NotDiamond({
|
|
324
|
+
logger: logger.child({ name: 'NotDiamond' }),
|
|
325
|
+
logLevel: 'debug', // Send all messages to pino, allowing it to filter
|
|
326
|
+
});
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
### Making custom/undocumented requests
|
|
330
|
+
|
|
331
|
+
This library is typed for convenient access to the documented API. If you need to access undocumented
|
|
332
|
+
endpoints, params, or response properties, the library can still be used.
|
|
333
|
+
|
|
334
|
+
#### Undocumented endpoints
|
|
335
|
+
|
|
336
|
+
To make requests to undocumented endpoints, you can use `client.get`, `client.post`, and other HTTP verbs.
|
|
337
|
+
Options on the client, such as retries, will be respected when making these requests.
|
|
338
|
+
|
|
339
|
+
```ts
|
|
340
|
+
await client.post('/some/path', {
|
|
341
|
+
body: { some_prop: 'foo' },
|
|
342
|
+
query: { some_query_arg: 'bar' },
|
|
343
|
+
});
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
#### Undocumented request params
|
|
347
|
+
|
|
348
|
+
To make requests using undocumented parameters, you may use `// @ts-expect-error` on the undocumented
|
|
349
|
+
parameter. This library doesn't validate at runtime that the request matches the type, so any extra values you
|
|
350
|
+
send will be sent as-is.
|
|
351
|
+
|
|
352
|
+
```ts
|
|
353
|
+
client.routing.selectModel({
|
|
354
|
+
// ...
|
|
355
|
+
// @ts-expect-error baz is not yet public
|
|
356
|
+
baz: 'undocumented option',
|
|
357
|
+
});
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
For requests with the `GET` verb, any extra params will be in the query, all other requests will send the
|
|
361
|
+
extra param in the body.
|
|
362
|
+
|
|
363
|
+
If you want to explicitly send an extra argument, you can do so with the `query`, `body`, and `headers` request
|
|
364
|
+
options.
|
|
365
|
+
|
|
366
|
+
#### Undocumented response properties
|
|
367
|
+
|
|
368
|
+
To access undocumented response properties, you may access the response object with `// @ts-expect-error` on
|
|
369
|
+
the response object, or cast the response object to the requisite type. Like the request params, we do not
|
|
370
|
+
validate or strip extra properties from the response from the API.
|
|
371
|
+
|
|
372
|
+
### Customizing the fetch client
|
|
373
|
+
|
|
374
|
+
By default, this library expects a global `fetch` function is defined.
|
|
375
|
+
|
|
376
|
+
If you want to use a different `fetch` function, you can either polyfill the global:
|
|
377
|
+
|
|
378
|
+
```ts
|
|
379
|
+
import fetch from 'my-fetch';
|
|
380
|
+
|
|
381
|
+
globalThis.fetch = fetch;
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
Or pass it to the client:
|
|
385
|
+
|
|
386
|
+
```ts
|
|
387
|
+
import NotDiamond from 'notdiamond';
|
|
388
|
+
import fetch from 'my-fetch';
|
|
389
|
+
|
|
390
|
+
const client = new NotDiamond({ fetch });
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
### Fetch options
|
|
394
|
+
|
|
395
|
+
If you want to set custom `fetch` options without overriding the `fetch` function, you can provide a `fetchOptions` object when instantiating the client or making a request. (Request-specific options override client options.)
|
|
396
|
+
|
|
397
|
+
```ts
|
|
398
|
+
import NotDiamond from 'notdiamond';
|
|
399
|
+
|
|
400
|
+
const client = new NotDiamond({
|
|
401
|
+
fetchOptions: {
|
|
402
|
+
// `RequestInit` options
|
|
403
|
+
},
|
|
404
|
+
});
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
#### Configuring proxies
|
|
408
|
+
|
|
409
|
+
To modify proxy behavior, you can provide custom `fetchOptions` that add runtime-specific proxy
|
|
410
|
+
options to requests:
|
|
411
|
+
|
|
412
|
+
<img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/node.svg" align="top" width="18" height="21"> **Node** <sup>[[docs](https://github.com/nodejs/undici/blob/main/docs/docs/api/ProxyAgent.md#example---proxyagent-with-fetch)]</sup>
|
|
413
|
+
|
|
414
|
+
```ts
|
|
415
|
+
import NotDiamond from 'notdiamond';
|
|
416
|
+
import * as undici from 'undici';
|
|
417
|
+
|
|
418
|
+
const proxyAgent = new undici.ProxyAgent('http://localhost:8888');
|
|
419
|
+
const client = new NotDiamond({
|
|
420
|
+
fetchOptions: {
|
|
421
|
+
dispatcher: proxyAgent,
|
|
422
|
+
},
|
|
423
|
+
});
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
<img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/bun.svg" align="top" width="18" height="21"> **Bun** <sup>[[docs](https://bun.sh/guides/http/proxy)]</sup>
|
|
427
|
+
|
|
428
|
+
```ts
|
|
429
|
+
import NotDiamond from 'notdiamond';
|
|
430
|
+
|
|
431
|
+
const client = new NotDiamond({
|
|
432
|
+
fetchOptions: {
|
|
433
|
+
proxy: 'http://localhost:8888',
|
|
434
|
+
},
|
|
435
|
+
});
|
|
436
|
+
```
|
|
437
|
+
|
|
438
|
+
<img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/deno.svg" align="top" width="18" height="21"> **Deno** <sup>[[docs](https://docs.deno.com/api/deno/~/Deno.createHttpClient)]</sup>
|
|
439
|
+
|
|
440
|
+
```ts
|
|
441
|
+
import NotDiamond from 'npm:notdiamond';
|
|
442
|
+
|
|
443
|
+
const httpClient = Deno.createHttpClient({ proxy: { url: 'http://localhost:8888' } });
|
|
444
|
+
const client = new NotDiamond({
|
|
445
|
+
fetchOptions: {
|
|
446
|
+
client: httpClient,
|
|
447
|
+
},
|
|
448
|
+
});
|
|
449
|
+
```
|
|
450
|
+
|
|
451
|
+
## Frequently Asked Questions
|
|
452
|
+
|
|
453
|
+
## Semantic versioning
|
|
454
|
+
|
|
455
|
+
This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:
|
|
456
|
+
|
|
457
|
+
1. Changes that only affect static types, without breaking runtime behavior.
|
|
458
|
+
2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_
|
|
459
|
+
3. Changes that we do not expect to impact the vast majority of users in practice.
|
|
460
|
+
|
|
461
|
+
We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.
|
|
122
462
|
|
|
123
|
-
|
|
463
|
+
We are keen for your feedback; please open an [issue](https://www.github.com/Not-Diamond/not-diamond-typescript/issues) with questions, bugs, or suggestions.
|
|
124
464
|
|
|
125
|
-
##
|
|
465
|
+
## Requirements
|
|
126
466
|
|
|
127
|
-
|
|
128
|
-
- **tradeoff**: The factor to optimize for (e.g., 'latency', 'cost', 'performance').
|
|
129
|
-
- **tools**: Custom functions that the AI can use to perform specific tasks.
|
|
130
|
-
- **maxModelDepth**: The maximum number of models to include in the response (for advanced use cases).
|
|
467
|
+
TypeScript >= 4.9 is supported.
|
|
131
468
|
|
|
132
|
-
|
|
469
|
+
The following runtimes are supported:
|
|
133
470
|
|
|
134
|
-
|
|
471
|
+
- Web browsers (Up-to-date Chrome, Firefox, Safari, Edge, and more)
|
|
472
|
+
- Node.js 20 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions.
|
|
473
|
+
- Deno v1.28.0 or higher.
|
|
474
|
+
- Bun 1.0 or later.
|
|
475
|
+
- Cloudflare Workers.
|
|
476
|
+
- Vercel Edge Runtime.
|
|
477
|
+
- Jest 28 or greater with the `"node"` environment (`"jsdom"` is not supported at this time).
|
|
478
|
+
- Nitro v2.6 or greater.
|
|
135
479
|
|
|
136
|
-
|
|
480
|
+
Note that React Native is not supported at this time.
|
|
137
481
|
|
|
138
|
-
If you
|
|
482
|
+
If you are interested in other runtime environments, please open or upvote an issue on GitHub.
|
|
139
483
|
|
|
140
|
-
##
|
|
484
|
+
## Contributing
|
|
141
485
|
|
|
142
|
-
|
|
486
|
+
See [the contributing documentation](./CONTRIBUTING.md).
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-promise.d.mts","sourceRoot":"","sources":["src/api-promise.ts"],"names":[],"mappings":""}
|
package/api-promise.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-promise.d.ts","sourceRoot":"","sources":["src/api-promise.ts"],"names":[],"mappings":""}
|
package/api-promise.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("./internal/tslib.js");
|
|
4
|
+
/** @deprecated Import from ./core/api-promise instead */
|
|
5
|
+
tslib_1.__exportStar(require("./core/api-promise.js"), exports);
|
|
6
|
+
//# sourceMappingURL=api-promise.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-promise.js","sourceRoot":"","sources":["src/api-promise.ts"],"names":[],"mappings":";;;AAAA,yDAAyD;AACzD,gEAAmC"}
|
package/api-promise.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-promise.mjs","sourceRoot":"","sources":["src/api-promise.ts"],"names":[],"mappings":""}
|