Add phased knowledge layer: comments and semantic linking pipeline
This commit is contained in:
52
backend/src/knowledge/dto/semantic-link.dto.ts
Normal file
52
backend/src/knowledge/dto/semantic-link.dto.ts
Normal file
@@ -0,0 +1,52 @@
|
||||
import { IsIn, IsNumber, IsObject, IsOptional, IsString, Max, Min } from 'class-validator';
|
||||
|
||||
export const SEMANTIC_LINK_STATUSES = ['suggested', 'approved', 'rejected', 'dismissed'] as const;
|
||||
export const SEMANTIC_LINK_ORIGINS = ['manual', 'semantic', 'llm', 'hybrid', 'rule_based'] as const;
|
||||
|
||||
export class ReviewSemanticLinkDto {
|
||||
@IsString()
|
||||
@IsIn(SEMANTIC_LINK_STATUSES)
|
||||
status: (typeof SEMANTIC_LINK_STATUSES)[number];
|
||||
}
|
||||
|
||||
export class UpsertSemanticLinkDto {
|
||||
@IsString()
|
||||
sourceEntityType: string;
|
||||
|
||||
@IsString()
|
||||
sourceEntityId: string;
|
||||
|
||||
@IsString()
|
||||
targetEntityType: string;
|
||||
|
||||
@IsString()
|
||||
targetEntityId: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
linkType?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@IsIn(SEMANTIC_LINK_STATUSES)
|
||||
status?: (typeof SEMANTIC_LINK_STATUSES)[number];
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@IsIn(SEMANTIC_LINK_ORIGINS)
|
||||
origin?: (typeof SEMANTIC_LINK_ORIGINS)[number];
|
||||
|
||||
@IsOptional()
|
||||
@IsNumber()
|
||||
@Min(0)
|
||||
@Max(1)
|
||||
confidence?: number;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
reason?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsObject()
|
||||
evidence?: Record<string, any>;
|
||||
}
|
||||
Reference in New Issue
Block a user