mirror of
https://github.com/lancedb/lancedb.git
synced 2026-05-20 13:30:41 +00:00
ci(node): check docs in CI (#2084)
* Make `npm run docs` fail if there are any warnings. This will catch items missing from the API reference. * Add a check in our CI to make sure `npm run dos` runs without warnings and doesn't generate any new files (indicating it might be out-of-date. * Hide constructors that aren't user facing. * Remove unused enum `WriteMode`. Closes #2068
This commit is contained in:
@@ -78,7 +78,7 @@ export abstract class EmbeddingFunction<
|
||||
*
|
||||
* @param optionsOrDatatype - The options for the field or the datatype
|
||||
*
|
||||
* @see {@link lancedb.LanceSchema}
|
||||
* @see {@link LanceSchema}
|
||||
*/
|
||||
sourceField(
|
||||
optionsOrDatatype: Partial<FieldOptions> | DataType,
|
||||
@@ -100,9 +100,9 @@ export abstract class EmbeddingFunction<
|
||||
/**
|
||||
* vectorField is used in combination with `LanceSchema` to provide a declarative data model
|
||||
*
|
||||
* @param options - The options for the field
|
||||
* @param optionsOrDatatype - The options for the field
|
||||
*
|
||||
* @see {@link lancedb.LanceSchema}
|
||||
* @see {@link LanceSchema}
|
||||
*/
|
||||
vectorField(
|
||||
optionsOrDatatype?: Partial<FieldOptions> | DataType,
|
||||
|
||||
@@ -6,7 +6,13 @@ import { sanitizeType } from "../sanitize";
|
||||
import { EmbeddingFunction } from "./embedding_function";
|
||||
import { EmbeddingFunctionConfig, getRegistry } from "./registry";
|
||||
|
||||
export { EmbeddingFunction, TextEmbeddingFunction } from "./embedding_function";
|
||||
export {
|
||||
FieldOptions,
|
||||
EmbeddingFunction,
|
||||
TextEmbeddingFunction,
|
||||
FunctionOptions,
|
||||
EmbeddingFunctionConstructor,
|
||||
} from "./embedding_function";
|
||||
|
||||
export * from "./registry";
|
||||
|
||||
|
||||
@@ -7,11 +7,11 @@ import {
|
||||
} from "./embedding_function";
|
||||
import "reflect-metadata";
|
||||
|
||||
type CreateReturnType<T> = T extends { init: () => Promise<void> }
|
||||
export type CreateReturnType<T> = T extends { init: () => Promise<void> }
|
||||
? Promise<T>
|
||||
: T;
|
||||
|
||||
interface EmbeddingFunctionCreate<T extends EmbeddingFunction> {
|
||||
export interface EmbeddingFunctionCreate<T extends EmbeddingFunction> {
|
||||
create(options?: T["TOptions"]): CreateReturnType<T>;
|
||||
}
|
||||
|
||||
@@ -33,8 +33,6 @@ export class EmbeddingFunctionRegistry {
|
||||
|
||||
/**
|
||||
* Register an embedding function
|
||||
* @param name The name of the function
|
||||
* @param func The function to register
|
||||
* @throws Error if the function is already registered
|
||||
*/
|
||||
register<
|
||||
|
||||
Reference in New Issue
Block a user