Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using BotSharp.Abstraction.VectorStorage.Enums;
using Newtonsoft.Json.Linq;

namespace BotSharp.Abstraction.VectorStorage.Models;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand All @@ -26,6 +29,7 @@ public static VectorKnowledgeViewModel From(VectorSearchResult result)
{
Id = result.Id,
Data = result.Data,
Payload = result.Payload,
Score = result.Score,
VectorDimension = result.Vector?.Length
};
Expand All @@ -37,6 +41,7 @@ public static VectorKnowledgeViewModel From(VectorCollectionData data)
{
Id = data.Id,
Data = data.Data,
Payload = data.Payload,
VectorDimension = data.Vector?.Length
};
}
Expand Down
Loading