Each extension should be in specific Source package(for example in LangChain.Sources.Pdf)
It will simplify code like this:
var vectorDatabase = new SqLiteVectorDatabase("vectors.db");
var vectorCollection = await vectorDatabase.GetOrCreateCollectionAsync("harry-potter", dimensions: 1536);
if (await vectorCollection.IsEmptyAsync())
{
var pdfSource = new PdfPigPdfSource("E:\\AI\\Datasets\\Books\\Harry-Potter-Book-1.pdf");
var documents = await pdfSource.LoadAsync();
await vectorCollection.AddSplitDocumentsAsync(
embeddingModel,
documents);
}
to
var vectorDatabase = new SqLiteVectorDatabase("vectors.db");
var vectorCollection = await vectorDatabase.GetOrCreateCollectionAsync("harry-potter", dimensions: 1536);
if (await vectorCollection.IsEmptyAsync())
{
await vectorCollection.AddPdfFromPathAsync(
embeddingModel,
"E:\\AI\\Datasets\\Books\\Harry-Potter-Book-1.pdf");
}
Each extension should be in specific Source package(for example in LangChain.Sources.Pdf)
It will simplify code like this:
to