agent-server.ts 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. import {
  2. IsString,
  3. IsNotEmpty,
  4. ValidateIf,
  5. IsArray,
  6. IsNumber,
  7. IsObject
  8. } from 'class-validator'
  9. export class GetDialogueHistoryDto {
  10. @IsString()
  11. @IsNotEmpty({ message: 'staffId不能为空' })
  12. staffId: string
  13. @IsString()
  14. @ValidateIf((o) => !o.unionId)
  15. @IsNotEmpty({ message: 'userName不能为空' })
  16. userName: string
  17. @IsString()
  18. @ValidateIf((o) => !o.userName)
  19. @IsNotEmpty({ message: 'unionId不能为空' })
  20. unionId: string
  21. @IsString()
  22. @IsNotEmpty({ message: 'recentMinutes不能为空' })
  23. recentMinutes: string
  24. }
  25. export class GetBasePromptDto {
  26. @IsString()
  27. @IsNotEmpty({ message: 'scene不能为空' })
  28. scene: string
  29. }
  30. export class GetUserProfileDto {
  31. @IsString()
  32. @IsNotEmpty({ message: 'user_id不能为空' })
  33. userId: string
  34. }
  35. export class GetStaffProfileDto {
  36. @IsString()
  37. @IsNotEmpty({ message: 'staff_id不能为空' })
  38. staffId: string
  39. }
  40. export class RunPromptDto {
  41. @IsString()
  42. @IsNotEmpty({ message: 'scene不能为空' })
  43. scene: string
  44. @IsString()
  45. @IsNotEmpty({ message: 'prompt不能为空' })
  46. prompt: string
  47. @IsObject()
  48. @IsNotEmpty({ message: 'staffProfile不能为空' })
  49. staffProfile: StaffProfile
  50. @IsObject()
  51. @IsNotEmpty({ message: 'userProfile不能为空' })
  52. userProfile: UserProfile
  53. @IsArray()
  54. @IsNotEmpty({ message: 'dialogueHistory不能为空' })
  55. dialogueHistory: DialogueHistory
  56. @IsString()
  57. @IsNotEmpty({ message: 'modelName不能为空' })
  58. modelName: string
  59. @IsNumber()
  60. @IsNotEmpty({ message: 'currentTimestamp不能为空' })
  61. currentTimestamp: number
  62. }
  63. export class ListUsersDto {
  64. @IsString()
  65. @ValidateIf((o) => !o.unionId)
  66. @IsNotEmpty({ message: 'userName不能为空' })
  67. userName: string
  68. @IsString()
  69. @ValidateIf((o) => !o.userName)
  70. @IsNotEmpty({ message: 'unionId不能为空' })
  71. unionId: string
  72. }