37 lines
694 B
TypeScript
37 lines
694 B
TypeScript
import { Type } from 'class-transformer';
|
|
import { IsNotEmpty, IsObject, IsOptional, IsString, ValidateNested } from 'class-validator';
|
|
import { AiChatMessageDto } from './ai-chat.message.dto';
|
|
|
|
export class AiChatContextDto {
|
|
@IsOptional()
|
|
@IsString()
|
|
objectApiName?: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
view?: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
recordId?: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
route?: string;
|
|
}
|
|
|
|
export class AiChatRequestDto {
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
message: string;
|
|
|
|
@IsOptional()
|
|
@IsObject()
|
|
context?: AiChatContextDto;
|
|
|
|
@IsOptional()
|
|
@ValidateNested({ each: true })
|
|
@Type(() => AiChatMessageDto)
|
|
history?: AiChatMessageDto[];
|
|
}
|