intent_records.py 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. from datetime import datetime
  4. from pydantic import ConfigDict
  5. from common.schema import SchemaBase
  6. intent_status_map = {
  7. 1: "有意向",
  8. 2: "无意向",
  9. 3: "其他"
  10. }
  11. class IntentRecordsSchemaBase(SchemaBase):
  12. pass
  13. class GetIntentRecordsByIdParam(IntentRecordsSchemaBase):
  14. internal_id: str | None = None
  15. external_id: str | None = None
  16. org_id: int | None = 0
  17. class CreateIntentRecordsParam(IntentRecordsSchemaBase):
  18. id: str | None = 0
  19. external_id: str
  20. industry_type: int | None = 0
  21. chat_history: str
  22. manual_intent: int | None = None
  23. org_id: int | None = 0
  24. created_at: datetime | None = None
  25. updated_at: datetime | None = None
  26. class UpdateIntentRecordsParam(IntentRecordsSchemaBase):
  27. internal_id: str | None = None
  28. external_id: str | None = None
  29. manual_intent: int
  30. org_id: int | None = 0
  31. class GetIntentRecordsListDetails(IntentRecordsSchemaBase):
  32. model_config = ConfigDict(from_attributes=True)
  33. id: str
  34. created_at: datetime
  35. updated_at: datetime | None = None
  36. class GetIntentRecordsDetails(IntentRecordsSchemaBase):
  37. model_config = ConfigDict(from_attributes=True)
  38. id: str
  39. external_id: str
  40. chat_history: str
  41. org_id: int | None = 0