mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-13 16:36:06 +00:00
Fix wikipedia summaries (#2187)
This upsteam wikipedia page loading seems to still have issues. Finding a compromise solution where it does an exact match search and not a search for the completion. See previous PR: https://github.com/hwchase17/langchain/pull/2169
This commit is contained in:
parent
35a3218e84
commit
5d86a6acf1
@ -47,7 +47,7 @@ class WikipediaAPIWrapper(BaseModel):
|
||||
|
||||
def fetch_formatted_page_summary(self, page: str) -> Optional[str]:
|
||||
try:
|
||||
wiki_page = self.wiki_client.page(pageid=page)
|
||||
wiki_page = self.wiki_client.page(title=page, auto_suggest=False)
|
||||
return f"Page: {page}\nSummary: {wiki_page.summary}"
|
||||
except (
|
||||
self.wiki_client.exceptions.PageError,
|
||||
|
Loading…
Reference in New Issue
Block a user