Skip to main content

Tool plugin for zk-rag to search Wikipedia

Project description

zk-rag-wikipedia Plugin

A plugin for zk-rag that enables Wikipedia content lookup functionality.

Description

This plugin provides a tool to search and retrieve content from Wikipedia articles. It can be used to enhance your RAG (Retrieval-Augmented Generation) applications with Wikipedia knowledge.

Features

  • Search Wikipedia articles
  • Retrieve article summaries
  • Handle disambiguation pages
  • Comprehensive error handling

Installation

pip install zk-rag-wikipedia

Usage

The plugin will be automatically discovered by zk-rag when installed. It provides the LookUpTopicOnWikipedia tool which can be used to retrieve information about specific topics from Wikipedia.

Example usage through zk-rag:

from zk_rag import get_tool

wikipedia_tool = get_tool("wikipedia")
result = wikipedia_tool.run("Python programming language")
print(result.title)  # The article title
print(result.content)  # The article summary
print(result.url)  # The Wikipedia URL

Requirements

  • Python >= 3.11
  • mojentic
  • wikipedia

Local Development

To set up this project for local development:

  1. Clone the repository:

    git clone https://github.com/yourusername/zk-rag-wikipedia.git
    cd zk-rag-wikipedia
    
  2. Create and activate a virtual environment:

    python -m venv .venv
    source .venv/bin/activate  # On Windows, use: .venv\Scripts\activate
    
  3. Install development dependencies:

    pip install -r requirements.txt
    pip install -r dev-requirements.txt
    
  4. Install the package in editable mode:

    pip install -e .
    

Building Locally

To build the package locally:

  1. Ensure you have the build dependencies:

    pip install build
    
  2. Build the package:

    python -m build
    

This will create both wheel and source distribution in the dist/ directory.

Running Tests

To run the tests:

pytest

License

MIT License

Author

Stacey Vetzal (stacey@vetzal.com)

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

zk_rag_wikipedia-1.0.1.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

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

zk_rag_wikipedia-1.0.1-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file zk_rag_wikipedia-1.0.1.tar.gz.

File metadata

  • Download URL: zk_rag_wikipedia-1.0.1.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for zk_rag_wikipedia-1.0.1.tar.gz
Algorithm Hash digest
SHA256 0a35910ef77879725162ae6cf5ba84462f2b2a919d4da0286a21a3d2b4d0e18d
MD5 b42e2ca38a02167c0aaebe6b4ef45190
BLAKE2b-256 6da010952f23f648b5ee25ea24f90daa1cc908ca564137cfc6f0fa0c1f018e21

See more details on using hashes here.

Provenance

The following attestation bundles were made for zk_rag_wikipedia-1.0.1.tar.gz:

Publisher: python-publish.yml on svetzal/zk-rag-wikipedia

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file zk_rag_wikipedia-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for zk_rag_wikipedia-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 eb68307624100b4bef7c95d5efdb1283fe43358f019360cc899cd3e132ed518c
MD5 220589fbce3669ae91de4da69da58430
BLAKE2b-256 0714504531b0fc10a8d16788992d493e25eea8ab8e3780c3e5f3f8608b2ae956

See more details on using hashes here.

Provenance

The following attestation bundles were made for zk_rag_wikipedia-1.0.1-py3-none-any.whl:

Publisher: python-publish.yml on svetzal/zk-rag-wikipedia

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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