WP output fixes

This commit is contained in:
moosecrap 2026-07-25 02:40:17 -07:00
parent d8a2a102e4
commit 449a41742d

View File

@ -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]: