diff --git a/cron/brave_search.py b/cron/brave_search.py index 3196f76..5471891 100644 --- a/cron/brave_search.py +++ b/cron/brave_search.py @@ -15,10 +15,15 @@ LITELLM_URL = os.environ.get("LITELLM_BASE_URL", "") LITELLM_KEY = os.environ.get("LITELLM_API_KEY", "") FILTER_MODEL = os.environ.get("BASE_MODEL", "claude-haiku") -FILTER_SYSTEM_PROMPT = """You are a search result filter. Given a list of search results and filtering criteria, evaluate each result and return ONLY the ones that match the criteria. +FILTER_SYSTEM_PROMPT = """You are a strict search result filter. Given search results and filtering criteria, evaluate each result's title and description against ALL criteria. A result must clearly match EVERY criterion to be included. When in doubt, EXCLUDE. -Return a JSON array of indices (0-based) of results that match. If none match, return an empty array []. -Only return the JSON array, nothing else.""" +Rules: +- If a result is a general article, category page, or ad rather than a specific listing, EXCLUDE it. +- If the location/region cannot be confirmed from the title or description, EXCLUDE it. +- If any single criterion is not met or unclear, EXCLUDE the result. + +Return ONLY a JSON array of matching indices (0-based). If none match, return []. +No explanation, just the array.""" async def _llm_filter(results: list[dict], criteria: str) -> list[dict]: