1212// See the License for the specific language governing permissions and
1313// limitations under the License.
1414
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+
1550/**
1651 * The overarching result containing the `embeddingProviders` map.
1752 *
@@ -26,7 +61,7 @@ export interface FindEmbeddingProvidersResult {
2661 * A map of embedding provider names (e.g. `openai`), to information about said provider (e.g. models/auth).
2762 *
2863 * @example
29- * ```typescript
64+ * ```ts
3065 * {
3166 * openai: {
3267 * displayName: 'OpenAI',
@@ -56,7 +91,7 @@ export interface EmbeddingProviderInfo {
5691 * The prettified name of the provider (as shown in the Astra portal).
5792 *
5893 * @example
59- * ```typescript
94+ * ```ts
6095 * // openai.displayName:
6196 * 'OpenAI'
6297 * ```
@@ -69,7 +104,7 @@ export interface EmbeddingProviderInfo {
69104 * parameters (such as `huggingfaceDedicated` or `azureOpenAI`).
70105 *
71106 * @example
72- * ```typescript
107+ * ```ts
73108 * // openai.url:
74109 * 'https://api.openai.com/v1/'
75110 *
@@ -85,7 +120,7 @@ export interface EmbeddingProviderInfo {
85120 *
86121 * - `HEADER`: Authentication using direct API keys passed through headers on every Data API call.
87122 * See {@link EmbeddingHeadersProvider} for more info.
88- * ```typescript
123+ * ```ts
89124 * const collections = await db.createCollection('my_coll', {
90125 * vector: {
91126 * service: {
@@ -101,15 +136,15 @@ export interface EmbeddingProviderInfo {
101136 * ```
102137 *
103138 * - `SHARED_SECRET`: Authentication tied to a collections at collections creation time using the Astra KMS.
104- * ```typescript
139+ * ```ts
105140 * const collections = await db.collections('my_coll', {
106141 * // Not tied to the collections; can be different every time.
107142 * embeddingApiKey: 'sk-...',
108143 * });
109144 * ```
110145 *
111146 * - `NONE`: For when a client doesn't need authentication to use (e.g. nvidia).
112- * ```typescript
147+ * ```ts
113148 * const collections = await db.createCollection('my_coll', {
114149 * vector: {
115150 * service: {
@@ -121,7 +156,7 @@ export interface EmbeddingProviderInfo {
121156 * ```
122157 *
123158 * @example
124- * ```typescript
159+ * ```ts
125160 * // openai.supportedAuthentication.HEADER:
126161 * {
127162 * enabled: true,
@@ -132,14 +167,14 @@ export interface EmbeddingProviderInfo {
132167 * }
133168 * ```
134169 */
135- supportedAuthentication : Record < string , EmbeddingProviderAuthInfo > ,
170+ supportedAuthentication : Record < LitUnion < 'HEADER' | 'SHARED_SECRET' | 'NONE' > , EmbeddingProviderAuthInfo > ,
136171 /**
137172 * Any additional, arbitrary parameters the provider may take in. May or may not be required.
138173 *
139174 * Passed into the `parameters` block in {@link VectorizeServiceOptions} (except for `vectorDimension`).
140175 *
141176 * @example
142- * ```typescript
177+ * ```ts
143178 * // openai.parameters[1]
144179 * {
145180 * name: 'projectId',
@@ -159,7 +194,7 @@ export interface EmbeddingProviderInfo {
159194 * may be truly arbitrary.
160195 *
161196 * @example
162- * ```typescript
197+ * ```ts
163198 * // nvidia.models[0]
164199 * {
165200 * name: 'NV-Embed-QA',
@@ -194,7 +229,7 @@ export interface EmbeddingProviderInfo {
194229 * See {@link EmbeddingHeadersProvider} for more info about the `HEADER` auth through the client.
195230 *
196231 * @example
197- * ```typescript
232+ * ```ts
198233 * // openai.supportedAuthentication.HEADER:
199234 * {
200235 * enabled: true,
@@ -231,7 +266,7 @@ export interface EmbeddingProviderAuthInfo {
231266 * Info on how exactly a method of auth may be used.
232267 *
233268 * @example
234- * ```typescript
269+ * ```ts
235270 * // openai.supportedAuthentication.HEADER.tokens[0]:
236271 * {
237272 * accepted: 'x-embedding-api-key',
@@ -268,7 +303,7 @@ export interface EmbeddingProviderTokenInfo {
268303 * set in the upper-level `dimension: number` field).
269304 *
270305 * @example
271- * ```typescript
306+ * ```ts
272307 * // openai.parameters[1]
273308 * {
274309 * name: 'vectorDimension',
@@ -300,7 +335,7 @@ export interface EmbeddingProviderModelParameterInfo {
300335 * `vector` block in {@link CollectionVectorOptions}/{@link TableVectorColumnDefinition }.
301336 *
302337 * @example
303- * ```typescript
338+ * ```ts
304339 * // huggingface.parameters[0].name
305340 * endpointName
306341 * ```
@@ -312,7 +347,7 @@ export interface EmbeddingProviderModelParameterInfo {
312347 * Commonly `number` or `STRING`.
313348 *
314349 * @example
315- * ```typescript
350+ * ```ts
316351 * // huggingface.parameters[0].type
317352 * STRING
318353 * ```
@@ -322,7 +357,7 @@ export interface EmbeddingProviderModelParameterInfo {
322357 * Whether the parameter is required to be passed in.
323358 *
324359 * @example
325- * ```typescript
360+ * ```ts
326361 * // huggingface.parameters[0].required
327362 * true
328363 * ```
@@ -334,7 +369,7 @@ export interface EmbeddingProviderModelParameterInfo {
334369 * Will always be in string form (even if the `type` is `'number'`).
335370 *
336371 * @example
337- * ```typescript
372+ * ```ts
338373 * // huggingface.parameters[0].defaultValue
339374 * ''
340375 * ```
@@ -346,7 +381,7 @@ export interface EmbeddingProviderModelParameterInfo {
346381 * Commonly either an empty record, or `{ numericRange: [<min>, <max>] }`.
347382 *
348383 * @example
349- * ```typescript
384+ * ```ts
350385 * // huggingface.parameters[0].validation
351386 * {}
352387 * ```
@@ -356,7 +391,7 @@ export interface EmbeddingProviderModelParameterInfo {
356391 * Any additional help text/information about the parameter.
357392 *
358393 * @example
359- * ```typescript
394+ * ```ts
360395 * // huggingface.parameters[0].help
361396 * 'The name of your Hugging Face dedicated endpoint, the first part of the Endpoint URL.'
362397 * ```
@@ -371,7 +406,7 @@ export interface EmbeddingProviderModelParameterInfo {
371406 * set in the upper-level `dimension: number` field).
372407 *
373408 * @example
374- * ```typescript
409+ * ```ts
375410 * // openai.parameters[1]
376411 * {
377412 * name: 'projectId',
@@ -404,7 +439,7 @@ export interface EmbeddingProviderProviderParameterInfo extends EmbeddingProvide
404439 * Display name for the parameter.
405440 *
406441 * @example
407- * ```typescript
442+ * ```ts
408443 * // openai.parameters[0].displayName
409444 * 'Organization ID'
410445 * ```
@@ -414,7 +449,7 @@ export interface EmbeddingProviderProviderParameterInfo extends EmbeddingProvide
414449 * Hint for parameter usage.
415450 *
416451 * @example
417- * ```typescript
452+ * ```ts
418453 * // openai.parameters[0].hint
419454 * 'Add an (optional) organization ID'
420455 * ```
@@ -429,7 +464,7 @@ export interface EmbeddingProviderProviderParameterInfo extends EmbeddingProvide
429464 * may be truly arbitrary.
430465 *
431466 * @example
432- * ```typescript
467+ * ```ts
433468 * // nvidia.models[0]
434469 * {
435470 * name: 'NV-Embed-QA',
@@ -454,7 +489,7 @@ export interface EmbeddingProviderModelInfo {
454489 * may be truly arbitrary.
455490 *
456491 * @example
457- * ```typescript
492+ * ```ts
458493 * // openai.models[0].name
459494 * 'text-embedding-3-small'
460495 *
@@ -469,7 +504,7 @@ export interface EmbeddingProviderModelInfo {
469504 * If not present, a `vectorDimension` parameter will be present in the `model.parameters` block.
470505 *
471506 * @example
472- * ```typescript
507+ * ```ts
473508 * // openai.models[3].vectorDimension (text-embedding-ada-002)
474509 * 1536
475510 *
@@ -484,7 +519,7 @@ export interface EmbeddingProviderModelInfo {
484519 * Passed into the `parameters` block in {@link VectorizeServiceOptions} (except for `vectorDimension`).
485520 *
486521 * @example
487- * ```typescript
522+ * ```ts
488523 * // openai.models[0].parameters[0] (text-embedding-3-small)
489524 * {
490525 * name: 'vectorDimension',
@@ -497,4 +532,36 @@ export interface EmbeddingProviderModelInfo {
497532 * ```
498533 */
499534 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 ,
500567}
0 commit comments