Skip to main content
Telegram Messenger는 전 세계적으로 접근 가능한 프리미엄, 크로스 플랫폼, 암호화된 클라우드 기반 중앙 집중식 인스턴트 메시징 서비스입니다. 이 애플리케이션은 선택적 엔드투엔드 암호화 채팅 및 화상 통화, VoIP, 파일 공유 및 여러 기타 기능도 제공합니다.
이 노트북은 Telegram으로부터 데이터를 로드하여 LangChain에 수집할 수 있는 형식으로 변환하는 방법을 다룹니다.
from langchain_community.document_loaders import (
    TelegramChatApiLoader,
    TelegramChatFileLoader,
)
loader = TelegramChatFileLoader("example_data/telegram.json")
loader.load()
[Document(page_content="Henry on 2020-01-01T00:00:02: It's 2020...\n\nHenry on 2020-01-01T00:00:04: Fireworks!\n\nGrace 🧤 ðŸ\x8d’ on 2020-01-01T00:00:05: You're a minute late!\n\n", metadata={'source': 'example_data/telegram.json'})]
TelegramChatApiLoader는 Telegram의 지정된 채팅에서 직접 데이터를 로드합니다. 데이터를 내보내려면 Telegram 계정을 인증해야 합니다. my.telegram.org/auth?to=apps에서 API_HASH 및 API_ID를 얻을 수 있습니다. chat_entity – 채널의 엔티티를 사용하는 것이 권장됩니다.
loader = TelegramChatApiLoader(
    chat_entity="<CHAT_URL>",  # recommended to use Entity here
    api_hash="<API HASH >",
    api_id="<API_ID>",
    username="",  # needed only for caching the session.
)
loader.load()

Connect these docs programmatically to Claude, VSCode, and more via MCP for real-time answers.
I