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"

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.

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.1.3.tar.gz (2.7 kB view hashes)

Uploaded Source

Built Distribution

llama_index_readers_zulip-0.1.3-py3-none-any.whl (3.0 kB view hashes)

Uploaded Python 3

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