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.4.0.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

llama_index_readers_whatsapp-0.4.0-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for llama_index_readers_whatsapp-0.4.0.tar.gz
Algorithm Hash digest
SHA256 9131fe4788681bd271edab52a57f29f31c60468d75b7aa75bb164d9e46fe0a22
MD5 bec497d9725f4c018787718417cd669c
BLAKE2b-256 834ba277893d33ecdd1ea8f364646057f569b9f6b289b808898f34dcc02a475b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for llama_index_readers_whatsapp-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0895e38e0ef13c075e19e209920476727e1d22975579d190d309f6243cd89042
MD5 410b5e80b59fb1d9bb7f0eb4303bf3e6
BLAKE2b-256 09dff43d953293743cf47a47cd451a8086bf15cc6e3c6657fe62e4249e48d37a

See more details on using hashes here.

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