12
12
// See the License for the specific language governing permissions and
13
13
// limitations under the License.
14
14
15
+ import type { ModelLifecycleStatus } from '@/src/administration/types/db-admin/common.js' ;
16
+ import type { CommandOptions , LitUnion } from '@/src/lib/index.js' ;
17
+
18
+ /**
19
+ * Options for finding embedding providers.
20
+ *
21
+ * @field filterModelStatus - Filter models by their lifecycle status. If not provided, defaults to 'SUPPORTED' only. Use empty string '' to include all statuses.
22
+ *
23
+ * @see DbAdmin.findEmbeddingProviders
24
+ *
25
+ * @public
26
+ */
27
+ export interface FindEmbeddingProvidersOptions extends CommandOptions < { timeout : 'databaseAdminTimeoutMs' } > {
28
+ /**
29
+ * Filter models by their lifecycle status.
30
+ *
31
+ * - If not provided: defaults to `'SUPPORTED'` only
32
+ * - If set to `''`: includes all statuses (`'SUPPORTED'`, `'DEPRECATED'`, `'END_OF_LIFE'`)
33
+ * - If set to specific status: includes only models with that status
34
+ *
35
+ * @example
36
+ * ```ts
37
+ * // Only supported models (default behavior)
38
+ * { filterModelStatus: 'SUPPORTED' }
39
+ *
40
+ * // All models regardless of status
41
+ * { filterModelStatus: '' }
42
+ *
43
+ * // Only deprecated models
44
+ * { filterModelStatus: 'DEPRECATED' }
45
+ * ```
46
+ */
47
+ filterModelStatus ?: ModelLifecycleStatus | '' ;
48
+ }
49
+
15
50
/**
16
51
* The overarching result containing the `embeddingProviders` map.
17
52
*
@@ -26,7 +61,7 @@ export interface FindEmbeddingProvidersResult {
26
61
* A map of embedding provider names (e.g. `openai`), to information about said provider (e.g. models/auth).
27
62
*
28
63
* @example
29
- * ```typescript
64
+ * ```ts
30
65
* {
31
66
* openai: {
32
67
* displayName: 'OpenAI',
@@ -56,7 +91,7 @@ export interface EmbeddingProviderInfo {
56
91
* The prettified name of the provider (as shown in the Astra portal).
57
92
*
58
93
* @example
59
- * ```typescript
94
+ * ```ts
60
95
* // openai.displayName:
61
96
* 'OpenAI'
62
97
* ```
@@ -69,7 +104,7 @@ export interface EmbeddingProviderInfo {
69
104
* parameters (such as `huggingfaceDedicated` or `azureOpenAI`).
70
105
*
71
106
* @example
72
- * ```typescript
107
+ * ```ts
73
108
* // openai.url:
74
109
* 'https://api.openai.com/v1/'
75
110
*
@@ -85,7 +120,7 @@ export interface EmbeddingProviderInfo {
85
120
*
86
121
* - `HEADER`: Authentication using direct API keys passed through headers on every Data API call.
87
122
* See {@link EmbeddingHeadersProvider} for more info.
88
- * ```typescript
123
+ * ```ts
89
124
* const collections = await db.createCollection('my_coll', {
90
125
* vector: {
91
126
* service: {
@@ -101,15 +136,15 @@ export interface EmbeddingProviderInfo {
101
136
* ```
102
137
*
103
138
* - `SHARED_SECRET`: Authentication tied to a collections at collections creation time using the Astra KMS.
104
- * ```typescript
139
+ * ```ts
105
140
* const collections = await db.collections('my_coll', {
106
141
* // Not tied to the collections; can be different every time.
107
142
* embeddingApiKey: 'sk-...',
108
143
* });
109
144
* ```
110
145
*
111
146
* - `NONE`: For when a client doesn't need authentication to use (e.g. nvidia).
112
- * ```typescript
147
+ * ```ts
113
148
* const collections = await db.createCollection('my_coll', {
114
149
* vector: {
115
150
* service: {
@@ -121,7 +156,7 @@ export interface EmbeddingProviderInfo {
121
156
* ```
122
157
*
123
158
* @example
124
- * ```typescript
159
+ * ```ts
125
160
* // openai.supportedAuthentication.HEADER:
126
161
* {
127
162
* enabled: true,
@@ -132,14 +167,14 @@ export interface EmbeddingProviderInfo {
132
167
* }
133
168
* ```
134
169
*/
135
- supportedAuthentication : Record < string , EmbeddingProviderAuthInfo > ,
170
+ supportedAuthentication : Record < LitUnion < 'HEADER' | 'SHARED_SECRET' | 'NONE' > , EmbeddingProviderAuthInfo > ,
136
171
/**
137
172
* Any additional, arbitrary parameters the provider may take in. May or may not be required.
138
173
*
139
174
* Passed into the `parameters` block in {@link VectorizeServiceOptions} (except for `vectorDimension`).
140
175
*
141
176
* @example
142
- * ```typescript
177
+ * ```ts
143
178
* // openai.parameters[1]
144
179
* {
145
180
* name: 'projectId',
@@ -159,7 +194,7 @@ export interface EmbeddingProviderInfo {
159
194
* may be truly arbitrary.
160
195
*
161
196
* @example
162
- * ```typescript
197
+ * ```ts
163
198
* // nvidia.models[0]
164
199
* {
165
200
* name: 'NV-Embed-QA',
@@ -194,7 +229,7 @@ export interface EmbeddingProviderInfo {
194
229
* See {@link EmbeddingHeadersProvider} for more info about the `HEADER` auth through the client.
195
230
*
196
231
* @example
197
- * ```typescript
232
+ * ```ts
198
233
* // openai.supportedAuthentication.HEADER:
199
234
* {
200
235
* enabled: true,
@@ -231,7 +266,7 @@ export interface EmbeddingProviderAuthInfo {
231
266
* Info on how exactly a method of auth may be used.
232
267
*
233
268
* @example
234
- * ```typescript
269
+ * ```ts
235
270
* // openai.supportedAuthentication.HEADER.tokens[0]:
236
271
* {
237
272
* accepted: 'x-embedding-api-key',
@@ -268,7 +303,7 @@ export interface EmbeddingProviderTokenInfo {
268
303
* set in the upper-level `dimension: number` field).
269
304
*
270
305
* @example
271
- * ```typescript
306
+ * ```ts
272
307
* // openai.parameters[1]
273
308
* {
274
309
* name: 'vectorDimension',
@@ -300,7 +335,7 @@ export interface EmbeddingProviderModelParameterInfo {
300
335
* `vector` block in {@link CollectionVectorOptions}/{@link TableVectorColumnDefinition }.
301
336
*
302
337
* @example
303
- * ```typescript
338
+ * ```ts
304
339
* // huggingface.parameters[0].name
305
340
* endpointName
306
341
* ```
@@ -312,7 +347,7 @@ export interface EmbeddingProviderModelParameterInfo {
312
347
* Commonly `number` or `STRING`.
313
348
*
314
349
* @example
315
- * ```typescript
350
+ * ```ts
316
351
* // huggingface.parameters[0].type
317
352
* STRING
318
353
* ```
@@ -322,7 +357,7 @@ export interface EmbeddingProviderModelParameterInfo {
322
357
* Whether the parameter is required to be passed in.
323
358
*
324
359
* @example
325
- * ```typescript
360
+ * ```ts
326
361
* // huggingface.parameters[0].required
327
362
* true
328
363
* ```
@@ -334,7 +369,7 @@ export interface EmbeddingProviderModelParameterInfo {
334
369
* Will always be in string form (even if the `type` is `'number'`).
335
370
*
336
371
* @example
337
- * ```typescript
372
+ * ```ts
338
373
* // huggingface.parameters[0].defaultValue
339
374
* ''
340
375
* ```
@@ -346,7 +381,7 @@ export interface EmbeddingProviderModelParameterInfo {
346
381
* Commonly either an empty record, or `{ numericRange: [<min>, <max>] }`.
347
382
*
348
383
* @example
349
- * ```typescript
384
+ * ```ts
350
385
* // huggingface.parameters[0].validation
351
386
* {}
352
387
* ```
@@ -356,7 +391,7 @@ export interface EmbeddingProviderModelParameterInfo {
356
391
* Any additional help text/information about the parameter.
357
392
*
358
393
* @example
359
- * ```typescript
394
+ * ```ts
360
395
* // huggingface.parameters[0].help
361
396
* 'The name of your Hugging Face dedicated endpoint, the first part of the Endpoint URL.'
362
397
* ```
@@ -371,7 +406,7 @@ export interface EmbeddingProviderModelParameterInfo {
371
406
* set in the upper-level `dimension: number` field).
372
407
*
373
408
* @example
374
- * ```typescript
409
+ * ```ts
375
410
* // openai.parameters[1]
376
411
* {
377
412
* name: 'projectId',
@@ -404,7 +439,7 @@ export interface EmbeddingProviderProviderParameterInfo extends EmbeddingProvide
404
439
* Display name for the parameter.
405
440
*
406
441
* @example
407
- * ```typescript
442
+ * ```ts
408
443
* // openai.parameters[0].displayName
409
444
* 'Organization ID'
410
445
* ```
@@ -414,7 +449,7 @@ export interface EmbeddingProviderProviderParameterInfo extends EmbeddingProvide
414
449
* Hint for parameter usage.
415
450
*
416
451
* @example
417
- * ```typescript
452
+ * ```ts
418
453
* // openai.parameters[0].hint
419
454
* 'Add an (optional) organization ID'
420
455
* ```
@@ -429,7 +464,7 @@ export interface EmbeddingProviderProviderParameterInfo extends EmbeddingProvide
429
464
* may be truly arbitrary.
430
465
*
431
466
* @example
432
- * ```typescript
467
+ * ```ts
433
468
* // nvidia.models[0]
434
469
* {
435
470
* name: 'NV-Embed-QA',
@@ -454,7 +489,7 @@ export interface EmbeddingProviderModelInfo {
454
489
* may be truly arbitrary.
455
490
*
456
491
* @example
457
- * ```typescript
492
+ * ```ts
458
493
* // openai.models[0].name
459
494
* 'text-embedding-3-small'
460
495
*
@@ -469,7 +504,7 @@ export interface EmbeddingProviderModelInfo {
469
504
* If not present, a `vectorDimension` parameter will be present in the `model.parameters` block.
470
505
*
471
506
* @example
472
- * ```typescript
507
+ * ```ts
473
508
* // openai.models[3].vectorDimension (text-embedding-ada-002)
474
509
* 1536
475
510
*
@@ -484,7 +519,7 @@ export interface EmbeddingProviderModelInfo {
484
519
* Passed into the `parameters` block in {@link VectorizeServiceOptions} (except for `vectorDimension`).
485
520
*
486
521
* @example
487
- * ```typescript
522
+ * ```ts
488
523
* // openai.models[0].parameters[0] (text-embedding-3-small)
489
524
* {
490
525
* name: 'vectorDimension',
@@ -497,4 +532,36 @@ export interface EmbeddingProviderModelInfo {
497
532
* ```
498
533
*/
499
534
parameters : EmbeddingProviderModelParameterInfo [ ] ,
535
+ /**
536
+ * Information about the model's API support status.
537
+ *
538
+ * @example
539
+ * ```ts
540
+ * // openai.models[0].apiModelSupport
541
+ * { status: 'SUPPORTED' }
542
+ * ```
543
+ */
544
+ apiModelSupport : EmbeddingProviderModelApiSupportInfo ,
545
+ }
546
+
547
+ /**
548
+ * Information about the model's API support status and lifecycle.
549
+ *
550
+ * @field status - The current lifecycle status of the model
551
+ *
552
+ * @see EmbeddingProviderModelInfo
553
+ *
554
+ * @public
555
+ */
556
+ export interface EmbeddingProviderModelApiSupportInfo {
557
+ /**
558
+ * The current lifecycle status of the model.
559
+ *
560
+ * @example
561
+ * ```ts
562
+ * // openai.models[0].apiModelSupport.status
563
+ * 'SUPPORTED'
564
+ * ```
565
+ */
566
+ status : ModelLifecycleStatus ,
500
567
}
0 commit comments