Skip to main content

llama-index readers whatsapp integration

Project description

Whatsapp chat loader

pip install llama-index-readers-whatsapp

Export a Whatsapp chat

  1. Open a chat
  2. Tap on the menu > More > Export chat
  3. Select Without media
  4. Save the .txt file in your working directory

For more info see Whatsapp's Help Center

Usage

  • Messages will get saved in the format: {timestamp} {author}: {message}. Useful for when you want to ask about specific people in a group chat.
  • Metadata automatically included: source (file name), author and timestamp.
from pathlib import Path

from llama_index.readers.whatsapp import WhatsappChatLoader

path = "whatsapp.txt"
loader = WhatsappChatLoader(path=path)
documents = loader.load_data()

# see what's created
documents[0]
# >>> Document(text='2023-02-20 00:00:00 ur mom: Hi 😊', doc_id='e0a7c508-4ba0-48e1-a2ba-9af133225636', embedding=None, extra_info={'source': 'WhatsApp Chat with ur mom', 'author': 'ur mom', 'date': '2023-02-20 00:00:00'})

This loader is designed to be used as a way to load data into LlamaIndex.

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_whatsapp-0.2.0.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file llama_index_readers_whatsapp-0.2.0.tar.gz.

File metadata

File hashes

Hashes for llama_index_readers_whatsapp-0.2.0.tar.gz
Algorithm Hash digest
SHA256 652cc363e6951de0ee98d5aa9ecb7ee3378ab4886b8ccdea0f0dbf52d46e857b
MD5 21d0aa45147856d7e34ceddccf422e3b
BLAKE2b-256 b37ff50f8d46921ef4b09281788fb0890abdba5b47bb9f4e916f0a1b91260ac3

See more details on using hashes here.

File details

Details for the file llama_index_readers_whatsapp-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_readers_whatsapp-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0a810daf2197b1612207591086a5d50e0b5a0fccc4cd1b80d359280dd19b9c4e
MD5 8957246483bf7d5a8c4b4fe169b045fe
BLAKE2b-256 deb0ed43a9bbc62e9de2573844cda3ab77f022afb91ca23c226bb8f7072a42d9

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