Fix incorrect wikipage summaries (#2169)

Creating a page using the title causes a wikipedia search with
autocomplete set to true. This frequently causes the summaries to be
unrelated to the actual page found.

See:
1554943e8a/wikipedia/wikipedia.py (L254-L280)
doc
Rui Ferreira 1 year ago committed by GitHub
parent 6be67279fb
commit f83c36d8fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -47,7 +47,7 @@ class WikipediaAPIWrapper(BaseModel):
def fetch_formatted_page_summary(self, page: str) -> Optional[str]:
try:
wiki_page = self.wiki_client.page(title=page)
wiki_page = self.wiki_client.page(pageid=page)
return f"Page: {page}\nSummary: {wiki_page.summary}"
except (
self.wiki_client.exceptions.PageError,

Loading…
Cancel
Save