intent_records.py 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. 4: "无意向"
  11. }
  12. class IntentRecordsSchemaBase(SchemaBase):
  13. pass
  14. class GetIntentRecordsByIdParam(IntentRecordsSchemaBase):
  15. internal_id: str | None = None
  16. external_id: str | None = None
  17. org_id: int | None = 0
  18. class CreateIntentRecordsParam(IntentRecordsSchemaBase):
  19. id: str | None = 0
  20. external_id: str
  21. industry_type: int | None = 0
  22. chat_history: str
  23. manual_intent: int | None = None
  24. org_id: int | None = 0
  25. created_at: datetime | None = None
  26. updated_at: datetime | None = None
  27. class UpdateIntentRecordsParam(IntentRecordsSchemaBase):
  28. internal_id: str | None = None
  29. external_id: str | None = None
  30. manual_intent: int
  31. org_id: int | None = 0
  32. class GetIntentRecordsListDetails(IntentRecordsSchemaBase):
  33. model_config = ConfigDict(from_attributes=True)
  34. id: str
  35. created_at: datetime
  36. updated_at: datetime | None = None
  37. class GetIntentRecordsDetails(IntentRecordsSchemaBase):
  38. model_config = ConfigDict(from_attributes=True)
  39. id: str
  40. external_id: str
  41. chat_history: str
  42. org_id: int | None = 0