@epam/ai-dial-typescript-sdk 0.1.0-dev.3 → 0.1.0-dev.30
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/README.md +16 -14
- package/dist/index.cjs +416 -31
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11376 -4312
- package/dist/index.d.ts +11376 -4312
- package/dist/index.js +416 -31
- package/dist/index.js.map +1 -1
- package/package.json +12 -8
package/README.md
CHANGED
|
@@ -35,13 +35,13 @@ const embeddings = await sdk.sendEmbeddingsRequest('text-embedding-ada-002', {
|
|
|
35
35
|
|
|
36
36
|
`createSDK(options: SDKOptions)` accepts the following options:
|
|
37
37
|
|
|
38
|
-
| Option
|
|
39
|
-
|
|
40
|
-
| `baseUrl` | `string`
|
|
41
|
-
| `apiKey`
|
|
42
|
-
| `token`
|
|
43
|
-
| `headers` | `Record<string, string>` | Additional custom headers merged into every request.
|
|
44
|
-
| `fetch`
|
|
38
|
+
| Option | Type | Description |
|
|
39
|
+
| --------- | ------------------------ | --------------------------------------------------------------- |
|
|
40
|
+
| `baseUrl` | `string` | **Required.** Base URL of the DIAL Core API. |
|
|
41
|
+
| `apiKey` | `string` | API key — sent as the `Api-Key` header. |
|
|
42
|
+
| `token` | `string` | JWT bearer token — sent as `Authorization: Bearer <token>`. |
|
|
43
|
+
| `headers` | `Record<string, string>` | Additional custom headers merged into every request. |
|
|
44
|
+
| `fetch` | `typeof fetch` | Custom fetch implementation (e.g. for Node.js < 18 or testing). |
|
|
45
45
|
|
|
46
46
|
Only one of `apiKey` or `token` is typically needed.
|
|
47
47
|
|
|
@@ -58,6 +58,7 @@ sdk.sendEmbeddingsRequest(deployment_name, init?)
|
|
|
58
58
|
|
|
59
59
|
```typescript
|
|
60
60
|
sdk.getDeployments(init?)
|
|
61
|
+
sdk.getDeploymentsByInterfaceType(init?)
|
|
61
62
|
sdk.getDeployment(deployment_name, init?)
|
|
62
63
|
sdk.getDeploymentLimits(deployment_name, init?)
|
|
63
64
|
sdk.configurationDeployment(deployment_name, init?)
|
|
@@ -214,13 +215,13 @@ npm install
|
|
|
214
215
|
|
|
215
216
|
### Scripts
|
|
216
217
|
|
|
217
|
-
| Command
|
|
218
|
-
|
|
219
|
-
| `npm run gen`
|
|
220
|
-
| `npm run build`
|
|
221
|
-
| `npm run dev`
|
|
222
|
-
| `npm run lint`
|
|
223
|
-
| `npm run format` | Run Prettier
|
|
218
|
+
| Command | Description |
|
|
219
|
+
| ---------------- | ---------------------------------------------------------------------- |
|
|
220
|
+
| `npm run gen` | Bundle the OpenAPI spec and regenerate TypeScript types and SDK client |
|
|
221
|
+
| `npm run build` | Generate types and compile to CJS + ESM with type definitions |
|
|
222
|
+
| `npm run dev` | Watch mode build |
|
|
223
|
+
| `npm run lint` | Run ESLint |
|
|
224
|
+
| `npm run format` | Run Prettier |
|
|
224
225
|
|
|
225
226
|
### Code Generation
|
|
226
227
|
|
|
@@ -231,6 +232,7 @@ npm run gen
|
|
|
231
232
|
```
|
|
232
233
|
|
|
233
234
|
This will:
|
|
235
|
+
|
|
234
236
|
1. Bundle `openapi.yaml` into `openapi.bundle.yaml` via Redocly CLI
|
|
235
237
|
2. Generate TypeScript types (`src/schema.ts`) via `openapi-typescript`
|
|
236
238
|
3. Generate the SDK client (`src/client.ts`) and path helpers (`src/api-paths.ts`)
|