Skip to main content

llama-index tools wikipedia integration

Project description

Wikipedia Tool

This tool fetches content from wikipedia and makes it available to the agent as a Tool. You can search for pages or load pages directly.

Usage

This tool has more extensive example usage documented in a Jupyter notebook here

from llama_index.tools.wikipedia import WikipediaToolSpec
from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.openai import OpenAI

tool_spec = WikipediaToolSpec()

agent = FunctionAgent(
    tools=tool_spec.to_tool_list(), llm=OpenAI(model="gpt-4.1")
)

print(await agent.run("Who is Ben Afflecks spouse?"))

load_data: Loads a page from wikipedia search_data: Searches wikipedia for a query and loads all matching pages

This loader is designed to be used as a way to load data as a Tool in a Agent. See this LlamaIndex tutorial for examples.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llama_index_tools_wikipedia-0.4.1.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

llama_index_tools_wikipedia-0.4.1-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file llama_index_tools_wikipedia-0.4.1.tar.gz.

File metadata

File hashes

Hashes for llama_index_tools_wikipedia-0.4.1.tar.gz
Algorithm Hash digest
SHA256 a10f486818adbbbce1129f054f7b95de5361cba118367c2078b01347f35812c6
MD5 0e135f59f77da33390079810190c4b22
BLAKE2b-256 ba51a9ed3f846ed5bec50dd4371fc1411f2d86466be5dbb78733652805fb522a

See more details on using hashes here.

File details

Details for the file llama_index_tools_wikipedia-0.4.1-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_tools_wikipedia-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c2b879669e8358d41e0baec3d6279721a5b73772717d8e869b20e9c8a4d9b312
MD5 40a3fa3bba49832624b4e29be7da8353
BLAKE2b-256 ea835b2bfbfa41e1b5a68c680667f3e7fb406db9dac5ce58b3891a96143f020a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page