Skip to content

Commit

Permalink
Update code to be culture invariant
Browse files Browse the repository at this point in the history
  • Loading branch information
feaselkl committed Nov 14, 2024
1 parent 4181968 commit 56d35fb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/ContosoSuitesWebAPI/Services/VectorizationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,11 @@ public async Task<float[]> GetEmbeddings(string text)
// var db = _cosmosClient.GetDatabase(configuration.GetValue<string>("CosmosDB:DatabaseName") ?? "ContosoSuites");
// var container = db.GetContainer(configuration.GetValue<string>("CosmosDB:MaintenanceRequestsContainerName") ?? "MaintenanceRequests");

// var query = $"SELECT c.hotel_id AS HotelId, c.hotel AS Hotel, c.details AS Details, c.source AS Source, VectorDistance(c.request_vector, [{string.Join(",", queryVector)}]) AS SimilarityScore FROM c";
// query += $" WHERE VectorDistance(c.request_vector, [{string.Join(",", queryVector)}]) > {minimum_similarity_score}";
// query += $" ORDER BY VectorDistance(c.request_vector, [{string.Join(",", queryVector)}])";
// var vectorString = string.Join(", ", queryVector.Select(v => v.ToString(CultureInfo.InvariantCulture)).ToArray());

// var query = $"SELECT c.hotel_id AS HotelId, c.hotel AS Hotel, c.details AS Details, c.source AS Source, VectorDistance(c.request_vector, [{vectorString}]) AS SimilarityScore FROM c";
// query += $" WHERE VectorDistance(c.request_vector, [{vectorString}]) > {minimum_similarity_score.ToString(CultureInfo.InvariantCulture)}";
// query += $" ORDER BY VectorDistance(c.request_vector, [{vectorString}])";

// var results = new List<VectorSearchResult>();

Expand Down

0 comments on commit 56d35fb

Please sign in to comment.