Move Knowledge Constants and Fix Inverted Ownership Filters
- Add XAiKnowledgeScope enum (Conversation=0, Project=1, Global=2, User=3) with StringValue prefixes; - Add Knowledge constants, scope prefixes, metadata keys and XAiErrorRoute to XAiModelsConstants; - Fix inverted ownerId condition in QueryProjects / QueryConversations / QueryMessages (ownership filter was skipped for real owners -> cross-user data exposure); - Fix inverted HasChild() validation in HasDefaultProject / HasDefaultConversation; - LoadConversations: ignore soft-deleted conversations; - CreateProject / CreateConversation: set isDefaultLanguageHandled = true; - GetDefaultConversation: use projectId instead of unloaded project.Id.
This commit is contained in:
@@ -60,5 +60,28 @@ namespace xAiModels.Constants
|
||||
|
||||
//
|
||||
public const string XOpenAINoKey = "no-key-required";
|
||||
|
||||
//
|
||||
// Knowledge (Persistent RAG) ...
|
||||
public const string XAiDefaultKnowledgeType = "XAiKnowledge";
|
||||
public const string XAiKnowledgeSeparator = "/";
|
||||
public const string XAiKnowledgeOwnerSeparator = "/";
|
||||
public const string XAiKnowledgeChunkSeparator = "#";
|
||||
public const string XAiKnowledgeUserPrefix = "user";
|
||||
public const string XAiKnowledgeGlobalPrefix = "global";
|
||||
public const string XAiKnowledgeProjectPrefix = "project";
|
||||
public const string XAiKnowledgeConversationPrefix = "conversation";
|
||||
|
||||
//
|
||||
// Error Handler Route (Production) ...
|
||||
public const string XAiErrorRoute = "/error";
|
||||
|
||||
//
|
||||
// Knowledge Metadata Keys ...
|
||||
public const string XAiKnowledgeMetadataType = "type";
|
||||
public const string XAiKnowledgeMetadataScope = "scope";
|
||||
public const string XAiKnowledgeMetadataScopeId = "scopeId";
|
||||
public const string XAiKnowledgeMetadataOwnerId = "ownerId";
|
||||
public const string XAiKnowledgeMetadataIngestedAtUtc = "ingestedAtUtc";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user