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.0.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for llama_index_tools_wikipedia-0.4.0.tar.gz
Algorithm Hash digest
SHA256 ad76718508cd8028c2b2acd442727129b95e3de3b714ef3205dc0220a2976829
MD5 56b9b7dcd85265415621e5ea46e675de
BLAKE2b-256 9891363291f0928c1503c7678bf544eac753d966295512b7cf5ac0a266b0a4e3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for llama_index_tools_wikipedia-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 91dbc72172ff3eb2d38135e52ec5e476a848ae5e775278674298f7f914c891f4
MD5 0332a6edb5eda7dc3b6265043a9d6002
BLAKE2b-256 128956bdd34f1099a9f4e0f4d4429ff36a2e93123ee203289c04039aebe54a15

See more details on using hashes here.

Supported by

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