Skip to content

Commit

Permalink
update variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
alexwolfmsft committed Dec 12, 2024
1 parent b934e54 commit 4685a9b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,20 +60,20 @@

// Create and populate the vector store
var vectorStore = new InMemoryVectorStore();
var movies = vectorStore.GetCollection<int, CloudService>("movies");
await movies.CreateCollectionIfNotExistsAsync();
var cloudServices = vectorStore.GetCollection<int, CloudService>("cloudServices");
await cloudServices.CreateCollectionIfNotExistsAsync();

foreach (var movie in cloudService)
{
movie.Vector = await generator.GenerateEmbeddingVectorAsync(movie.Description);
await movies.UpsertAsync(movie);
await cloudServices.UpsertAsync(movie);
}

// Convert a search query to a vector and search the vector store
var query = "Which Azure service should I use to store my Word documents?";
var queryEmbedding = await generator.GenerateEmbeddingVectorAsync(query);

var results = await movies.VectorizedSearchAsync(queryEmbedding, new VectorSearchOptions()
var results = await cloudServices.VectorizedSearchAsync(queryEmbedding, new VectorSearchOptions()
{
Top = 1,
VectorPropertyName = "Vector"
Expand Down
8 changes: 4 additions & 4 deletions docs/ai/quickstarts/snippets/chat-with-data/openai/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,20 +58,20 @@

// Create and populate the vector store
var vectorStore = new InMemoryVectorStore();
var movies = vectorStore.GetCollection<int, CloudService>("movies");
await movies.CreateCollectionIfNotExistsAsync();
var cloudServices = vectorStore.GetCollection<int, CloudService>("cloudServices");
await cloudServices.CreateCollectionIfNotExistsAsync();

foreach (var movie in cloudService)
{
movie.Vector = await generator.GenerateEmbeddingVectorAsync(movie.Description);
await movies.UpsertAsync(movie);
await cloudServices.UpsertAsync(movie);
}

// Convert a search query to a vector and search the vector store
var query = "Which Azure service should I use to store my Word documents?";
var queryEmbedding = await generator.GenerateEmbeddingVectorAsync(query);

var results = await movies.VectorizedSearchAsync(queryEmbedding, new VectorSearchOptions()
var results = await cloudServices.VectorizedSearchAsync(queryEmbedding, new VectorSearchOptions()
{
Top = 1,
VectorPropertyName = "Vector"
Expand Down

0 comments on commit 4685a9b

Please sign in to comment.