You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
The data type of the Id member in the ScoredPoint class may need to be changed to int. #794
publicasyncTaskqdrant_SK_Http_HNSW_index_Cosine_50_ProcessAsync(){QdrantMemoryStorememoryStore=newQdrantMemoryStore(GlobalManager.SelfHostQdrantHttpConnectionString,6333,vectorSize:4//, ConsoleLogger.Log);IKernelkernel=Kernel.Builder//.WithLogger(ConsoleLogger.Log).Configure(
c =>{c.AddOpenAITextCompletionService("text-davinci-003","123");c.AddOpenAITextEmbeddingGenerationService("text-embedding-ada-002","123");}).WithMemoryStorage(memoryStore).Build();varMemoryCollectionName="small";//bug here!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!varsearchResults=kernel.Memory.SearchAsync(MemoryCollectionName,"My favorite color is orange",limit:20,minRelevanceScore:0.8,withEmbeddings:true);awaitforeach(variteminsearchResults){//Console.WriteLine(item.Metadata.Text + " : " + item.Relevance);_=item.Relevance;}}
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
OS: [e.g. Windows]
IDE: [e.g. Visual Studio, VS Code]
NuGet Package Version [e.g. 0.1.0]
Additional context
Add any other context about the problem here.
Tara W (@tawalke) Thanks for your feedback in advance.
I think it would be better to support both int id and string uuid when deserializing as a string Id property from JSON.
Here is some sample code for reference, I have test it passed and succeed when invoke QdrantVectorDbClient.FindNearestInCollectionAsync :
SearchVectorsResponse.cs
// Copyright (c) Microsoft. All rights reserved.usingSystem;usingSystem.Collections.Generic;usingSystem.Globalization;usingSystem.Text.Json;usingSystem.Text.Json.Serialization;namespaceMicrosoft.SemanticKernel.Connectors.Memory.Qdrant.Http.ApiSchema;
#pragma warning disable CA1812// Avoid uninstantiated internal classes: Used for Json DeserializationinternalsealedclassSearchVectorsResponse:QdrantResponse{internalsealedclassScoredPoint{[JsonPropertyName("id")]// add by AwesomeYuer@Microshaoft @ 2023-05-04[JsonConverter(typeof(NumberToStringConverter))]publicstringId{get;}[JsonPropertyName("version")]publicintVersion{get;set;}[JsonPropertyName("score")]publicdouble?Score{get;}[JsonPropertyName("payload")]publicDictionary<string,object>Payload{get;set;}[JsonPropertyName("vector")]publicIEnumerable<float>?Vector{get;}[JsonConstructor]publicScoredPoint(stringid,double?score,Dictionary<string,object>payload,IEnumerable<float>vector){this.Id=id;this.Score=score;this.Payload=payload;this.Vector=vector;}}[JsonPropertyName("result")]publicIEnumerable<ScoredPoint>Results{get;set;}[JsonConstructor]publicSearchVectorsResponse(IEnumerable<ScoredPoint>results){this.Results=results;}
#region private ================================================================================
privateSearchVectorsResponse(){this.Results=newList<ScoredPoint>();}
#endregion
}
#pragma warning restore CA1812// Avoid uninstantiated internal classes// add by AwesomeYuer@Microshaoft @ 2023-05-04publicclassNumberToStringConverter:JsonConverter<string>{publicoverridestringRead(refUtf8JsonReaderreader,TypetypeToConvert,JsonSerializerOptionsoptions){if(typeToConvert!=typeof(string)){thrownewNotSupportedException($"{nameof(typeToConvert)}: {typeToConvert}");}varresult=string.Empty;vartokenType=reader.TokenType;if(tokenType==JsonTokenType.String){result=reader.GetString();}elseif(tokenType==JsonTokenType.Number){reader.TryGetInt32(outvarvalueInt);result=valueInt.ToString("D",NumberFormatInfo.InvariantInfo);}else{thrownewNotSupportedException($"{nameof(JsonTokenType)}.{tokenType}");}returnresult!;}publicoverridevoidWrite(Utf8JsonWriterwriter,string@value,JsonSerializerOptionsoptions){writer.WriteStringValue(@value);}}
Activity
tawalke commentedon May 3, 2023
于斯人也 (@AwesomeYuer) Qdrant definition for Points object allows for both 64-bit integers and UUID strings
You can look at the ExtendedPointId object here:

https://github.com/qdrant/qdrant/blob/master/src/common/points.rs
AwesomeYuer commentedon May 4, 2023
Tara W (@tawalke) Thanks for your feedback in advance.
I think it would be better to support both
int idandstring uuidwhen deserializing as astring Id propertyfromJSON.Here is some sample code for reference, I have test it passed and succeed when invoke
QdrantVectorDbClient.FindNearestInCollectionAsync:SearchVectorsResponse.csAwesomeYuer commentedon May 5, 2023
good
craigomatic commentedon May 5, 2023
Another simple option we can consider:
https://learn.microsoft.com/en-us/dotnet/api/system.text.json.serialization.jsonnumberhandlingattribute
Fix bug preventing Qdrant points with numeric id from being consumed (#…
craigomatic commentedon May 19, 2023
Closing as the PR has been merged. Please reopen if this issue persists!
Fix bug preventing Qdrant points with numeric id from being consumed (m…
AwesomeYuer commentedon May 20, 2023
glad to hear that
Fix incorrect attribute causing the Qdrant connector to break (#1313)
Fix incorrect attribute causing the Qdrant connector to break (micros…
Fix incorrect attribute causing the Qdrant connector to break (micros…
Python: Bump psycopg from 3.1.19 to 3.2.1 in /python (#7039)
Python: Bump psycopg from 3.1.19 to 3.2.1 in /python (microsoft#7039)