Files
gongxue-base/apps/server/src/ai-chat/dto/ai-chat.dto.ts

127 lines
2.0 KiB
TypeScript

import { Type } from 'class-transformer';
import {
ArrayMaxSize,
IsArray,
IsIn,
IsInt,
IsNotEmpty,
IsObject,
IsOptional,
IsString,
IsUUID,
Max,
MaxLength,
Min,
} from 'class-validator';
import { REASONING_EFFORT_LEVELS } from '../../ai-config/dto/ai-config.dto';
export class CreateConversationDto {
@IsOptional()
@IsString()
@MaxLength(100)
title?: string;
@IsOptional()
@IsString()
@MaxLength(50)
lockedSkillKey?: string | null;
}
export class UpdateConversationDto {
@IsOptional()
@IsString()
@IsNotEmpty()
@MaxLength(100)
title?: string;
@IsOptional()
@IsString()
@MaxLength(50)
lockedSkillKey?: string | null;
}
export class SendMessageDto {
@IsString()
@IsNotEmpty()
@MaxLength(16000)
message: string;
@IsOptional()
@IsArray()
@ArrayMaxSize(5)
@IsInt({ each: true })
@Min(1, { each: true })
attachmentIds?: number[];
@IsOptional()
@IsString()
@MaxLength(50)
skillKey?: string | null;
@IsUUID()
clientRequestId: string;
@IsOptional()
@IsIn(REASONING_EFFORT_LEVELS)
reasoningEffort?: string | null;
}
export class RegenerateMessageDto {
@IsUUID()
clientRequestId: string;
@IsOptional()
@IsIn(REASONING_EFFORT_LEVELS)
reasoningEffort?: string | null;
}
export class EditMessageDto {
@IsString()
@IsNotEmpty()
@MaxLength(16000)
content: string;
@IsUUID()
clientRequestId: string;
@IsOptional()
@IsIn(REASONING_EFFORT_LEVELS)
reasoningEffort?: string | null;
}
export class SubmitFormDto {
@IsUUID()
clientRequestId: string;
@IsObject()
values: Record<string, unknown>;
@IsOptional()
@IsIn(REASONING_EFFORT_LEVELS)
reasoningEffort?: string | null;
}
export class SubmitReviewDto {
@IsUUID()
clientRequestId: string;
@IsOptional()
@IsIn(REASONING_EFFORT_LEVELS)
reasoningEffort?: string | null;
}
export class MessagePageQueryDto {
@IsOptional()
@Type(() => Number)
@IsInt()
@Min(1)
page?: number;
@IsOptional()
@Type(() => Number)
@IsInt()
@Min(1)
@Max(100)
limit?: number;
}