mirror of
https://github.com/DrizzleTime/Foxel.git
synced 2026-05-13 17:30:22 +08:00
- Replace pgvector with Microsoft Vector DB for image vector storage and search - Update Picture model to use float[] instead of Vector type - Modify PictureService to use VectorDbService for vector search - Remove vector-related code from MyDbContext - Add PictureVector model for Vector DB integration
12 lines
362 B
C#
12 lines
362 B
C#
namespace Foxel.Models.Vector;
|
|
|
|
using Microsoft.Extensions.VectorData;
|
|
|
|
public class PictureVector
|
|
{
|
|
[VectorStoreKey] public int Id { get; set; }
|
|
[VectorStoreData] public string? Name { get; set; }
|
|
|
|
[VectorStoreVector(Dimensions: 1024, DistanceFunction = DistanceFunction.CosineSimilarity)]
|
|
public ReadOnlyMemory<float>? Embedding { get; set; }
|
|
} |