From 449a41742d4ddee75c32ca687f0780ab0b897c3d Mon Sep 17 00:00:00 2001 From: moosecrap Date: Sat, 25 Jul 2026 02:40:17 -0700 Subject: [PATCH] WP output fixes --- tools/wikipedia.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/wikipedia.py b/tools/wikipedia.py index 26c6736..c93e154 100644 --- a/tools/wikipedia.py +++ b/tools/wikipedia.py @@ -50,7 +50,7 @@ async def _search(title: str, limit: int = 5, fallback: bool = False) -> str: return f"No Wikipedia results found for '{title}'." if fallback: - header = f"Article not found. Here are some similar results for '{title}':" + header = f"Article not found. Please select one of the following similar articles to proceed with '{title}':" else: header = f"Search results for '{title}':" @@ -61,6 +61,9 @@ async def _search(title: str, limit: int = 5, fallback: bool = False) -> str: # Brackets around title help the AI identify the exact string for subsequent calls lines.append(f"{i}. [{title_res}] - Snippet: {snippet}") + if fallback: + lines.append("\n[Tip: Use the title in brackets [ ] to explore the selected page.]") + return "\n".join(lines) async def _fetch_content(title: str, section_index: int) -> Optional[str]: