Migration جدید
یک Migration جدید با نام InitialMigrationAiApi ایجاد شده که شامل جداول زیر است:
| جدول |
توضیح |
Indexes |
AiProjects | پروژههای AI کاربران | — |
AiConversations | گفتگوهای هر پروژه | — |
AiMessages | پیامهای هر گفتگو | — |
AiVectors |
Vectorهای ذخیرهشده (Persistent RAG) |
IX_AiVectors_Identifier، IX_AiVectors_Type |
Files | فایلهای آپلودی (xFileService) | — |
Strings | منابع چندزبانه (xStringService) | — |
Tags | تگها (xTagService) | — |
⚠️ نکته مهم: جدول AiVectors دارای Index روی Identifier است که برای جستجوی Prefix-Based (مثلاً user/{ownerId}/) حیاتی است. همچنین Index روی Type برای فیلتر کردن بر اساس نوع دانش (مثلاً XAiKnowledge) استفاده میشود.
تغییرات Constants
در XAiModelsConstants، ثابتهای زیر اضافه شدهاند:
// Knowledge (Persistent RAG) ...
XAiDefaultKnowledgeType = "XAiKnowledge"
XAiKnowledgeSeparator = "/"
XAiKnowledgeOwnerSeparator = "/"
XAiKnowledgeChunkSeparator = "#"
XAiKnowledgeUserPrefix = "user"
XAiKnowledgeGlobalPrefix = "global"
XAiKnowledgeProjectPrefix = "project"
XAiKnowledgeConversationPrefix = "conversation"
// Metadata Keys ...
XAiKnowledgeMetadataType = "type"
XAiKnowledgeMetadataScope = "scope"
XAiKnowledgeMetadataScopeId = "scopeId"
XAiKnowledgeMetadataOwnerId = "ownerId"
XAiKnowledgeMetadataIngestedAtUtc = "ingestedAtUtc"
تغییرات XAiVector Entity و DTO
فیلد Type به XAiVector و XAiVectorDto اضافه شده است:
XAiVector.cs
[StringLength(100)]
public string Type { get; set; }