From 83cb3bbc9f2d9dd775749f8667aa04bc52d66f50 Mon Sep 17 00:00:00 2001 From: Boqi Chen Date: Mon, 17 Nov 2025 15:36:55 -0500 Subject: [PATCH] adapt arxiv search to new response format --- src/sherpa_ai/tools.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/sherpa_ai/tools.py b/src/sherpa_ai/tools.py index 6297c1e9..c23b09c7 100644 --- a/src/sherpa_ai/tools.py +++ b/src/sherpa_ai/tools.py @@ -126,6 +126,10 @@ def _run( summaries = re.findall(summary_pattern, xml_content, re.DOTALL) title_pattern = r"(.*?)" titles = re.findall(title_pattern, xml_content, re.DOTALL) + + # Note that arXiv may return on extra title for the search feed itself + titles = titles[len(titles) - len(summaries):] # align titles and summaries + id_pattern = r"(.*?)" ids = re.findall(id_pattern, xml_content, re.DOTALL)