fix: recognize Dutch evolution questions
This commit is contained in:
@@ -27,7 +27,7 @@ from app.services.vector_feature_service import VectorFeatureService
|
||||
class GeoAssistantService:
|
||||
HISTORY_KEYWORDS = (
|
||||
"histor",
|
||||
"evolutie",
|
||||
"evolu",
|
||||
"verander",
|
||||
"trend",
|
||||
"vroeger",
|
||||
@@ -38,6 +38,11 @@ class GeoAssistantService:
|
||||
"gestegen",
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def history_requested(cls, question: str) -> bool:
|
||||
normalized = question.casefold()
|
||||
return any(keyword in normalized for keyword in cls.HISTORY_KEYWORDS)
|
||||
|
||||
def __init__(self, settings: Settings | None = None):
|
||||
self.settings = settings or get_settings()
|
||||
|
||||
@@ -272,7 +277,7 @@ class GeoAssistantService:
|
||||
|
||||
temporal_series: list[AssistantTemporalSeries] = []
|
||||
temporal_context: list[dict[str, Any]] = []
|
||||
include_history = any(keyword in payload.question.casefold() for keyword in self.HISTORY_KEYWORDS)
|
||||
include_history = self.history_requested(payload.question)
|
||||
for key, observations in self._series(datasets):
|
||||
first = observations[0]
|
||||
last = observations[-1]
|
||||
|
||||
Reference in New Issue
Block a user