Skip to content

Commit 9faf48e

Browse files
committed
修复:Google搜索使用模糊匹配以避免无结果
1 parent bc1c991 commit 9faf48e

File tree

1 file changed

+4
-4
lines changed
  • backend_api_python/app/services/agents

1 file changed

+4
-4
lines changed

backend_api_python/app/services/agents/tools.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -525,13 +525,13 @@ def get_news(self, market: str, symbol: str, days: int = 7, company_name: str =
525525

526526
if market == 'AShare':
527527
# AShare CN keywords
528-
search_query = f'"{search_name}" {symbol} (利好 OR 利空 OR 财报 OR 公告 OR 业绩) after:{datetime.now().year-1}'
528+
search_query = f'{search_name} {symbol} (利好 OR 利空 OR 财报 OR 公告 OR 业绩) after:{datetime.now().year-1}'
529529
elif market == 'HShare':
530-
search_query = f'"{search_name}" {symbol} (港股 OR 股价 OR 业绩) after:{datetime.now().year-1}'
530+
search_query = f'{search_name} {symbol} (港股 OR 股价 OR 业绩) after:{datetime.now().year-1}'
531531
elif market == 'Crypto':
532-
search_query = f'"{search_name}" {symbol} crypto news analysis'
532+
search_query = f'{search_name} {symbol} crypto news analysis'
533533
else:
534-
search_query = f'"{search_name}" {symbol} stock news'
534+
search_query = f'{search_name} {symbol} stock news'
535535

536536
logger.info(f"Running news search: {search_query}")
537537
# Google CSE uses `dateRestrict` as a separate param; SearchService supports it.

0 commit comments

Comments
 (0)