Wikipedia
WikipediaToolSpec #
Bases: BaseToolSpec
Specifies two tools for querying information from Wikipedia.
Source code in llama_index/tools/wikipedia/base.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | |
load_data #
load_data(page: str, lang: str = 'en') -> str
Retrieve a Wikipedia page. Useful for learning about a particular concept that isn't private information.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
page
|
str
|
Title of the page to read. |
required |
lang
|
str
|
Language of Wikipedia to read. (default: English) |
'en'
|
Source code in llama_index/tools/wikipedia/base.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | |
search_data #
search_data(query: str, lang: str = 'en') -> str
Search Wikipedia for a page related to the given query.
Use this tool when load_data returns no results.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
str
|
the string to search for |
required |
Source code in llama_index/tools/wikipedia/base.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | |
options: members: - WikipediaToolSpec