Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
hinthornw committed Jul 27, 2023
1 parent 8eee924 commit aa39b59
Show file tree
Hide file tree
Showing 118 changed files with 2,113 additions and 1,119 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
[![Open in Dev Containers](https://img.shields.io/static/v1?label=Dev%20Containers&message=Open&color=blue&logo=visualstudiocode)](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/hwchase17/langchain)
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/hwchase17/langchain)
[![GitHub star chart](https://img.shields.io/github/stars/hwchase17/langchain?style=social)](https://star-history.com/#hwchase17/langchain)
[![Dependency Status](https://img.shields.io/librariesio/github/hwchase17/langchain)](https://libraries.io/github/hwchase17/langchain)
[![Dependency Status](https://img.shields.io/librariesio/github/langchain-ai/langchain)](https://libraries.io/github/langchain-ai/langchain)
[![Open Issues](https://img.shields.io/github/issues-raw/hwchase17/langchain)](https://github.com/hwchase17/langchain/issues)


Expand Down
2 changes: 1 addition & 1 deletion docs/api_reference/guide_imports.json

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions docs/docs_skeleton/docs/guides/safety/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Preventing harmful outputs

One of the key concerns with using LLMs is that they may generate harmful or unethical text. This is an area of active research in the field. Here we present some built-in chains inspired by this research, which are intended to make the outputs of LLMs safer.

- [Moderation chain](/docs/use_cases/safety/moderation): Explicitly check if any output text is harmful and flag it.
- [Constitutional chain](/docs/use_cases/safety/constitutional_chain): Prompt the model with a set of principles which should guide it's behavior.
8 changes: 0 additions & 8 deletions docs/docs_skeleton/docs/modules/chains/additional/index.mdx

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Sequential

<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! Instead, edit the notebook w/the location & name as this file. -->


The next step after calling a language model is make a series of calls to a language model. This is particularly useful when you want to take the output from one call and use it as the input to another.

Expand Down
8 changes: 0 additions & 8 deletions docs/docs_skeleton/docs/modules/chains/popular/index.mdx

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
label: 'How to'
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
sidebar_position: 2
---

# Conversational Retrieval QA
# Store and reference chat history
The ConversationalRetrievalQA chain builds on RetrievalQAChain to provide a chat history component.

It first combines the chat history (either explicitly passed in or retrieved from the provided memory) and the question into a standalone question, then looks up relevant documents from the retriever, and finally passes those documents and the question to a question answering chain to return a response.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Dynamically selecting from multiple retrievers
# Dynamically select from multiple retrievers

This notebook demonstrates how to use the `RouterChain` paradigm to create a chain that dynamically selects which Retrieval system to use. Specifically we show how to use the `MultiRetrievalQAChain` to create a question-answering chain that selects the retrieval QA chain which is most relevant for a given question, and then answers the question using it.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Document QA
# QA over in-memory documents

Here we walk through how to use LangChain for question answering over a list of documents. Under the hood we'll be using our [Document chains](/docs/modules/chains/document/).

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
sidebar_position: 1
---
# Retrieval QA
# QA using a Retriever

This example showcases question answering over an index.

Expand Down
192 changes: 178 additions & 14 deletions docs/docs_skeleton/vercel.json
Original file line number Diff line number Diff line change
Expand Up @@ -1610,59 +1610,59 @@
},
{
"source": "/en/latest/modules/chains/examples/flare.html",
"destination": "/docs/modules/chains/additional/flare"
"destination": "/docs/use_cases/question_answering/how_to/flare"
},
{
"source": "/en/latest/modules/chains/examples/graph_cypher_qa.html",
"destination": "/docs/modules/chains/additional/graph_cypher_qa"
"destination": "/docs/use_cases/graph/graph_cypher_qa"
},
{
"source": "/en/latest/modules/chains/examples/graph_nebula_qa.html",
"destination": "/docs/modules/chains/additional/graph_nebula_qa"
"destination": "/docs/use_cases/graph/graph_nebula_qa"
},
{
"source": "/en/latest/modules/chains/index_examples/graph_qa.html",
"destination": "/docs/modules/chains/additional/graph_qa"
"destination": "/docs/use_cases/graph/graph_qa"
},
{
"source": "/en/latest/modules/chains/index_examples/hyde.html",
"destination": "/docs/modules/chains/additional/hyde"
"destination": "/docs/use_cases/question_answering/how_to/hyde"
},
{
"source": "/en/latest/modules/chains/examples/llm_bash.html",
"destination": "/docs/modules/chains/additional/llm_bash"
"destination": "/docs/use_cases/code_writing/llm_bash"
},
{
"source": "/en/latest/modules/chains/examples/llm_checker.html",
"destination": "/docs/modules/chains/additional/llm_checker"
"destination": "/docs/use_cases/self_check/llm_checker"
},
{
"source": "/en/latest/modules/chains/examples/llm_math.html",
"destination": "/docs/modules/chains/additional/llm_math"
"destination": "/docs/use_cases/code_writing/llm_math"
},
{
"source": "/en/latest/modules/chains/examples/llm_requests.html",
"destination": "/docs/modules/chains/additional/llm_requests"
"destination": "/docs/use_cases/apis/llm_requests"
},
{
"source": "/en/latest/modules/chains/examples/llm_summarization_checker.html",
"destination": "/docs/modules/chains/additional/llm_summarization_checker"
"destination": "/docs/use_cases/self_check/llm_summarization_checker"
},
{
"source": "/en/latest/modules/chains/examples/openapi.html",
"destination": "/docs/modules/chains/additional/openapi"
"destination": "/docs/use_cases/apis/openapi"
},
{
"source": "/en/latest/modules/chains/examples/pal.html",
"destination": "/docs/modules/chains/additional/pal"
"destination": "/docs/use_cases/code_writing/pal"
},
{
"source": "/en/latest/modules/chains/examples/tagging.html",
"destination": "/docs/modules/chains/additional/tagging"
"destination": "/docs/use_cases/tagging"
},
{
"source": "/en/latest/modules/chains/index_examples/vector_db_text_generation.html",
"destination": "/docs/modules/chains/additional/vector_db_text_generation"
"destination": "/docs/use_cases/question_answering/how_to/vector_db_text_generation"
},
{
"source": "/en/latest/modules/chains/generic/router.html",
Expand Down Expand Up @@ -3771,6 +3771,170 @@
{
"source": "/en/latest/:path*",
"destination": "/docs/:path*"
},
{
"source": "/docs/modules/chains/additional/constitutional_chain",
"destination": "/docs/guides/safety/constitutional_chain"
},
{
"source": "/docs/modules/chains/additional/moderation",
"destination": "/docs/guides/safety/moderation"
},
{
"source": "/docs/modules/chains/popular/api",
"destination": "/docs/use_cases/apis/api"
},
{
"source": "/docs/modules/chains/additional/analyze_document",
"destination": "/docs/use_cases/question_answering/how_to/analyze_document"
},
{
"source": "/docs/modules/chains/popular/chat_vector_db",
"destination": "/docs/use_cases/question_answering/how_to/chat_vector_db"
},
{
"source": "/docs/modules/chains/additional/multi_retrieval_qa_router",
"destination": "/docs/use_cases/question_answering/how_to/multi_retrieval_qa_router"
},
{
"source": "/docs/modules/chains/additional/question_answering",
"destination": "/docs/use_cases/question_answering/how_to/question_answering"
},
{
"source": "/docs/modules/chains/popular/vector_db_qa",
"destination": "/docs/use_cases/question_answering/how_to/vector_db_qa"
},
{
"source": "/docs/modules/chains/popular/summarize",
"destination": "/docs/use_cases/summarization/summarize"
},
{
"source": "/docs/modules/chains/popular/sqlite",
"destination": "/docs/use_cases/tabular/sqlite"
},
{
"source": "/docs/modules/chains/popular/openai_functions",
"destination": "/docs/modules/chains/how_to/openai_functions"
},
{
"source": "/docs/modules/chains/additional/llm_requests",
"destination": "/docs/use_cases/apis/llm_requests"
},
{
"source": "/docs/modules/chains/additional/openai_openapi",
"destination": "/docs/use_cases/apis/openai_openapi"
},
{
"source": "/docs/modules/chains/additional/openapi",
"destination": "/docs/use_cases/apis/openapi"
},
{
"source": "/docs/modules/chains/additional/openapi_openai",
"destination": "/docs/use_cases/apis/openapi_openai"
},
{
"source": "/docs/modules/chains/additional/cpal",
"destination": "/docs/use_cases/code_writing/cpal"
},
{
"source": "/docs/modules/chains/additional/llm_bash",
"destination": "/docs/use_cases/code_writing/llm_bash"
},
{
"source": "/docs/modules/chains/additional/llm_math",
"destination": "/docs/use_cases/code_writing/llm_math"
},
{
"source": "/docs/modules/chains/additional/llm_symbolic_math",
"destination": "/docs/use_cases/code_writing/llm_symbolic_math"
},
{
"source": "/docs/modules/chains/additional/pal",
"destination": "/docs/use_cases/code_writing/pal"
},
{
"source": "/docs/modules/chains/additional/graph_arangodb_qa",
"destination": "/docs/use_cases/graph/graph_arangodb_qa"
},
{
"source": "/docs/modules/chains/additional/graph_cypher_qa",
"destination": "/docs/use_cases/graph/graph_cypher_qa"
},
{
"source": "/docs/modules/chains/additional/graph_hugegraph_qa",
"destination": "/docs/use_cases/graph/graph_hugegraph_qa"
},
{
"source": "/docs/modules/chains/additional/graph_kuzu_qa",
"destination": "/docs/use_cases/graph/graph_kuzu_qa"
},
{
"source": "/docs/modules/chains/additional/graph_nebula_qa",
"destination": "/docs/use_cases/graph/graph_nebula_qa"
},
{
"source": "/docs/modules/chains/additional/graph_qa",
"destination": "/docs/use_cases/graph/graph_qa"
},
{
"source": "/docs/modules/chains/additional/graph_sparql_qa",
"destination": "/docs/use_cases/graph/graph_sparql_qa"
},
{
"source": "/docs/modules/chains/additional/neptune_cypher_qa",
"destination": "/docs/use_cases/graph/neptune_cypher_qa"
},
{
"source": "/docs/modules/chains/additional/tot",
"destination": "/docs/use_cases/graph/tot"
},
{
"source": "/docs/use_cases/question_answering//document-context-aware-QA",
"destination": "/docs/use_cases/question_answering/how_to/document-context-aware-QA"
},
{
"source": "/docs/modules/chains/additional/flare",
"destination": "/docs/use_cases/question_answering/how_to/flare"
},
{
"source": "/docs/modules/chains/additional/hyde",
"destination": "/docs/use_cases/question_answering/how_to/hyde"
},
{
"source": "/docs/use_cases/question_answering//local_retrieval_qa",
"destination": "/docs/use_cases/question_answering/how_to/local_retrieval_qa"
},
{
"source": "/docs/modules/chains/additional/qa_citations",
"destination": "/docs/use_cases/question_answering/how_to/qa_citations"
},
{
"source": "/docs/modules/chains/additional/vector_db_text_generation",
"destination": "/docs/use_cases/question_answering/how_to/vector_db_text_generation"
},
{
"source": "/docs/modules/chains/additional/openai_functions_retrieval_qa",
"destination": "/docs/use_cases/question_answering/integrations/openai_functions_retrieval_qa"
},
{
"source": "/docs/use_cases/question_answering//semantic-search-over-chat",
"destination": "/docs/use_cases/question_answering/integrations/semantic-search-over-chat"
},
{
"source": "/docs/modules/chains/additional/llm_checker",
"destination": "/docs/use_cases/self_check/llm_checker"
},
{
"source": "/docs/modules/chains/additional/llm_summarization_checker",
"destination": "/docs/use_cases/self_check/llm_summarization_checker"
},
{
"source": "/docs/modules/chains/additional/elasticsearch_database",
"destination": "/docs/use_cases/tabular/elasticsearch_database"
},
{
"source": "/docs/modules/chains/additional/tagging",
"destination": "/docs/use_cases/tagging"
}
]
}
1 change: 1 addition & 0 deletions docs/extras/additional_resources/tutorials.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Tutorials

Below are links to video tutorials and courses on LangChain. For written guides on common use cases for LangChain, check out the [use cases guides](/docs/use_cases).

⛓ icon marks a new addition [last update 2023-07-05]

Expand Down
2 changes: 1 addition & 1 deletion docs/extras/guides/debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ If you're building with LLMs, at some point something will break, and you'll nee

Here's a few different tools and functionalities to aid in debugging.

<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! Instead, edit the notebook w/the location & name as this file. -->


## Tracing

Expand Down
4 changes: 2 additions & 2 deletions docs/extras/guides/model_laboratory.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"id": "920a3c1a",
"metadata": {},
"source": [
"# Model Comparison\n",
"# Model comparison\n",
"\n",
"Constructing your language model application will likely involved choosing between many different options of prompts, models, and even chains to use. When doing so, you will want to compare these different options on different inputs in an easy, flexible, and intuitive way. \n",
"\n",
Expand Down Expand Up @@ -254,7 +254,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.9"
"version": "3.11.3"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion docs/extras/integrations/callbacks/argilla.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"> using both human and machine feedback. We provide support for each step in the MLOps cycle, \n",
"> from data labeling to model monitoring.\n",
"\n",
"<a target=\"_blank\" href=\"https://colab.research.google.com/github/hwchase17/langchain/blob/master/docs/modules/callbacks/integrations/argilla.html\">\n",
"<a target=\"_blank\" href=\"https://colab.research.google.com/github/hwchase17/langchain/blob/master/docs/integrations/callbacks/argilla.html\">\n",
" <img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/>\n",
"</a>"
]
Expand Down
12 changes: 6 additions & 6 deletions docs/extras/integrations/document_loaders/Etherscan.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
"You will need a Etherscan api key to proceed. The free api key has 5 calls per seconds quota.\n",
"\n",
"The loader supports the following six functinalities:\n",
"* Retrieve normal transactions under specifc account on Ethereum Mainet\n",
"* Retrieve internal transactions under specifc account on Ethereum Mainet\n",
"* Retrieve erc20 transactions under specifc account on Ethereum Mainet\n",
"* Retrieve erc721 transactions under specifc account on Ethereum Mainet\n",
"* Retrieve erc1155 transactions under specifc account on Ethereum Mainet\n",
"* Retrieve ethereum balance in wei under specifc account on Ethereum Mainet\n",
"* Retrieve normal transactions under specific account on Ethereum Mainet\n",
"* Retrieve internal transactions under specific account on Ethereum Mainet\n",
"* Retrieve erc20 transactions under specific account on Ethereum Mainet\n",
"* Retrieve erc721 transactions under specific account on Ethereum Mainet\n",
"* Retrieve erc1155 transactions under specific account on Ethereum Mainet\n",
"* Retrieve ethereum balance in wei under specific account on Ethereum Mainet\n",
"\n",
"\n",
"If the account does not have corresponding transactions, the loader will a list with one document. The content of document is ''.\n",
Expand Down
Loading

0 comments on commit aa39b59

Please sign in to comment.