url stringlengths 34 116 | markdown stringlengths 0 150k ⌀ | screenshotUrl null | crawl dict | metadata dict | text stringlengths 0 147k |
|---|---|---|---|---|---|
https://python.langchain.com/docs/guides/productionization/evaluation/comparison/pairwise_string/ | ## Pairwise string comparison
[](https://colab.research.google.com/github/langchain-ai/langchain/blob/master/docs/docs/guides/evaluation/comparison/pairwise_string.ipynb)
Open In Colab
Often you will want to compare predictions of an LLM, Chain, or Agent f... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:36:52.850Z",
"loadedUrl": "https://python.langchain.com/docs/guides/productionization/evaluation/comparison/pairwise_string/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/guides/productionization/evaluation/comparison/pairwise_string/",
"description": "Open In Colab",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "3333",
"cache-control": "publ... | Pairwise string comparison
Open In Colab
Often you will want to compare predictions of an LLM, Chain, or Agent for a given input. The StringComparison evaluators facilitate this so you can answer questions like:
Which LLM or prompt produces a preferred output for a given question?
Which examples should I include for fe... |
https://python.langchain.com/docs/guides/productionization/evaluation/examples/ | ## Examples
🚧 _Docs under construction_ 🚧
Below are some examples for inspecting and checking different chains.
[
## 📄️ Comparing Chain Outputs
Open In Colab
](https://python.langchain.com/docs/guides/productionization/evaluation/examples/comparisons/)
* * *
#### Help us out by providing feedback on this doc... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:36:54.540Z",
"loadedUrl": "https://python.langchain.com/docs/guides/productionization/evaluation/examples/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/guides/productionization/evaluation/examples/",
"description": "🚧 Docs under construction 🚧",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "7938",
"cache-control": "public... | Examples
🚧 Docs under construction 🚧
Below are some examples for inspecting and checking different chains.
📄️ Comparing Chain Outputs
Open In Colab
Help us out by providing feedback on this documentation page: |
https://python.langchain.com/docs/ | null | {
"depth": 0,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:36:55.446Z",
"loadedUrl": "https://python.langchain.com/",
"referrerUrl": "https://python.langchain.com/docs/"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/",
"description": null,
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "7035",
"cache-control": "public, max-age=0, must-revalidate",
"content-disposition": "inline",
"cont... | ||
https://python.langchain.com/docs/guides/productionization/evaluation/examples/comparisons/ | ## Comparing Chain Outputs
[](https://colab.research.google.com/github/langchain-ai/langchain/blob/master/docs/docs/guides/evaluation/examples/comparisons.ipynb)
Open In Colab
Suppose you have two different prompts (or LLMs). How do you know which will gen... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:36:55.483Z",
"loadedUrl": "https://python.langchain.com/docs/guides/productionization/evaluation/examples/comparisons/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/guides/productionization/evaluation/examples/comparisons/",
"description": "Open In Colab",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "3692",
"cache-control": "public, ma... | Comparing Chain Outputs
Open In Colab
Suppose you have two different prompts (or LLMs). How do you know which will generate “better” results?
One automated way to predict the preferred configuration is to use a PairwiseStringEvaluator like the PairwiseStringEvalChain[1]. This chain prompts an LLM to select which output... |
https://python.langchain.com/docs/guides/productionization/evaluation/string/ | ## String Evaluators
A string evaluator is a component within LangChain designed to assess the performance of a language model by comparing its generated outputs (predictions) to a reference string or an input. This comparison is a crucial step in the evaluation of language models, providing a measure of the accuracy ... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:36:56.745Z",
"loadedUrl": "https://python.langchain.com/docs/guides/productionization/evaluation/string/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/guides/productionization/evaluation/string/",
"description": "A string evaluator is a component within LangChain designed to assess the performance of a language model by comparing its generated outputs (predictions) to a reference string or an ... | String Evaluators
A string evaluator is a component within LangChain designed to assess the performance of a language model by comparing its generated outputs (predictions) to a reference string or an input. This comparison is a crucial step in the evaluation of language models, providing a measure of the accuracy or q... |
https://python.langchain.com/docs/guides/productionization/evaluation/string/criteria_eval_chain/ | ## Criteria Evaluation
[](https://colab.research.google.com/github/langchain-ai/langchain/blob/master/docs/docs/guides/evaluation/string/criteria_eval_chain.ipynb)
Open In Colab
In scenarios where you wish to assess a model’s output using a specific rubric... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:36:57.127Z",
"loadedUrl": "https://python.langchain.com/docs/guides/productionization/evaluation/string/criteria_eval_chain/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/guides/productionization/evaluation/string/criteria_eval_chain/",
"description": "Open In Colab",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "3337",
"cache-control": "publ... | Criteria Evaluation
Open In Colab
In scenarios where you wish to assess a model’s output using a specific rubric or criteria set, the criteria evaluator proves to be a handy tool. It allows you to verify if an LLM or Chain’s output complies with a defined set of criteria.
To understand its functionality and configurabi... |
https://python.langchain.com/docs/guides/productionization/evaluation/string/embedding_distance/ | ## Embedding Distance
[](https://colab.research.google.com/github/langchain-ai/langchain/blob/master/docs/docs/guides/evaluation/string/embedding_distance.ipynb)
Open In Colab
To measure semantic similarity (or dissimilarity) between a prediction and a ref... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:36:58.643Z",
"loadedUrl": "https://python.langchain.com/docs/guides/productionization/evaluation/string/embedding_distance/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/guides/productionization/evaluation/string/embedding_distance/",
"description": "Open In Colab",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "6612",
"cache-control": "publi... | Embedding Distance
Open In Colab
To measure semantic similarity (or dissimilarity) between a prediction and a reference label string, you could use a vector distance metric the two embedded representations using the embedding_distance evaluator.[1]
Note: This returns a distance score, meaning that the lower the number,... |
https://python.langchain.com/docs/guides/productionization/evaluation/string/custom/ | You can make your own custom string evaluators by inheriting from the `StringEvaluator` class and implementing the `_evaluate_strings` (and `_aevaluate_strings` for async support) methods.
In this example, you will create a perplexity evaluator using the HuggingFace [evaluate](https://huggingface.co/docs/evaluate/inde... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:36:59.535Z",
"loadedUrl": "https://python.langchain.com/docs/guides/productionization/evaluation/string/custom/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/guides/productionization/evaluation/string/custom/",
"description": "Open In Colab",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "3340",
"cache-control": "public, max-age=0... | You can make your own custom string evaluators by inheriting from the StringEvaluator class and implementing the _evaluate_strings (and _aevaluate_strings for async support) methods.
In this example, you will create a perplexity evaluator using the HuggingFace evaluate library. Perplexity is a measure of how well the g... |
https://python.langchain.com/docs/guides/productionization/evaluation/string/exact_match/ | ## Exact Match
[](https://colab.research.google.com/github/langchain-ai/langchain/blob/master/docs/docs/guides/evaluation/string/exact_match.ipynb)
Open In Colab
Probably the simplest ways to evaluate an LLM or runnable’s string output against a reference ... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:36:59.670Z",
"loadedUrl": "https://python.langchain.com/docs/guides/productionization/evaluation/string/exact_match/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/guides/productionization/evaluation/string/exact_match/",
"description": "Open In Colab",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "3687",
"cache-control": "public, max-... | Exact Match
Open In Colab
Probably the simplest ways to evaluate an LLM or runnable’s string output against a reference label is by a simple string equivalence.
This can be accessed using the exact_match evaluator.
from langchain.evaluation import ExactMatchStringEvaluator
evaluator = ExactMatchStringEvaluator()
Alter... |
https://python.langchain.com/docs/guides/productionization/evaluation/string/json/ | ## JSON Evaluators
Evaluating [extraction](https://python.langchain.com/docs/use_cases/extraction/) and function calling applications often comes down to validation that the LLM’s string output can be parsed correctly and how it compares to a reference object. The following `JSON` validators provide functionality to c... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:00.346Z",
"loadedUrl": "https://python.langchain.com/docs/guides/productionization/evaluation/string/json/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/guides/productionization/evaluation/string/json/",
"description": "Evaluating extraction and function calling",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "3340",
"cache-c... | JSON Evaluators
Evaluating extraction and function calling applications often comes down to validation that the LLM’s string output can be parsed correctly and how it compares to a reference object. The following JSON validators provide functionality to check your model’s output consistently.
JsonValidityEvaluator
The... |
https://python.langchain.com/docs/guides/productionization/evaluation/string/regex_match/ | ## Regex Match
[](https://colab.research.google.com/github/langchain-ai/langchain/blob/master/docs/docs/guides/evaluation/string/regex_match.ipynb)
Open In Colab
To evaluate chain or runnable string predictions against a custom regex, you can use the `rege... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:01.545Z",
"loadedUrl": "https://python.langchain.com/docs/guides/productionization/evaluation/string/regex_match/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/guides/productionization/evaluation/string/regex_match/",
"description": "Open In Colab",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "3341",
"cache-control": "public, max-... | Regex Match
Open In Colab
To evaluate chain or runnable string predictions against a custom regex, you can use the regex_match evaluator.
from langchain.evaluation import RegexMatchStringEvaluator
evaluator = RegexMatchStringEvaluator()
Alternatively via the loader:
from langchain.evaluation import load_evaluator
eva... |
https://python.langchain.com/docs/guides/productionization/evaluation/string/string_distance/ | ## String Distance
[](https://colab.research.google.com/github/langchain-ai/langchain/blob/master/docs/docs/guides/evaluation/string/string_distance.ipynb)
Open In Colab
> In information theory, linguistics, and computer science, the [Levenshtein distance ... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:02.206Z",
"loadedUrl": "https://python.langchain.com/docs/guides/productionization/evaluation/string/string_distance/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/guides/productionization/evaluation/string/string_distance/",
"description": "Open In Colab",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "4143",
"cache-control": "public, ... | String Distance
Open In Colab
In information theory, linguistics, and computer science, the Levenshtein distance (Wikipedia) is a string metric for measuring the difference between two sequences. Informally, the Levenshtein distance between two words is the minimum number of single-character edits (insertions, deletion... |
https://python.langchain.com/docs/guides/productionization/evaluation/trajectory/ | ## Trajectory Evaluators
Trajectory Evaluators in LangChain provide a more holistic approach to evaluating an agent. These evaluators assess the full sequence of actions taken by an agent and their corresponding responses, which we refer to as the "trajectory". This allows you to better measure an agent's effectivenes... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:02.745Z",
"loadedUrl": "https://python.langchain.com/docs/guides/productionization/evaluation/trajectory/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/guides/productionization/evaluation/trajectory/",
"description": "Trajectory Evaluators in LangChain provide a more holistic approach to evaluating an agent. These evaluators assess the full sequence of actions taken by an agent and their corres... | Trajectory Evaluators
Trajectory Evaluators in LangChain provide a more holistic approach to evaluating an agent. These evaluators assess the full sequence of actions taken by an agent and their corresponding responses, which we refer to as the "trajectory". This allows you to better measure an agent's effectiveness an... |
https://python.langchain.com/docs/guides/productionization/evaluation/string/scoring_eval_chain/ | ## Scoring Evaluator
The Scoring Evaluator instructs a language model to assess your model’s predictions on a specified scale (default is 1-10) based on your custom criteria or rubric. This feature provides a nuanced evaluation instead of a simplistic binary score, aiding in evaluating models against tailored rubrics ... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:02.965Z",
"loadedUrl": "https://python.langchain.com/docs/guides/productionization/evaluation/string/scoring_eval_chain/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/guides/productionization/evaluation/string/scoring_eval_chain/",
"description": "The Scoring Evaluator instructs a language model to assess your model’s",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-or... | Scoring Evaluator
The Scoring Evaluator instructs a language model to assess your model’s predictions on a specified scale (default is 1-10) based on your custom criteria or rubric. This feature provides a nuanced evaluation instead of a simplistic binary score, aiding in evaluating models against tailored rubrics and ... |
https://python.langchain.com/docs/guides/productionization/evaluation/trajectory/custom/ | You can make your own custom trajectory evaluators by inheriting from the [AgentTrajectoryEvaluator](https://api.python.langchain.com/en/latest/evaluation/langchain.evaluation.schema.AgentTrajectoryEvaluator.html#langchain.evaluation.schema.AgentTrajectoryEvaluator) class and overwriting the `_evaluate_agent_trajectory... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:03.741Z",
"loadedUrl": "https://python.langchain.com/docs/guides/productionization/evaluation/trajectory/custom/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/guides/productionization/evaluation/trajectory/custom/",
"description": "Open In Colab",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "3690",
"cache-control": "public, max-a... | You can make your own custom trajectory evaluators by inheriting from the AgentTrajectoryEvaluator class and overwriting the _evaluate_agent_trajectory (and _aevaluate_agent_action) method.
In this example, you will make a simple trajectory evaluator that uses an LLM to determine if any actions were unnecessary.
from t... |
https://python.langchain.com/docs/guides/productionization/evaluation/trajectory/trajectory_eval/ | ## Agent Trajectory
[](https://colab.research.google.com/github/langchain-ai/langchain/blob/master/docs/docs/guides/evaluation/trajectory/trajectory_eval.ipynb)
Open In Colab
Agents can be difficult to holistically evaluate due to the breadth of actions an... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:04.126Z",
"loadedUrl": "https://python.langchain.com/docs/guides/productionization/evaluation/trajectory/trajectory_eval/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/guides/productionization/evaluation/trajectory/trajectory_eval/",
"description": "Open In Colab",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "1378",
"cache-control": "publ... | Agent Trajectory
Open In Colab
Agents can be difficult to holistically evaluate due to the breadth of actions and generation they can make. We recommend using multiple evaluation techniques appropriate to your use case. One way to evaluate an agent is to look at the whole trajectory of actions taken along with their re... |
https://python.langchain.com/docs/guides/productionization/fallbacks/ | ## Fallbacks
When working with language models, you may often encounter issues from the underlying APIs, whether these be rate limiting or downtime. Therefore, as you go to move your LLM applications into production it becomes more and more important to safeguard against these. That’s why we’ve introduced the concept ... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:04.819Z",
"loadedUrl": "https://python.langchain.com/docs/guides/productionization/fallbacks/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/guides/productionization/fallbacks/",
"description": "When working with language models, you may often encounter issues from",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "3344... | Fallbacks
When working with language models, you may often encounter issues from the underlying APIs, whether these be rate limiting or downtime. Therefore, as you go to move your LLM applications into production it becomes more and more important to safeguard against these. That’s why we’ve introduced the concept of f... |
https://python.langchain.com/docs/guides/productionization/safety/ | ## Privacy & Safety
One of the key concerns with using LLMs is that they may misuse private data or 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.
* [Amazon Com... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:05.288Z",
"loadedUrl": "https://python.langchain.com/docs/guides/productionization/safety/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/guides/productionization/safety/",
"description": "One of the key concerns with using LLMs is that they may misuse private data or generate harmful or unethical text. This is an area of active research in the field. Here we present some built-in... | Privacy & Safety
One of the key concerns with using LLMs is that they may misuse private data or 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.
Amazon Comprehend mo... |
https://python.langchain.com/docs/guides/productionization/safety/amazon_comprehend_chain/ | ## Amazon Comprehend Moderation Chain
> [Amazon Comprehend](https://aws.amazon.com/comprehend/) is a natural-language processing (NLP) service that uses machine learning to uncover valuable insights and connections in text.
This notebook shows how to use `Amazon Comprehend` to detect and handle `Personally Identifiab... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:05.529Z",
"loadedUrl": "https://python.langchain.com/docs/guides/productionization/safety/amazon_comprehend_chain/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/guides/productionization/safety/amazon_comprehend_chain/",
"description": "Amazon Comprehend is a",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "0",
"cache-control": "publi... | Amazon Comprehend Moderation Chain
Amazon Comprehend is a natural-language processing (NLP) service that uses machine learning to uncover valuable insights and connections in text.
This notebook shows how to use Amazon Comprehend to detect and handle Personally Identifiable Information (PII) and toxicity.
Setting up
%... |
https://python.langchain.com/docs/guides/productionization/safety/constitutional_chain/ | This example shows the Self-critique chain with `Constitutional AI`.
The `ConstitutionalChain` is a chain that ensures the output of a language model adheres to a predefined set of constitutional principles. By incorporating specific rules and guidelines, the `ConstitutionalChain` filters and modifies the generated co... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:07.752Z",
"loadedUrl": "https://python.langchain.com/docs/guides/productionization/safety/constitutional_chain/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/guides/productionization/safety/constitutional_chain/",
"description": "This example shows the Self-critique chain with Constitutional AI.",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
... | This example shows the Self-critique chain with Constitutional AI.
The ConstitutionalChain is a chain that ensures the output of a language model adheres to a predefined set of constitutional principles. By incorporating specific rules and guidelines, the ConstitutionalChain filters and modifies the generated content t... |
https://python.langchain.com/docs/guides/productionization/safety/hugging_face_prompt_injection/ | This notebook shows how to prevent prompt injection attacks using the text classification model from `HuggingFace`.
By default, it uses a _[laiyer/deberta-v3-base-prompt-injection](https://huggingface.co/laiyer/deberta-v3-base-prompt-injection)_ model trained to identify prompt injections.
In this notebook, we will u... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:08.751Z",
"loadedUrl": "https://python.langchain.com/docs/guides/productionization/safety/hugging_face_prompt_injection/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/guides/productionization/safety/hugging_face_prompt_injection/",
"description": "This notebook shows how to prevent prompt injection attacks using the",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-orig... | This notebook shows how to prevent prompt injection attacks using the text classification model from HuggingFace.
By default, it uses a laiyer/deberta-v3-base-prompt-injection model trained to identify prompt injections.
In this notebook, we will use the ONNX version of the model to speed up the inference.
Usage
First... |
https://python.langchain.com/docs/guides/productionization/safety/layerup_security/ | The [Layerup Security](https://uselayerup.com/) integration allows you to secure your calls to any LangChain LLM, LLM chain or LLM agent. The LLM object wraps around any existing LLM object, allowing for a secure layer between your users and your LLMs.
While the Layerup Security object is designed as an LLM, it is not... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:08.986Z",
"loadedUrl": "https://python.langchain.com/docs/guides/productionization/safety/layerup_security/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/guides/productionization/safety/layerup_security/",
"description": "The Layerup Security integration allows you to secure your calls to any LangChain LLM, LLM chain or LLM agent. The LLM object wraps around any existing LLM object, allowing for ... | The Layerup Security integration allows you to secure your calls to any LangChain LLM, LLM chain or LLM agent. The LLM object wraps around any existing LLM object, allowing for a secure layer between your users and your LLMs.
While the Layerup Security object is designed as an LLM, it is not actually an LLM itself, it ... |
https://python.langchain.com/docs/guides/productionization/safety/logical_fallacy_chain/ | ## Logical Fallacy chain
This example shows how to remove logical fallacies from model output.
## Logical Fallacies[](#logical-fallacies "Direct link to Logical Fallacies")
`Logical fallacies` are flawed reasoning or false arguments that can undermine the validity of a model's outputs.
Examples include circular re... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:09.722Z",
"loadedUrl": "https://python.langchain.com/docs/guides/productionization/safety/logical_fallacy_chain/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/guides/productionization/safety/logical_fallacy_chain/",
"description": "This example shows how to remove logical fallacies from model output.",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*"... | Logical Fallacy chain
This example shows how to remove logical fallacies from model output.
Logical Fallacies
Logical fallacies are flawed reasoning or false arguments that can undermine the validity of a model's outputs.
Examples include circular reasoning, false dichotomies, ad hominem attacks, etc. Machine learnin... |
https://python.langchain.com/docs/guides/productionization/safety/moderation/ | ## Moderation chain
This notebook walks through examples of how to use a moderation chain, and several common ways for doing so. Moderation chains are useful for detecting text that could be hateful, violent, etc. This can be useful to apply on both user input, but also on the output of a Language Model. Some API prov... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:10.347Z",
"loadedUrl": "https://python.langchain.com/docs/guides/productionization/safety/moderation/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/guides/productionization/safety/moderation/",
"description": "This notebook walks through examples of how to use a moderation chain,",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age... | Moderation chain
This notebook walks through examples of how to use a moderation chain, and several common ways for doing so. Moderation chains are useful for detecting text that could be hateful, violent, etc. This can be useful to apply on both user input, but also on the output of a Language Model. Some API provider... |
https://python.langchain.com/docs/guides/productionization/safety/presidio_data_anonymization/ | [](https://colab.research.google.com/github/langchain-ai/langchain/blob/master/docs/docs/guides/privacy/presidio_data_anonymization/index.ipynb)
Open In Colab
> [Presidio](https://microsoft.github.io/presidio/) (Origin from Latin praesidium ‘protection, gar... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:10.572Z",
"loadedUrl": "https://python.langchain.com/docs/guides/productionization/safety/presidio_data_anonymization/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/guides/productionization/safety/presidio_data_anonymization/",
"description": "Open In Colab",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "728",
"cache-control": "public, ... | Open In Colab
Presidio (Origin from Latin praesidium ‘protection, garrison’) helps to ensure sensitive data is properly managed and governed. It provides fast identification and anonymization modules for private entities in text and images such as credit card numbers, names, locations, social security numbers, bitcoin ... |
https://python.langchain.com/docs/guides/productionization/safety/presidio_data_anonymization/multi_language/ | [](https://colab.research.google.com/github/langchain-ai/langchain/blob/master/docs/docs/guides/privacy/presidio_data_anonymization/multi_language.ipynb)
Open In Colab
## Use case[](#use-case "Direct link to Use case")
Multi-language support in data pseud... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:11.114Z",
"loadedUrl": "https://python.langchain.com/docs/guides/productionization/safety/presidio_data_anonymization/multi_language/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/guides/productionization/safety/presidio_data_anonymization/multi_language/",
"description": "multi-language-data-anonymization-with-microsoft-presidio}",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-or... | Open In Colab
Use case
Multi-language support in data pseudonymization is essential due to differences in language structures and cultural contexts. Different languages may have varying formats for personal identifiers. For example, the structure of names, locations and dates can differ greatly between languages and r... |
https://python.langchain.com/docs/expression_language/primitives/binding/ | ## Binding: Attach runtime args
Sometimes we want to invoke a Runnable within a Runnable sequence with constant arguments that are not part of the output of the preceding Runnable in the sequence, and which are not part of the user input. We can use `Runnable.bind()` to pass these arguments in.
Suppose we have a simp... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:12.135Z",
"loadedUrl": "https://python.langchain.com/docs/expression_language/primitives/binding/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/expression_language/primitives/binding/",
"description": "binding-attach-runtime-args}",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "3355",
"cache-control": "public, max-a... | Binding: Attach runtime args
Sometimes we want to invoke a Runnable within a Runnable sequence with constant arguments that are not part of the output of the preceding Runnable in the sequence, and which are not part of the user input. We can use Runnable.bind() to pass these arguments in.
Suppose we have a simple prom... |
https://python.langchain.com/docs/expression_language/primitives/assign/ | The `RunnablePassthrough.assign(...)` static method takes an input value and adds the extra arguments passed to the assign function.
This is useful when additively creating a dictionary to use as input to a later step, which is a common LCEL pattern.
Here’s an example:
```
%pip install --upgrade --quiet langchain la... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:12.516Z",
"loadedUrl": "https://python.langchain.com/docs/expression_language/primitives/assign/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/expression_language/primitives/assign/",
"description": "adding-values-to-chain-state}",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "3355",
"cache-control": "public, max-a... | The RunnablePassthrough.assign(...) static method takes an input value and adds the extra arguments passed to the assign function.
This is useful when additively creating a dictionary to use as input to a later step, which is a common LCEL pattern.
Here’s an example:
%pip install --upgrade --quiet langchain langchain-o... |
https://python.langchain.com/docs/expression_language/primitives/configure/ | Oftentimes you may want to experiment with, or even expose to the end user, multiple different ways of doing things. In order to make this experience as easy as possible, we have defined two methods.
First, a `configurable_fields` method. This lets you configure particular fields of a runnable.
Second, a `configurabl... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:13.382Z",
"loadedUrl": "https://python.langchain.com/docs/expression_language/primitives/configure/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/expression_language/primitives/configure/",
"description": "configure-chain-internals-at-runtime}",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "8166",
"cache-control": "pu... | Oftentimes you may want to experiment with, or even expose to the end user, multiple different ways of doing things. In order to make this experience as easy as possible, we have defined two methods.
First, a configurable_fields method. This lets you configure particular fields of a runnable.
Second, a configurable_alt... |
https://python.langchain.com/docs/expression_language/primitives/functions/ | ## Run custom functions
You can use arbitrary functions in the pipeline.
Note that all inputs to these functions need to be a SINGLE argument. If you have a function that accepts multiple arguments, you should write a wrapper that accepts a single input and unpacks it into multiple argument.
%pip install –upgrade –q... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:14.199Z",
"loadedUrl": "https://python.langchain.com/docs/expression_language/primitives/functions/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/expression_language/primitives/functions/",
"description": "run-custom-functions}",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "5844",
"cache-control": "public, max-age=0,... | Run custom functions
You can use arbitrary functions in the pipeline.
Note that all inputs to these functions need to be a SINGLE argument. If you have a function that accepts multiple arguments, you should write a wrapper that accepts a single input and unpacks it into multiple argument.
%pip install –upgrade –quiet l... |
https://python.langchain.com/docs/expression_language/primitives/passthrough/ | ## Passing data through
RunnablePassthrough on its own allows you to pass inputs unchanged. This typically is used in conjuction with RunnableParallel to pass data through to a new key in the map.
See the example below:
```
%pip install --upgrade --quiet langchain langchain-openai
```
```
from langchain_core.runna... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:15.090Z",
"loadedUrl": "https://python.langchain.com/docs/expression_language/primitives/passthrough/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/expression_language/primitives/passthrough/",
"description": "passing-data-through}",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "4389",
"cache-control": "public, max-age=... | Passing data through
RunnablePassthrough on its own allows you to pass inputs unchanged. This typically is used in conjuction with RunnableParallel to pass data through to a new key in the map.
See the example below:
%pip install --upgrade --quiet langchain langchain-openai
from langchain_core.runnables import Runnable... |
https://python.langchain.com/docs/expression_language/primitives/parallel/ | ## Formatting inputs & output
The `RunnableParallel` primitive is essentially a dict whose values are runnables (or things that can be coerced to runnables, like functions). It runs all of its values in parallel, and each value is called with the overall input of the `RunnableParallel`. The final return value is a dic... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:15.375Z",
"loadedUrl": "https://python.langchain.com/docs/expression_language/primitives/parallel/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/expression_language/primitives/parallel/",
"description": "formatting-inputs-output}",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "3358",
"cache-control": "public, max-age... | Formatting inputs & output
The RunnableParallel primitive is essentially a dict whose values are runnables (or things that can be coerced to runnables, like functions). It runs all of its values in parallel, and each value is called with the overall input of the RunnableParallel. The final return value is a dict with t... |
https://python.langchain.com/docs/expression_language/primitives/sequence/ | ## Chaining runnables
One key advantage of the `Runnable` interface is that any two runnables can be “chained” together into sequences. The output of the previous runnable’s `.invoke()` call is passed as input to the next runnable. This can be done using the pipe operator (`|`), or the more explicit `.pipe()` method, ... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:16.325Z",
"loadedUrl": "https://python.langchain.com/docs/expression_language/primitives/sequence/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/expression_language/primitives/sequence/",
"description": "chaining-runnables}",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "3359",
"cache-control": "public, max-age=0, mu... | Chaining runnables
One key advantage of the Runnable interface is that any two runnables can be “chained” together into sequences. The output of the previous runnable’s .invoke() call is passed as input to the next runnable. This can be done using the pipe operator (|), or the more explicit .pipe() method, which does t... |
https://python.langchain.com/docs/expression_language/streaming/ | ## Streaming With LangChain
Streaming is critical in making applications based on LLMs feel responsive to end-users.
Important LangChain primitives like LLMs, parsers, prompts, retrievers, and agents implement the LangChain [Runnable Interface](https://python.langchain.com/docs/expression_language/interface/).
This ... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:17.204Z",
"loadedUrl": "https://python.langchain.com/docs/expression_language/streaming/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/expression_language/streaming/",
"description": "streaming-with-langchain}",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "8549",
"cache-control": "public, max-age=0, must-r... | Streaming With LangChain
Streaming is critical in making applications based on LLMs feel responsive to end-users.
Important LangChain primitives like LLMs, parsers, prompts, retrievers, and agents implement the LangChain Runnable Interface.
This interface provides two general approaches to stream content:
sync stream a... |
https://python.langchain.com/docs/expression_language/why/ | ## Advantages of LCEL
tip
We recommend reading the LCEL [Get started](https://python.langchain.com/docs/expression_language/get_started/) section first.
LCEL is designed to streamline the process of building useful apps with LLMs and combining related components. It does this by providing:
1. **A unified interface... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:19.742Z",
"loadedUrl": "https://python.langchain.com/docs/expression_language/why/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/expression_language/why/",
"description": "We recommend reading the LCEL [Get",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "4496",
"cache-control": "public, max-age=0, mus... | Advantages of LCEL
tip
We recommend reading the LCEL Get started section first.
LCEL is designed to streamline the process of building useful apps with LLMs and combining related components. It does this by providing:
A unified interface: Every LCEL object implements the Runnable interface, which defines a common set o... |
https://python.langchain.com/docs/get_started/installation/ | ## Installation
## Official release[](#official-release "Direct link to Official release")
To install LangChain run:
* Pip
* Conda
This will install the bare minimum requirements of LangChain. A lot of the value of LangChain comes when integrating it with various model providers, datastores, etc. By default, t... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:21.720Z",
"loadedUrl": "https://python.langchain.com/docs/get_started/installation/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/get_started/installation/",
"description": "Official release",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "8634",
"cache-control": "public, max-age=0, must-revalidate",
... | Installation
Official release
To install LangChain run:
Pip
Conda
This will install the bare minimum requirements of LangChain. A lot of the value of LangChain comes when integrating it with various model providers, datastores, etc. By default, the dependencies needed to do that are NOT installed. You will need to ins... |
https://python.langchain.com/docs/get_started/quickstart/ | ## Quickstart
In this quickstart we'll show you how to:
* Get setup with LangChain, LangSmith and LangServe
* Use the most basic and common components of LangChain: prompt templates, models, and output parsers
* Use LangChain Expression Language, the protocol that LangChain is built on and which facilitates com... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:21.820Z",
"loadedUrl": "https://python.langchain.com/docs/get_started/quickstart/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/get_started/quickstart/",
"description": "In this quickstart we'll show you how to:",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "8632",
"cache-control": "public, max-age=... | Quickstart
In this quickstart we'll show you how to:
Get setup with LangChain, LangSmith and LangServe
Use the most basic and common components of LangChain: prompt templates, models, and output parsers
Use LangChain Expression Language, the protocol that LangChain is built on and which facilitates component chaining
B... |
https://python.langchain.com/docs/get_started/introduction/ | ## Introduction
**LangChain** is a framework for developing applications powered by large language models (LLMs).
LangChain simplifies every stage of the LLM application lifecycle:
* **Development**: Build your applications using LangChain's open-source [building blocks](https://python.langchain.com/docs/expressio... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:23.437Z",
"loadedUrl": "https://python.langchain.com/docs/get_started/introduction/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/get_started/introduction/",
"description": "LangChain is a framework for developing applications powered by large language models (LLMs).",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
... | Introduction
LangChain is a framework for developing applications powered by large language models (LLMs).
LangChain simplifies every stage of the LLM application lifecycle:
Development: Build your applications using LangChain's open-source building blocks and components. Hit the ground running using third-party integr... |
https://python.langchain.com/docs/guides/ | ## Guides
This section contains deeper dives into the LangChain framework and how to apply it.
* * *
#### Help us out by providing feedback on this documentation page: | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:24.233Z",
"loadedUrl": "https://python.langchain.com/docs/guides/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/guides/",
"description": "This section contains deeper dives into the LangChain framework and how to apply it.",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "4090",
"cache-... | Guides
This section contains deeper dives into the LangChain framework and how to apply it.
Help us out by providing feedback on this documentation page: |
https://python.langchain.com/docs/guides/development/ | [
## 📄️ Debugging
If you're building with LLMs, at some point something will break, and you'll need to debug. A model call will fail, or the model output will be misformatted, or there will be some nested model calls and it won't be clear where along the way an incorrect output was created.
](https://python.langcha... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:24.777Z",
"loadedUrl": "https://python.langchain.com/docs/guides/development/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/guides/development/",
"description": "This section contains guides with general information around building apps with LangChain.",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "... | 📄️ Debugging
If you're building with LLMs, at some point something will break, and you'll need to debug. A model call will fail, or the model output will be misformatted, or there will be some nested model calls and it won't be clear where along the way an incorrect output was created. |
https://python.langchain.com/docs/guides/development/local_llms/ | ## Run LLMs locally
## Use case[](#use-case "Direct link to Use case")
The popularity of projects like [PrivateGPT](https://github.com/imartinez/privateGPT), [llama.cpp](https://github.com/ggerganov/llama.cpp), [Ollama](https://github.com/ollama/ollama), [GPT4All](https://github.com/nomic-ai/gpt4all), [llamafile](ht... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:25.535Z",
"loadedUrl": "https://python.langchain.com/docs/guides/development/local_llms/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/guides/development/local_llms/",
"description": "Use case",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "8412",
"cache-control": "public, max-age=0, must-revalidate",
"... | Run LLMs locally
Use case
The popularity of projects like PrivateGPT, llama.cpp, Ollama, GPT4All, llamafile, and others underscore the demand to run LLMs locally (on your own device).
This has at least two important benefits:
Privacy: Your data is not sent to a third party, and it is not subject to the terms of servic... |
https://python.langchain.com/docs/guides/development/debugging/ | ```
[chain/start] [1:RunTypeEnum.chain:AgentExecutor] Entering Chain run with input: { "input": "Who directed the 2023 film Oppenheimer and what is their age? What is their age in days (assume 365 days per year)?" } [chain/start] [1:RunTypeEnum.chain:AgentExecutor > 2:RunTypeEnum.chain:LLMChain] Enter... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:26.012Z",
"loadedUrl": "https://python.langchain.com/docs/guides/development/debugging/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/guides/development/debugging/",
"description": "If you're building with LLMs, at some point something will break, and you'll need to debug. A model call will fail, or the model output will be misformatted, or there will be some nested model call... | [chain/start] [1:RunTypeEnum.chain:AgentExecutor] Entering Chain run with input:
{
"input": "Who directed the 2023 film Oppenheimer and what is their age? What is their age in days (assume 365 days per year)?"
}
[chain/start] [1:RunTypeEnum.chain:AgentExecutor > 2:RunTypeEnum.chain:LLMChain] Entering Chain run with inp... |
https://python.langchain.com/docs/guides/development/extending_langchain/ | ## Extending LangChain
Extending LangChain's base abstractions, whether you're planning to contribute back to the open-source repo or build a bespoke internal integration, is encouraged.
Check out these guides for building your own custom classes for the following modules:
* [Chat models](https://python.langchain.... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:26.925Z",
"loadedUrl": "https://python.langchain.com/docs/guides/development/extending_langchain/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/guides/development/extending_langchain/",
"description": "Extending LangChain's base abstractions, whether you're planning to contribute back to the open-source repo or build a bespoke internal integration, is encouraged.",
"headers": {
":... | Extending LangChain
Extending LangChain's base abstractions, whether you're planning to contribute back to the open-source repo or build a bespoke internal integration, is encouraged.
Check out these guides for building your own custom classes for the following modules:
Chat models for interfacing with chat-tuned langu... |
https://python.langchain.com/docs/guides/development/pydantic_compatibility/ | ## Pydantic compatibility
* Pydantic v2 was released in June, 2023 ([https://docs.pydantic.dev/2.0/blog/pydantic-v2-final/](https://docs.pydantic.dev/2.0/blog/pydantic-v2-final/))
* v2 contains has a number of breaking changes ([https://docs.pydantic.dev/2.0/migration/](https://docs.pydantic.dev/2.0/migration/))
*... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:27.101Z",
"loadedUrl": "https://python.langchain.com/docs/guides/development/pydantic_compatibility/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/guides/development/pydantic_compatibility/",
"description": "- Pydantic v2 was released in June, 2023 (https://docs.pydantic.dev/2.0/blog/pydantic-v2-final/)",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-all... | Pydantic compatibility
Pydantic v2 was released in June, 2023 (https://docs.pydantic.dev/2.0/blog/pydantic-v2-final/)
v2 contains has a number of breaking changes (https://docs.pydantic.dev/2.0/migration/)
Pydantic v2 and v1 are under the same package name, so both versions cannot be installed at the same time
LangChai... |
https://python.langchain.com/docs/guides/productionization/ | ## Productionization
After you've developed a prototype of your language model application, the next step is to prepare it for production. This section contains guides around best practices for getting and keeping your application production-ready, ensuring it's ready for real-world use.
[
## 🗃️ Deployment
1 items... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:27.303Z",
"loadedUrl": "https://python.langchain.com/docs/guides/productionization/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/guides/productionization/",
"description": "After you've developed a prototype of your language model application, the next step is to prepare it for production.",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control... | Productionization
After you've developed a prototype of your language model application, the next step is to prepare it for production. This section contains guides around best practices for getting and keeping your application production-ready, ensuring it's ready for real-world use.
🗃️ Deployment
1 items
🗃️ Evaluat... |
https://python.langchain.com/docs/guides/productionization/deployments/ | ## Deployment
In today's fast-paced technological landscape, the use of Large Language Models (LLMs) is rapidly expanding. As a result, it is crucial for developers to understand how to effectively deploy these models in production environments. LLM interfaces typically fall into two categories:
* **Case 1: Utilizi... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:27.954Z",
"loadedUrl": "https://python.langchain.com/docs/guides/productionization/deployments/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/guides/productionization/deployments/",
"description": "In today's fast-paced technological landscape, the use of Large Language Models (LLMs) is rapidly expanding. As a result, it is crucial for developers to understand how to effectively deplo... | Deployment
In today's fast-paced technological landscape, the use of Large Language Models (LLMs) is rapidly expanding. As a result, it is crucial for developers to understand how to effectively deploy these models in production environments. LLM interfaces typically fall into two categories:
Case 1: Utilizing External... |
https://python.langchain.com/docs/guides/productionization/evaluation/ | ## Evaluation
Building applications with language models involves many moving parts. One of the most critical components is ensuring that the outcomes produced by your models are reliable and useful across a broad array of inputs, and that they work well with your application's other software components. Ensuring reli... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:27.884Z",
"loadedUrl": "https://python.langchain.com/docs/guides/productionization/evaluation/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/guides/productionization/evaluation/",
"description": "Building applications with language models involves many moving parts. One of the most critical components is ensuring that the outcomes produced by your models are reliable and useful acros... | Evaluation
Building applications with language models involves many moving parts. One of the most critical components is ensuring that the outcomes produced by your models are reliable and useful across a broad array of inputs, and that they work well with your application's other software components. Ensuring reliabil... |
https://python.langchain.com/docs/guides/productionization/evaluation/comparison/ | ## Comparison Evaluators
Comparison evaluators in LangChain help measure two different chains or LLM outputs. These evaluators are helpful for comparative analyses, such as A/B testing between two language models, or comparing different versions of the same model. They can also be useful for things like generating pre... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:28.710Z",
"loadedUrl": "https://python.langchain.com/docs/guides/productionization/evaluation/comparison/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/guides/productionization/evaluation/comparison/",
"description": "Comparison evaluators in LangChain help measure two different chains or LLM outputs. These evaluators are helpful for comparative analyses, such as A/B testing between two languag... | Comparison Evaluators
Comparison evaluators in LangChain help measure two different chains or LLM outputs. These evaluators are helpful for comparative analyses, such as A/B testing between two language models, or comparing different versions of the same model. They can also be useful for things like generating prefere... |
https://python.langchain.com/docs/guides/productionization/evaluation/comparison/custom/ | ## Custom pairwise evaluator
[](https://colab.research.google.com/github/langchain-ai/langchain/blob/master/docs/docs/guides/evaluation/comparison/custom.ipynb)
Open In Colab
You can make your own pairwise string evaluators by inheriting from `PairwiseStri... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:28.833Z",
"loadedUrl": "https://python.langchain.com/docs/guides/productionization/evaluation/comparison/custom/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/guides/productionization/evaluation/comparison/custom/",
"description": "Open In Colab",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "0",
"cache-control": "public, max-age=... | Custom pairwise evaluator
Open In Colab
You can make your own pairwise string evaluators by inheriting from PairwiseStringEvaluator class and overwriting the _evaluate_string_pairs method (and the _aevaluate_string_pairs method if you want to use the evaluator asynchronously).
In this example, you will make a simple cu... |
https://python.langchain.com/docs/guides/productionization/deployments/template_repos/ | * * *
#### Help us out by providing feedback on this documentation page: | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:29.268Z",
"loadedUrl": "https://python.langchain.com/docs/guides/productionization/deployments/template_repos/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/guides/productionization/deployments/template_repos/",
"description": "For more information on LangChain Templates, visit",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "3726",
... | Help us out by providing feedback on this documentation page: |
https://python.langchain.com/docs/guides/productionization/evaluation/comparison/pairwise_embedding_distance/ | ## Pairwise embedding distance
[](https://colab.research.google.com/github/langchain-ai/langchain/blob/master/docs/docs/guides/evaluation/comparison/pairwise_embedding_distance.ipynb)
Open In Colab
One way to measure the similarity (or dissimilarity) betwe... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:29.710Z",
"loadedUrl": "https://python.langchain.com/docs/guides/productionization/evaluation/comparison/pairwise_embedding_distance/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/guides/productionization/evaluation/comparison/pairwise_embedding_distance/",
"description": "Open In Colab",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "3370",
"cache-con... | Pairwise embedding distance
Open In Colab
One way to measure the similarity (or dissimilarity) between two predictions on a shared or similar input is to embed the predictions and compute a vector distance between the two embeddings.[1]
You can load the pairwise_embedding_distance evaluator to do this.
Note: This retur... |
https://python.langchain.com/docs/additional_resources/dependents/ | ## Dependents
Dependents stats for `langchain-ai/langchain`
[](https://github.com/langchain-ai/langchain/network/dependents) [&message=538&color=informati... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:30.230Z",
"loadedUrl": "https://python.langchain.com/docs/additional_resources/dependents/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/additional_resources/dependents/",
"description": "Dependents stats for langchain-ai/langchain",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "541",
"cache-control": "public... | Dependents
Dependents stats for langchain-ai/langchain
[update: 2023-12-08; only dependent repositories with Stars > 100]
RepositoryStars
AntonOsika/gpt-engineer 46514
imartinez/privateGPT 44439
LAION-AI/Open-Assistant 35906
hpcaitech/ColossalAI 35528
moymix/TaskMatrix 34342
geekan/MetaGPT 31126
streamlit/streaml... |
https://python.langchain.com/docs/additional_resources/youtube/ | * * *
#### Help us out by providing feedback on this documentation page: | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:41.659Z",
"loadedUrl": "https://python.langchain.com/docs/additional_resources/youtube/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/additional_resources/youtube/",
"description": "⛓ icon marks a new addition [last update 2023-09-21]",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "3386",
"cache-control": ... | Help us out by providing feedback on this documentation page: |
https://python.langchain.com/docs/additional_resources/tutorials/ | * * *
#### Help us out by providing feedback on this documentation page: | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:42.515Z",
"loadedUrl": "https://python.langchain.com/docs/additional_resources/tutorials/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/additional_resources/tutorials/",
"description": "Books and Handbooks",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "7658",
"cache-control": "public, max-age=0, must-revali... | Help us out by providing feedback on this documentation page: |
https://python.langchain.com/docs/changelog/core/ | * * *
#### Help us out by providing feedback on this documentation page: | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:43.111Z",
"loadedUrl": "https://python.langchain.com/docs/changelog/core/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/changelog/core/",
"description": "0.1.7 (Jan 5, 2024)",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "0",
"cache-control": "public, max-age=0, must-revalidate",
"content... | Help us out by providing feedback on this documentation page: |
https://python.langchain.com/docs/changelog/langchain/ | ChatVectorDBChainConversationalRetrievalChainMore general to all retrieverscreate\_ernie\_fn\_chaincreate\_ernie\_fn\_runnableUse LCEL under the hoodcreated\_structured\_output\_chaincreate\_structured\_output\_runnableUse LCEL under the hoodNatBotChainNot usedcreate\_openai\_fn\_chaincreate\_openai\_fn\_runnableUse LC... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:43.659Z",
"loadedUrl": "https://python.langchain.com/docs/changelog/langchain/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/changelog/langchain/",
"description": "0.1.0 (Jan 5, 2024)",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "3388",
"cache-control": "public, max-age=0, must-revalidate",
... | ChatVectorDBChainConversationalRetrievalChainMore general to all retrieverscreate_ernie_fn_chaincreate_ernie_fn_runnableUse LCEL under the hoodcreated_structured_output_chaincreate_structured_output_runnableUse LCEL under the hoodNatBotChainNot usedcreate_openai_fn_chaincreate_openai_fn_runnableUse LCEL under the hoodc... |
https://python.langchain.com/docs/contributing/ | ## Welcome Contributors
Hi there! Thank you for even being interested in contributing to LangChain. As an open-source project in a rapidly developing field, we are extremely open to contributions, whether they involve new features, improved infrastructure, better documentation, or bug fixes.
## 🗺️ Guidelines[](#️-g... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:44.215Z",
"loadedUrl": "https://python.langchain.com/docs/contributing/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/contributing/",
"description": "Hi there! Thank you for even being interested in contributing to LangChain.",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "736",
"cache-cont... | Welcome Contributors
Hi there! Thank you for even being interested in contributing to LangChain. As an open-source project in a rapidly developing field, we are extremely open to contributions, whether they involve new features, improved infrastructure, better documentation, or bug fixes.
🗺️ Guidelines
👩💻 Ways to ... |
https://python.langchain.com/docs/contributing/code/ | ## Contribute Code
To contribute to this project, please follow the ["fork and pull request"](https://docs.github.com/en/get-started/quickstart/contributing-to-projects) workflow. Please do not try to push directly to this repo unless you are a maintainer.
Please follow the checked-in pull request template when openi... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:45.021Z",
"loadedUrl": "https://python.langchain.com/docs/contributing/code/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/contributing/code/",
"description": "To contribute to this project, please follow the \"fork and pull request\" workflow.",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "4456",
... | Contribute Code
To contribute to this project, please follow the "fork and pull request" workflow. Please do not try to push directly to this repo unless you are a maintainer.
Please follow the checked-in pull request template when opening pull requests. Note related issues and tag relevant maintainers.
Pull requests c... |
https://python.langchain.com/docs/contributing/documentation/style_guide/ | ## LangChain Documentation Style Guide
## Introduction[](#introduction "Direct link to Introduction")
As LangChain continues to grow, the surface area of documentation required to cover it continues to grow too. This page provides guidelines for anyone writing documentation for LangChain, as well as some of our phil... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:46.323Z",
"loadedUrl": "https://python.langchain.com/docs/contributing/documentation/style_guide/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/contributing/documentation/style_guide/",
"description": "Introduction",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "3961",
"cache-control": "public, max-age=0, must-reval... | LangChain Documentation Style Guide
Introduction
As LangChain continues to grow, the surface area of documentation required to cover it continues to grow too. This page provides guidelines for anyone writing documentation for LangChain, as well as some of our philosophies around organization and structure.
Philosophy... |
https://python.langchain.com/docs/contributing/documentation/technical_logistics/ | ## Technical logistics
LangChain documentation consists of two components:
1. Main Documentation: Hosted at [python.langchain.com](https://python.langchain.com/), this comprehensive resource serves as the primary user-facing documentation. It covers a wide array of topics, including tutorials, use cases, integration... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:46.901Z",
"loadedUrl": "https://python.langchain.com/docs/contributing/documentation/technical_logistics/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/contributing/documentation/technical_logistics/",
"description": "LangChain documentation consists of two components:",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "3391",
... | Technical logistics
LangChain documentation consists of two components:
Main Documentation: Hosted at python.langchain.com, this comprehensive resource serves as the primary user-facing documentation. It covers a wide array of topics, including tutorials, use cases, integrations, and more, offering extensive guidance o... |
https://python.langchain.com/docs/contributing/faq/ | ## Frequently Asked Questions
## Pull Requests (PRs)[](#pull-requests-prs "Direct link to Pull Requests (PRs)")
### How do I allow maintainers to edit my PR?[](#how-do-i-allow-maintainers-to-edit-my-pr "Direct link to How do I allow maintainers to edit my PR?")
When you submit a pull request, there may be addition... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:47.804Z",
"loadedUrl": "https://python.langchain.com/docs/contributing/faq/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/contributing/faq/",
"description": "Pull Requests (PRs)",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "3392",
"cache-control": "public, max-age=0, must-revalidate",
"co... | Frequently Asked Questions
Pull Requests (PRs)
How do I allow maintainers to edit my PR?
When you submit a pull request, there may be additional changes necessary before merging it. Oftentimes, it is more efficient for the maintainers to make these changes themselves before merging, rather than asking you to do so in... |
https://python.langchain.com/docs/contributing/repo_structure/ | If you plan on contributing to LangChain code or documentation, it can be useful to understand the high level structure of the repository.
```
.├── cookbook # Tutorials and examples├── docs # Contains content for the documentation here: https://python.langchain.com/├── libs│ ├── langchain # Main package│ │ ├── t... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:48.599Z",
"loadedUrl": "https://python.langchain.com/docs/contributing/repo_structure/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/contributing/repo_structure/",
"description": "If you plan on contributing to LangChain code or documentation, it can be useful",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "0... | If you plan on contributing to LangChain code or documentation, it can be useful to understand the high level structure of the repository.
.
├── cookbook # Tutorials and examples
├── docs # Contains content for the documentation here: https://python.langchain.com/
├── libs
│ ├── langchain # Main package
│ │ ├── tests/u... |
https://python.langchain.com/docs/contributing/integrations/ | ## Contribute Integrations
To begin, make sure you have all the dependencies outlined in guide on [Contributing Code](https://python.langchain.com/docs/contributing/code/).
There are a few different places you can contribute integrations for LangChain:
* **Community**: For lighter-weight integrations that are prim... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:49.038Z",
"loadedUrl": "https://python.langchain.com/docs/contributing/integrations/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/contributing/integrations/",
"description": "To begin, make sure you have all the dependencies outlined in guide on Contributing Code.",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"a... | Contribute Integrations
To begin, make sure you have all the dependencies outlined in guide on Contributing Code.
There are a few different places you can contribute integrations for LangChain:
Community: For lighter-weight integrations that are primarily maintained by LangChain and the Open Source Community.
Partner P... |
https://python.langchain.com/docs/contributing/testing/ | ## Testing
All of our packages have unit tests and integration tests, and we favor unit tests over integration tests.
Unit tests run on every pull request, so they should be fast and reliable.
Integration tests run once a day, and they require more setup, so they should be reserved for confirming interface points wi... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:49.648Z",
"loadedUrl": "https://python.langchain.com/docs/contributing/testing/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/contributing/testing/",
"description": "All of our packages have unit tests and integration tests, and we favor unit tests over integration tests.",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin":... | Testing
All of our packages have unit tests and integration tests, and we favor unit tests over integration tests.
Unit tests run on every pull request, so they should be fast and reliable.
Integration tests run once a day, and they require more setup, so they should be reserved for confirming interface points with ext... |
https://python.langchain.com/docs/expression_language/ | ## LangChain Expression Language (LCEL)
LangChain Expression Language, or LCEL, is a declarative way to easily compose chains together. LCEL was designed from day 1 to **support putting prototypes in production, with no code changes**, from the simplest “prompt + LLM” chain to the most complex chains (we’ve seen folks... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:50.335Z",
"loadedUrl": "https://python.langchain.com/docs/expression_language/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/expression_language/",
"description": "LangChain Expression Language, or LCEL, is a declarative way to easily compose chains together.",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"a... | LangChain Expression Language (LCEL)
LangChain Expression Language, or LCEL, is a declarative way to easily compose chains together. LCEL was designed from day 1 to support putting prototypes in production, with no code changes, from the simplest “prompt + LLM” chain to the most complex chains (we’ve seen folks success... |
https://python.langchain.com/docs/expression_language/cookbook/code_writing/ | ## Code writing
Example of how to use LCEL to write Python code.
```
%pip install --upgrade --quiet langchain-core langchain-experimental langchain-openai
```
```
from langchain_core.output_parsers import StrOutputParserfrom langchain_core.prompts import ( ChatPromptTemplate,)from langchain_experimental.utilitie... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:50.391Z",
"loadedUrl": "https://python.langchain.com/docs/expression_language/cookbook/code_writing/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/expression_language/cookbook/code_writing/",
"description": "Example of how to use LCEL to write Python code.",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "0",
"cache-cont... | Code writing
Example of how to use LCEL to write Python code.
%pip install --upgrade --quiet langchain-core langchain-experimental langchain-openai
from langchain_core.output_parsers import StrOutputParser
from langchain_core.prompts import (
ChatPromptTemplate,
)
from langchain_experimental.utilities import PythonREPL... |
https://python.langchain.com/docs/expression_language/cookbook/multiple_chains/ | ```
'El país donde se encuentra la ciudad de Honolulu, donde nació Barack Obama, el 44º Presidente de los Estados Unidos, es Estados Unidos. Honolulu se encuentra en la isla de Oahu, en el estado de Hawái.'
```
```
ChatPromptValue(messages=[HumanMessage(content='What is the color of strawberry and the flag of China?',... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:50.939Z",
"loadedUrl": "https://python.langchain.com/docs/expression_language/cookbook/multiple_chains/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/expression_language/cookbook/multiple_chains/",
"description": "Runnables can easily be used to string together multiple Chains",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "3... | 'El país donde se encuentra la ciudad de Honolulu, donde nació Barack Obama, el 44º Presidente de los Estados Unidos, es Estados Unidos. Honolulu se encuentra en la isla de Oahu, en el estado de Hawái.'
ChatPromptValue(messages=[HumanMessage(content='What is the color of strawberry and the flag of China?', additional_k... |
https://python.langchain.com/docs/expression_language/cookbook/prompt_llm_parser/ | ## Get started
LCEL makes it easy to build complex chains from basic components, and supports out of the box functionality such as streaming, parallelism, and logging.
## Basic example: prompt + model + output parser[](#basic-example-prompt-model-output-parser "Direct link to Basic example: prompt + model + output p... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:53.237Z",
"loadedUrl": "https://python.langchain.com/docs/expression_language/get_started/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/expression_language/get_started/",
"description": "LCEL makes it easy to build complex chains from basic components, and",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "4863",
... | Get started
LCEL makes it easy to build complex chains from basic components, and supports out of the box functionality such as streaming, parallelism, and logging.
Basic example: prompt + model + output parser
The most basic and common use case is chaining a prompt template and a model together. To see how this works... |
https://python.langchain.com/docs/expression_language/cookbook/prompt_size/ | Agents dynamically call tools. The results of those tool calls are added back to the prompt, so that the agent can plan the next action. Depending on what tools are being used and how they’re being called, the agent prompt can easily grow larger than the model context window.
With LCEL, it’s easy to add custom functio... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:54.470Z",
"loadedUrl": "https://python.langchain.com/docs/expression_language/cookbook/prompt_size/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/expression_language/cookbook/prompt_size/",
"description": "Agents dynamically call tools. The results of those tool calls are added",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age... | Agents dynamically call tools. The results of those tool calls are added back to the prompt, so that the agent can plan the next action. Depending on what tools are being used and how they’re being called, the agent prompt can easily grow larger than the model context window.
With LCEL, it’s easy to add custom function... |
https://python.langchain.com/docs/expression_language/how_to/decorator/ | You can also turn an arbitrary function into a chain by adding a `@chain` decorator. This is functionaly equivalent to wrapping in a [`RunnableLambda`](https://python.langchain.com/docs/expression_language/primitives/functions/).
This will have the benefit of improved observability by tracing your chain correctly. Any... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:56.113Z",
"loadedUrl": "https://python.langchain.com/docs/expression_language/how_to/decorator/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/expression_language/how_to/decorator/",
"description": "You can also turn an arbitrary function into a chain by adding a",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "6499",
... | You can also turn an arbitrary function into a chain by adding a @chain decorator. This is functionaly equivalent to wrapping in a RunnableLambda.
This will have the benefit of improved observability by tracing your chain correctly. Any calls to runnables inside this function will be traced as nested childen.
It will a... |
https://python.langchain.com/docs/expression_language/how_to/inspect/ | ## Inspect your runnables
Once you create a runnable with LCEL, you may often want to inspect it to get a better sense for what is going on. This notebook covers some methods for doing so.
First, let’s create an example LCEL. We will create one that does retrieval
```
%pip install --upgrade --quiet langchain langch... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:56.598Z",
"loadedUrl": "https://python.langchain.com/docs/expression_language/how_to/inspect/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/expression_language/how_to/inspect/",
"description": "Once you create a runnable with LCEL, you may often want to inspect it",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "3400... | Inspect your runnables
Once you create a runnable with LCEL, you may often want to inspect it to get a better sense for what is going on. This notebook covers some methods for doing so.
First, let’s create an example LCEL. We will create one that does retrieval
%pip install --upgrade --quiet langchain langchain-openai ... |
https://python.langchain.com/docs/expression_language/how_to/message_history/ | ## Add message history (memory)
The `RunnableWithMessageHistory` lets us add message history to certain types of chains. It wraps another Runnable and manages the chat message history for it.
Specifically, it can be used for any Runnable that takes as input one of
* a sequence of `BaseMessage`
* a dict with a ke... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:57.329Z",
"loadedUrl": "https://python.langchain.com/docs/expression_language/how_to/message_history/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/expression_language/how_to/message_history/",
"description": "The RunnableWithMessageHistory lets us add message history to certain",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age"... | Add message history (memory)
The RunnableWithMessageHistory lets us add message history to certain types of chains. It wraps another Runnable and manages the chat message history for it.
Specifically, it can be used for any Runnable that takes as input one of
a sequence of BaseMessage
a dict with a key that takes a seq... |
https://python.langchain.com/docs/expression_language/how_to/routing/ | ## Dynamically route logic based on input
This notebook covers how to do routing in the LangChain Expression Language.
Routing allows you to create non-deterministic chains where the output of a previous step defines the next step. Routing helps provide structure and consistency around interactions with LLMs.
There ... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:58.237Z",
"loadedUrl": "https://python.langchain.com/docs/expression_language/how_to/routing/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/expression_language/how_to/routing/",
"description": "dynamically-route-logic-based-on-input}",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "5409",
"cache-control": "public... | Dynamically route logic based on input
This notebook covers how to do routing in the LangChain Expression Language.
Routing allows you to create non-deterministic chains where the output of a previous step defines the next step. Routing helps provide structure and consistency around interactions with LLMs.
There are tw... |
https://python.langchain.com/docs/expression_language/interface/ | ## Runnable interface
To make it as easy as possible to create custom chains, we’ve implemented a [“Runnable”](https://api.python.langchain.com/en/stable/runnables/langchain_core.runnables.base.Runnable.html#langchain_core.runnables.base.Runnable) protocol. Many LangChain components implement the `Runnable` protocol, ... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:37:59.930Z",
"loadedUrl": "https://python.langchain.com/docs/expression_language/interface/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/expression_language/interface/",
"description": "To make it as easy as possible to create custom chains, we’ve",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "8519",
"cache-... | Runnable interface
To make it as easy as possible to create custom chains, we’ve implemented a “Runnable” protocol. Many LangChain components implement the Runnable protocol, including chat models, LLMs, output parsers, retrievers, prompt templates, and more. There are also several useful primitives for working with ru... |
https://python.langchain.com/docs/expression_language/primitives/ | ## Primitives
In addition to various [components](https://python.langchain.com/docs/modules/) that are usable with LCEL, LangChain also includes various primitives that help pass around and format data, bind arguments, invoke custom logic, and more.
This section goes into greater depth on where and how some of these ... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:38:02.732Z",
"loadedUrl": "https://python.langchain.com/docs/expression_language/primitives/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/expression_language/primitives/",
"description": "In addition to various components that are usable with LCEL, LangChain also includes various primitives",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-o... | Primitives
In addition to various components that are usable with LCEL, LangChain also includes various primitives that help pass around and format data, bind arguments, invoke custom logic, and more.
This section goes into greater depth on where and how some of these components are useful.
📄️ Sequences: Chaining runn... |
https://python.langchain.com/docs/guides/productionization/safety/presidio_data_anonymization/qa_privacy_protection/ | [](https://colab.research.google.com/github/langchain-ai/langchain/blob/master/docs/docs/guides/privacy/presidio_data_anonymization/qa_privacy_protection.ipynb)
Open In Colab
In this notebook, we will look at building a basic system for question answering, ... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:38:03.393Z",
"loadedUrl": "https://python.langchain.com/docs/guides/productionization/safety/presidio_data_anonymization/qa_privacy_protection/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/guides/productionization/safety/presidio_data_anonymization/qa_privacy_protection/",
"description": "qa-with-private-data-protection}",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"ag... | Open In Colab
In this notebook, we will look at building a basic system for question answering, based on private data. Before feeding the LLM with this data, we need to protect it so that it doesn’t go to an external API (e.g. OpenAI, Anthropic). Then, after receiving the model output, we would like the data to be rest... |
https://python.langchain.com/docs/guides/productionization/safety/presidio_data_anonymization/reversible/ | [](https://colab.research.google.com/github/langchain-ai/langchain/blob/master/docs/docs/guides/privacy/presidio_data_anonymization/reversible.ipynb)
Open In Colab
## Use case[](#use-case "Direct link to Use case")
We have already written about the import... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:38:05.372Z",
"loadedUrl": "https://python.langchain.com/docs/guides/productionization/safety/presidio_data_anonymization/reversible/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/guides/productionization/safety/presidio_data_anonymization/reversible/",
"description": "reversible-data-anonymization-with-microsoft-presidio}",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "... | Open In Colab
Use case
We have already written about the importance of anonymizing sensitive data in the previous section. Reversible Anonymization is an equally essential technology while sharing information with language models, as it balances data protection with data usability. This technique involves masking sens... |
https://python.langchain.com/docs/integrations/adapters/ | [
## 📄️ OpenAI Adapter(Old)
Please ensure OpenAI library is less than 1.0.0; otherwise, refer to
](https://python.langchain.com/docs/integrations/adapters/openai-old/) | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:38:06.121Z",
"loadedUrl": "https://python.langchain.com/docs/integrations/adapters/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/integrations/adapters/",
"description": null,
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "3404",
"cache-control": "public, max-age=0, must-revalidate",
"content-dispos... | 📄️ OpenAI Adapter(Old)
Please ensure OpenAI library is less than 1.0.0; otherwise, refer to |
https://python.langchain.com/docs/integrations/adapters/openai/ | **Please ensure OpenAI library is version 1.0.0 or higher; otherwise, refer to the older doc [OpenAI Adapter(Old)](https://python.langchain.com/docs/integrations/adapters/openai-old/).**
A lot of people get started with OpenAI but want to explore other models. LangChain’s integrations with many model providers make th... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:38:07.165Z",
"loadedUrl": "https://python.langchain.com/docs/integrations/adapters/openai/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/integrations/adapters/openai/",
"description": "Please ensure OpenAI library is version 1.0.0 or higher; otherwise,",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "4345",
"c... | Please ensure OpenAI library is version 1.0.0 or higher; otherwise, refer to the older doc OpenAI Adapter(Old).
A lot of people get started with OpenAI but want to explore other models. LangChain’s integrations with many model providers make this easy to do so. While LangChain has it’s own message and model APIs, we’ve... |
https://python.langchain.com/docs/integrations/adapters/openai-old/ | ## OpenAI Adapter(Old)
**Please ensure OpenAI library is less than 1.0.0; otherwise, refer to the newer doc [OpenAI Adapter](https://python.langchain.com/docs/integrations/adapters/openai/).**
A lot of people get started with OpenAI but want to explore other models. LangChain’s integrations with many model providers ... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:38:07.702Z",
"loadedUrl": "https://python.langchain.com/docs/integrations/adapters/openai-old/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/integrations/adapters/openai-old/",
"description": "Please ensure OpenAI library is less than 1.0.0; otherwise, refer to",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "3406",
... | OpenAI Adapter(Old)
Please ensure OpenAI library is less than 1.0.0; otherwise, refer to the newer doc OpenAI Adapter.
A lot of people get started with OpenAI but want to explore other models. LangChain’s integrations with many model providers make this easy to do so. While LangChain has it’s own message and model APIs... |
https://python.langchain.com/docs/integrations/callbacks/ | [
## 📄️ LLMonitor
LLMonitor is an open-source observability platform that provides cost and usage analytics, user tracking, tracing and evaluation tools.
](https://python.langchain.com/docs/integrations/callbacks/llmonitor/) | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:38:08.052Z",
"loadedUrl": "https://python.langchain.com/docs/integrations/callbacks/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/integrations/callbacks/",
"description": null,
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "3406",
"cache-control": "public, max-age=0, must-revalidate",
"content-dispo... | 📄️ LLMonitor
LLMonitor is an open-source observability platform that provides cost and usage analytics, user tracking, tracing and evaluation tools. |
https://python.langchain.com/docs/integrations/callbacks/comet_tracing/ | ## Comet Tracing
There are two ways to trace your LangChains executions with Comet:
1. Setting the `LANGCHAIN_COMET_TRACING` environment variable to “true”. This is the recommended way.
2. Import the `CometTracer` manually and pass it explicitely.
```
import osimport comet_llmos.environ["LANGCHAIN_COMET_TRACING"] ... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:38:08.615Z",
"loadedUrl": "https://python.langchain.com/docs/integrations/callbacks/comet_tracing/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/integrations/callbacks/comet_tracing/",
"description": "There are two ways to trace your LangChains executions with Comet:",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "0",
... | Comet Tracing
There are two ways to trace your LangChains executions with Comet:
Setting the LANGCHAIN_COMET_TRACING environment variable to “true”. This is the recommended way.
Import the CometTracer manually and pass it explicitely.
import os
import comet_llm
os.environ["LANGCHAIN_COMET_TRACING"] = "true"
# Connec... |
https://python.langchain.com/docs/integrations/callbacks/argilla/ | ## Argilla
> [Argilla](https://argilla.io/) is an open-source data curation platform for LLMs. Using Argilla, everyone can build robust language models through faster data curation using both human and machine feedback. We provide support for each step in the MLOps cycle, from data labeling to model monitoring.
[ package for unit testing LLMs. Using Confident, everyone can build robust language models through faster iterations using both unit testing and integration testing. We provide support for each step in the iteration from synthetic data creation to testing.
In this g... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:38:09.631Z",
"loadedUrl": "https://python.langchain.com/docs/integrations/callbacks/confident/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/integrations/callbacks/confident/",
"description": "DeepEval package for unit testing LLMs.",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "0",
"cache-control": "public, max... | Confident
DeepEval package for unit testing LLMs. Using Confident, everyone can build robust language models through faster iterations using both unit testing and integration testing. We provide support for each step in the iteration from synthetic data creation to testing.
In this guide we will demonstrate how to test... |
https://python.langchain.com/docs/integrations/callbacks/context/ | ## Context
> [Context](https://context.ai/) provides user analytics for LLM-powered products and features.
With `Context`, you can start understanding your users and improving their experiences in less than 30 minutes.
In this guide we will show you how to integrate with Context.
## Installation and Setup[](#insta... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:38:10.446Z",
"loadedUrl": "https://python.langchain.com/docs/integrations/callbacks/context/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/integrations/callbacks/context/",
"description": "Context provides user analytics for LLM-powered",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "7936",
"cache-control": "pu... | Context
Context provides user analytics for LLM-powered products and features.
With Context, you can start understanding your users and improving their experiences in less than 30 minutes.
In this guide we will show you how to integrate with Context.
Installation and Setup
%pip install --upgrade --quiet langchain lang... |
https://python.langchain.com/docs/integrations/callbacks/fiddler/ | [Fiddler](https://www.fiddler.ai/) is the pioneer in enterprise Generative and Predictive system ops, offering a unified platform that enables Data Science, MLOps, Risk, Compliance, Analytics, and other LOB teams to monitor, explain, analyze, and improve ML deployments at enterprise scale.
These can be found by naviga... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:38:10.632Z",
"loadedUrl": "https://python.langchain.com/docs/integrations/callbacks/fiddler/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/integrations/callbacks/fiddler/",
"description": "Fiddler is the pioneer in enterprise",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "0",
"cache-control": "public, max-age=... | Fiddler is the pioneer in enterprise Generative and Predictive system ops, offering a unified platform that enables Data Science, MLOps, Risk, Compliance, Analytics, and other LOB teams to monitor, explain, analyze, and improve ML deployments at enterprise scale.
These can be found by navigating to the Settings page of... |
https://python.langchain.com/docs/integrations/callbacks/infino/ | This example shows how one can track the following while calling OpenAI and ChatOpenAI models via `LangChain` and [Infino](https://github.com/infinohq/infino):
```
a1159e99c6bdb3101139157acee6aba7ae9319375e77ab6fbc79beff75abeca3
```
```
In what country is Normandy located?generations=[[Generation(text='\n\nNormandy i... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:38:11.730Z",
"loadedUrl": "https://python.langchain.com/docs/integrations/callbacks/infino/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/integrations/callbacks/infino/",
"description": "Infino is a scalable telemetry",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "3771",
"cache-control": "public, max-age=0, m... | This example shows how one can track the following while calling OpenAI and ChatOpenAI models via LangChain and Infino:
a1159e99c6bdb3101139157acee6aba7ae9319375e77ab6fbc79beff75abeca3
In what country is Normandy located?
generations=[[Generation(text='\n\nNormandy is located in France.', generation_info={'finish_reaso... |
https://python.langchain.com/docs/integrations/callbacks/labelstudio/ | ## Label Studio
> [Label Studio](https://labelstud.io/guide/get_started) is an open-source data labeling platform that provides LangChain with flexibility when it comes to labeling data for fine-tuning large language models (LLMs). It also enables the preparation of custom training data and the collection and evaluati... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:38:12.234Z",
"loadedUrl": "https://python.langchain.com/docs/integrations/callbacks/labelstudio/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/integrations/callbacks/labelstudio/",
"description": "Label Studio is an",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "3408",
"cache-control": "public, max-age=0, must-rev... | Label Studio
Label Studio is an open-source data labeling platform that provides LangChain with flexibility when it comes to labeling data for fine-tuning large language models (LLMs). It also enables the preparation of custom training data and the collection and evaluation of responses through human feedback.
In this ... |
https://python.langchain.com/docs/integrations/callbacks/sagemaker_tracking/ | ## SageMaker Tracking
> [Amazon SageMaker](https://aws.amazon.com/sagemaker/) is a fully managed service that is used to quickly and easily build, train and deploy machine learning (ML) models.
> [Amazon SageMaker Experiments](https://docs.aws.amazon.com/sagemaker/latest/dg/experiments.html) is a capability of `Amazo... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:38:13.080Z",
"loadedUrl": "https://python.langchain.com/docs/integrations/callbacks/sagemaker_tracking/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/integrations/callbacks/sagemaker_tracking/",
"description": "Amazon SageMaker is a fully",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "3410",
"cache-control": "public, max... | SageMaker Tracking
Amazon SageMaker is a fully managed service that is used to quickly and easily build, train and deploy machine learning (ML) models.
Amazon SageMaker Experiments is a capability of Amazon SageMaker that lets you organize, track, compare and evaluate ML experiments and model versions.
This notebook sh... |
https://python.langchain.com/docs/integrations/callbacks/promptlayer/ | ## PromptLayer
> [PromptLayer](https://docs.promptlayer.com/introduction) is a platform for prompt engineering. It also helps with the LLM observability to visualize requests, version prompts, and track usage.
>
> While `PromptLayer` does have LLMs that integrate directly with LangChain (e.g. [`PromptLayerOpenAI`](ht... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:38:13.586Z",
"loadedUrl": "https://python.langchain.com/docs/integrations/callbacks/promptlayer/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/integrations/callbacks/promptlayer/",
"description": "PromptLayer is a platform",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "3410",
"cache-control": "public, max-age=0, m... | PromptLayer
PromptLayer is a platform for prompt engineering. It also helps with the LLM observability to visualize requests, version prompts, and track usage.
While PromptLayer does have LLMs that integrate directly with LangChain (e.g. PromptLayerOpenAI), using a callback is the recommended way to integrate PromptLay... |
https://python.langchain.com/docs/integrations/callbacks/llmonitor/ | ## LLMonitor
> [LLMonitor](https://llmonitor.com/?utm_source=langchain&utm_medium=py&utm_campaign=docs) is an open-source observability platform that provides cost and usage analytics, user tracking, tracing and evaluation tools.
## Setup[](#setup "Direct link to Setup")
Create an account on [llmonitor.com](https:/... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:38:14.105Z",
"loadedUrl": "https://python.langchain.com/docs/integrations/callbacks/llmonitor/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/integrations/callbacks/llmonitor/",
"description": "LLMonitor is an open-source observability platform that provides cost and usage analytics, user tracking, tracing and evaluation tools.",
"headers": {
":status": 200,
"accept-ranges":... | LLMonitor
LLMonitor is an open-source observability platform that provides cost and usage analytics, user tracking, tracing and evaluation tools.
Setup
Create an account on llmonitor.com, then copy your new app's tracking id.
Once you have it, set it as an environment variable by running:
export LLMONITOR_APP_ID="..."... |
https://python.langchain.com/docs/integrations/callbacks/streamlit/ | In this guide we will demonstrate how to use `StreamlitCallbackHandler` to display the thoughts and actions of an agent in an interactive Streamlit app. Try it out with the running app below using the MRKL agent:
You can run `streamlit hello` to load a sample app and validate your install succeeded. See full instructi... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:38:14.490Z",
"loadedUrl": "https://python.langchain.com/docs/integrations/callbacks/streamlit/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/integrations/callbacks/streamlit/",
"description": "Streamlit is a faster way to build and share data apps.",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "1565",
"cache-con... | In this guide we will demonstrate how to use StreamlitCallbackHandler to display the thoughts and actions of an agent in an interactive Streamlit app. Try it out with the running app below using the MRKL agent:
You can run streamlit hello to load a sample app and validate your install succeeded. See full instructions i... |
https://python.langchain.com/docs/integrations/callbacks/trubrics/ | ## Trubrics
> [Trubrics](https://trubrics.com/) is an LLM user analytics platform that lets you collect, analyse and manage user prompts & feedback on AI models.
>
> Check out [Trubrics repo](https://github.com/trubrics/trubrics-sdk) for more information on `Trubrics`.
In this guide, we will go over how to set up th... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:38:14.955Z",
"loadedUrl": "https://python.langchain.com/docs/integrations/callbacks/trubrics/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/integrations/callbacks/trubrics/",
"description": "Trubrics is an LLM user analytics platform",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "3774",
"cache-control": "public... | Trubrics
Trubrics is an LLM user analytics platform that lets you collect, analyse and manage user prompts & feedback on AI models.
Check out Trubrics repo for more information on Trubrics.
In this guide, we will go over how to set up the TrubricsCallbackHandler.
Installation and Setup
%pip install --upgrade --quiet t... |
https://python.langchain.com/docs/integrations/callbacks/uptrain/ | ## UpTrain
[](https://colab.research.google.com/github/langchain-ai/langchain/blob/master/docs/docs/integrations/callbacks/uptrain.ipynb)
> UpTrain \[[github](https://github.com/uptrain-ai/uptrain) || [website](https://uptrain.ai/) || [docs](ht... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:38:15.504Z",
"loadedUrl": "https://python.langchain.com/docs/integrations/callbacks/uptrain/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/integrations/callbacks/uptrain/",
"description": "UpTrain \\[github \\|\\|",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "3412",
"cache-control": "public, max-age=0, must-r... | UpTrain
UpTrain [github || website || docs] is an open-source platform to evaluate and improve LLM applications. It provides grades for 20+ preconfigured checks (covering language, code, embedding use cases), performs root cause analyses on instances of failure cases and provides guidance for resolving them.
UpTrain Ca... |
https://python.langchain.com/docs/integrations/chat_loaders/facebook/ | ## Facebook Messenger
This notebook shows how to load data from Facebook in a format you can fine-tune on. The overall steps are:
1. Download your messenger data to disk.
2. Create the Chat Loader and call `loader.load()` (or `loader.lazy_load()`) to perform the conversion.
3. Optionally use `merge_chat_runs` to c... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:38:16.439Z",
"loadedUrl": "https://python.langchain.com/docs/integrations/chat_loaders/facebook/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/integrations/chat_loaders/facebook/",
"description": "This notebook shows how to load data from Facebook in a format you can",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "3108... | Facebook Messenger
This notebook shows how to load data from Facebook in a format you can fine-tune on. The overall steps are:
Download your messenger data to disk.
Create the Chat Loader and call loader.load() (or loader.lazy_load()) to perform the conversion.
Optionally use merge_chat_runs to combine message from the... |
https://python.langchain.com/docs/integrations/chat_loaders/ | [
## 📄️ LangSmith Chat Datasets
This notebook demonstrates an easy way to load a LangSmith chat dataset
](https://python.langchain.com/docs/integrations/chat_loaders/langsmith_dataset/) | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:38:16.930Z",
"loadedUrl": "https://python.langchain.com/docs/integrations/chat_loaders/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/integrations/chat_loaders/",
"description": null,
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "3413",
"cache-control": "public, max-age=0, must-revalidate",
"content-di... | 📄️ LangSmith Chat Datasets
This notebook demonstrates an easy way to load a LangSmith chat dataset |
https://python.langchain.com/docs/integrations/chat_loaders/discord/ | ## Discord
This notebook shows how to create your own chat loader that works on copy-pasted messages (from dms) to a list of LangChain messages.
The process has four steps: 1. Create the chat .txt file by copying chats from the Discord app and pasting them in a file on your local computer 2. Copy the chat loader defi... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:38:17.152Z",
"loadedUrl": "https://python.langchain.com/docs/integrations/chat_loaders/discord/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/integrations/chat_loaders/discord/",
"description": "This notebook shows how to create your own chat loader that works on",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "3413",
... | Discord
This notebook shows how to create your own chat loader that works on copy-pasted messages (from dms) to a list of LangChain messages.
The process has four steps: 1. Create the chat .txt file by copying chats from the Discord app and pasting them in a file on your local computer 2. Copy the chat loader definitio... |
https://python.langchain.com/docs/integrations/chat_loaders/slack/ | ## Slack
This notebook shows how to use the Slack chat loader. This class helps map exported slack conversations to LangChain chat messages.
The process has three steps: 1. Export the desired conversation thread by following the [instructions here](https://slack.com/help/articles/1500001548241-Request-to-export-all-c... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:38:18.180Z",
"loadedUrl": "https://python.langchain.com/docs/integrations/chat_loaders/slack/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/integrations/chat_loaders/slack/",
"description": "This notebook shows how to use the Slack chat loader. This class helps",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "3414",
... | Slack
This notebook shows how to use the Slack chat loader. This class helps map exported slack conversations to LangChain chat messages.
The process has three steps: 1. Export the desired conversation thread by following the instructions here. 2. Create the SlackChatLoader with the file path pointed to the json file o... |
https://python.langchain.com/docs/integrations/chat_loaders/gmail/ | ## GMail
This loader goes over how to load data from GMail. There are many ways you could want to load data from GMail. This loader is currently fairly opinionated in how to do so. The way it does it is it first looks for all messages that you have sent. It then looks for messages where you are responding to a previou... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:38:18.646Z",
"loadedUrl": "https://python.langchain.com/docs/integrations/chat_loaders/gmail/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/integrations/chat_loaders/gmail/",
"description": "This loader goes over how to load data from GMail. There are many ways",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"age": "6034",
... | GMail
This loader goes over how to load data from GMail. There are many ways you could want to load data from GMail. This loader is currently fairly opinionated in how to do so. The way it does it is it first looks for all messages that you have sent. It then looks for messages where you are responding to a previous em... |
https://python.langchain.com/docs/integrations/chat_loaders/langsmith_llm_runs/ | ## LangSmith LLM Runs
This notebook demonstrates how to directly load data from LangSmith’s LLM runs and fine-tune a model on that data. The process is simple and comprises 3 steps.
1. Select the LLM runs to train on.
2. Use the LangSmithRunChatLoader to load runs as chat sessions.
3. Fine-tune your model.
Then y... | null | {
"depth": 1,
"httpStatusCode": 200,
"loadedTime": "2024-04-22T02:38:18.979Z",
"loadedUrl": "https://python.langchain.com/docs/integrations/chat_loaders/langsmith_llm_runs/",
"referrerUrl": "https://python.langchain.com/sitemap.xml"
} | {
"author": null,
"canonicalUrl": "https://python.langchain.com/docs/integrations/chat_loaders/langsmith_llm_runs/",
"description": "This notebook demonstrates how to directly load data from LangSmith’s",
"headers": {
":status": 200,
"accept-ranges": null,
"access-control-allow-origin": "*",
"ag... | LangSmith LLM Runs
This notebook demonstrates how to directly load data from LangSmith’s LLM runs and fine-tune a model on that data. The process is simple and comprises 3 steps.
Select the LLM runs to train on.
Use the LangSmithRunChatLoader to load runs as chat sessions.
Fine-tune your model.
Then you can use the fin... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.