Skip to main content

llama-index readers zulip integration

Project description

Zulip Loader

The Zulip Loader is a Python script that allows you to load data from Zulip streams using a Zulip bot's API token. It fetches messages from specified streams or all streams if none are specified, and returns a list of documents with the stream content.

Prerequisites

Create a Zulip bot and obtain its API token. Follow the instructions in the Zulip documentation to create a bot and get the API key (token).

Set the ZULIP_TOKEN environment variable to your Zulip bot's API token:

export ZULIP_TOKEN="your-zulip-bot-api-token"

Installation

You can install the Zulip Reader via pip:

pip install llama-index-readers-zulip

Usage

Use the ZulipReader class to load data from Zulip streams:

from zulip_loader import ZulipReader

# Initialize the ZulipReader with the bot's email and Zulip domain
reader = ZulipReader(
    zulip_email="your-bot-email@your-zulip-domain.zulipchat.com",
    zulip_domain="your-zulip-domain.zulipchat.com",
)

# Load data from all streams
data = reader.load_data(reader.get_all_streams())

# Load data from specific streams
stream_names = ["stream1", "stream2"]
data = reader.load_data(stream_names)
# This will return a list of documents containing the content of the specified streams.

For more customization, you can pass the reverse_chronological parameter to the load_data() method to indicate the order of messages in the output.

This loader is designed to be used as a way to load data into LlamaIndex and/or subsequently used as a Tool in a LangChain Agent.

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_readers_zulip-0.3.0.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file llama_index_readers_zulip-0.3.0.tar.gz.

File metadata

  • Download URL: llama_index_readers_zulip-0.3.0.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.10 Darwin/22.3.0

File hashes

Hashes for llama_index_readers_zulip-0.3.0.tar.gz
Algorithm Hash digest
SHA256 18862c4f1cf25c791782279d3d08aaaabd6f5b0e682130a89e3a222ae3b5eb22
MD5 feabf561181f764e92df49476a59b51b
BLAKE2b-256 4d474faa53c79ad2a39b919cea839a28780c332f59bb8a2fd4e4a54dbd24411b

See more details on using hashes here.

File details

Details for the file llama_index_readers_zulip-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_readers_zulip-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ae0811c3043d7521a7b0c34b5c13e1f8b1ce1dc5ff96acec1c9b2e2791665f30
MD5 180f19b5cc8119422949e2917002b851
BLAKE2b-256 060e58f929c06b47d8fa97369a826bff7c79104911f47e8c9410d6e64d817df6

See more details on using hashes here.

Supported by

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