Method CreateVectorStoreDataSourceAsync
CreateVectorStoreDataSourceAsync(IVectorStore, string, LM, MetadataCollection, CancellationToken)
Asynchronously creates a new DataSource instance that is backed by the specified vector store. This method leverages the vector store to store and retrieve data associated with the data source.
public static Task<DataSource> CreateVectorStoreDataSourceAsync(IVectorStore vectorStore, string identifier, LM model, MetadataCollection metadata = null, CancellationToken cancellationToken = default)
Parameters
vectorStoreIVectorStoreThe vector store to be used for storing and retrieving data associated with the data source.
identifierstringThe unique identifier for the data source.
modelLMThe language model associated with the data source.
metadataMetadataCollectionOptional metadata to be associated with the data source.
cancellationTokenCancellationTokenA token to monitor for cancellation requests.
Returns
- Task<DataSource>
A task representing the asynchronous operation. The task result contains a new DataSource instance that interacts with the specified vector store.
CreateVectorStoreDataSourceAsync(IVectorStore, string, int, MetadataCollection, CancellationToken)
Asynchronously creates a new DataSource instance that is backed by the specified vector store. This method leverages the vector store to store and retrieve data associated with the data source, using an explicit embedding size rather than a language model.
public static Task<DataSource> CreateVectorStoreDataSourceAsync(IVectorStore vectorStore, string identifier, int embeddingSize, MetadataCollection metadata = null, CancellationToken cancellationToken = default)
Parameters
vectorStoreIVectorStoreThe vector store to be used for storing and retrieving data associated with the data source.
identifierstringThe unique identifier for the data source.
embeddingSizeintThe dimensionality of the vector embeddings to be used by this data source.
metadataMetadataCollectionOptional metadata to be associated with the data source.
cancellationTokenCancellationTokenA token to monitor for cancellation requests.
Returns
- Task<DataSource>
A task representing the asynchronous operation. The task result contains a new DataSource instance that interacts with the specified vector store.