forked from Chatbot/v3-api
first commit v3 initialiazed a temporary repository for darmanet client
This commit is contained in:
59
src/ai-v2/dto/threads.dto.ts
Normal file
59
src/ai-v2/dto/threads.dto.ts
Normal file
@@ -0,0 +1,59 @@
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user