- Add PromptFormatterService for formatting system prompts based on personality - Support context variable interpolation (userName, workspaceName, etc.) - Add formality level modifiers (VERY_CASUAL to VERY_FORMAL) - Add template validation for custom variables - Add preview endpoint for formatted prompts - Fix UpdatePersonalityDto to avoid @nestjs/mapped-types dependency - Update PersonalitiesController with new endpoints - Add comprehensive tests (33 passing tests) Closes #82
39 lines
722 B
TypeScript
39 lines
722 B
TypeScript
import { IsString, IsOptional, IsBoolean, MinLength, MaxLength, IsIn } from "class-validator";
|
|
import { FORMALITY_LEVELS, FormalityLevelType } from "./create-personality.dto";
|
|
|
|
export class UpdatePersonalityDto {
|
|
@IsOptional()
|
|
@IsString()
|
|
@MinLength(1)
|
|
@MaxLength(100)
|
|
name?: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
@MaxLength(500)
|
|
description?: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
@MinLength(1)
|
|
@MaxLength(50)
|
|
tone?: string;
|
|
|
|
@IsOptional()
|
|
@IsIn(FORMALITY_LEVELS)
|
|
formalityLevel?: FormalityLevelType;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
@MinLength(10)
|
|
systemPromptTemplate?: string;
|
|
|
|
@IsOptional()
|
|
@IsBoolean()
|
|
isDefault?: boolean;
|
|
|
|
@IsOptional()
|
|
@IsBoolean()
|
|
isActive?: boolean;
|
|
}
|