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.2.tar.gz (3.0 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.2-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: zk_rag_wikipedia-1.0.2.tar.gz
  • Upload date:
  • Size: 3.0 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.2.tar.gz
Algorithm Hash digest
SHA256 6d665f9be6d6ceb7be649622cd12f179a89f207ea09f78b8a240122a4b22a36e
MD5 36bd220bcaf76425e67138880ecc0c35
BLAKE2b-256 e343d00fabbfc13b28ad87f7ac272113d2f27006a5d7f3d0fc707ee9ab609e6a

See more details on using hashes here.

Provenance

The following attestation bundles were made for zk_rag_wikipedia-1.0.2.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.2-py3-none-any.whl.

File metadata

File hashes

Hashes for zk_rag_wikipedia-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7c8f9318d06c17655e385277ea9b60e7c00d2015194b017324f3d3675c8bf119
MD5 fbe7a6678c1b520eeaab9150940ee38e
BLAKE2b-256 d0b8c4495812ab4ceab9ff955e78274084e87ec27b821195cfb118859aea81b0

See more details on using hashes here.

Provenance

The following attestation bundles were made for zk_rag_wikipedia-1.0.2-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