id stringlengths 14 16 | text stringlengths 29 2.73k | source stringlengths 50 116 |
|---|---|---|
b103b496aa5d-1 | Click “Reset password”
Follow the prompts to reset the password
Format for Elastic Cloud URLs is
https://username:password@cluster_id.region_id.gcp.cloud.es.io:9243.
Example:
from langchain import ElasticVectorSearch
from langchain.embeddings import OpenAIEmbeddings
embedding = OpenAIEmbeddings(... | https:///python.langchain.com/en/latest/modules/indexes/vectorstores/examples/elasticsearch.html |
b103b496aa5d-2 | We cannot let this happen.
Tonight. I call on the Senate to: Pass the Freedom to Vote Act. Pass the John Lewis Voting Rights Act. And while you’re at it, pass the Disclose Act so Americans can know who is funding our elections.
Tonight, I’d like to honor someone who has dedicated his life to serve this country: Justi... | https:///python.langchain.com/en/latest/modules/indexes/vectorstores/examples/elasticsearch.html |
548c016ee949-0 | .ipynb
.pdf
Tair
Tair#
This notebook shows how to use functionality related to the Tair vector database.
To run, you should have an Tair instance up and running.
from langchain.embeddings.fake import FakeEmbeddings
from langchain.text_splitter import CharacterTextSplitter
from langchain.vectorstores import Tair
from la... | https:///python.langchain.com/en/latest/modules/indexes/vectorstores/examples/tair.html |
548c016ee949-1 | docs = vector_store.similarity_search(query)
docs[0]
Document(page_content='We’re going after the criminals who stole billions in relief money meant for small businesses and millions of Americans. \n\nAnd tonight, I’m announcing that the Justice Department will name a chief prosecutor for pandemic fraud. \n\nBy the en... | https:///python.langchain.com/en/latest/modules/indexes/vectorstores/examples/tair.html |
aa5b06fffd45-0 | .ipynb
.pdf
Airbyte JSON
Airbyte JSON#
This covers how to load any source from Airbyte into a local JSON file that can be read in as a document
Prereqs:
Have docker desktop installed
Steps:
Clone Airbyte from GitHub - git clone https://github.com/airbytehq/airbyte.git
Switch into Airbyte directory - cd airbyte
Start Ai... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/airbyte_json.html |
aa5b06fffd45-1 | game_indices:
game_index: 180
version:
name: red
url: https://pokeapi.co/api/v2/version/1/
game_index: 180
version:
name: blue
url: https://pokeapi.co/api/v2/version/2/
game_index: 180
version:
n
previous
CoNLL-U
next
Apify Dataset
By Harrison Chase
© Copyright 2023, Harrison Chase.
Last updated... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/airbyte_json.html |
f7216a8a34a1-0 | .ipynb
.pdf
Diffbot
Diffbot#
This covers how to extract HTML documents from a list of URLs using the Diffbot extract API, into a document format that we can use downstream.
urls = [
"https://python.langchain.com/en/latest/index.html",
]
The Diffbot Extract API Requires an API token. Once you have it, you can extrac... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/diffbot.html |
f7216a8a34a1-1 | [Document(page_content='LangChain is a framework for developing applications powered by language models. We believe that the most powerful and differentiated applications will not only call out to a language model via an API, but will also:\nBe data-aware: connect a language model to other sources of data\nBe agentic: ... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/diffbot.html |
f7216a8a34a1-2 | This includes prompt management, prompt optimization, and prompt serialization.\nMemory: Memory is the concept of persisting state between calls of a chain/agent. LangChain provides a standard interface for memory, a collection of memory implementations, and examples of chains/agents that use memory.\nIndexes: Language... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/diffbot.html |
f7216a8a34a1-3 | ways. LangChain also provides guidance and assistance in this. Below are some of the common use cases LangChain supports.\nPersonal Assistants: The main LangChain use case. Personal assistants need to take actions, remember interactions, and have knowledge about your data.\nQuestion Answering: The second big LangChain ... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/diffbot.html |
f7216a8a34a1-4 | type of Data Augmented Generation.\nEvaluation: Generative models are notoriously hard to evaluate with traditional metrics. One new way of evaluating them is using language models themselves to do the evaluation. LangChain provides some prompts/chains for assisting in this.\nReference Docs\nAll of LangChain’s referenc... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/diffbot.html |
f7216a8a34a1-5 | template repositories for deploying LangChain apps.\nTracing: A guide on using tracing in LangChain to visualize the execution of chains and agents.\nModel Laboratory: Experimenting with different prompts, models, and chains is a big part of developing the best possible application. The ModelLaboratory makes it easy to... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/diffbot.html |
f7216a8a34a1-6 | previous
DataFrame Loader
next
Directory Loader
By Harrison Chase
© Copyright 2023, Harrison Chase.
Last updated on May 02, 2023. | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/diffbot.html |
ea264cc2caf6-0 | .ipynb
.pdf
Modern Treasury
Modern Treasury#
This notebook covers how to load data from the Modern Treasury REST API into a format that can be ingested into LangChain, along with example usage for vectorization.
import os
from langchain.document_loaders import ModernTreasuryLoader
from langchain.indexes import Vectorst... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/modern_treasury.html |
b71cbcc8d627-0 | .ipynb
.pdf
Figma
Figma#
This notebook covers how to load data from the Figma REST API into a format that can be ingested into LangChain, along with example usage for code generation.
import os
from langchain.document_loaders.figma import FigmaFileLoader
from langchain.text_splitter import CharacterTextSplitter
from la... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/figma.html |
b71cbcc8d627-1 | # See https://python.langchain.com/en/latest/modules/models/chat/getting_started.html for chat info
system_prompt_template = """You are expert coder Jon Carmack. Use the provided design context to create idomatic HTML/CSS code as possible based on the user request.
Everything must be inline in one file and your... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/figma.html |
b71cbcc8d627-2 | <!DOCTYPE html>\n<html lang="en">\n<head>\n <meta charset="UTF-8">\n <meta name="viewport" content="width=device-width, initial-scale=1.0">\n <style>\n @import url(\'https://fonts.googleapis.com/css2?family=DM+Sans:wght@500;700&family=Inter:wght@600&display=swap\');\n\n body {\n margin... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/figma.html |
b71cbcc8d627-3 | font-weight: 700;\n margin: 0;\n }\n\n .header nav {\n display: flex;\n align-items: center;\n }\n\n .header nav a {\n font-size: 14px;\n font-weight: 500;\n text-decoration: none;\n color: #000;\n margin... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/figma.html |
b71cbcc8d627-4 | Ipsum</a>\n <a href="#">Lorem Ipsum</a>\n <a href="#">Lorem Ipsum</a>\n </nav>\n </header>\n</body>\n</html> | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/figma.html |
b71cbcc8d627-5 | previous
Facebook Chat
next
GCS Directory
By Harrison Chase
© Copyright 2023, Harrison Chase.
Last updated on May 02, 2023. | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/figma.html |
9de6b28117aa-0 | .ipynb
.pdf
BigQuery Loader
Contents
Basic Usage
Specifying Which Columns are Content vs Metadata
Adding Source to Metadata
BigQuery Loader#
Load a BigQuery query with one document per row.
from langchain.document_loaders import BigQueryLoader
BASE_QUERY = '''
SELECT
id,
dna_sequence,
organism
FROM (
SELECT
... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/bigquery.html |
9de6b28117aa-1 | Specifying Which Columns are Content vs Metadata#
loader = BigQueryLoader(BASE_QUERY, page_content_columns=["dna_sequence", "organism"], metadata_columns=["id"])
data = loader.load()
print(data)
[Document(page_content='dna_sequence: ATTCGA\norganism: Lokiarchaeum sp. (strain GC14_75).', lookup_str='', metadata={'id': 1... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/bigquery.html |
9de6b28117aa-2 | data = loader.load()
print(data)
[Document(page_content='id: 1\ndna_sequence: ATTCGA\norganism: Lokiarchaeum sp. (strain GC14_75).\nsource: 1', lookup_str='', metadata={'source': 1}, lookup_index=0), Document(page_content='id: 2\ndna_sequence: AGGCGA\norganism: Heimdallarchaeota archaeon (strain LC_2).\nsource: 2', loo... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/bigquery.html |
5037dd704a65-0 | .ipynb
.pdf
Discord
Discord#
You can follow the below steps to download your Discord data:
Go to your User Settings
Then go to Privacy and Safety
Head over to the Request all of my Data and click on Request Data button
It might take 30 days for you to receive your data. You’ll receive an email at the address which is r... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/discord_loader.html |
e2465f9df1d4-0 | .ipynb
.pdf
PowerPoint
Contents
Retain Elements
PowerPoint#
This covers how to load PowerPoint documents into a document format that we can use downstream.
from langchain.document_loaders import UnstructuredPowerPointLoader
loader = UnstructuredPowerPointLoader("example_data/fake-power-point.pptx")
data = loader.load... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/powerpoint.html |
a77235aacf94-0 | .ipynb
.pdf
EPubs
Contents
Retain Elements
EPubs#
This covers how to load .epub documents into a document format that we can use downstream. You’ll need to install the pandocs package for this loader to work.
from langchain.document_loaders import UnstructuredEPubLoader
loader = UnstructuredEPubLoader("winter-sports.... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/epub.html |
bf89bfef1772-0 | .ipynb
.pdf
Azure Blob Storage File
Azure Blob Storage File#
This covers how to load document objects from a Azure Blob Storage file.
from langchain.document_loaders import AzureBlobStorageFileLoader
#!pip install azure-storage-blob
loader = AzureBlobStorageFileLoader(conn_str='<connection string>', container='<contain... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/azure_blob_storage_file.html |
edc5118b2efd-0 | .ipynb
.pdf
Git
Contents
Load existing repository from disk
Clone repository from url
Filtering files to load
Git#
This notebook shows how to load text files from Git repository.
Load existing repository from disk#
from git import Repo
repo = Repo.clone_from(
"https://github.com/hwchase17/langchain", to_path="./e... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/git.html |
230d31a91985-0 | .ipynb
.pdf
Images
Contents
Using Unstructured
Retain Elements
Images#
This covers how to load images such as JPGs PNGs into a document format that we can use downstream.
Using Unstructured#
from langchain.document_loaders.image import UnstructuredImageLoader
loader = UnstructuredImageLoader("layout-parser-paper-fast... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/image.html |
230d31a91985-1 | Document(page_content="LayoutParser: A Unified Toolkit for Deep\nLearning Based Document Image Analysis\n\n\n‘Zxjiang Shen' (F3}, Ruochen Zhang”, Melissa Dell*, Benjamin Charles Germain\nLeet, Jacob Carlson, and Weining LiF\n\n\nsugehen\n\nshangthrows, et\n\n“Abstract. Recent advanocs in document image analysis (DIA) h... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/image.html |
230d31a91985-2 | streamlining the sage of DL in DIA research and appicn\n‘tons The core LayoutFaraer brary comes with a sch of simple and\nIntative interfaee or applying and eutomiing DI. odel fr Inyo de\npltfom for sharing both protrined modes an fal document dist\n{ation pipeline We demonutate that LayootPareer shea fr both\nlightwei... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/image.html |
230d31a91985-3 | Retain Elements#
Under the hood, Unstructured creates different “elements” for different chunks of text. By default we combine those together, but you can easily keep that separation by specifying mode="elements".
loader = UnstructuredImageLoader("layout-parser-paper-fast.jpg", mode="elements")
data = loader.load()
dat... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/image.html |
b0ba74431bbc-0 | .ipynb
.pdf
Subtitle Files
Subtitle Files#
How to load data from subtitle (.srt) files
from langchain.document_loaders import SRTLoader
loader = SRTLoader("example_data/Star_Wars_The_Clone_Wars_S06E07_Crisis_at_the_Heart.srt")
docs = loader.load()
docs[0].page_content[:100]
'<i>Corruption discovered\nat the core of the... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/srt.html |
201c882915b7-0 | .ipynb
.pdf
Notion
Contents
🧑 Instructions for ingesting your own dataset
Notion#
This notebook covers how to load documents from a Notion database dump.
In order to get this notion dump, follow these instructions:
🧑 Instructions for ingesting your own dataset#
Export your dataset from Notion. You can do this by cl... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/notion.html |
72ffc14dc9d4-0 | .ipynb
.pdf
EverNote
EverNote#
How to load EverNote file from disk.
# !pip install pypandoc
# import pypandoc
# pypandoc.download_pandoc()
from langchain.document_loaders import EverNoteLoader
loader = EverNoteLoader("example_data/testing.enex")
loader.load()
[Document(page_content='testing this\n\nwhat happens?\n\nto ... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/evernote.html |
dfd9854870ca-0 | .ipynb
.pdf
Reddit
Reddit#
This loader fetches the text from the Posts of Subreddits or Reddit users, using the praw Python package.
Make a Reddit Application from https://www.reddit.com/prefs/apps/ and initialize the loader with with your Reddit API credentials.
from langchain.document_loaders import RedditPostsLoader... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/reddit.html |
dfd9854870ca-1 | documents = loader.load()
documents[:5]
[Document(page_content='Hello, I am not looking for investment advice. I will apply my own due diligence. However, I am interested if anyone knows as a UK resident how fees and exchange rate differences would impact performance?\n\nI am planning to create a pie of index funds (pe... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/reddit.html |
dfd9854870ca-2 | Document(page_content='Have a general question? Want to offer some commentary on markets? Maybe you would just like to throw out a neat fact that doesn\'t warrant a self post? Feel free to post here! \n\nIf your question is "I have $10,000, what do I do?" or other "advice for my personal situation" questions, you sh... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/reddit.html |
dfd9854870ca-3 | big debts (include interest rate) or expenses? \n* And any other relevant financial information will be useful to give you a proper answer. \n\nPlease consider consulting our FAQ first - https://www.reddit.com/r/investing/wiki/faq\nAnd our [side bar](https://www.reddit.com/r/investing/about/sidebar) also has useful r... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/reddit.html |
dfd9854870ca-4 | Thread - April 27, 2023', 'post_score': 5, 'post_id': '130eszz', 'post_url': 'https://www.reddit.com/r/investing/comments/130eszz/daily_general_discussion_and_advice_thread_april/', 'post_author': Redditor(name='AutoModerator')}), | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/reddit.html |
dfd9854870ca-5 | Document(page_content="Based on recent news about salt battery advancements and the overall issues of lithium, I was wondering what would be feasible ways to invest into non-lithium based battery technologies? CATL is of course a choice, but the selection of brokers I currently have in my disposal don't provide HK stoc... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/reddit.html |
dfd9854870ca-6 | Document(page_content='Hello everyone,\n\nI would really like to invest in an ETF that follows spy or another big index, as I think this form of investment suits me best. \n\nThe problem is, that I live in Denmark where ETFs and funds are taxed annually on unrealised gains at quite a steep rate. This means that an ETF ... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/reddit.html |
6855e2673e8c-0 | .ipynb
.pdf
Twitter
Twitter#
This loader fetches the text from the Tweets of a list of Twitter users, using the tweepy Python package.
You must initialize the loader with your Twitter API token, and you need to pass in the Twitter username you want to extract.
from langchain.document_loaders import TwitterTweetLoader
#... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/twitter.html |
6855e2673e8c-1 | [Document(page_content='@MrAndyNgo @REI One store after another shutting down', metadata={'created_at': 'Tue Apr 18 03:45:50 +0000 2023', 'user_info': {'id': 44196397, 'id_str': '44196397', 'name': 'Elon Musk', 'screen_name': 'elonmusk', 'location': 'A Shortfall of Gravitas', 'profile_location': None, 'description': 'n... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/twitter.html |
6855e2673e8c-2 | [], 'user_mentions': [{'screen_name': 'MrAndyNgo', 'name': 'Andy Ngô 🏳️\u200d🌈', 'id': 2835451658, 'id_str': '2835451658', 'indices': [0, 10]}, {'screen_name': 'REI', 'name': 'REI', 'id': 16583846, 'id_str': '16583846', 'indices': [11, 15]}], 'urls': []}, 'source': '<a href="http://twitter.com/download/iphone" rel="n... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/twitter.html |
6855e2673e8c-3 | 'profile_background_tile': False, 'profile_image_url': 'http://pbs.twimg.com/profile_images/1590968738358079488/IY9Gx6Ok_normal.jpg', 'profile_image_url_https': 'https://pbs.twimg.com/profile_images/1590968738358079488/IY9Gx6Ok_normal.jpg', 'profile_banner_url': 'https://pbs.twimg.com/profile_banners/44196397/157618347... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/twitter.html |
6855e2673e8c-4 | Document(page_content='@KanekoaTheGreat @joshrogin @glennbeck Large ships are fundamentally vulnerable to ballistic (hypersonic) missiles', metadata={'created_at': 'Tue Apr 18 03:43:25 +0000 2023', 'user_info': {'id': 44196397, 'id_str': '44196397', 'name': 'Elon Musk', 'screen_name': 'elonmusk', 'location': 'A Shortfa... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/twitter.html |
6855e2673e8c-5 | down', 'truncated': False, 'entities': {'hashtags': [], 'symbols': [], 'user_mentions': [{'screen_name': 'MrAndyNgo', 'name': 'Andy Ngô 🏳️\u200d🌈', 'id': 2835451658, 'id_str': '2835451658', 'indices': [0, 10]}, {'screen_name': 'REI', 'name': 'REI', 'id': 16583846, 'id_str': '16583846', 'indices': [11, 15]}], 'urls': ... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/twitter.html |
6855e2673e8c-6 | 'http://abs.twimg.com/images/themes/theme1/bg.png', 'profile_background_image_url_https': 'https://abs.twimg.com/images/themes/theme1/bg.png', 'profile_background_tile': False, 'profile_image_url': 'http://pbs.twimg.com/profile_images/1590968738358079488/IY9Gx6Ok_normal.jpg', 'profile_image_url_https': 'https://pbs.twi... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/twitter.html |
6855e2673e8c-7 | Document(page_content='@KanekoaTheGreat The Golden Rule', metadata={'created_at': 'Tue Apr 18 03:37:17 +0000 2023', 'user_info': {'id': 44196397, 'id_str': '44196397', 'name': 'Elon Musk', 'screen_name': 'elonmusk', 'location': 'A Shortfall of Gravitas', 'profile_location': None, 'description': 'nothing', 'url': None, ... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/twitter.html |
6855e2673e8c-8 | 'MrAndyNgo', 'name': 'Andy Ngô 🏳️\u200d🌈', 'id': 2835451658, 'id_str': '2835451658', 'indices': [0, 10]}, {'screen_name': 'REI', 'name': 'REI', 'id': 16583846, 'id_str': '16583846', 'indices': [11, 15]}], 'urls': []}, 'source': '<a href="http://twitter.com/download/iphone" rel="nofollow">Twitter for iPhone</a>', 'in_... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/twitter.html |
6855e2673e8c-9 | 'profile_background_tile': False, 'profile_image_url': 'http://pbs.twimg.com/profile_images/1590968738358079488/IY9Gx6Ok_normal.jpg', 'profile_image_url_https': 'https://pbs.twimg.com/profile_images/1590968738358079488/IY9Gx6Ok_normal.jpg', 'profile_banner_url': 'https://pbs.twimg.com/profile_banners/44196397/157618347... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/twitter.html |
6855e2673e8c-10 | Document(page_content='@KanekoaTheGreat 🧐', metadata={'created_at': 'Tue Apr 18 03:35:48 +0000 2023', 'user_info': {'id': 44196397, 'id_str': '44196397', 'name': 'Elon Musk', 'screen_name': 'elonmusk', 'location': 'A Shortfall of Gravitas', 'profile_location': None, 'description': 'nothing', 'url': None, 'entities': {... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/twitter.html |
6855e2673e8c-11 | 'MrAndyNgo', 'name': 'Andy Ngô 🏳️\u200d🌈', 'id': 2835451658, 'id_str': '2835451658', 'indices': [0, 10]}, {'screen_name': 'REI', 'name': 'REI', 'id': 16583846, 'id_str': '16583846', 'indices': [11, 15]}], 'urls': []}, 'source': '<a href="http://twitter.com/download/iphone" rel="nofollow">Twitter for iPhone</a>', 'in_... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/twitter.html |
6855e2673e8c-12 | 'profile_background_tile': False, 'profile_image_url': 'http://pbs.twimg.com/profile_images/1590968738358079488/IY9Gx6Ok_normal.jpg', 'profile_image_url_https': 'https://pbs.twimg.com/profile_images/1590968738358079488/IY9Gx6Ok_normal.jpg', 'profile_banner_url': 'https://pbs.twimg.com/profile_banners/44196397/157618347... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/twitter.html |
6855e2673e8c-13 | Document(page_content='@TRHLofficial What’s he talking about and why is it sponsored by Erik’s son?', metadata={'created_at': 'Tue Apr 18 03:32:17 +0000 2023', 'user_info': {'id': 44196397, 'id_str': '44196397', 'name': 'Elon Musk', 'screen_name': 'elonmusk', 'location': 'A Shortfall of Gravitas', 'profile_location': N... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/twitter.html |
6855e2673e8c-14 | 'entities': {'hashtags': [], 'symbols': [], 'user_mentions': [{'screen_name': 'MrAndyNgo', 'name': 'Andy Ngô 🏳️\u200d🌈', 'id': 2835451658, 'id_str': '2835451658', 'indices': [0, 10]}, {'screen_name': 'REI', 'name': 'REI', 'id': 16583846, 'id_str': '16583846', 'indices': [11, 15]}], 'urls': []}, 'source': '<a href="ht... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/twitter.html |
6855e2673e8c-15 | 'http://abs.twimg.com/images/themes/theme1/bg.png', 'profile_background_image_url_https': 'https://abs.twimg.com/images/themes/theme1/bg.png', 'profile_background_tile': False, 'profile_image_url': 'http://pbs.twimg.com/profile_images/1590968738358079488/IY9Gx6Ok_normal.jpg', 'profile_image_url_https': 'https://pbs.twi... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/twitter.html |
6855e2673e8c-16 | previous
Telegram
next
Unstructured File Loader
By Harrison Chase
© Copyright 2023, Harrison Chase.
Last updated on May 02, 2023. | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/twitter.html |
640af7f1f5df-0 | .ipynb
.pdf
GCS Directory
Contents
Specifying a prefix
GCS Directory#
This covers how to load document objects from an Google Cloud Storage (GCS) directory.
from langchain.document_loaders import GCSDirectoryLoader
# !pip install google-cloud-storage
loader = GCSDirectoryLoader(project_name="aist", bucket="testing-hw... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/gcs_directory.html |
640af7f1f5df-1 | Specifying a prefix#
You can also specify a prefix for more finegrained control over what files to load.
loader = GCSDirectoryLoader(project_name="aist", bucket="testing-hwc", prefix="fake")
loader.load()
/Users/harrisonchase/workplace/langchain/.venv/lib/python3.10/site-packages/google/auth/_default.py:83: UserWarning... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/gcs_directory.html |
640af7f1f5df-2 | By Harrison Chase
© Copyright 2023, Harrison Chase.
Last updated on May 02, 2023. | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/gcs_directory.html |
1d919210eac0-0 | .ipynb
.pdf
HTML
Contents
Loading HTML with BeautifulSoup4
HTML#
This covers how to load HTML documents into a document format that we can use downstream.
from langchain.document_loaders import UnstructuredHTMLLoader
loader = UnstructuredHTMLLoader("example_data/fake-content.html")
data = loader.load()
data
[Document... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/html.html |
1c02d6722795-0 | .ipynb
.pdf
Confluence
Confluence#
A loader for Confluence pages.
This currently supports both username/api_key and Oauth2 login.
Specify a list page_ids and/or space_key to load in the corresponding pages into Document objects, if both are specified the union of both sets will be returned.
You can also specify a boole... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/confluence.html |
192cae61990d-0 | .ipynb
.pdf
Slack (Local Exported Zipfile)
Contents
🧑 Instructions for ingesting your own dataset
Slack (Local Exported Zipfile)#
This notebook covers how to load documents from a Zipfile generated from a Slack export.
In order to get this Slack export, follow these instructions:
🧑 Instructions for ingesting your o... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/slack_directory.html |
ad2ebc5ff781-0 | .ipynb
.pdf
Hacker News
Hacker News#
How to pull page data and comments from Hacker News
from langchain.document_loaders import HNLoader
loader = HNLoader("https://news.ycombinator.com/item?id=34817881")
data = loader.load()
data
[Document(page_content="delta_p_delta_x 18 hours ago \n | next [–] \n\nAstrop... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/hn.html |
ad2ebc5ff781-1 | Document(page_content="andrewflnr 19 hours ago \n | prev | next [–] \n\nWhoa. I didn't know the accretion theory of Ia supernovae was dead, much less that it had been since 2011.\n \nreply", lookup_str='', metadata={'source': 'https://news.ycombinator.com/item?id=34817881', 'title': 'What Lights the Univer... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/hn.html |
c6a8f30a4531-0 | .ipynb
.pdf
Gutenberg
Gutenberg#
This covers how to load links to Gutenberg e-books into a document format that we can use downstream.
from langchain.document_loaders import GutenbergLoader
loader = GutenbergLoader('https://www.gutenberg.org/cache/epub/69972/pg69972.txt')
data = loader.load()
data
previous
Google Drive... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/gutenberg.html |
58542f2f06fb-0 | .ipynb
.pdf
Email
Contents
Using Unstructured
Retain Elements
Using OutlookMessageLoader
Email#
This notebook shows how to load email (.eml) and Microsoft Outlook (.msg) files.
Using Unstructured#
from langchain.document_loaders import UnstructuredEmailLoader
loader = UnstructuredEmailLoader('example_data/fake-email.... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/email.html |
58542f2f06fb-1 | previous
DuckDB Loader
next
EPubs
Contents
Using Unstructured
Retain Elements
Using OutlookMessageLoader
By Harrison Chase
© Copyright 2023, Harrison Chase.
Last updated on May 02, 2023. | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/email.html |
f064355cd35c-0 | .ipynb
.pdf
Sitemap Loader
Contents
Filtering sitemap URLs
Sitemap Loader#
Extends from the WebBaseLoader, this will load a sitemap from a given URL, and then scrape and load all the pages in the sitemap, returning each page as a document.
The scraping is done concurrently, using WebBaseLoader. There are reasonable ... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/sitemap.html |
f064355cd35c-1 | Document(page_content='\n\n\n\n\n\nWelcome to LangChain — 🦜🔗 LangChain 0.0.123\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nSkip to main content\n\n\n\n\n\n\n\n\n\n\nCtrl+K\n\n\n\n\n\n\n\n\n\n\n\n\n🦜🔗 LangChain 0.0.123\n\n\n\nGetting Started\n\nQuickstart Guide\n\nMod... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/sitemap.html |
f064355cd35c-2 | OpenAI\nSageMakerEndpoint\nSelf-Hosted Models via Runhouse\nStochasticAI\nWriter\n\n\nAsync API for LLM\nStreaming with LLMs\n\n\nReference\n\n\nDocument Loaders\nKey Concepts\nHow To Guides\nCoNLL-U\nAirbyte JSON\nAZLyrics\nBlackboard\nCollege Confidential\nCopy Paste\nCSV Loader\nDirectory Loader\nEmail\nEverNote\nFa... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/sitemap.html |
f064355cd35c-3 | Document Embeddings\nText Splitter\nVectorStores\nAtlasDB\nChroma\nDeep Lake\nElasticSearch\nFAISS\nMilvus\nOpenSearch\nPGVector\nPinecone\nQdrant\nRedis\nWeaviate\nChatGPT Plugin Retriever\nVectorStore Retriever\nAnalyze Document\nChat Index\nGraph QA\nQuestion Answering with Sources\nQuestion Answering\nSummarization... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/sitemap.html |
f064355cd35c-4 | Agent\nJSON Agent\nOpenAPI Agent\nPandas Dataframe Agent\nPython Agent\nSQL Database Agent\nVectorstore Agent\nMRKL\nMRKL Chat\nReAct\nSelf Ask With Search\n\n\nReference\n\n\nMemory\nGetting Started\nKey Concepts\nHow-To Guides\nConversationBufferMemory\nConversationBufferWindowMemory\nEntity Memory\nConversation Know... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/sitemap.html |
f064355cd35c-5 | Generation\nQuestion Answering\nSQL Question Answering Benchmarking: Chinook\n\n\nModel Comparison\n\nReference\n\nInstallation\nIntegrations\nAPI References\nPrompts\nPromptTemplates\nExample Selector\n\n\nUtilities\nPython REPL\nSerpAPI\nSearxNG Search\nDocstore\nText Splitter\nEmbeddings\nVectorStores\n\n\nChains\nA... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/sitemap.html |
f064355cd35c-6 | Started\nModules\nUse Cases\nReference Docs\nLangChain Ecosystem\nAdditional Resources\n\n\n\n\n\n\n\n\nWelcome to LangChain#\nLarge language models (LLMs) are emerging as a transformative technology, enabling\ndevelopers to build applications that they previously could not.\nBut using these LLMs in isolation is often ... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/sitemap.html |
f064355cd35c-7 | support for.\nFor each module we provide some examples to get started, how-to guides, reference docs, and conceptual guides.\nThese modules are, in increasing order of complexity:\n\nPrompts: This includes prompt management, prompt optimization, and prompt serialization.\nLLMs: This includes a generic interface for all... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/sitemap.html |
f064355cd35c-8 | models are often more powerful when combined with your own text data - this module covers best practices for doing exactly that.\nAgents: Agents involve an LLM making decisions about which Actions to take, taking that Action, seeing an Observation, and repeating that until done. LangChain provides a standard interface ... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/sitemap.html |
f064355cd35c-9 | the common use cases LangChain supports.\n\nAgents: Agents are systems that use a language model to interact with other tools. These can be used to do more grounded question/answering, interact with APIs, or even take actions.\nChatbots: Since language models are good at producing text, that makes them ideal for creati... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/sitemap.html |
f064355cd35c-10 | SQL, dataframes, etc) you should read this page.\nEvaluation: Generative models are notoriously hard to evaluate with traditional metrics. One new way of evaluating them is using language models themselves to do the evaluation. LangChain provides some prompts/chains for assisting in this.\nGenerate similar examples: Ge... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/sitemap.html |
f064355cd35c-11 | application!\n\nLangChainHub: The LangChainHub is a place to share and explore other prompts, chains, and agents.\nGlossary: A glossary of all related terms, papers, methods, etc. Whether implemented in LangChain or not!\nGallery: A collection of our favorite projects that use LangChain. Useful for finding inspiration ... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/sitemap.html |
f064355cd35c-12 | Harrison Chase\n\n\n\n\n \n © Copyright 2023, Harrison Chase.\n \n\n\n\n\n Last updated on Mar 24, 2023.\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n', lookup_str='', metadata={'source': 'https://python.langchain.com/en/stable/', 'loc': 'https://python.langchain.com/en/stable/', 'lastmod': '2023-03-24T19:30:54.647... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/sitemap.html |
f064355cd35c-13 | Filtering sitemap URLs#
Sitemaps can be massive files, with thousands of urls. Often you don’t need every single one of them. You can filter the urls by passing a list of strings or regex patterns to the url_filter parameter. Only urls that match one of the patterns will be loaded.
loader = SitemapLoader(
"https... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/sitemap.html |
f064355cd35c-14 | Document(page_content='\n\n\n\n\n\nWelcome to LangChain — 🦜🔗 LangChain 0.0.123\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nSkip to main content\n\n\n\n\n\n\n\n\n\n\nCtrl+K\n\n\n\n\n\n\n\n\n\n\n\n\n🦜🔗 LangChain 0.0.123\n\n\n\nGetting Started\n\nQuickstart Guide\n\nMod... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/sitemap.html |
f064355cd35c-15 | Models\nGetting Started\nHow-To Guides\nHow to use few shot examples\nHow to stream responses\n\n\nIntegrations\nAzure\nOpenAI\nPromptLayer ChatOpenAI\n\n\n\n\nText Embedding Models\nAzureOpenAI\nCohere\nFake Embeddings\nHugging Face Hub\nInstructEmbeddings\nOpenAI\nSageMaker Endpoint Embeddings\nSelf Hosted Embeddings... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/sitemap.html |
f064355cd35c-16 | File Storage\nGitBook\nGoogle Drive\nGutenberg\nHacker News\nHTML\niFixit\nImages\nIMSDb\nMarkdown\nNotebook\nNotion\nObsidian\nPDF\nPowerPoint\nReadTheDocs Documentation\nRoam\ns3 Directory\ns3 File\nSubtitle Files\nTelegram\nUnstructured File Loader\nURL\nWeb Base\nWord Documents\nYouTube\n\n\nText Splitters\nGetting... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/sitemap.html |
f064355cd35c-17 | Memory class\nHow to use multiple memroy classes in the same chain\n\n\n\n\nChains\nGetting Started\nHow-To Guides\nAsync API for Chain\nLoading from LangChainHub\nLLM Chain\nSequential Chains\nSerialization\nTransformation Chain\nAnalyze Document\nChat Index\nGraph QA\nHypothetical Document Embeddings\nQuestion Answer... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/sitemap.html |
f064355cd35c-18 | Dataframe Agent\nPython Agent\nSQL Database Agent\nVectorstore Agent\n\n\nAgent Executors\nHow to combine agents and vectorstores\nHow to use the async API for Agents\nHow to create ChatGPT Clone\nHow to access intermediate steps\nHow to cap the max number of iterations\nHow to add SharedMemory to an Agent and its Tool... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/sitemap.html |
f064355cd35c-19 | Lake\nForefrontAI\nGoogle Search Wrapper\nGoogle Serper Wrapper\nGooseAI\nGraphsignal\nHazy Research\nHelicone\nHugging Face\nMilvus\nModal\nNLPCloud\nOpenAI\nOpenSearch\nPetals\nPGVector\nPinecone\nPromptLayer\nQdrant\nRunhouse\nSearxNG Search API\nSerpAPI\nStochasticAI\nUnstructured\nWeights & Biases\nWeaviate\nWolfr... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/sitemap.html |
f064355cd35c-20 | data\nBe agentic: allow a language model to interact with its environment\n\nThe LangChain framework is designed with the above principles in mind.\nThis is the Python specific portion of the documentation. For a purely conceptual guide to LangChain, see here. For the JavaScript documentation, see here.\n\nGetting Star... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/sitemap.html |
f064355cd35c-21 | that use memory.\nIndexes: Language models are often more powerful when combined with your own text data - this module covers best practices for doing exactly that.\nChains: Chains go beyond just a single LLM call, and are sequences of calls (whether to an LLM or a different utility). LangChain provides a standard inte... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/sitemap.html |
f064355cd35c-22 | have knowledge about your data.\nQuestion Answering: The second big LangChain use case. Answering questions over specific documents, only utilizing the information in those documents to construct an answer.\nChatbots: Since language models are good at producing text, that makes them ideal for creating chatbots.\nQueryi... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/sitemap.html |
f064355cd35c-23 | assisting in this.\n\n\n\n\n\nReference Docs#\nAll of LangChain’s reference documentation, in one place. Full documentation on all methods, classes, installation methods, and integration setups for LangChain.\n\nReference Documentation\n\n\n\n\n\nLangChain Ecosystem#\nGuides for how other companies/products can be used... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/sitemap.html |
f064355cd35c-24 | prompts, models, and chains is a big part of developing the best possible application. The ModelLaboratory makes it easy to do so.\nDiscord: Join us on our Discord to discuss all things LangChain!\nProduction Support: As you move your LangChains into production, we’d love to offer more comprehensive support. Please fil... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/sitemap.html |
f064355cd35c-25 | previous
s3 File
next
Slack (Local Exported Zipfile)
Contents
Filtering sitemap URLs
By Harrison Chase
© Copyright 2023, Harrison Chase.
Last updated on May 02, 2023. | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/sitemap.html |
a67eac0a82f4-0 | .ipynb
.pdf
Word Documents
Contents
Using Docx2txt
Using Unstructured
Retain Elements
Word Documents#
This covers how to load Word documents into a document format that we can use downstream.
Using Docx2txt#
Load .docx using Docx2txt into a document.
from langchain.document_loaders import Docx2txtLoader
loader = Docx... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/word_document.html |
933f22ee7e36-0 | .ipynb
.pdf
DataFrame Loader
DataFrame Loader#
This notebook goes over how to load data from a pandas dataframe
import pandas as pd
df = pd.read_csv('example_data/mlb_teams_2012.csv')
df.head()
Team
"Payroll (millions)"
"Wins"
0
Nationals
81.34
98
1
Reds
82.20
97
2
Yankees
197.96
95
3
Giants
117.62
94
4
Braves
83.31
94... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/dataframe.html |
933f22ee7e36-1 | Document(page_content='Rays', metadata={' "Payroll (millions)"': 64.17, ' "Wins"': 90}),
Document(page_content='Angels', metadata={' "Payroll (millions)"': 154.49, ' "Wins"': 89}),
Document(page_content='Tigers', metadata={' "Payroll (millions)"': 132.3, ' "Wins"': 88}),
Document(page_content='Cardinals', metadata={... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/dataframe.html |
933f22ee7e36-2 | Document(page_content='Mets', metadata={' "Payroll (millions)"': 93.35, ' "Wins"': 74}),
Document(page_content='Blue Jays', metadata={' "Payroll (millions)"': 75.48, ' "Wins"': 73}),
Document(page_content='Royals', metadata={' "Payroll (millions)"': 60.91, ' "Wins"': 72}),
Document(page_content='Marlins', metadata={... | https:///python.langchain.com/en/latest/modules/indexes/document_loaders/examples/dataframe.html |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.