repo_name
string
dataset
string
owner
string
lang
string
func_name
string
code
string
docstring
string
url
string
sha
string
project-lakechain
github_2023
awslabs
typescript
LanceDbStorageConnectorBuilder.withStorageProvider
public withStorageProvider(storageProvider: LanceDbStorageConnectorProps['storageProvider']) { this.providerProps.storageProvider = storageProvider; return (this); }
/** * Sets the storage provider to use. * @param storageProvider the storage provider to use. * @returns the builder instance. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/lancedb-storage-connector/src/index.ts#L78-L81
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
LanceDbStorageConnectorBuilder.withTableName
public withTableName(tableName: string) { this.providerProps.tableName = tableName; return (this); }
/** * Sets the name of the table in LanceDB. * @param tableName the name of the table in LanceDB. * @returns the builder instance. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/lancedb-storage-connector/src/index.ts#L88-L91
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
LanceDbStorageConnectorBuilder.withVectorSize
public withVectorSize(vectorSize: number) { this.providerProps.vectorSize = vectorSize; return (this); }
/** * Sets the size of the vector embeddings. * @param vectorSize the size of the vector embeddings. * @returns the builder instance. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/lancedb-storage-connector/src/index.ts#L98-L101
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
LanceDbStorageConnectorBuilder.withIncludeText
public withIncludeText(includeText: boolean) { this.providerProps.includeText = includeText; return (this); }
/** * Sets whether to include the text associated * with the embeddings in LanceDB. * @param includeText whether to include the text * associated with the embeddings in LanceDB. * @default false * @returns the builder instance. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/lancedb-storage-connector/src/index.ts#L111-L114
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
LanceDbStorageConnectorBuilder.build
public build(): LanceDbStorageConnector { return (new LanceDbStorageConnector( this.scope, this.identifier, { ...this.providerProps as LanceDbStorageConnectorProps, ...this.props } )); }
/** * @returns a new instance of the `LanceDbStorageConnector` * service constructed with the given parameters. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/lancedb-storage-connector/src/index.ts#L120-L128
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
LanceDbStorageConnector.constructor
constructor(scope: Construct, id: string, props: LanceDbStorageConnectorProps) { super(scope, id, description, { ...props, queueVisibilityTimeout: cdk.Duration.seconds( 2 * PROCESSING_TIMEOUT.toSeconds() ) }); // Validate the properties. props = this.parse(LanceDbStorageConnec...
/** * LanceDb data store constructor. * @param scope the construct scope. * @param id the construct identifier. * @param props the construct properties. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/lancedb-storage-connector/src/index.ts#L158-L248
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
LanceDbStorageConnector.grantReadProcessedDocuments
grantReadProcessedDocuments(_: iam.IGrantable): iam.Grant { return ({} as iam.Grant); }
/** * Allows a grantee to read from the processed documents * generated by this middleware. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/lancedb-storage-connector/src/index.ts#L254-L256
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
LanceDbStorageConnector.supportedInputTypes
supportedInputTypes(): string[] { return ([ '*/*' ]); }
/** * @returns an array of mime-types supported as input * type by this middleware. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/lancedb-storage-connector/src/index.ts#L262-L266
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
LanceDbStorageConnector.supportedOutputTypes
supportedOutputTypes(): string[] { return ([]); }
/** * @returns an array of mime-types supported as output * type by this middleware. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/lancedb-storage-connector/src/index.ts#L272-L274
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
LanceDbStorageConnector.supportedComputeTypes
supportedComputeTypes(): ComputeType[] { return ([ ComputeType.CPU ]); }
/** * @returns the supported compute types by a given * middleware. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/lancedb-storage-connector/src/index.ts#L280-L284
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
LanceDbStorageConnector.conditional
conditional() { return (super .conditional() .and(when('type').equals('document-created')) .and(when('data.metadata.properties.attrs.embeddings.vectors').exists()) ); }
/** * @returns the middleware conditional statement defining * in which conditions this middleware should be executed. * In this case, we want the middleware to only be invoked * when the document mime-type is supported, the event * type is `document-created`, and embeddings are available * in the doc...
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/lancedb-storage-connector/src/index.ts#L294-L300
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
EfsStorageProviderBuilder.withScope
public withScope(scope: Construct): EfsStorageProviderBuilder { this.scope = scope; return (this); }
/** * Sets the construct scope. * @param scope the construct scope. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/lancedb-storage-connector/src/definitions/storage/efs/index.ts#L98-L101
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
EfsStorageProviderBuilder.withIdentifier
public withIdentifier(id: string): EfsStorageProviderBuilder { this.id = id; return (this); }
/** * Sets the construct identifier. * @param id the construct identifier. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/lancedb-storage-connector/src/definitions/storage/efs/index.ts#L107-L110
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
EfsStorageProviderBuilder.withFileSystem
public withFileSystem(fileSystem: efs.IFileSystem): EfsStorageProviderBuilder { this.props.efs = fileSystem; return (this); }
/** * Sets the EFS file system. * @param fileSystem the EFS file system. * @returns a reference to the builder. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/lancedb-storage-connector/src/definitions/storage/efs/index.ts#L117-L120
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
EfsStorageProviderBuilder.withVpc
public withVpc(vpc: ec2.IVpc): EfsStorageProviderBuilder { this.props.vpc = vpc; return (this); }
/** * Sets the VPC in which the EFS storage should be deployed. * @param vpc the VPC in which the EFS storage should be deployed. * @returns a reference to the builder. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/lancedb-storage-connector/src/definitions/storage/efs/index.ts#L127-L130
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
EfsStorageProviderBuilder.withPath
public withPath(path: string): EfsStorageProviderBuilder { this.props.path = path; return (this); }
/** * Sets the path to the LanceDB dataset in the bucket. * @param path the path to the LanceDB dataset in the bucket. * @returns a reference to the builder. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/lancedb-storage-connector/src/definitions/storage/efs/index.ts#L137-L140
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
EfsStorageProviderBuilder.build
public build(): EfsStorageProvider { return (EfsStorageProvider.from( this.scope, this.id, this.props )); }
/** * Builds the EFS storage properties. * @returns a new instance of the `EfsStorageProvider` class. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/lancedb-storage-connector/src/definitions/storage/efs/index.ts#L146-L152
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
EfsStorageProvider.constructor
constructor(scope: Construct, resourceId: string, public props: EfsStorageProviderProps) { super(scope, resourceId); // Set the file system. this.fileSystem = props.efs; // Create the access point. this.accessPoint = new efs.AccessPoint(this, 'AccessPoint', { fileSystem: this.fileSystem,...
/** * Creates a new instance of the `EfsStorageProvider` class. * @param scope the construct scope. * @param resourceId the construct identifier. * @param props the task properties. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/lancedb-storage-connector/src/definitions/storage/efs/index.ts#L181-L201
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
EfsStorageProvider.id
public id(): string { return (this.props.id); }
/** * @returns the storage identifier. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/lancedb-storage-connector/src/definitions/storage/efs/index.ts#L206-L208
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
EfsStorageProvider.efs
public efs(): efs.IFileSystem { return (this.fileSystem); }
/** * @returns the file system. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/lancedb-storage-connector/src/definitions/storage/efs/index.ts#L213-L215
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
EfsStorageProvider.vpc
public vpc(): ec2.IVpc { return (this.props.vpc); }
/** * @returns the VPC. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/lancedb-storage-connector/src/definitions/storage/efs/index.ts#L220-L222
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
EfsStorageProvider.path
public path(): string { return (this.props.path); }
/** * @returns the storage path. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/lancedb-storage-connector/src/definitions/storage/efs/index.ts#L227-L229
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
EfsStorageProvider.uri
public uri(): string { return (path.join('/', 'mnt', 'efs', this.path())); }
/** * @returns the storage URI. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/lancedb-storage-connector/src/definitions/storage/efs/index.ts#L234-L236
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
EfsStorageProvider.grant
grant(grantee: iam.IGrantable) { this.fileSystem.grantReadWrite(grantee); }
/** * Grants permissions to an `IGrantable`. * @param grantee the grantee to whom permissions should be granted. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/lancedb-storage-connector/src/definitions/storage/efs/index.ts#L242-L244
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
EfsStorageProvider.from
public static from(scope: Construct, id: string, props: any) { return (new EfsStorageProvider(scope, id, EfsStorageProviderPropsSchema.parse(props))); }
/** * Creates a new instance of the `EfsStorageProvider` class. * @param scope the construct scope. * @param id the construct identifier. * @param props the storage properties. * @returns a new instance of the `EfsStorageProvider` class. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/lancedb-storage-connector/src/definitions/storage/efs/index.ts#L253-L255
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
EfsStorageProvider.toJSON
public toJSON() { return ({ id: this.id(), path: this.path(), uri: this.uri() }); }
/** * @returns the JSON representation of the storage. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/lancedb-storage-connector/src/definitions/storage/efs/index.ts#L260-L266
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
S3StorageProviderBuilder.withScope
public withScope(scope: Construct): S3StorageProviderBuilder { this.scope = scope; return (this); }
/** * Sets the construct scope. * @param scope the construct scope. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/lancedb-storage-connector/src/definitions/storage/s3/index.ts#L86-L89
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
S3StorageProviderBuilder.withIdentifier
public withIdentifier(id: string): S3StorageProviderBuilder { this.id = id; return (this); }
/** * Sets the construct identifier. * @param id the construct identifier. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/lancedb-storage-connector/src/definitions/storage/s3/index.ts#L95-L98
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
S3StorageProviderBuilder.withPath
public withPath(path: string): S3StorageProviderBuilder { this.props.path = path; return (this); }
/** * Sets the path to the LanceDB dataset in the bucket. * @param path the path to the LanceDB dataset in the bucket. * @returns a reference to the builder. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/lancedb-storage-connector/src/definitions/storage/s3/index.ts#L105-L108
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
S3StorageProviderBuilder.withBucket
public withBucket(bucket: s3.IBucket): S3StorageProviderBuilder { this.props.bucket = bucket; return (this); }
/** * Sets the bucket to use as a storage. * @param bucket the bucket to use as a storage. * @returns a reference to the builder. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/lancedb-storage-connector/src/definitions/storage/s3/index.ts#L115-L118
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
S3StorageProviderBuilder.build
public build(): S3StorageProvider { return (S3StorageProvider.from( this.scope, this.id, this.props )); }
/** * Builds the S3 storage properties. * @returns a new instance of the `S3StorageProvider` class. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/lancedb-storage-connector/src/definitions/storage/s3/index.ts#L124-L130
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
S3StorageProvider.constructor
constructor(scope: Construct, resourceId: string, public props: S3StorageProviderProps) { super(scope, resourceId); // Set the bucket. this.bucketStorage = props.bucket; // Create the DynamoDB table. this.table = new dynamodb.Table(this, 'Table', { partitionKey: { name: 'base_uri', ...
/** * Creates a new instance of the `S3StorageProvider` class. * @param scope the construct scope. * @param resourceId the construct identifier. * @param props the task properties. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/lancedb-storage-connector/src/definitions/storage/s3/index.ts#L159-L178
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
S3StorageProvider.id
public id(): string { return (this.props.id); }
/** * @returns the storage identifier. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/lancedb-storage-connector/src/definitions/storage/s3/index.ts#L183-L185
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
S3StorageProvider.bucket
public bucket(): s3.IBucket { return (this.bucketStorage); }
/** * @returns the storage bucket. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/lancedb-storage-connector/src/definitions/storage/s3/index.ts#L190-L192
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
S3StorageProvider.path
public path(): string { return (this.props.path); }
/** * @returns the storage path. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/lancedb-storage-connector/src/definitions/storage/s3/index.ts#L197-L199
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
S3StorageProvider.uri
public uri(): string { return (`s3+ddb://${this.bucketStorage.bucketName}/${this.path()}?ddbTableName=${this.table.tableName}`); }
/** * @returns the storage URI. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/lancedb-storage-connector/src/definitions/storage/s3/index.ts#L204-L206
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
S3StorageProvider.grant
grant(grantee: iam.IGrantable) { // Allow the processor to read and write to the DynamoDB table. this.table.grantReadWriteData(grantee); // Allow the processor to read and write to the S3 bucket. this.bucketStorage.grantReadWrite(grantee); }
/** * Grants permissions to an `IGrantable`. * @param grantee the grantee to whom permissions should be granted. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/lancedb-storage-connector/src/definitions/storage/s3/index.ts#L212-L217
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
S3StorageProvider.from
public static from(scope: Construct, id: string, props: any) { return (new S3StorageProvider(scope, id, S3StorageProviderPropsSchema.parse(props))); }
/** * Creates a new instance of the `S3StorageProvider` class. * @param scope the construct scope. * @param id the construct identifier. * @param props the storage properties. * @returns a new instance of the `S3StorageProvider` class. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/lancedb-storage-connector/src/definitions/storage/s3/index.ts#L226-L228
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
S3StorageProvider.toJSON
public toJSON() { return ({ id: this.id(), path: this.path(), uri: this.uri() }); }
/** * @returns the JSON representation of the storage. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/lancedb-storage-connector/src/definitions/storage/s3/index.ts#L233-L239
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
Lambda.getId
private getId(event: CloudEvent) { const metadata = event.data().metadata(); // If there is a chunk identifier that specifically // identifies a chunk associated with the given document, // we use that. if (metadata.properties?.kind === 'text' && metadata.properties.attrs?.chunk) { retu...
/** * @param event the event associated with the * received document. * @returns a unique identifier for the given * document that is fit to identify the vectors * associated with the document. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/lancedb-storage-connector/src/lambdas/processor/index.ts#L45-L57
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
Lambda.getEmbeddings
private getEmbeddings(event: CloudEvent): Promise<number[]> { const metadata = event.data().metadata(); if (metadata.properties?.kind !== 'text' || !metadata.properties.attrs.embeddings) { throw new Error('The event does not contain embeddings.'); } return (metadata.properties.attrs.embedd...
/** * @param event the event associated with the * received document. * @returns a vector embedding object associated * with the document. * @throws if the vector embedding object could not * be resolved. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/lancedb-storage-connector/src/lambdas/processor/index.ts#L67-L76
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
Lambda.getTable
private async getTable(): Promise<lancedb.Table> { const db = await lancedb.connect(LANCEDB_STORAGE.uri); let table: lancedb.Table; try { // Attempt to open the table. table = await db.openTable(LANCEDB_TABLE_NAME); } catch (e) { // If the table does not exist, we create it. tab...
/** * Retrieves the table to use to store events and embeddings. * @returns a promise resolved with the table object. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/lancedb-storage-connector/src/lambdas/processor/index.ts#L82-L98
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
Lambda.getText
private async getText(event: CloudEvent): Promise<string | null> { const metadata = event.data().metadata(); const document = event.data().document(); if (metadata.properties?.kind === 'text') { return ((await document.data().asBuffer()).toString('utf-8')); } return (null); }
/** * A helper returning a textual representation of the document * to include within the index. * @param event the event associated with the * received document. * @returns a string representation of the * document, null if the document is not text. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/lancedb-storage-connector/src/lambdas/processor/index.ts#L108-L116
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
Lambda.handler
async handler(event: SQSEvent, _: Context) { const table = await this.getTable(); const data = []; // Combine all received events into a single batch. for (const record of event.Records) { const event = CloudEvent.from(JSON.parse(record.body)); data.push({ ...normalizeEvent(event),...
// eslint-disable-next-line @typescript-eslint/no-unused-vars
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/lancedb-storage-connector/src/lambdas/processor/index.ts#L126-L143
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
Neo4jStorageConnectorBuilder.withUri
public withUri(uri: string): Neo4jStorageConnectorBuilder { this.providerProps.uri = uri; return (this); }
/** * Sets the URI for the Neo4j API. * @param uri the URI for the Neo4j API. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/neo4j-storage-connector/src/index.ts#L74-L77
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
Neo4jStorageConnectorBuilder.withCredentials
public withCredentials(credentials: secrets.ISecret): Neo4jStorageConnectorBuilder { this.providerProps.credentials = credentials; return (this); }
/** * Sets the credentials to use for the Neo4j API. * @param credentials the credentials to use for the Neo4j API. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/neo4j-storage-connector/src/index.ts#L83-L86
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
Neo4jStorageConnectorBuilder.build
public build(): Neo4jStorageConnector { return (new Neo4jStorageConnector( this.scope, this.identifier, { ...this.providerProps as Neo4jStorageConnectorProps, ...this.props } )); }
/** * @returns a new instance of the `Neo4jStorageConnector` * service constructed with the given parameters. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/neo4j-storage-connector/src/index.ts#L92-L100
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
Neo4jStorageConnector.constructor
constructor(scope: Construct, id: string, props: Neo4jStorageConnectorProps) { super(scope, id, description, { ...props, queueVisibilityTimeout: cdk.Duration.seconds( 6 * PROCESSING_TIMEOUT.toSeconds() ) }); // Validate the properties. props = this.parse(Neo4jStorageConnectorP...
/** * Neo4j data store constructor. * @param scope the construct scope. * @param id the construct identifier. * @param props the construct properties. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/neo4j-storage-connector/src/index.ts#L125-L188
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
Neo4jStorageConnector.grantReadProcessedDocuments
grantReadProcessedDocuments(_: iam.IGrantable): iam.Grant { return ({} as iam.Grant); }
/** * Allows a grantee to read from the processed documents * generated by this middleware. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/neo4j-storage-connector/src/index.ts#L194-L196
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
Neo4jStorageConnector.supportedInputTypes
supportedInputTypes(): string[] { return ([ '*/*' ]); }
/** * @returns an array of mime-types supported as input * type by this middleware. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/neo4j-storage-connector/src/index.ts#L202-L206
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
Neo4jStorageConnector.supportedOutputTypes
supportedOutputTypes(): string[] { return ([]); }
/** * @returns an array of mime-types supported as output * type by this middleware. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/neo4j-storage-connector/src/index.ts#L212-L214
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
Neo4jStorageConnector.supportedComputeTypes
supportedComputeTypes(): ComputeType[] { return ([ ComputeType.CPU ]); }
/** * @returns the supported compute types by a given * middleware. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/neo4j-storage-connector/src/index.ts#L220-L224
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
Neo4jStorageConnector.conditional
conditional() { return (super .conditional() .and(when('type').equals('document-created')) ); }
/** * @returns the middleware conditional statement defining * in which conditions this middleware should be executed. * In this case, we want the middleware to only be invoked * when the document mime-type is supported, and the event * type is `document-created`. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/neo4j-storage-connector/src/index.ts#L233-L238
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
Lambda.sanitize
private sanitize(str: string, maxLength = 128): string { if (str.length > maxLength || !/^[a-zA-Z0-9_]+$/.test(str)) { throw new Error( `Invalid value: ${str}. Only alphanumeric characters and underscores are allowed, and values must not exceed ${maxLength} characters.` ); } return (str)...
/** * Sanitizes a string. * @param str the string to sanitize. * @param maxLength the maximum length of the string. * @throws an error if the string is invalid. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/neo4j-storage-connector/src/lambdas/processor/index.ts#L46-L53
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
Lambda.recordHandler
async recordHandler(record: SQSRecord): Promise<void> { const event = CloudEvent.from(JSON.parse(record.body)); const graph = await event.asGraph(); const client = await createClient(); const session = client.session(); try { await session.executeWrite(async (tx) => { //...
/** * Writes the document graph in the Neo4j database. * @param record the SQS record associated with * the received document. * @returns a promise resolved when the document graph * has been written in the database. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/neo4j-storage-connector/src/lambdas/processor/index.ts#L62-L101
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
Lambda.handler
async handler(event: SQSEvent, _: Context) { return (await processPartialResponse( event, this.recordHandler.bind(this), processor )); }
// eslint-disable-next-line @typescript-eslint/no-unused-vars
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/neo4j-storage-connector/src/lambdas/processor/index.ts#L111-L115
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
OpenSearchStorageConnectorBuilder.withDomain
public withDomain(domain: opensearch.Domain) { this.providerProps.domain = domain; return (this); }
/** * Specifies the OpenSearch domain to use. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/opensearch-storage-connector/src/index.ts#L56-L59
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
OpenSearchStorageConnectorBuilder.withIndexName
public withIndexName(index: string) { this.providerProps.index = index; return (this); }
/** * Specifies the name of the index to use. * @param index the name of the index. * @returns the current builder instance. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/opensearch-storage-connector/src/index.ts#L66-L69
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
OpenSearchStorageConnectorBuilder.withBufferingHints
public withBufferingHints(hints: firehose.CfnDeliveryStream.BufferingHintsProperty) { this.providerProps.bufferingHints = hints; return (this); }
/** * Specifies buffering hints to apply on the Firehose * delivery stream. * @param hints the buffering hints. * @returns the current builder instance. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/opensearch-storage-connector/src/index.ts#L77-L80
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
OpenSearchStorageConnectorBuilder.withIndexRotationPeriod
public withIndexRotationPeriod(period: IndexRotationPeriod) { this.providerProps.indexRotationPeriod = period; return (this); }
/** * Specifies the index rotation period to apply * when inserting data in OpenSearch. * @param period the index rotation period. * @returns the current builder instance. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/opensearch-storage-connector/src/index.ts#L88-L91
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
OpenSearchStorageConnectorBuilder.build
public build(): OpenSearchStorageConnector { return (new OpenSearchStorageConnector( this.scope, this.identifier, { ...this.providerProps as OpenSearchStorageConnectorProps, ...this.props } )); }
/** * @returns a new instance of the `OpenSearchStorageConnector` * service constructed with the given parameters. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/opensearch-storage-connector/src/index.ts#L97-L105
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
OpenSearchStorageConnector.constructor
constructor(scope: Construct, id: string, private props: OpenSearchStorageConnectorProps) { super(scope, id, description, props); // Validate the properties. this.props = this.parse(OpenSearchStorageConnectorPropsSchema, props); /////////////////////////////////////////// ///// Firehose Bucket ...
/** * Construct constructor. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/opensearch-storage-connector/src/index.ts#L141-L216
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
OpenSearchStorageConnector.getInput
public getInput() { return (this.deliveryStream); }
/** * We override the `getInput` method to allow the previous middlewares * to write their data directly to the Firehose delivery stream. * @returns the Firehose delivery stream that should be used by * the previous middlewares to write their data. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/opensearch-storage-connector/src/index.ts#L224-L226
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
OpenSearchStorageConnector.getFirehoseRole
private getFirehoseRole(id: string): iam.IRole { const policy = new iam.PolicyDocument({ statements:[ // VPC Policy new iam.PolicyStatement({ effect: iam.Effect.ALLOW, actions: [ 'ec2:DescribeVpcs', 'ec2:DescribeVpcAttribute', 'ec2:Descri...
/** * Creates the IAM role to be used by the Firehose * delivery stream. * @param id the identifier of the role. * @returns the created role. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/opensearch-storage-connector/src/index.ts#L234-L324
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
OpenSearchStorageConnector.grantReadProcessedDocuments
grantReadProcessedDocuments(_: iam.IGrantable): iam.Grant { return ({} as iam.Grant); }
/** * Allows a grantee to read from the processed documents * generated by this middleware. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/opensearch-storage-connector/src/index.ts#L330-L332
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
OpenSearchStorageConnector.supportedInputTypes
supportedInputTypes(): string[] { return ([ '*/*' ]); }
/** * @returns an array of mime-types supported as input * type by this middleware. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/opensearch-storage-connector/src/index.ts#L338-L342
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
OpenSearchStorageConnector.supportedOutputTypes
supportedOutputTypes(): string[] { return ([]); }
/** * @returns an array of mime-types supported as output * type by the data producer. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/opensearch-storage-connector/src/index.ts#L348-L350
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
OpenSearchStorageConnector.supportedComputeTypes
supportedComputeTypes(): ComputeType[] { return ([ ComputeType.CPU ]); }
/** * @returns the supported compute types by a given * middleware. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/opensearch-storage-connector/src/index.ts#L356-L360
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
OpenSearchVectorStorageConnectorBuilder.withEndpoint
public withEndpoint(endpoint: opensearch.IDomain | oss.ICollection | opensearchserverless.CfnCollection) { const e = endpoint as any; if (e.collectionName && e.collectionArn && e.collectionId && e.collectionEndpoint) { endpoint = oss.Collection.fromCollectionAttributes(this.scope, 'Collection', { ...
/** * Specifies the OpenSearch endpoint to use. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/opensearch-vector-storage-connector/src/index.ts#L82-L96
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
OpenSearchVectorStorageConnectorBuilder.withIndex
public withIndex(index: OpenSearchVectorIndexDefinition) { this.providerProps.index = index; return (this); }
/** * Specifies the definition of the index to use. * @param index the index definition. * @returns the current builder instance. * @see https://opensearch.org/docs/latest/search-plugins/knn/knn-index#method-definitions */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/opensearch-vector-storage-connector/src/index.ts#L104-L107
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
OpenSearchVectorStorageConnectorBuilder.withIncludeDocument
public withIncludeDocument(includeDocument: boolean) { this.providerProps.includeDocument = includeDocument; return (this); }
/** * Specifies whether to include the document associated * with the embeddings in the OpenSearch index. * @param includeDocument whether to include the document. * @returns the current builder instance. * @default true */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/opensearch-vector-storage-connector/src/index.ts#L116-L119
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
OpenSearchVectorStorageConnectorBuilder.build
public build(): OpenSearchVectorStorageConnector { return (new OpenSearchVectorStorageConnector( this.scope, this.identifier, { ...this.providerProps as OpenSearchVectorStorageConnectorProps, ...this.props } )); }
/** * @returns a new instance of the `OpenSearchVectorStorageConnector` * service constructed with the given parameters. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/opensearch-vector-storage-connector/src/index.ts#L125-L133
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
OpenSearchVectorStorageConnector.constructor
constructor(scope: Construct, id: string, private props: OpenSearchVectorStorageConnectorProps) { super(scope, id, description, props); // Validate the properties. this.props = this.parse(OpenSearchVectorStorageConnectorPropsSchema, props); /////////////////////////////////////////////// /////// ...
/** * Construct constructor. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/opensearch-vector-storage-connector/src/index.ts#L155-L283
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
OpenSearchVectorStorageConnector.getEndpoint
private getEndpoint(endpoint: opensearch.IDomain | oss.ICollection): string { const serviceIdentifier = this.getServiceIdentifier(endpoint); if (serviceIdentifier === 'es') { return (`https://${(endpoint as opensearch.Domain).domainEndpoint}`); } else if (serviceIdentifier === 'aoss') { return ...
/** * Get the URL of the OpenSearch endpoint. * @param endpoint the OpenSearch endpoint. * @returns the endpoint URL. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/opensearch-vector-storage-connector/src/index.ts#L290-L300
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
OpenSearchVectorStorageConnector.getServiceIdentifier
private getServiceIdentifier(endpoint: opensearch.IDomain | oss.ICollection): ServiceIdentifier { const e = endpoint as any; if (e.domainArn && e.domainName && e.domainId && e.domainEndpoint) { return ('es'); } else if (e.collectionName && e.collectionArn && e.collec...
/** * Get the service identifier of the OpenSearch endpoint. * @param endpoint the OpenSearch endpoint. * @returns a string identifying the service. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/opensearch-vector-storage-connector/src/index.ts#L307-L323
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
OpenSearchVectorStorageConnector.grantReadProcessedDocuments
grantReadProcessedDocuments(_: iam.IGrantable): iam.Grant { return ({} as iam.Grant); }
/** * Allows a grantee to read from the processed documents * generated by this middleware. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/opensearch-vector-storage-connector/src/index.ts#L329-L331
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
OpenSearchVectorStorageConnector.supportedInputTypes
supportedInputTypes(): string[] { return ([ '*/*' ]); }
/** * @returns an array of mime-types supported as input * type by this middleware. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/opensearch-vector-storage-connector/src/index.ts#L337-L341
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
OpenSearchVectorStorageConnector.supportedOutputTypes
supportedOutputTypes(): string[] { return ([]); }
/** * @returns an array of mime-types supported as output * type by the data producer. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/opensearch-vector-storage-connector/src/index.ts#L347-L349
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
OpenSearchVectorStorageConnector.supportedComputeTypes
supportedComputeTypes(): ComputeType[] { return ([ ComputeType.CPU ]); }
/** * @returns the supported compute types by a given * middleware. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/opensearch-vector-storage-connector/src/index.ts#L355-L359
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
OpenSearchVectorStorageConnector.conditional
conditional() { return (super .conditional() .and(when('type').equals('document-created')) .and(when('data.metadata.properties.attrs.embeddings.vectors').exists()) ); }
/** * @returns the middleware conditional statement defining * in which conditions this middleware should be executed. * In this case, we want the middleware to only be invoked * when the document mime-type is supported, the event * type is `document-created`, and embeddings are available * in the doc...
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/opensearch-vector-storage-connector/src/index.ts#L369-L375
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
OpenSearchIndexDefinitionBuilder.withIndexName
public withIndexName(indexName: string) { this.props.indexName = indexName; return (this); }
/** * @param indexName the name of the index. * @returns the OpenSearch index definition builder. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/opensearch-vector-storage-connector/src/definitions/index.ts#L117-L120
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
OpenSearchIndexDefinitionBuilder.withKnnMethod
public withKnnMethod(knnMethod: KnnMethod) { this.props.knnMethod = knnMethod; return (this); }
/** * @param knnMethod the k-NN method. * @returns the OpenSearch index definition builder. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/opensearch-vector-storage-connector/src/definitions/index.ts#L126-L129
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
OpenSearchIndexDefinitionBuilder.withKnnEngine
public withKnnEngine(knnEngine: KnnEngine) { this.props.knnEngine = knnEngine; return (this); }
/** * @param knnEngine the k-NN engine. * @returns the OpenSearch index definition builder. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/opensearch-vector-storage-connector/src/definitions/index.ts#L135-L138
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
OpenSearchIndexDefinitionBuilder.withSpaceType
public withSpaceType(spaceType: SpaceType) { this.props.spaceType = spaceType; return (this); }
/** * @param spaceType the space type. * @returns the OpenSearch index definition builder. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/opensearch-vector-storage-connector/src/definitions/index.ts#L144-L147
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
OpenSearchIndexDefinitionBuilder.withDimensions
public withDimensions(dimensions: number) { this.props.dimensions = dimensions; return (this); }
/** * @param dimensions the vector dimensions. * @returns the OpenSearch index definition builder. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/opensearch-vector-storage-connector/src/definitions/index.ts#L153-L156
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
OpenSearchIndexDefinitionBuilder.withEfSearch
public withEfSearch(efSearch: number) { this.props.efSearch = efSearch; return (this); }
/** * @param efSearch the size of the dynamic list used during k-NN searches. * @returns the OpenSearch index definition builder. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/opensearch-vector-storage-connector/src/definitions/index.ts#L162-L165
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
OpenSearchIndexDefinitionBuilder.withParameters
public withParameters(parameters: any) { this.props.parameters = parameters; return (this); }
/** * @param parameters the parameters. * @returns the OpenSearch index definition builder. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/opensearch-vector-storage-connector/src/definitions/index.ts#L171-L174
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
OpenSearchIndexDefinitionBuilder.build
public build() { return (OpenSearchVectorIndexDefinition.from(this.props)); }
/** * @returns a new OpenSearch index definition. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/opensearch-vector-storage-connector/src/definitions/index.ts#L179-L181
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
OpenSearchVectorIndexDefinition.constructor
constructor(public props: OpenSearchVectorIndexDefinitionProps) {}
/** * OpenSearch index definition constructor. * @param props the properties of the OpenSearch index definition. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/opensearch-vector-storage-connector/src/definitions/index.ts#L198-L198
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
OpenSearchVectorIndexDefinition.indexName
indexName() { return (this.props.indexName); }
/** * @returns the name of the index. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/opensearch-vector-storage-connector/src/definitions/index.ts#L203-L205
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
OpenSearchVectorIndexDefinition.knnMethod
knnMethod() { return (this.props.knnMethod); }
/** * @returns the k-NN method. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/opensearch-vector-storage-connector/src/definitions/index.ts#L210-L212
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
OpenSearchVectorIndexDefinition.knnEngine
knnEngine() { return (this.props.knnEngine); }
/** * @returns the k-NN engine. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/opensearch-vector-storage-connector/src/definitions/index.ts#L217-L219
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
OpenSearchVectorIndexDefinition.spaceType
spaceType() { return (this.props.spaceType); }
/** * @returns the space type. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/opensearch-vector-storage-connector/src/definitions/index.ts#L224-L226
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
OpenSearchVectorIndexDefinition.dimensions
dimensions() { return (this.props.dimensions); }
/** * @returns the vector dimensions. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/opensearch-vector-storage-connector/src/definitions/index.ts#L231-L233
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
OpenSearchVectorIndexDefinition.efSearch
efSearch() { return (this.props.efSearch); }
/** * @returns the size of the dynamic list used during k-NN searches. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/opensearch-vector-storage-connector/src/definitions/index.ts#L238-L240
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
OpenSearchVectorIndexDefinition.parameters
parameters() { return (this.props.parameters); }
/** * @returns the parameters. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/opensearch-vector-storage-connector/src/definitions/index.ts#L245-L247
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
OpenSearchVectorIndexDefinition.from
public static from(data: any) { return (new OpenSearchVectorIndexDefinition(OpenSearchVectorIndexDefinitionPropsSchema.parse(data))); }
/** * @returns a new OpenSearch index definition. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/opensearch-vector-storage-connector/src/definitions/index.ts#L252-L254
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
Lambda.getId
private getId(event: CloudEvent) { const metadata = event.data().metadata(); const docId = event.data().document().id(); // If there is a chunk identifier that specifically // identifies a chunk associated with the given document, // we use a combination between the identifier of the // docu...
/** * @param event the event associated with the * received document. * @returns a unique identifier for the given * document that is fit to identify the vectors * associated with the document. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/opensearch-vector-storage-connector/src/lambdas/processor/index.ts#L80-L94
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
Lambda.getEmbeddings
private getEmbeddings(event: CloudEvent): Promise<number[]> { const metadata = event.data().metadata(); if (!metadata.properties?.attrs.embeddings) { throw new Error('The event does not contain embeddings.'); } return (metadata.properties.attrs.embeddings.vectors.resolve()); }
/** * @param event the event associated with the * received document. * @returns a vector embedding object associated * with the document. * @throws if the vector embedding object could not * be resolved. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/opensearch-vector-storage-connector/src/lambdas/processor/index.ts#L104-L111
4285173e80584eedfc1a8424d3d1b6c1a7038088
project-lakechain
github_2023
awslabs
typescript
Lambda.getDocument
private async getDocument(event: CloudEvent): Promise<string | Buffer> { const metadata = event.data().metadata(); const buffer = await event.data() .document() .data() .asBuffer(); if (metadata.properties?.kind === 'text') { return (buffer.toString('utf-8')); } else { ret...
/** * A helper returning a representation of the document * to include within the index. * @param event the event associated with the * received document. * @returns a string or buffer representation of the * document. */
https://github.com/awslabs/project-lakechain/blob/4285173e80584eedfc1a8424d3d1b6c1a7038088/packages/middlewares/storage-connectors/opensearch-vector-storage-connector/src/lambdas/processor/index.ts#L121-L133
4285173e80584eedfc1a8424d3d1b6c1a7038088