Files
stack/apps/api/src/personalities/dto/update-personality.dto.ts
Jason Woltje 8383a98070 feat(#82): add prompt formatter service to personality module
- 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
2026-01-29 19:38:18 -06:00

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;
}