Wikipedia#

class langchain_community.docstore.wikipedia.Wikipedia[source]#

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.

__init__() None[source]#

Check that wikipedia package is installed.

Return type:

None

delete(ids: List) None#

Deleting IDs from in memory dictionary.

Parameters:

ids (List)

Return type:

None

search(search: str) 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:

str | Document

Returns: a Document object or error message.