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.1.0.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.1.0-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: zk_rag_wikipedia-1.1.0.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.1.0.tar.gz
Algorithm Hash digest
SHA256 9de2ef2c88833f24f76cf01177837ee797ed026d735e585832648f06098ea817
MD5 29af9e23ad16de9d10eb6ac1ca8f8b17
BLAKE2b-256 7569e21e633b5bd15eb39bdda537fc917997d16485b6930dec105ebeb2d39cdd

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for zk_rag_wikipedia-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aee195166ff876962f26bffbf9314cab525952659a8d1dcc0f88817a8aef266f
MD5 39978c646d0707ca6411cac2cf2da8f1
BLAKE2b-256 53208c94d7856395162e8a0df463730c4321f6a6f04b311c117c41f6d93f49d8

See more details on using hashes here.

Provenance

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