37 lines
653 B
TypeScript
37 lines
653 B
TypeScript
import { IsIn, IsObject, IsOptional, IsString, IsUUID, MaxLength } from 'class-validator';
|
|
|
|
export class CreateConversationDto {
|
|
@IsOptional()
|
|
@IsString()
|
|
@MaxLength(255)
|
|
title?: string;
|
|
|
|
@IsOptional()
|
|
@IsUUID()
|
|
projectId?: string;
|
|
}
|
|
|
|
export class UpdateConversationDto {
|
|
@IsOptional()
|
|
@IsString()
|
|
@MaxLength(255)
|
|
title?: string;
|
|
|
|
@IsOptional()
|
|
@IsUUID()
|
|
projectId?: string | null;
|
|
}
|
|
|
|
export class SendMessageDto {
|
|
@IsIn(['user', 'assistant', 'system'])
|
|
role!: 'user' | 'assistant' | 'system';
|
|
|
|
@IsString()
|
|
@MaxLength(10_000)
|
|
content!: string;
|
|
|
|
@IsOptional()
|
|
@IsObject()
|
|
metadata?: Record<string, unknown>;
|
|
}
|