feat(mcp): search_org accepte track=False pour ne pas polluer Matomo

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Colin Maudry
2026-07-09 20:01:57 +02:00
parent 722694bec9
commit ce9a79f420
3 changed files with 26 additions and 2 deletions
+5 -2
View File
@@ -5,7 +5,9 @@ from src.utils.table import add_links
from src.utils.tracking import track_search
def search_org(dff: pl.DataFrame, query: str, org_type: str) -> pl.DataFrame:
def search_org(
dff: pl.DataFrame, query: str, org_type: str, track: bool = True
) -> pl.DataFrame:
"""
Search in either 'acheteur' or 'titulaire' DataFrame.
@@ -18,7 +20,8 @@ def search_org(dff: pl.DataFrame, query: str, org_type: str) -> pl.DataFrame:
return dff.select(pl.lit(False).alias("matches"))
# Enregistrement des recherche dans Matomo
track_search(query, "home_page_search")
if track:
track_search(query, "home_page_search")
# Normalize query
normalized_query = unidecode(query.strip()).upper()