Some checks failed
ci/woodpecker/push/ci Pipeline failed
Co-authored-by: Jason Woltje <jason@diversecanvas.com> Co-committed-by: Jason Woltje <jason@diversecanvas.com>
72 lines
1.0 KiB
TypeScript
72 lines
1.0 KiB
TypeScript
import {
|
|
IsBoolean,
|
|
IsIn,
|
|
IsInt,
|
|
IsObject,
|
|
IsOptional,
|
|
IsString,
|
|
IsUUID,
|
|
Max,
|
|
MaxLength,
|
|
Min,
|
|
} from 'class-validator';
|
|
import { Type } from 'class-transformer';
|
|
|
|
export class SearchMessagesDto {
|
|
@IsString()
|
|
@MaxLength(500)
|
|
q!: string;
|
|
|
|
@IsOptional()
|
|
@Type(() => Number)
|
|
@IsInt()
|
|
@Min(1)
|
|
@Max(100)
|
|
limit?: number = 20;
|
|
|
|
@IsOptional()
|
|
@Type(() => Number)
|
|
@IsInt()
|
|
@Min(0)
|
|
offset?: number = 0;
|
|
}
|
|
|
|
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;
|
|
|
|
@IsOptional()
|
|
@IsBoolean()
|
|
archived?: boolean;
|
|
}
|
|
|
|
export class SendMessageDto {
|
|
@IsIn(['user', 'assistant', 'system'])
|
|
role!: 'user' | 'assistant' | 'system';
|
|
|
|
@IsString()
|
|
@MaxLength(10_000)
|
|
content!: string;
|
|
|
|
@IsOptional()
|
|
@IsObject()
|
|
metadata?: Record<string, unknown>;
|
|
}
|