mirror of
https://github.com/DrizzleTime/Foxel.git
synced 2026-05-15 20:38:20 +08:00
feat(vector-db): integrate vector database for image search
- 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
This commit is contained in:
@@ -2,7 +2,6 @@ using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Text.Json;
|
||||
using Foxel.Services.Attributes;
|
||||
using Vector = Pgvector.Vector;
|
||||
|
||||
namespace Foxel.Models.DataBase;
|
||||
|
||||
@@ -15,7 +14,7 @@ public class Picture : BaseModel
|
||||
[StringLength(1024)] public string? ThumbnailPath { get; set; } = string.Empty;
|
||||
|
||||
[StringLength(2000)] public string Description { get; set; } = string.Empty;
|
||||
[Column(TypeName = "vector(1024)")] public Vector? Embedding { get; set; }
|
||||
public float[]? Embedding { get; set; }
|
||||
|
||||
public DateTime? TakenAt { get; set; }
|
||||
|
||||
@@ -57,8 +56,8 @@ public enum PermissionType
|
||||
|
||||
public enum ProcessingStatus
|
||||
{
|
||||
Pending, // 等待处理
|
||||
Processing, // 处理中
|
||||
Completed, // 处理完成
|
||||
Failed // 处理失败
|
||||
Pending, // 等待处理
|
||||
Processing, // 处理中
|
||||
Completed, // 处理完成
|
||||
Failed // 处理失败
|
||||
}
|
||||
Reference in New Issue
Block a user