forked from xiangwang25/whale-town-end-v2
88 lines
3.0 KiB
TypeScript
88 lines
3.0 KiB
TypeScript
import { IsBoolean, IsIn, IsInt, IsOptional, IsString, IsUrl, Length, Matches, Max, Min } from 'class-validator';
|
|
|
|
export class RegisterCafeCompanionAgentDto {
|
|
@IsString({ message: '服务点ID必须是字符串' })
|
|
@Length(1, 80, { message: '服务点ID长度需在1-80字符之间' })
|
|
@Matches(/^[A-Za-z0-9_:-]+$/, { message: '服务点ID格式不正确' })
|
|
service_point_id!: string;
|
|
|
|
@IsString({ message: '人设名称必须是字符串' })
|
|
@Length(1, 80, { message: '人设名称长度需在1-80字符之间' })
|
|
persona_name!: string;
|
|
|
|
@IsOptional()
|
|
@IsIn(['openai', 'anthropic'], { message: '代理协议必须是 openai 或 anthropic' })
|
|
protocol?: 'openai' | 'anthropic';
|
|
|
|
@IsUrl({ require_tld: false }, { message: '接口URL格式不正确' })
|
|
@Length(1, 240, { message: '接口URL长度需在1-240字符之间' })
|
|
base_url!: string;
|
|
|
|
@IsString({ message: '接口Token必须是字符串' })
|
|
@Length(1, 2000, { message: '接口Token长度需在1-2000字符之间' })
|
|
token!: string;
|
|
|
|
@IsString({ message: '模型名称必须是字符串' })
|
|
@Length(1, 120, { message: '模型名称长度需在1-120字符之间' })
|
|
model!: string;
|
|
|
|
@IsOptional()
|
|
@IsString({ message: '补充人设指令必须是字符串' })
|
|
@Length(0, 4000, { message: '补充人设指令不能超过4000字符' })
|
|
persona_prompt?: string;
|
|
|
|
@IsOptional()
|
|
@IsString({ message: '身份必须是字符串' })
|
|
@Length(0, 500, { message: '身份不能超过500字符' })
|
|
identity?: string;
|
|
|
|
@IsOptional()
|
|
@IsString({ message: '职位必须是字符串' })
|
|
@Length(0, 200, { message: '职位不能超过200字符' })
|
|
job_title?: string;
|
|
|
|
@IsOptional()
|
|
@IsString({ message: '性格必须是字符串' })
|
|
@Length(0, 1000, { message: '性格不能超过1000字符' })
|
|
personality?: string;
|
|
|
|
@IsOptional()
|
|
@IsString({ message: '语气必须是字符串' })
|
|
@Length(0, 500, { message: '语气不能超过500字符' })
|
|
tone?: string;
|
|
|
|
@IsOptional()
|
|
@IsString({ message: '背景必须是字符串' })
|
|
@Length(0, 2000, { message: '背景不能超过2000字符' })
|
|
background?: string;
|
|
|
|
@IsOptional()
|
|
@IsString({ message: '喜好必须是字符串' })
|
|
@Length(0, 1000, { message: '喜好不能超过1000字符' })
|
|
preferences?: string;
|
|
|
|
@IsOptional()
|
|
@IsString({ message: '禁忌必须是字符串' })
|
|
@Length(0, 1000, { message: '禁忌不能超过1000字符' })
|
|
taboos?: string;
|
|
|
|
@IsOptional()
|
|
@IsString({ message: '话题必须是字符串' })
|
|
@Length(0, 1000, { message: '话题不能超过1000字符' })
|
|
topics?: string;
|
|
|
|
@IsOptional()
|
|
@IsString({ message: '欢迎语必须是字符串' })
|
|
@Length(0, 300, { message: '欢迎语不能超过300字符' })
|
|
welcome_message?: string;
|
|
|
|
@IsOptional()
|
|
@IsBoolean({ message: '启用状态必须是布尔值' })
|
|
enabled?: boolean;
|
|
|
|
@IsInt({ message: '打工时间必须是整数分钟' })
|
|
@Min(30, { message: '打工时间不能少于30分钟' })
|
|
@Max(480, { message: '打工时间不能超过8小时' })
|
|
employment_minutes!: number;
|
|
}
|