id
stringlengths
14
16
text
stringlengths
36
2.73k
source
stringlengths
49
117
2aa15396c9dd-165
Check Cache and run the LLM on the given prompt and input. async agenerate(prompts: List[str], stop: Optional[List[str]] = None, callbacks: Optional[Union[List[langchain.callbacks.base.BaseCallbackHandler], langchain.callbacks.base.BaseCallbackManager]] = None) → langchain.schema.LLMResult# Run the LLM on the given pro...
https://python.langchain.com/en/latest/reference/modules/llms.html
2aa15396c9dd-166
Parameters include – fields to include in new model exclude – fields to exclude from new model, as with values this takes precedence over include update – values to change/add in the new model. Note: the data is not validated before creating the new model: you should trust this data deep – set to True to make a deep co...
https://python.langchain.com/en/latest/reference/modules/llms.html
2aa15396c9dd-167
Get the token present in the text. json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: ...
https://python.langchain.com/en/latest/reference/modules/llms.html
2aa15396c9dd-168
field location: str = 'us-central1'# The default location to use when making API calls. field max_output_tokens: int = 128# Token limit determines the maximum amount of text output from one prompt. field project: Optional[str] = None# The default GCP project to use when making Vertex API calls. field stop: Optional[Lis...
https://python.langchain.com/en/latest/reference/modules/llms.html
2aa15396c9dd-169
Run the LLM on the given prompt and input. async agenerate_prompt(prompts: List[langchain.schema.PromptValue], stop: Optional[List[str]] = None, callbacks: Optional[Union[List[langchain.callbacks.base.BaseCallbackHandler], langchain.callbacks.base.BaseCallbackManager]] = None) → langchain.schema.LLMResult# Take in a li...
https://python.langchain.com/en/latest/reference/modules/llms.html
2aa15396c9dd-170
Returns new model instance dict(**kwargs: Any) → Dict# Return a dictionary of the LLM. generate(prompts: List[str], stop: Optional[List[str]] = None, callbacks: Optional[Union[List[langchain.callbacks.base.BaseCallbackHandler], langchain.callbacks.base.BaseCallbackManager]] = None) → langchain.schema.LLMResult# Run the...
https://python.langchain.com/en/latest/reference/modules/llms.html
2aa15396c9dd-171
predict(text: str, *, stop: Optional[Sequence[str]] = None) → str# Predict text from text. predict_messages(messages: List[langchain.schema.BaseMessage], *, stop: Optional[Sequence[str]] = None) → langchain.schema.BaseMessage# Predict message from messages. save(file_path: Union[pathlib.Path, str]) → None# Save the LLM...
https://python.langchain.com/en/latest/reference/modules/llms.html
2aa15396c9dd-172
field n: Optional[int] = None# How many completions to generate. field presence_penalty: Optional[float] = None# Penalizes repeated tokens regardless of frequency. field repetition_penalty: Optional[float] = None# Penalizes repeated tokens according to frequency. field stop: Optional[List[str]] = None# Sequences when c...
https://python.langchain.com/en/latest/reference/modules/llms.html
2aa15396c9dd-173
Predict text from text. async apredict_messages(messages: List[langchain.schema.BaseMessage], *, stop: Optional[Sequence[str]] = None) → langchain.schema.BaseMessage# Predict message from messages. classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) → Model# Creates a new model setting __dict__ a...
https://python.langchain.com/en/latest/reference/modules/llms.html
2aa15396c9dd-174
Run the LLM on the given prompt and input. generate_prompt(prompts: List[langchain.schema.PromptValue], stop: Optional[List[str]] = None, callbacks: Optional[Union[List[langchain.callbacks.base.BaseCallbackHandler], langchain.callbacks.base.BaseCallbackManager]] = None) → langchain.schema.LLMResult# Take in a list of p...
https://python.langchain.com/en/latest/reference/modules/llms.html
2aa15396c9dd-175
Save the LLM. Parameters file_path – Path to file to save the LLM to. Example: .. code-block:: python llm.save(file_path=”path/llm.yaml”) classmethod update_forward_refs(**localns: Any) → None# Try to update ForwardRefs on fields based on this Model, globalns and localns. previous Writer next Chat Models By Harrison Ch...
https://python.langchain.com/en/latest/reference/modules/llms.html
ec216bc31b80-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...
https://python.langchain.com/en/latest/modules/memory.html
5a86e412f95c-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...
https://python.langchain.com/en/latest/modules/indexes.html
78f873671699-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...
https://python.langchain.com/en/latest/modules/models.html
5112dde6f45a-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...
https://python.langchain.com/en/latest/modules/prompts.html
001996dca2a3-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...
https://python.langchain.com/en/latest/modules/chains.html
11c286fff64d-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...
https://python.langchain.com/en/latest/modules/agents.html
11c286fff64d-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...
https://python.langchain.com/en/latest/modules/agents.html
11c286fff64d-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...
https://python.langchain.com/en/latest/modules/agents.html
ac5572e2a572-0
.ipynb .pdf Callbacks Contents Callbacks How to use callbacks When do you want to use each of these? Using an existing handler Creating a custom handler Async Callbacks Using multiple handlers, passing in handlers Tracing and Token Counting Tracing Token Counting Callbacks# LangChain provides a callbacks system that ...
https://python.langchain.com/en/latest/modules/callbacks/getting_started.html
ac5572e2a572-1
CallbackHandlers are objects that implement the CallbackHandler interface, which has a method for each event that can be subscribed to. The CallbackManager will call the appropriate method on each handler when the event is triggered. class BaseCallbackHandler: """Base callback handler that can be used to handle cal...
https://python.langchain.com/en/latest/modules/callbacks/getting_started.html
ac5572e2a572-2
def on_tool_end(self, output: str, **kwargs: Any) -> Any: """Run when tool ends running.""" def on_tool_error( self, error: Union[Exception, KeyboardInterrupt], **kwargs: Any ) -> Any: """Run when tool errors.""" def on_text(self, text: str, **kwargs: Any) -> Any: """Run on a...
https://python.langchain.com/en/latest/modules/callbacks/getting_started.html
ac5572e2a572-3
The verbose argument is available on most objects throughout the API (Chains, Models, Tools, Agents, etc.) as a constructor argument, eg. LLMChain(verbose=True), and it is equivalent to passing a ConsoleCallbackHandler to the callbacks argument of that object and all child objects. This is useful for debugging, as it w...
https://python.langchain.com/en/latest/modules/callbacks/getting_started.html
ac5572e2a572-4
# First, let's explicitly set the StdOutCallbackHandler in `callbacks` chain = LLMChain(llm=llm, prompt=prompt, callbacks=[handler]) chain.run(number=2) # Then, let's use the `verbose` flag to achieve the same result chain = LLMChain(llm=llm, prompt=prompt, verbose=True) chain.run(number=2) # Finally, let's use the req...
https://python.langchain.com/en/latest/modules/callbacks/getting_started.html
ac5572e2a572-5
My custom handler, token: My custom handler, token: Why My custom handler, token: did My custom handler, token: the My custom handler, token: tomato My custom handler, token: turn My custom handler, token: red My custom handler, token: ? My custom handler, token: Because My custom handler, token: it My custom h...
https://python.langchain.com/en/latest/modules/callbacks/getting_started.html
ac5572e2a572-6
) -> None: """Run when chain starts running.""" print("zzzz....") await asyncio.sleep(0.3) class_name = serialized["name"] print("Hi! I just woke up. Your llm is starting") async def on_llm_end(self, response: LLMResult, **kwargs: Any) -> None: """Run when chain ends ...
https://python.langchain.com/en/latest/modules/callbacks/getting_started.html
ac5572e2a572-7
Sync handler being called in a `thread_pool_executor`: token: make Sync handler being called in a `thread_pool_executor`: token: up Sync handler being called in a `thread_pool_executor`: token: everything Sync handler being called in a `thread_pool_executor`: token: ! Sync handler being called in a `thread_pool_exec...
https://python.langchain.com/en/latest/modules/callbacks/getting_started.html
ac5572e2a572-8
from langchain.callbacks import tracing_enabled from langchain.llms import OpenAI # First, define custom callback handler implementations class MyCustomHandlerOne(BaseCallbackHandler): def on_llm_start( self, serialized: Dict[str, Any], prompts: List[str], **kwargs: Any ) -> Any: print(f"on_llm_...
https://python.langchain.com/en/latest/modules/callbacks/getting_started.html
ac5572e2a572-9
# Setup the agent. Only the `llm` will issue callbacks for handler2 llm = OpenAI(temperature=0, streaming=True, callbacks=[handler2]) tools = load_tools(["llm-math"], llm=llm) agent = initialize_agent( tools, llm, agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION ) # Callbacks for handler1 will be issued by every object ...
https://python.langchain.com/en/latest/modules/callbacks/getting_started.html
ac5572e2a572-10
on_new_token on_new_token ```text on_new_token on_new_token 2 on_new_token ** on_new_token 0 on_new_token . on_new_token 235 on_new_token on_new_token ``` on_new_token ... on_new_token num on_new_token expr on_new_token . on_new_token evaluate on_new_token (" on_new_token 2 on_new_token ** on_new_token 0 on_new_toke...
https://python.langchain.com/en/latest/modules/callbacks/getting_started.html
ac5572e2a572-11
import os from langchain.agents import AgentType, initialize_agent, load_tools from langchain.callbacks import tracing_enabled from langchain.llms import OpenAI # To run the code, make sure to set OPENAI_API_KEY and SERPAPI_API_KEY llm = OpenAI(temperature=0) tools = load_tools(["llm-math", "serpapi"], llm=llm) agent =...
https://python.langchain.com/en/latest/modules/callbacks/getting_started.html
ac5572e2a572-12
Action: Search Action Input: "US Open men's final 2019 winner" Observation: Rafael Nadal defeated Daniil Medvedev in the final, 7–5, 6–3, 5–7, 4–6, 6–4 to win the men's singles tennis title at the 2019 US Open. It was his fourth US ... Thought: I need to find out the age of the winner Action: Search Action Input: "Rafa...
https://python.langchain.com/en/latest/modules/callbacks/getting_started.html
ac5572e2a572-13
Action: Calculator Action Input: 29^0.23 Observation: Answer: 2.169459462491557 Thought: I now know the final answer. Final Answer: Harry Styles is Olivia Wilde's boyfriend and his current age raised to the 0.23 power is 2.169459462491557. > Finished chain. # Now, we unset the environment variable and use a context man...
https://python.langchain.com/en/latest/modules/callbacks/getting_started.html
ac5572e2a572-14
Thought: I now know the final answer Final Answer: Rafael Nadal, aged 36, won the US Open men's final in 2019 and his age raised to the 0.334 power is 3.3098250249682484. > Finished chain. > Entering new AgentExecutor chain... I need to find out who Olivia Wilde's boyfriend is and then calculate his age raised to the ...
https://python.langchain.com/en/latest/modules/callbacks/getting_started.html
ac5572e2a572-15
with tracing_enabled() as session: assert session tasks = [agent.arun(q) for q in questions[1:3]] # these should be traced await asyncio.gather(*tasks) await task > Entering new AgentExecutor chain... > Entering new AgentExecutor chain... > Entering new AgentExecutor chain... I need to find out who won th...
https://python.langchain.com/en/latest/modules/callbacks/getting_started.html
ac5572e2a572-16
Action: Search Action Input: "Rafael Nadal age"36 years I need to find out Harry Styles' age. Action: Search Action Input: "Harry Styles age" I need to find out Lewis Hamilton's age Action: Search Action Input: "Lewis Hamilton Age"29 years I need to calculate the age raised to the 0.334 power Action: Calculator Action ...
https://python.langchain.com/en/latest/modules/callbacks/getting_started.html
ac5572e2a572-17
with get_openai_callback() as cb: await asyncio.gather( *[llm.agenerate(["What is the square root of 4?"]) for _ in range(3)] ) assert cb.total_tokens == total_tokens * 3 # The context manager is concurrency safe task = asyncio.create_task(llm.agenerate(["What is the square root of 4?"])) with get_opena...
https://python.langchain.com/en/latest/modules/callbacks/getting_started.html
7366c01fc4a6-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...
https://python.langchain.com/en/latest/modules/indexes/getting_started.html
7366c01fc4a6-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...
https://python.langchain.com/en/latest/modules/indexes/getting_started.html
7366c01fc4a6-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...
https://python.langchain.com/en/latest/modules/indexes/getting_started.html
7366c01fc4a6-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...
https://python.langchain.com/en/latest/modules/indexes/getting_started.html
7366c01fc4a6-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...
https://python.langchain.com/en/latest/modules/indexes/getting_started.html
e3fe30b2ef8c-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...
https://python.langchain.com/en/latest/modules/indexes/document_loaders.html
e3fe30b2ef8c-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...
https://python.langchain.com/en/latest/modules/indexes/document_loaders.html
804d1d42f459-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...
https://python.langchain.com/en/latest/modules/indexes/vectorstores.html
764d876df394-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...
https://python.langchain.com/en/latest/modules/indexes/retrievers.html
493568990047-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...
https://python.langchain.com/en/latest/modules/indexes/text_splitters.html
493568990047-1
Getting Started By Harrison Chase © Copyright 2023, Harrison Chase. Last updated on Jun 11, 2023.
https://python.langchain.com/en/latest/modules/indexes/text_splitters.html
50cf76aa0c35-0
.ipynb .pdf Sitemap Contents Filtering sitemap URLs Add custom scraping rules Local Sitemap Sitemap# Extends from the WebBaseLoader, SitemapLoader loads a sitemap from a given URL, and then scrape and load all pages in the sitemap, returning each page as a Document. The scraping is done concurrently. There are reaso...
https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/sitemap.html
50cf76aa0c35-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
50cf76aa0c35-2
JSON\nAZLyrics\nBlackboard\nCollege Confidential\nCopy Paste\nCSV Loader\nDirectory Loader\nEmail\nEverNote\nFacebook Chat\nFigma\nGCS Directory\nGCS File Storage\nGitBook\nGoogle Drive\nGutenberg\nHacker News\nHTML\niFixit\nImages\nIMSDb\nMarkdown\nNotebook\nNotion\nObsidian\nPDF\nPowerPoint\nReadTheDocs Documentation...
https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/sitemap.html
50cf76aa0c35-3
Chain\n\n\nUtility Chains\nAPI Chains\nSelf-Critique Chain with Constitutional AI\nBashChain\nLLMCheckerChain\nLLM Math\nLLMRequestsChain\nLLMSummarizationCheckerChain\nModeration\nPAL\nSQLite example\n\n\nAsync API for Chain\n\n\nKey Concepts\nReference\n\n\nAgents\nGetting Started\nKey Concepts\nHow-To Guides\nAgents...
https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/sitemap.html
50cf76aa0c35-4
Benchmarking: Search + Calculator\nAgent VectorDB Question Answering Benchmarking\nBenchmarking Template\nData Augmented Question Answering\nUsing Hugging Face Datasets\nLLM Math\nQuestion Answering Benchmarking: Paul Graham Essay\nQuestion Answering Benchmarking: State of the Union Address\nQA Generation\nQuestion Ans...
https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/sitemap.html
50cf76aa0c35-5
to LangChain\n\n\n\n\n Contents \n\n\n\nGetting 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 n...
https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/sitemap.html
50cf76aa0c35-6
of knowledge or computation. This can include Python REPLs, embeddings, search engines, and more. LangChain provides a large collection of common utils to use in your application.\nChains: Chains go beyond just a single LLM call, and are sequences of calls (whether to an LLM or a different utility). LangChain provides ...
https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/sitemap.html
50cf76aa0c35-7
Generation involves specific types of chains that first interact with an external datasource to fetch data to use in the generation step. Examples of this include summarization of long pieces of text and question/answering over specific data sources.\nQuestion Answering: Answering questions over specific documents, onl...
https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/sitemap.html
50cf76aa0c35-8
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 or seeing how things were done in other applications.\nDeployments:...
https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/sitemap.html
50cf76aa0c35-9
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
50cf76aa0c35-10
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
50cf76aa0c35-11
Face Hub\nInstructEmbeddings\nOpenAI\nSageMaker Endpoint Embeddings\nSelf Hosted Embeddings\nTensorflowHub\n\n\n\n\nPrompts\nPrompt Templates\nGetting Started\nHow-To Guides\nHow to create a custom prompt template\nHow to create a prompt template that uses few shot examples\nHow to work with partial Prompt Templates\nH...
https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/sitemap.html
50cf76aa0c35-12
Splitter\n\n\nVectorstores\nGetting Started\nAtlasDB\nChroma\nDeep Lake\nElasticSearch\nFAISS\nMilvus\nOpenSearch\nPGVector\nPinecone\nQdrant\nRedis\nWeaviate\n\n\nRetrievers\nChatGPT Plugin Retriever\nVectorStore Retriever\n\n\n\n\nMemory\nGetting Started\nHow-To Guides\nConversationBufferMemory\nConversationBufferWin...
https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/sitemap.html
50cf76aa0c35-13
Search API\nSerpAPI\nWolfram Alpha\nZapier Natural Language Actions API\n\n\nAgents\nAgent Types\nCustom Agent\nConversation Agent (for Chat Models)\nConversation Agent\nMRKL\nMRKL Chat\nReAct\nSelf Ask With Search\n\n\nToolkits\nCSV Agent\nJSON Agent\nOpenAPI Agent\nPandas Dataframe Agent\nPython Agent\nSQL Database A...
https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/sitemap.html
50cf76aa0c35-14
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\nWolfram Alpha Wrapper\nWriter\n\n\n\nAdditional Resour...
https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/sitemap.html
50cf76aa0c35-15
an Language Model application.\n\nGetting Started Documentation\n\n\n\n\n\nModules#\nThere are several main modules that LangChain provides 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:\...
https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/sitemap.html
50cf76aa0c35-16
construct an answer.\nChatbots: Since language models are good at producing text, that makes them ideal for creating chatbots.\nQuerying Tabular Data: If you want to understand how to use LLMs to query data that is stored in a tabular format (csvs, SQL, dataframes, etc) you should read this page.\nInteracting with APIs...
https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/sitemap.html
50cf76aa0c35-17
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/sitemap.html
50cf76aa0c35-18
Add custom scraping rules# The SitemapLoader uses beautifulsoup4 for the scraping process, and it scrapes every element on the page by default. The SitemapLoader constructor accepts a custom scraping function. This feature can be helpful to tailor the scraping process to your specific needs; for example, you might want...
https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/sitemap.html
50cf76aa0c35-19
By Harrison Chase © Copyright 2023, Harrison Chase. Last updated on Jun 11, 2023.
https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/sitemap.html
ee2622e0672d-0
.ipynb .pdf Images Contents Using Unstructured Retain Elements Images# This covers how to load images such as JPG or PNG into a document format that we can use downstream. Using Unstructured# #!pip install pdfminer from langchain.document_loaders.image import UnstructuredImageLoader loader = UnstructuredImageLoader("...
https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/image.html
ee2622e0672d-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
ee2622e0672d-2
Image Analysis» Deep Learning Layout Analysis\n‘Character Renguition - Open Serres dary « Tol\n\n\nIntroduction\n\n\n‘Deep Learning(DL)-based approaches are the state-of-the-art for a wide range of\ndoctiment image analysis (DIA) tea including document image clasiffeation [I]\n", lookup_str='', metadata={'source': 'lay...
https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/image.html
ee2622e0672d-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
a54533024d16-0
.ipynb .pdf Modern Treasury Modern Treasury# Modern Treasury simplifies complex payment operations. It is a unified platform to power products and processes that move money. Connect to banks and payment systems Track transactions and balances in real-time Automate payment operations for scale This notebook covers how t...
https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/modern_treasury.html
7fa49adfa264-0
.ipynb .pdf Open Document Format (ODT) Open Document Format (ODT)# The Open Document Format for Office Applications (ODF), also known as OpenDocument, is an open file format for word processing documents, spreadsheets, presentations and graphics and using ZIP-compressed XML files. It was developed with the aim of provi...
https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/odt.html
0946553b0e47-0
.ipynb .pdf TOML TOML# TOML is a file format for configuration files. It is intended to be easy to read and write, and is designed to map unambiguously to a dictionary. Its specification is open-source. TOML is implemented in many programming languages. The name TOML is an acronym for “Tom’s Obvious, Minimal Language” ...
https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/toml.html
199db7255963-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...
https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/conll-u.html
28cdf3f7d35c-0
.ipynb .pdf EPub Contents Retain Elements EPub# EPUB is an e-book file format that uses the “.epub” file extension. The term is short for electronic publication and is sometimes styled ePub. EPUB is supported by many e-readers, and compatible software is available for most smartphones, tablets, and computers. This co...
https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/epub.html
359148380e25-0
.ipynb .pdf Notion DB 2/2 Contents Requirements Setup 1. Create a Notion Table Database 2. Create a Notion Integration 3. Connect the Integration to the Database 4. Get the Database ID Usage Notion DB 2/2# Notion is a collaboration platform with modified Markdown support that integrates kanban boards, tasks, wikis an...
https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/notiondb.html
359148380e25-1
Click the “Submit” button to create the integration. Once the integration is created, you’ll be provided with an Integration Token (API key). Copy this token and keep it safe, as you’ll need it to use the NotionDBLoader. 3. Connect the Integration to the Database# To connect your integration to the database, follow the...
https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/notiondb.html
359148380e25-2
········ from langchain.document_loaders import NotionDBLoader loader = NotionDBLoader( integration_token=NOTION_TOKEN, database_id=DATABASE_ID, request_timeout_sec=30 # optional, defaults to 10 ) docs = loader.load() print(docs) previous Modern Treasury next Notion DB 1/2 Contents Requirements Setup 1...
https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/notiondb.html
1800ecb21a83-0
.ipynb .pdf Diffbot Diffbot# Unlike traditional web scraping tools, Diffbot doesn’t require any rules to read the content on a page. It starts with computer vision, which classifies a page into one of 20 possible types. Content is then interpreted by a machine learning model trained to identify the key attributes on a ...
https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/diffbot.html
1800ecb21a83-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
1800ecb21a83-2
until done. LangChain provides a standard interface for agents, a selection of agents to choose from, and examples of end to end agents.\nUse Cases\nThe above modules can be used in a variety of ways. LangChain also provides guidance and assistance in this. Below are some of the common use cases LangChain supports.\nPe...
https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/diffbot.html
1800ecb21a83-3
think may be useful as you develop your application!\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 Lang...
https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/diffbot.html
1800ecb21a83-4
previous Confluence next Docugami By Harrison Chase © Copyright 2023, Harrison Chase. Last updated on Jun 11, 2023.
https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/diffbot.html
1c43ba46f583-0
.ipynb .pdf Google Cloud Storage File Google Cloud Storage File# Google Cloud Storage is a managed service for storing unstructured data. This covers how to load document objects from an Google Cloud Storage (GCS) file object (blob). # !pip install google-cloud-storage from langchain.document_loaders import GCSFileLoad...
https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/google_cloud_storage_file.html
eeb2c26eff80-0
.ipynb .pdf Git Contents Load existing repository from disk Clone repository from url Filtering files to load Git# Git is a distributed version control system that tracks changes in any set of computer files, usually used for coordinating work among programmers collaboratively developing source code during software d...
https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/git.html
eeb2c26eff80-1
By Harrison Chase © Copyright 2023, Harrison Chase. Last updated on Jun 11, 2023.
https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/git.html
e223e38ced13-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...
https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/image_captions.html
e223e38ced13-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...
https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/image_captions.html
e223e38ced13-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...
https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/image_captions.html
e223e38ced13-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...
https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/image_captions.html
e223e38ced13-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...
https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/image_captions.html
d01b56fc1b88-0
.ipynb .pdf Weather Weather# OpenWeatherMap is an open source weather service provider This loader fetches the weather data from the OpenWeatherMap’s OneCall API, using the pyowm Python package. You must initialize the loader with your OpenWeatherMap API token and the names of the cities you want the weather data for. ...
https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/weather.html
0136005c27d0-0
.ipynb .pdf GitBook Contents Load from single GitBook page Load from all paths in a given GitBook GitBook# GitBook is a modern documentation platform where teams can document everything from products to internal knowledge bases and APIs. This notebook shows how to pull page data from any GitBook. from langchain.docum...
https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/gitbook.html
0136005c27d0-1
loader = GitbookLoader("https://docs.gitbook.com", load_all_paths=True) all_pages_data = loader.load() Fetching text from https://docs.gitbook.com/ Fetching text from https://docs.gitbook.com/getting-started/overview Fetching text from https://docs.gitbook.com/getting-started/import Fetching text from https://docs.gitb...
https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/gitbook.html
0136005c27d0-2
Fetching text from https://docs.gitbook.com/troubleshooting/faqs Fetching text from https://docs.gitbook.com/troubleshooting/hard-refresh Fetching text from https://docs.gitbook.com/troubleshooting/report-bugs Fetching text from https://docs.gitbook.com/troubleshooting/connectivity-issues Fetching text from https://doc...
https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/gitbook.html
0136005c27d0-3
Document(page_content="Import\nFind out how to easily migrate your existing documentation and which formats are supported.\nThe import function allows you to migrate and unify existing documentation in GitBook. You can choose to import single or multiple pages although limits apply. \nPermissions\nAll members with edit...
https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/gitbook.html
0136005c27d0-4
started\nGit Sync\nLast modified \n4mo ago", lookup_str='', metadata={'source': 'https://docs.gitbook.com/getting-started/import', 'title': 'Import'}, lookup_index=0)
https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/gitbook.html
0136005c27d0-5
previous Figma next Git Contents Load from single GitBook page Load from all paths in a given GitBook By Harrison Chase © Copyright 2023, Harrison Chase. Last updated on Jun 11, 2023.
https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/gitbook.html