add payload schema
This commit is contained in:
parent
7f42bc7296
commit
5ffbbaa41f
|
|
@ -25,6 +25,9 @@ public class VectorCollectionDetails
|
|||
|
||||
[JsonPropertyName("basic_info")]
|
||||
public VectorCollectionConfig? BasicInfo { get; set; }
|
||||
|
||||
[JsonPropertyName("payload_schema")]
|
||||
public List<PayloadSchemaDetail> PayloadSchema { get; set; } = [];
|
||||
}
|
||||
|
||||
public class VectorCollectionDetailConfig
|
||||
|
|
@ -48,4 +51,21 @@ public class VectorCollectionDetailConfigParam
|
|||
|
||||
[JsonPropertyName("read_fan_out_factor")]
|
||||
public uint? ReadFanOutFactor { get; set; }
|
||||
}
|
||||
|
||||
public class PayloadSchemaDetail
|
||||
{
|
||||
[JsonPropertyName("field_name")]
|
||||
public string FieldName { get; set; } = null!;
|
||||
|
||||
[JsonPropertyName("field_data_type")]
|
||||
public string FieldDataType { get; set; } = null!;
|
||||
|
||||
[JsonPropertyName("data_count")]
|
||||
public ulong DataCount { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"{FieldName} ({FieldDataType})";
|
||||
}
|
||||
}
|
||||
|
|
@ -17,7 +17,8 @@ public class VectorCollectionDetailsViewModel : VectorCollectionDetails
|
|||
IndexedVectorsCount = model.IndexedVectorsCount,
|
||||
PointsCount = model.PointsCount,
|
||||
InnerConfig = model.InnerConfig,
|
||||
BasicInfo = model.BasicInfo
|
||||
BasicInfo = model.BasicInfo,
|
||||
PayloadSchema = model.PayloadSchema
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
using BotSharp.Abstraction.Files;
|
||||
using BotSharp.Abstraction.VectorStorage.Enums;
|
||||
using static Microsoft.EntityFrameworkCore.DbLoggerCategory;
|
||||
using BotSharp.Core.Infrastructures;
|
||||
|
||||
namespace BotSharp.Plugin.KnowledgeBase.Services;
|
||||
|
||||
|
|
|
|||
|
|
@ -110,6 +110,13 @@ public class QdrantDb : IVectorDb
|
|||
|
||||
if (details == null) return null;
|
||||
|
||||
var payloadSchema = details.PayloadSchema?.Select(x => new PayloadSchemaDetail
|
||||
{
|
||||
FieldName = x.Key,
|
||||
FieldDataType = x.Value.DataType.ToString().ToLowerInvariant(),
|
||||
DataCount = x.Value.Points
|
||||
})?.ToList() ?? [];
|
||||
|
||||
return new VectorCollectionDetails
|
||||
{
|
||||
Status = details.Status.ToString(),
|
||||
|
|
@ -128,7 +135,8 @@ public class QdrantDb : IVectorDb
|
|||
},
|
||||
VectorsCount = details.VectorsCount,
|
||||
IndexedVectorsCount = details.IndexedVectorsCount,
|
||||
PointsCount = details.PointsCount
|
||||
PointsCount = details.PointsCount,
|
||||
PayloadSchema = payloadSchema
|
||||
};
|
||||
}
|
||||
#endregion
|
||||
|
|
|
|||
Loading…
Reference in a new issue