place.py 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. from __future__ import annotations
  2. """地点研究结果模型:MapResearchResult包含候选景点、餐饮与天气信息。"""
  3. from pydantic import Field
  4. from app.schemas.common import AppModel
  5. class PlaceCandidate(AppModel):
  6. """真实地点候选。"""
  7. poi_id: str | None = None
  8. name: str
  9. category: str | None = None
  10. address: str | None = None
  11. district: str | None = None
  12. # 高德通常使用 "经度,纬度" 字符串
  13. location: str | None = None
  14. telephone: str | None = None
  15. source_query: str | None = None
  16. # 这里只说明为什么匹配用户兴趣,
  17. # 不涉及距离和交通便利性的判断。
  18. match_reason: str | None = None
  19. class WeatherItem(AppModel):
  20. """天气查询结果。"""
  21. date: str | None = None
  22. week: str | None = None
  23. day_weather: str | None = None
  24. night_weather: str | None = None
  25. day_temperature: str | None = None
  26. night_temperature: str | None = None
  27. day_wind_direction: str | None = None
  28. night_wind_direction: str | None = None
  29. class MapResearchResult(AppModel):
  30. """地图研究 Agent 的结构化结果。"""
  31. city: str
  32. attractions: list[PlaceCandidate] = Field(
  33. default_factory=list
  34. )
  35. restaurants: list[PlaceCandidate] = Field(
  36. default_factory=list
  37. )
  38. weather: list[WeatherItem] = Field(
  39. default_factory=list
  40. )
  41. notes: list[str] = Field(
  42. default_factory=list
  43. )