import { IsIn, IsOptional, IsString, IsUrl, Length } from 'class-validator';

export class ListCafeCompanionModelsDto {
  @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;
}
