Files
v3-api/src/ai-v2/dto/threads.dto.ts

60 lines
1.3 KiB
TypeScript

import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import {
IsBoolean,
IsOptional,
IsString,
MaxLength,
MinLength,
} from 'class-validator';
export class CreateRunDto {
@ApiProperty({
example: 'مدارک لازم برای بستری چیست؟',
description: 'User question. Same field as /user/ask.',
})
@IsString()
@MinLength(1)
@MaxLength(4000)
question: string;
@ApiPropertyOptional({
description:
'Existing chat session id. Omit or leave empty on the first question.',
example: '',
})
@IsOptional()
@IsString()
sessionId?: string;
}
export class CreateFeedbackDto {
@ApiProperty({
example: '64f1a2b3c4d5e6f7a8b9c0d1',
description: 'Chat session id (also the AI thread id).',
})
@IsString()
@MinLength(1)
sessionId: string;
@ApiProperty({
example: '64f1a2b3c4d5e6f7a8b9c0d2',
description: 'Our bot messageId. Backend looks up the stored AI runId.',
})
@IsString()
@MinLength(1)
messageId: string;
@ApiProperty({
example: true,
description: 'true = Like, false = Dislike. Also sent to the AI as `helpful`.',
})
@IsBoolean()
helpful: boolean;
@ApiPropertyOptional({ maxLength: 2000 })
@IsOptional()
@IsString()
@MaxLength(2000)
comment?: string | null;
}