Skip to content

Commit

Permalink
Addressed PR comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
westey-m committed Nov 1, 2024
1 parent f8bf692 commit 6a46170
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,17 @@ public async Task IngestDataIntoInMemoryVectorStoreAsync()
await IngestDataIntoVectorStoreAsync(collection, fixture.TextEmbeddingGenerationService);

// Retrieve an item from the collection and write it to the console.
var skDefinition = await collection.GetAsync("4");
Console.WriteLine(skDefinition!.Definition);
var record = await collection.GetAsync("4");
Console.WriteLine(record!.Definition);
}

/// <summary>
/// Ingest data into the given collection.
/// </summary>
/// <param name="collection">The collection to ingest data into.</param>
/// <param name="textEmbeddingGenerationService">The service to use for generating embeddings.</param>
internal static async Task IngestDataIntoVectorStoreAsync(
/// <returns>The keys of the upserted records.</returns>
internal static async Task<IEnumerable<string>> IngestDataIntoVectorStoreAsync(
IVectorStoreRecordCollection<string, Glossary> collection,
ITextEmbeddingGenerationService textEmbeddingGenerationService)
{
Expand All @@ -51,7 +52,7 @@ internal static async Task IngestDataIntoVectorStoreAsync(

// Upsert the glossary entries into the collection and return their keys.
var upsertedKeysTasks = glossaryEntries.Select(x => collection.UpsertAsync(x));
var upsertedKeys = await Task.WhenAll(upsertedKeysTasks);
return await Task.WhenAll(upsertedKeysTasks);
}

/// <summary>
Expand Down

0 comments on commit 6a46170

Please sign in to comment.