Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VectorStore/VectorIndex methods should allow to specify multiply Sources #178

Open
HavenDV opened this issue Mar 28, 2024 · 0 comments
Open
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@HavenDV
Copy link
Contributor

HavenDV commented Mar 28, 2024

From this thread: https://discord.com/channels/1115206893015662663/1115206893544161302/1222715558181736539

Simplify code like this:

var source1 = await PdfPigPdfSource.CreateFromUriAsync(new Uri("https://canonburyprimaryschool.co.uk/wp-content/uploads/2016/01/Joanne-K.-Rowling-Harry-Potter-Book-1-Harry-Potter-and-the-Philosophers-Stone-EnglishOnlineClub.com_.pdf"));
var source2 = await PdfPigPdfSource.CreateFromUriAsync(new Uri("https://canonburyprimaryschool.co.uk/wp-content/uploads/2016/01/Joanne-K.-Rowling-Harry-Potter-Book-1-Harry-Potter-and-the-Philosophers-Stone-EnglishOnlineClub.com_.pdf"));
var documents1 = await source1.LoadAsync(cancellationToken).ConfigureAwait(false);
var documents2 = await source2.LoadAsync(cancellationToken).ConfigureAwait(false);
var documents = documents1.Concat(documents2).ToArray();

var options = new SQLIteVectorStoreOptions();
var vectorStore = new SQLiteVectorStore(options.Filename, options.TableName, embeddings);
var textSplitter = new CharacterTextSplitter();
var indexCreator = new VectorStoreIndexCreator(vectorStore, textSplitter);
var index = await indexCreator.FromDocumentsAsync(documents).ConfigureAwait(false);
@HavenDV HavenDV added enhancement New feature or request good first issue Good for newcomers labels Mar 28, 2024
@HavenDV HavenDV added this to the QA over Documents milestone Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
Status: No status
Development

No branches or pull requests

1 participant