commit
12077f0ebf
|
|
@ -4,6 +4,7 @@ public class VectorCollectionData
|
|||
{
|
||||
public string Id { get; set; }
|
||||
public Dictionary<string, VectorPayloadValue> Data { get; set; } = new();
|
||||
public Dictionary<string, object> Payload => Data?.ToDictionary(x => x.Key, x => x.Value.DataValue) ?? [];
|
||||
public double? Score { get; set; }
|
||||
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
using BotSharp.Abstraction.VectorStorage.Enums;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace BotSharp.Abstraction.VectorStorage.Models;
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,9 @@ public class VectorKnowledgeViewModel
|
|||
[JsonPropertyName("data")]
|
||||
public IDictionary<string, VectorPayloadValue> Data { get; set; }
|
||||
|
||||
[JsonPropertyName("payload")]
|
||||
public IDictionary<string, object> Payload { get; set; }
|
||||
|
||||
[JsonPropertyName("score")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public double? Score { get; set; }
|
||||
|
|
@ -26,6 +29,7 @@ public class VectorKnowledgeViewModel
|
|||
{
|
||||
Id = result.Id,
|
||||
Data = result.Data,
|
||||
Payload = result.Payload,
|
||||
Score = result.Score,
|
||||
VectorDimension = result.Vector?.Length
|
||||
};
|
||||
|
|
@ -37,6 +41,7 @@ public class VectorKnowledgeViewModel
|
|||
{
|
||||
Id = data.Id,
|
||||
Data = data.Data,
|
||||
Payload = data.Payload,
|
||||
VectorDimension = data.Vector?.Length
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue