id stringlengths 14 16 | text stringlengths 36 2.73k | source stringlengths 59 127 |
|---|---|---|
e2c8137bb4fb-0 | .rst
.pdf
Deploying LLMs in Production
Contents
Outline
Designing a Robust LLM Application Service
Monitoring
Fault tolerance
Zero down time upgrade
Load balancing
Maintaining Cost-Efficiency and Scalability
Self-hosting models
Resource Management and Auto-Scaling
Utilizing Spot Instances
Independent Scaling
Batching... | rtdocs_stable/api.python.langchain.com/en/stable/additional_resources/deploy_llms.html |
e2c8137bb4fb-1 | Maintaining Cost-Efficiency
Ensuring Rapid Iteration
Understanding these components is crucial when assessing serving systems. LangChain integrates with several open-source projects designed to tackle these issues, providing a robust framework for productionizing your LLM applications. Some notable frameworks include:
... | rtdocs_stable/api.python.langchain.com/en/stable/additional_resources/deploy_llms.html |
e2c8137bb4fb-2 | Fault tolerance#
Your application may encounter errors such as exceptions in your model inference or business logic code, causing failures and disrupting traffic. Other potential issues could arise from the machine running your application, such as unexpected hardware breakdowns or loss of spot-instances during high-de... | rtdocs_stable/api.python.langchain.com/en/stable/additional_resources/deploy_llms.html |
e2c8137bb4fb-3 | There are several strategies for load balancing. For example, one common method is the Round Robin strategy, where each request is sent to the next server in line, cycling back to the first when all servers have received a request. This works well when all servers are equally capable. However, if some servers are more ... | rtdocs_stable/api.python.langchain.com/en/stable/additional_resources/deploy_llms.html |
e2c8137bb4fb-4 | Resource Management and Auto-Scaling#
Computational logic within your application requires precise resource allocation. For instance, if part of your traffic is served by an OpenAI endpoint and another part by a self-hosted model, it’s crucial to allocate suitable resources for each. Auto-scaling—adjusting resource all... | rtdocs_stable/api.python.langchain.com/en/stable/additional_resources/deploy_llms.html |
e2c8137bb4fb-5 | Ensuring Rapid Iteration#
The LLM landscape is evolving at an unprecedented pace, with new libraries and model architectures being introduced constantly. Consequently, it’s crucial to avoid tying yourself to a solution specific to one particular framework. This is especially relevant in serving, where changes to your i... | rtdocs_stable/api.python.langchain.com/en/stable/additional_resources/deploy_llms.html |
e2c8137bb4fb-6 | CI/CD#
In a fast-paced environment, implementing CI/CD pipelines can significantly speed up the iteration process. They help automate the testing and deployment of your LLM applications, reducing the risk of errors and enabling faster feedback and iteration.
previous
Deployments
next
Tracing
Contents
Outline
Design... | rtdocs_stable/api.python.langchain.com/en/stable/additional_resources/deploy_llms.html |
8f892b7df843-0 | .rst
.pdf
Agents
Contents
Action Agents
Plan-and-Execute Agents
Agents#
Note
Conceptual Guide
Some applications require not just a predetermined chain of calls to LLMs/other tools,
but potentially an unknown chain that depends on the user’s input.
In these types of chains, there is an agent which has access to a suit... | rtdocs_stable/api.python.langchain.com/en/stable/modules/agents.html |
8f892b7df843-1 | The different abstractions involved in agents are:
Agent: this is where the logic of the application lives. Agents expose an interface that takes in user input
along with a list of previous steps the agent has taken, and returns either an AgentAction or AgentFinish
AgentAction corresponds to the tool to use and the inp... | rtdocs_stable/api.python.langchain.com/en/stable/modules/agents.html |
8f892b7df843-2 | create an agent from them.
Agent Executor: The Agent Executor class, which is responsible for calling
the agent and tools in a loop. We go over different ways to customize this, and options you can use for more control.
Plan-and-Execute Agents#
High level pseudocode of the Plan-and-Execute Agents:
The user input is rec... | rtdocs_stable/api.python.langchain.com/en/stable/modules/agents.html |
89ec7d8248ca-0 | .rst
.pdf
Models
Contents
Model Types
Models#
Note
Conceptual Guide
This section of the documentation deals with different types of models that are used in LangChain.
On this page we will go over the model types at a high level,
but we have individual pages for each model type.
The pages contain more detailed “how-to... | rtdocs_stable/api.python.langchain.com/en/stable/modules/models.html |
1ca5f7aa0a34-0 | .rst
.pdf
Chains
Chains#
Note
Conceptual Guide
Using an LLM in isolation is fine for some simple applications,
but more complex applications require chaining LLMs - either with each other or with other experts.
LangChain provides a standard interface for Chains, as well as several common implementations of chains.
Gett... | rtdocs_stable/api.python.langchain.com/en/stable/modules/chains.html |
55336fc52db9-0 | .rst
.pdf
Memory
Memory#
Note
Conceptual Guide
By default, Chains and Agents are stateless,
meaning that they treat each incoming query independently (as are the underlying LLMs and chat models).
In some applications (chatbots being a GREAT example) it is highly important
to remember previous interactions, both at a sh... | rtdocs_stable/api.python.langchain.com/en/stable/modules/memory.html |
8016761ebd2e-0 | .rst
.pdf
Prompts
Prompts#
Note
Conceptual Guide
The new way of programming models is through prompts.
A prompt refers to the input to the model.
This input is often constructed from multiple components.
A PromptTemplate is responsible for the construction of this input.
LangChain provides several classes and functions... | rtdocs_stable/api.python.langchain.com/en/stable/modules/prompts.html |
8c2d4fab34e6-0 | .rst
.pdf
Indexes
Contents
Index Types
Indexes#
Note
Conceptual Guide
Indexes refer to ways to structure documents so that LLMs can best interact with them.
The most common way that indexes are used in chains is in a “retrieval” step.
This step refers to taking a user’s query and returning the most relevant documents... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes.html |
a6a3b8384081-0 | .rst
.pdf
Document Loaders
Contents
Transform loaders
Public dataset or service loaders
Proprietary dataset or service loaders
Document Loaders#
Note
Conceptual Guide
Combining language models with your own text data is a powerful way to differentiate them.
The first step in doing this is to load the data into “Docum... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders.html |
a6a3b8384081-1 | College Confidential
Gutenberg
Hacker News
HuggingFace dataset
iFixit
IMSDb
MediaWikiDump
Wikipedia
YouTube transcripts
Proprietary dataset or service loaders#
These datasets and services are not from the public domain.
These loaders mostly transform data from specific formats of applications or cloud services,
for exa... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders.html |
a26177cb557c-0 | .rst
.pdf
Vectorstores
Vectorstores#
Note
Conceptual Guide
Vectorstores are one of the most important components of building indexes.
For an introduction to vectorstores and generic functionality see:
Getting Started
We also have documentation for all the types of vectorstores that are supported.
Please see below for t... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/vectorstores.html |
7f82c2ee76a0-0 | .rst
.pdf
Text Splitters
Text Splitters#
Note
Conceptual Guide
When you want to deal with long pieces of text, it is necessary to split up that text into chunks.
As simple as this sounds, there is a lot of potential complexity here. Ideally, you want to keep the semantically related pieces of text together. What “seman... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/text_splitters.html |
7f82c2ee76a0-1 | Getting Started
By Harrison Chase
© Copyright 2023, Harrison Chase.
Last updated on Jun 16, 2023. | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/text_splitters.html |
f7f81f82fe86-0 | .rst
.pdf
Retrievers
Retrievers#
Note
Conceptual Guide
The retriever interface is a generic interface that makes it easy to combine documents with
language models. This interface exposes a get_relevant_documents method which takes in a query
(a string) and returns a list of documents.
Please see below for a list of all... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/retrievers.html |
a725427396f5-0 | .ipynb
.pdf
Getting Started
Contents
One Line Index Creation
Walkthrough
Getting Started#
LangChain primarily focuses on constructing indexes with the goal of using them as a Retriever. In order to best understand what this means, it’s worth highlighting what the base Retriever interface is. The BaseRetriever class i... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/getting_started.html |
a725427396f5-1 | Create a Retriever from that index
Create a question answering chain
Ask questions!
Each of the steps has multiple sub steps and potential configurations. In this notebook we will primarily focus on (1). We will start by showing the one-liner for doing so, but then break down what is actually going on.
First, let’s imp... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/getting_started.html |
a725427396f5-2 | index.query_with_sources(query)
{'question': 'What did the president say about Ketanji Brown Jackson',
'answer': " The president said that he nominated Circuit Court of Appeals Judge Ketanji Brown Jackson, one of the nation's top legal minds, to continue Justice Breyer's legacy of excellence, and that she has received... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/getting_started.html |
a725427396f5-3 | We will then select which embeddings we want to use.
from langchain.embeddings import OpenAIEmbeddings
embeddings = OpenAIEmbeddings()
We now create the vectorstore to use as the index.
from langchain.vectorstores import Chroma
db = Chroma.from_documents(texts, embeddings)
Running Chroma using direct local API.
Using D... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/getting_started.html |
a725427396f5-4 | )
Hopefully this highlights what is going on under the hood of VectorstoreIndexCreator. While we think it’s important to have a simple way to create indexes, we also think it’s important to understand what’s going on under the hood.
previous
Indexes
next
Document Loaders
Contents
One Line Index Creation
Walkthrough... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/getting_started.html |
71592a034aad-0 | .ipynb
.pdf
URL
Contents
URL
Selenium URL Loader
Setup
Playwright URL Loader
Setup
URL#
This covers how to load HTML documents from a list of URLs into a document format that we can use downstream.
from langchain.document_loaders import UnstructuredURLLoader
urls = [
"https://www.understandingwar.org/backgrounde... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/url.html |
71592a034aad-1 | !pip install "unstructured"
!playwright install
from langchain.document_loaders import PlaywrightURLLoader
urls = [
"https://www.youtube.com/watch?v=dQw4w9WgXcQ",
"https://goo.gl/maps/NDSHwePEyaHMFGwh8"
]
loader = PlaywrightURLLoader(urls=urls, remove_selectors=["header", "footer"])
data = loader.load()
previou... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/url.html |
0f1176b90497-0 | .ipynb
.pdf
Confluence
Contents
Confluence
Examples
Username and Password or Username and API Token (Atlassian Cloud only)
Personal Access Token (Server/On-Prem only)
Confluence#
Confluence is a wiki collaboration platform that saves and organizes all of the project-related material. Confluence is a knowledge base th... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/confluence.html |
0f1176b90497-1 | By default the code will return up to 1000 documents in 50 documents batches. To control the total number of documents use the max_pages parameter.
Plese note the maximum value for the limit parameter in the atlassian-python-api package is currently 100.
from langchain.document_loaders import ConfluenceLoader
loader = ... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/confluence.html |
f8c90ea26461-0 | .ipynb
.pdf
OpenAIWhisperParser
OpenAIWhisperParser#
This notebook goes over how to load data from an audio file, such as an mp3.
We use the OpenAIWhisperParser, which will use the OpenAI Whisper API to transcribe audio to text.
Note: You will need to have an OPENAI_API_KEY supplied.
from langchain.document_loaders.gen... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/audio.html |
f8c90ea26461-1 | [Document(page_content="Hello, my name is Andrej and I've been training deep neural networks for a bit more than a decade. And in this lecture I'd like to show you what neural network training looks like under the hood. So in particular we are going to start with a blank Jupyter notebook and by the end of this lecture ... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/audio.html |
f8c90ea26461-2 | and you'll see that a and b are negative four and two but we are wrapping those values into this value object that we are going to build out as part of micrograd. So this value object will wrap the numbers themselves and then we are going to build out a mathematical expression here where a and b are transformed into c ... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/audio.html |
f8c90ea26461-3 | going to evaluate basically the derivative of g with respect to all the internal nodes like e, d, and c but also with respect to the inputs a and b. And then we can actually query this derivative of g with respect to a, for example that's a.grad, in this case it happens to be 138, and the derivative of g with respect t... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/audio.html |
f8c90ea26461-4 | machinery for training of neural networks. Now one more note I would like to make at this stage is that as you see here micrograd is a scalar valued autograd engine so it's working on the you know level of individual scalars like negative 4 and 2 and we're taking neural nets and we're breaking them down all the way to ... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/audio.html |
f8c90ea26461-5 | So if we just go to micrograd and you'll see that there's only two files here in micrograd. This is the actual engine, it doesn't know anything about neural nets and this is the entire neural nets library on top of micrograd. So engine and nn.py. So the actual back propagation autograd engine that gives you the power o... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/audio.html |
f8c90ea26461-6 | can tell from the mathematical expression that this is probably a parabola, it's a quadratic and so if we just create a set of scalar values that we can feed in using for example a range from negative 5 to 5 in steps of 0.25. So this is so x is just from negative 5 to 5 not including 5 in steps of 0.25 and we can actua... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/audio.html |
f8c90ea26461-7 | really understand what the derivative is measuring, what it's telling you about the function. And so if we just look up derivative we see that okay so this is not a very good definition of derivative. This is a definition of what it means to be differentiable but if you remember from your calculus it is the limit as h ... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/audio.html |
f8c90ea26461-8 | we have to normalize by the run so we have the rise over run to get the slope so this of course is just a numerical approximation of the slope because we have to make h very very small to converge to the exact amount now if i'm doing too many zeros at some point i'm going to i'm going to get an incorrect answer because... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/audio.html |
f8c90ea26461-9 | going to start you know complexifying a bit so now we have a function here with output variable d that is a function of three scalar inputs a b and c so a b and c are some specific values three inputs into our expression graph and a single output d and so if we just print d we get four and now what i like to do is i'd ... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/audio.html |
f8c90ea26461-10 | uh printed out here in particular d1 will be four will d2 be a number slightly greater than four or slightly lower than four and that's going to tell us the sign of the derivative so we're bumping a by h b is minus three c is 10 so you can just intuitively think through this derivative and what it's doing a will be sli... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/audio.html |
f8c90ea26461-11 | working well and then if c gets bumped a tiny amount in h by h then of course a times b is unaffected and now c becomes slightly bit higher what does that do to the function it makes it slightly bit higher because we're simply adding c and it makes it slightly bit higher by the exact same amount that we added to c and ... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/audio.html |
f8c90ea26461-12 | previous
Airtable
next
CoNLL-U
By Harrison Chase
© Copyright 2023, Harrison Chase.
Last updated on Jun 16, 2023. | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/audio.html |
3e1829265bad-0 | .ipynb
.pdf
Psychic
Contents
Prerequisites
Loading documents
Converting the docs to embeddings
Psychic#
This notebook covers how to load documents from Psychic. See here for more details.
Prerequisites#
Follow the Quick Start section in this document
Log into the Psychic dashboard and get your secret key
Install the ... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/psychic.html |
3e1829265bad-1 | from langchain.vectorstores import Chroma
from langchain.text_splitter import CharacterTextSplitter
from langchain.llms import OpenAI
from langchain.chains import RetrievalQAWithSourcesChain
text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=0)
texts = text_splitter.split_documents(documents)
embeddin... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/psychic.html |
13531034bf37-0 | .ipynb
.pdf
Reddit
Reddit#
Reddit is an American social news aggregation, content rating, and discussion website.
This loader fetches the text from the Posts of Subreddits or Reddit users, using the praw Python package.
Make a Reddit Application and initialize the loader with with your Reddit API credentials.
from lang... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/reddit.html |
13531034bf37-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... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/reddit.html |
13531034bf37-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... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/reddit.html |
13531034bf37-3 | the resources in the sidebar.\n\nBe aware that these answers are just opinions of Redditors and should be used as a starting point for your research. You should strongly consider seeing a registered investment adviser if you need professional support before making any financial decisions!', metadata={'post_subreddit': ... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/reddit.html |
13531034bf37-4 | 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... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/reddit.html |
13531034bf37-5 | 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 ... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/reddit.html |
6c094a724903-0 | .ipynb
.pdf
Iugu
Iugu#
Iugu is a Brazilian services and software as a service (SaaS) company. It offers payment-processing software and application programming interfaces for e-commerce websites and mobile applications.
This notebook covers how to load data from the Iugu REST API into a format that can be ingested into... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/iugu.html |
1704a4f58d6d-0 | .ipynb
.pdf
CoNLL-U
CoNLL-U#
CoNLL-U is revised version of the CoNLL-X format. Annotations are encoded in plain text files (UTF-8, normalized to NFC, using only the LF character as line break, including an LF character at the end of file) with three types of lines:
Word lines containing the annotation of a word/token i... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/conll-u.html |
edb5797ac282-0 | .ipynb
.pdf
File Directory
Contents
Show a progress bar
Use multithreading
Change loader class
Auto detect file encodings with TextLoader
A. Default Behavior
B. Silent fail
C. Auto detect encodings
File Directory#
This covers how to use the DirectoryLoader to load all documents in a directory. Under the hood, by defa... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/file_directory.html |
edb5797ac282-1 | docs = loader.load()
len(docs)
1
If you need to load Python source code files, use the PythonLoader.
from langchain.document_loaders import PythonLoader
loader = DirectoryLoader('../../../../../', glob="**/*.py", loader_cls=PythonLoader)
docs = loader.load()
len(docs)
691
Auto detect file encodings with TextLoader#
In ... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/file_directory.html |
edb5797ac282-2 | │ │
│ 319 │ def decode(self, input, final=False): │
│ 320 │ │ # decode input (taking the buffer into account) │
│ 321 │ │ ... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/file_directory.html |
edb5797ac282-3 | │ 85 │ │ │ │ │ finally: │
│ 86 │ │ │ │ │ │ if pbar: │
│ 87 │ │ │ │ │ │ │ pbar.update(1) │
│ ... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/file_directory.html |
edb5797ac282-4 | │ 45 │ │ │ except Exception as e: │
│ 46 │ │ │ │ raise RuntimeError(f"Error loading {self.file_path}") from e │
│ 47 │
╰────────────────... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/file_directory.html |
edb5797ac282-5 | '../../../../../tests/integration_tests/examples/whatsapp_chat.txt',
'../../../../../tests/integration_tests/examples/example-utf8.txt']
previous
Facebook Chat
next
HTML
Contents
Show a progress bar
Use multithreading
Change loader class
Auto detect file encodings with TextLoader
A. Default Behavior
B. Silent fail... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/file_directory.html |
450a5ce831b8-0 | .ipynb
.pdf
Facebook Chat
Facebook Chat#
Messenger is an American proprietary instant messaging app and platform developed by Meta Platforms. Originally developed as Facebook Chat in 2008, the company revamped its messaging service in 2010.
This notebook covers how to load data from the Facebook Chats into a format tha... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/facebook_chat.html |
450a5ce831b8-1 | loader = FacebookChatLoader("example_data/facebook_chat.json")
loader.load()
[Document(page_content='User 2 on 2023-02-05 03:46:11: Bye!\n\nUser 1 on 2023-02-05 03:43:55: Oh no worries! Bye\n\nUser 2 on 2023-02-05 03:24:37: No Im sorry it was my mistake, the blue one is not for sale\n\nUser 1 on 2023-02-05 03:05:40: I ... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/facebook_chat.html |
ca55632ffaf3-0 | .ipynb
.pdf
2Markdown
2Markdown#
2markdown service transforms website content into structured markdown files.
# You will need to get your own API key. See https://2markdown.com/login
api_key = ""
from langchain.document_loaders import ToMarkdownLoader
loader = ToMarkdownLoader.from_api_key(url="https://python.langchain... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/tomarkdown.html |
ca55632ffaf3-1 | Concepts and terminology.
- [Concepts and terminology](https://python.langchain.com/en/latest/getting_started/concepts.html)
Tutorials created by community experts and presented on YouTube.
- [Tutorials](https://python.langchain.com/en/latest/getting_started/tutorials.html)
## Modules [\#](\#modules "Permalink to this ... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/tomarkdown.html |
ca55632ffaf3-2 | - [Callbacks](https://python.langchain.com/en/latest/modules/callbacks/getting_started.html): Callbacks let you log and stream the intermediate steps of any chain, making it easy to observe, debug, and evaluate the internals of an application.
## Use Cases [\#](\#use-cases "Permalink to this headline")
Best practices a... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/tomarkdown.html |
ca55632ffaf3-3 | - [Code Understanding](https://python.langchain.com/en/latest/use_cases/code.html): Recommended reading if you want to use language models to analyze code.
- [Interacting with APIs](https://python.langchain.com/en/latest/use_cases/apis.html): Enabling language models to interact with APIs is extremely powerful. It give... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/tomarkdown.html |
ca55632ffaf3-4 | - [Gallery](https://python.langchain.com/en/latest/additional_resources/gallery.html): A collection of our favorite projects that use LangChain. Useful for finding inspiration or seeing how things were done in other applications.
- [Deployments](https://python.langchain.com/en/latest/additional_resources/deployments.ht... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/tomarkdown.html |
fe2eb3db5047-0 | .ipynb
.pdf
Markdown
Contents
Retain Elements
Markdown#
Markdown is a lightweight markup language for creating formatted text using a plain-text editor.
This covers how to load markdown documents into a document format that we can use downstream.
# !pip install unstructured > /dev/null
from langchain.document_loaders... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/markdown.html |
fe2eb3db5047-1 | [Document(page_content="ð\x9f¦\x9cï¸\x8fð\x9f”\x97 LangChain\n\nâ\x9a¡ Building applications with LLMs through composability â\x9a¡\n\nLooking for the JS/TS version? Check out LangChain.js.\n\nProduction Support: As you move your LangChains into production, we'd love to offer more comprehensive support.\nPlease fill ou... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/markdown.html |
fe2eb3db5047-2 | explanation of core concepts)\n\nð\x9f\x9a\x80 What can this help with?\n\nThere are six main areas that LangChain is designed to help with.\nThese are, in increasing order of complexity:\n\nð\x9f“\x83 LLMs and Prompts:\n\nThis includes prompt management, prompt optimization, a generic interface for all LLMs, and commo... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/markdown.html |
fe2eb3db5047-3 | is using language models themselves to do the evaluation. LangChain provides some prompts/chains for assisting in this.\n\nFor more information on these concepts, please see our full documentation.\n\nð\x9f’\x81 Contributing\n\nAs an open-source project in a rapidly developing field, we are extremely open to contributi... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/markdown.html |
fe2eb3db5047-4 | 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 = UnstructuredMarkdownLoader(markdown_path, mode="elements")
data = loader.load()
data[0]
Document(... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/markdown.html |
c613e8fb8c74-0 | .ipynb
.pdf
Image captions
Contents
Prepare a list of image urls from Wikimedia
Create the loader
Create the index
Query
Image captions#
By default, the loader utilizes the pre-trained Salesforce BLIP image captioning model.
This notebook shows how to use the ImageCaptionLoader to generate a query-able index of image... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/image_captions.html |
c613e8fb8c74-1 | 'https://upload.wikimedia.org/wikipedia/commons/thumb/5/5e/Messier83_-_Heic1403a.jpg/277px-Messier83_-_Heic1403a.jpg',
'https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/2022-01-22_Men%27s_World_Cup_at_2021-22_St._Moritz%E2%80%93Celerina_Luge_World_Cup_and_European_Championships_by_Sandro_Halank%E2%80%93257... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/image_captions.html |
c613e8fb8c74-2 | warnings.warn(
[Document(page_content='an image of a frog on a flower [SEP]', metadata={'image_path': 'https://upload.wikimedia.org/wikipedia/commons/thumb/5/5a/Hyla_japonica_sep01.jpg/260px-Hyla_japonica_sep01.jpg'}),
Document(page_content='an image of a shark swimming in the ocean [SEP]', metadata={'image_path': 'ht... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/image_captions.html |
c613e8fb8c74-3 | Document(page_content='an image of the spiral galaxy [SEP]', metadata={'image_path': 'https://upload.wikimedia.org/wikipedia/commons/thumb/5/5e/Messier83_-_Heic1403a.jpg/277px-Messier83_-_Heic1403a.jpg'}),
Document(page_content='an image of a man on skis in the snow [SEP]', metadata={'image_path': 'https://upload.wiki... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/image_captions.html |
c613e8fb8c74-4 | index = VectorstoreIndexCreator().from_loaders([loader])
/Users/saitosean/dev/langchain/.venv/lib/python3.10/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html
from .autonotebook import tqdm as notebo... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/image_captions.html |
5ecfac98fee7-0 | .ipynb
.pdf
HTML
Contents
Loading HTML with BeautifulSoup4
HTML#
The HyperText Markup Language or HTML is the standard markup language for documents designed to be displayed in a web browser.
This covers how to load HTML documents into a document format that we can use downstream.
from langchain.document_loaders impo... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/html.html |
af7dc672a177-0 | .ipynb
.pdf
Copy Paste
Contents
Metadata
Copy Paste#
This notebook covers how to load a document object from something you just want to copy and paste. In this case, you don’t even need to use a DocumentLoader, but rather can just construct the Document directly.
from langchain.docstore.document import Document
text ... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/copypaste.html |
8d1aa5f48a16-0 | .ipynb
.pdf
Pandas DataFrame
Pandas DataFrame#
This notebook goes over how to load data from a pandas DataFrame.
#!pip install pandas
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.6... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/pandas_dataframe.html |
8d1aa5f48a16-1 | Document(page_content='Orioles', metadata={' "Payroll (millions)"': 81.43, ' "Wins"': 93}),
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={' ... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/pandas_dataframe.html |
8d1aa5f48a16-2 | Document(page_content='Mariners', metadata={' "Payroll (millions)"': 81.97, ' "Wins"': 75}),
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=... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/pandas_dataframe.html |
59105bb7c7a2-0 | .ipynb
.pdf
Microsoft OneDrive
Contents
Prerequisites
🧑 Instructions for ingesting your documents from OneDrive
🔑 Authentication
🗂️ Documents loader
📑 Loading documents from a OneDrive Directory
📑 Loading documents from a list of Documents IDs
Microsoft OneDrive#
Microsoft OneDrive (formerly SkyDrive) is a file ... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/microsoft_onedrive.html |
59105bb7c7a2-1 | 🧑 Instructions for ingesting your documents from OneDrive#
🔑 Authentication#
By default, the OneDriveLoader expects that the values of CLIENT_ID and CLIENT_SECRET must be stored as environment variables named O365_CLIENT_ID and O365_CLIENT_SECRET respectively. You could pass those environment variables through a .env... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/microsoft_onedrive.html |
59105bb7c7a2-2 | from langchain.document_loaders.onedrive import OneDriveLoader
loader = OneDriveLoader(drive_id="YOUR DRIVE ID", folder_path="Documents/clients", auth_with_token=True)
documents = loader.load()
📑 Loading documents from a list of Documents IDs#
Another possibility is to provide a list of object_id for each document you... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/microsoft_onedrive.html |
e4b5eeae0f29-0 | .ipynb
.pdf
MediaWikiDump
MediaWikiDump#
MediaWiki XML Dumps contain the content of a wiki (wiki pages with all their revisions), without the site-related data. A XML dump does not create a full backup of the wiki database, the dump does not contain user accounts, images, edit logs, etc.
This covers how to load a Media... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/mediawikidump.html |
e4b5eeae0f29-1 | Document(page_content='{| class="article-table plainlinks" style="width:100%;"\n|- style="font-size:18px;"\n! style="padding:0px;" | Template documentation\n|-\n| Note: portions of the template sample may not be visible without values provided.\n|-\n| View or edit this documentation. (About template documentation)\n|-\... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/mediawikidump.html |
e4b5eeae0f29-2 | Document(page_content='Description\nThis template is used to insert descriptions on template pages.\n\nSyntax\nAdd <noinclude></noinclude> at the end of the template page.\n\nAdd <noinclude></noinclude> to transclude an alternative page from the /doc subpage.\n\nUsage\n\nOn the Template page\nThis is the normal format ... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/mediawikidump.html |
e4b5eeae0f29-3 | the Template:T template.\n\nCategory:Documentation templatesCategory:Template documentation', metadata={'source': 'Documentation/doc'}), | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/mediawikidump.html |
e4b5eeae0f29-4 | Document(page_content='Description\nA template link with a variable number of parameters (0-20).\n\nSyntax\n \n\nSource\nImproved version not needing t/piece subtemplate developed on Templates wiki see the list of authors. Copied here via CC-By-SA 3.0 license.\n\nExample\n\nCategory:General wiki templates\nCategory:Tem... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/mediawikidump.html |
38b10c4eb916-0 | .ipynb
.pdf
iFixit
Contents
Searching iFixit using /suggest
iFixit#
iFixit is the largest, open repair community on the web. The site contains nearly 100k repair manuals, 200k Questions & Answers on 42k devices, and all the data is licensed under CC-BY-NC-SA 3.0.
This loader will allow you to download the text of a r... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/ifixit.html |
38b10c4eb916-1 | data = loader.load()
data
[Document(page_content="# Banana Teardown\nIn this teardown, we open a banana to see what's inside. Yellow and delicious, but most importantly, yellow.\n\n\n###Tools Required:\n\n - Fingers\n\n - Teeth\n\n - Thumbs\n\n\n###Parts Required:\n\n - None\n\n\n## Step 1\nTake one banana from the bu... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/ifixit.html |
38b10c4eb916-2 | [Document(page_content='# My iPhone 6 is typing and opening apps by itself\nmy iphone 6 is typing and opening apps by itself. How do i fix this. I just bought it last week.\nI restored as manufactures cleaned up the screen\nthe problem continues\n\n## 27 Answers\n\nFilter by: \n\nMost Helpful\nNewest\nOldest\n\n### Acc... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/ifixit.html |
38b10c4eb916-3 | reset the hardware (hold the power and home button till the screen goes off and comes back with apple logo). release the buttons when you see this.\nThen, connect to your laptop and log in to iTunes and reset your phone completely. (please take a back-up first).\nAnd your phone should be good to use again.\nWhat really... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/ifixit.html |
38b10c4eb916-4 | a repair shop, they opened the phone, disconnected the three ribbons the screen has, blew up and cleaned the connectors and connected the screen again and it solved the issue… it’s hardware, not software.\n\n\n\n### Other Answer\nHey.\nJust had this problem now. As it turns out, you just need to plug in your phone. I u... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/ifixit.html |
38b10c4eb916-5 | Hope I can fix it!!!!\n\n\n\n### Other Answer\nNo answer, but same problem with iPhone 6 plus--random, self-generated jumping amongst apps and typing on its own--plus freezing regularly (aha--maybe that\'s what the "plus" in "6 plus" refers to?). An Apple Genius recommended upgrading to iOS 11.3.1 from 11.2.2, to see ... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/ifixit.html |
38b10c4eb916-6 | on typing letters incorrectly. I have been doing it for a day until i come across this article. Very helpful! God bless you!!\n\n\n\n### Other Answer\nI just turned it off, and turned it back on.\n\n\n\n### Other Answer\nMy problem has not gone away completely but its better now i changed my charger and turned off pred... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/ifixit.html |
38b10c4eb916-7 | below. I took it off and it stopped. I ordered more protectors from amazon and replaced it\n\n\n\n### Other Answer\niPhone 6 Plus first generation….I had the same issues as all above, apps opening by themselves, self typing, ultra sensitive screen, items jumping around all over….it even called someone on FaceTime twice... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/ifixit.html |
38b10c4eb916-8 | I try to remove the screen or should I follow your step above.\n\n\n\n### Other Answer\nI tried everything and it seems to come back to needing the original iPhone cable…or at least another 1 that would have come with another iPhone…not the $5 Store fast charging cables. My original cable is pretty beat up - like most... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/ifixit.html |
38b10c4eb916-9 | self or touch IC. in my country some repair shops just change them all for almost 40$ since they dont want to troubleshoot one by one. readers of this comment also should know that partial screen not responding in other iphone models might also have an issue in LCD connector on the motherboard, specially if you lock/un... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/ifixit.html |
38b10c4eb916-10 | loader = IFixitLoader("https://www.ifixit.com/Device/Standard_iPad")
data = loader.load()
data
[Document(page_content="Standard iPad\nThe standard edition of the tablet computer made by Apple.\n== Background Information ==\n\nOriginally introduced in January 2010, the iPad is Apple's standard edition of their tablet co... | rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/ifixit.html |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.