langchain_community.docstore.wikipedia
.Wikipedia¶
- class langchain_community.docstore.wikipedia.Wikipedia[source]¶
Wrapper around wikipedia API.
Check that wikipedia package is installed.
Methods
__init__
()Check that wikipedia package is installed.
delete
(ids)Deleting IDs from in memory dictionary.
search
(search)Try to search for wiki page.
- delete(ids: List) None ¶
Deleting IDs from in memory dictionary.
- Parameters
ids (List) –
- Return type
None
- search(search: str) Union[str, Document] [source]¶
Try to search for wiki page.
If page exists, return the page summary, and a PageWithLookups object. If page does not exist, return similar entries.
- Parameters
search (str) – search string.
- Return type
Union[str, Document]
Returns: a Document object or error message.