Method CreateVectorStoreDataSource
CreateVectorStoreDataSource(IVectorStore, string, LM, MetadataCollection, CancellationToken)
Creates a new DataSource instance that is backed by the specified vector store. This is a synchronous wrapper around the asynchronous CreateVectorStoreDataSourceAsync method.
public static DataSource CreateVectorStoreDataSource(IVectorStore vectorStore, string identifier, LM model, MetadataCollection metadata = null, CancellationToken cancellationToken = default)
Parameters
vectorStore
IVectorStoreThe vector store to be used for storing and retrieving data associated with the data source.
identifier
stringThe unique identifier for the data source.
model
LMThe language model associated with the data source.
metadata
MetadataCollectionOptional metadata to be associated with the data source.
cancellationToken
CancellationTokenA token to monitor for cancellation requests.
Returns
- DataSource
A new DataSource instance that interacts with the specified vector store.
Exceptions
- Exception
Any exception encountered during the asynchronous operation is rethrown.
CreateVectorStoreDataSource(IVectorStore, string, int, MetadataCollection, CancellationToken)
Creates a new DataSource instance that is backed by the specified vector store. This is a synchronous wrapper around the asynchronous CreateVectorStoreDataSourceAsync method, using an explicit embedding size rather than a language model.
public static DataSource CreateVectorStoreDataSource(IVectorStore vectorStore, string identifier, int embeddingSize, MetadataCollection metadata = null, CancellationToken cancellationToken = default)
Parameters
vectorStore
IVectorStoreThe vector store to be used for storing and retrieving data associated with the data source.
identifier
stringThe unique identifier for the data source.
embeddingSize
intThe dimensionality of the vector embeddings to be used by this data source.
metadata
MetadataCollectionOptional metadata to be associated with the data source.
cancellationToken
CancellationTokenA token to monitor for cancellation requests.
Returns
- DataSource
A new DataSource instance that interacts with the specified vector store.
Exceptions
- Exception
Any exception encountered during the asynchronous operation is rethrown.