Skip to content

Commit

Permalink
Merge branch 'langchain-ai:master' into falkordb-langchain
Browse files Browse the repository at this point in the history
  • Loading branch information
gkorland authored Aug 24, 2023
2 parents 4a54140 + b048236 commit 22461dc
Show file tree
Hide file tree
Showing 163 changed files with 5,796 additions and 1,158 deletions.
2 changes: 1 addition & 1 deletion docs/api_reference/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def setup(app):
html_static_path = ["_static"]

# These paths are either relative to html_static_path
# or fully qualified paths (eg. https://...)
# or fully qualified paths (e.g. https://...)
html_css_files = [
"css/custom.css",
]
Expand Down
4 changes: 2 additions & 2 deletions docs/docs_skeleton/docs/community.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ If you’re working on something you’re proud of, and think the LangChain comm

Here’s where our team hangs out, talks shop, spotlights cool work, and shares what we’re up to. We’d love to see you there too.

- **[Twitter](https://twitter.com/LangChainAI):** we post about what we’re working on and what cool things we’re seeing in the space. If you tag @langchainai in your post, we’ll almost certainly see it, and can snow you some love!
- **[Discord](https://discord.gg/6adMQxSpJS):** connect with with >30k developers who are building with LangChain
- **[Twitter](https://twitter.com/LangChainAI):** we post about what we’re working on and what cool things we’re seeing in the space. If you tag @langchainai in your post, we’ll almost certainly see it, and can show you some love!
- **[Discord](https://discord.gg/6adMQxSpJS):** connect with >30k developers who are building with LangChain
- **[GitHub](https://github.com/langchain-ai/langchain):** open pull requests, contribute to a discussion, and/or contribute
- **[Subscribe to our bi-weekly Release Notes](https://6w1pwbss0py.typeform.com/to/KjZB1auB):** a twice/month email roundup of the coolest things going on in our orbit
- **Slack:** if you’re building an application in production at your company, we’d love to get into a Slack channel together. Fill out [this form](https://airtable.com/appwQzlErAS2qiP0L/shrGtGaVBVAz7NcV2) and we’ll get in touch about setting one up.
8 changes: 4 additions & 4 deletions docs/docs_skeleton/docs/get_started/quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ import PromptTemplateChatModel from "@snippets/get_started/quickstart/prompt_tem
<PromptTemplateLLM/>

However, the advantages of using these over raw string formatting are several.
You can "partial" out variables - eg you can format only some of the variables at a time.
You can "partial" out variables - e.g. you can format only some of the variables at a time.
You can compose them together, easily combining different templates into a single prompt.
For explanations of these functionalities, see the [section on prompts](/docs/modules/model_io/prompts) for more detail.

Expand All @@ -121,12 +121,12 @@ Let's take a look at this below:

ChatPromptTemplates can also include other things besides ChatMessageTemplates - see the [section on prompts](/docs/modules/model_io/prompts) for more detail.

## Output Parsers
## Output parsers

OutputParsers convert the raw output of an LLM into a format that can be used downstream.
There are few main type of OutputParsers, including:

- Convert text from LLM -> structured information (eg JSON)
- Convert text from LLM -> structured information (e.g. JSON)
- Convert a ChatMessage into just a string
- Convert the extra information returned from a call besides the message (like OpenAI function invocation) into a string.

Expand All @@ -149,7 +149,7 @@ import LLMChain from "@snippets/get_started/quickstart/llm_chain.mdx"

<LLMChain/>

## Next Steps
## Next steps

This is it!
We've now gone over how to create the core building block of LangChain applications - the LLMChains.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ sidebar_position: 3
---
# Comparison Evaluators

Comparison evaluators in LangChain help measure two different chain 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 preference scores for ai-assisted reinforcement learning.
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 preference scores for ai-assisted reinforcement learning.

These evaluators inherit from the `PairwiseStringEvaluator` class, providing a comparison interface for two strings - typically, the outputs from two different prompts or models, or two versions of the same model. In essence, a comparison evaluator performs an evaluation on a pair of strings and returns a dictionary containing the evaluation score and other relevant details.

Expand All @@ -16,7 +16,7 @@ Here's a summary of the key methods and properties of a comparison evaluator:
- `requires_input`: This property indicates whether this evaluator requires an input string.
- `requires_reference`: This property specifies whether this evaluator requires a reference label.

Detailed information about creating custom evaluators and the available built-in comparison evaluators are provided in the following sections.
Detailed information about creating custom evaluators and the available built-in comparison evaluators is provided in the following sections.

import DocCardList from "@theme/DocCardList";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Few-shot prompt templates

In this tutorial, we'll learn how to create a prompt template that uses few shot examples. A few shot prompt template can be constructed from either a set of examples, or from an Example Selector object.
In this tutorial, we'll learn how to create a prompt template that uses few-shot examples. A few-shot prompt template can be constructed from either a set of examples, or from an Example Selector object.

import Example from "@snippets/modules/model_io/prompts/prompt_templates/few_shot_examples.mdx"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ sidebar_position: 0

Prompt templates are pre-defined recipes for generating prompts for language models.

A template may include instructions, few shot examples, and specific context and
A template may include instructions, few-shot examples, and specific context and
questions appropriate for a given task.

LangChain provides tooling to create and work with prompt templates.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Partial prompt templates

Like other methods, it can make sense to "partial" a prompt template - eg pass in a subset of the required values, as to create a new prompt template which expects only the remaining subset of values.
Like other methods, it can make sense to "partial" a prompt template - e.g. pass in a subset of the required values, as to create a new prompt template which expects only the remaining subset of values.

LangChain supports this in two ways:
1. Partial formatting with string values.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

This notebook goes over how to compose multiple prompts together. This can be useful when you want to reuse parts of prompts. This can be done with a PipelinePrompt. A PipelinePrompt consists of two main parts:

- Final prompt: This is the final prompt that is returned
- Pipeline prompts: This is a list of tuples, consisting of a string name and a prompt template. Each prompt template will be formatted and then passed to future prompt templates as a variable with the same name.
- Final prompt: The final prompt that is returned
- Pipeline prompts: A list of tuples, consisting of a string name and a prompt template. Each prompt template will be formatted and then passed to future prompt templates as a variable with the same name.

import Example from "@snippets/modules/model_io/prompts/prompt_templates/prompt_composition.mdx"

Expand Down
4 changes: 4 additions & 0 deletions docs/docs_skeleton/vercel.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{
"redirects": [
{
"source": "/docs/modules/data_connection/caching_embeddings(/?)",
"destination": "/docs/modules/data_connection/text_embedding/caching_embeddings"
},
{
"source": "/en/latest/additional_resources/youtube.html",
"destination": "/docs/additional_resources/youtube"
Expand Down
2 changes: 1 addition & 1 deletion docs/extras/guides/expression_language/cookbook.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1318,7 +1318,7 @@
"source": [
"template = \"\"\"Write some python code to solve the user's problem. \n",
"\n",
"Return only python code in Markdown format, eg:\n",
"Return only python code in Markdown format, e.g.:\n",
"\n",
"```python\n",
"....\n",
Expand Down
2 changes: 1 addition & 1 deletion docs/extras/integrations/callbacks/promptlayer.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"\n",
"[PromptLayer](https://promptlayer.com) is a an LLM observability platform that lets you visualize requests, version prompts, and track usage. In this guide we will go over how to setup the `PromptLayerCallbackHandler`. \n",
"\n",
"While PromptLayer does have LLMs that integrate directly with LangChain (eg [`PromptLayerOpenAI`](https://python.langchain.com/docs/integrations/llms/promptlayer_openai)), this callback is the recommended way to integrate PromptLayer with LangChain.\n",
"While PromptLayer does have LLMs that integrate directly with LangChain (e.g. [`PromptLayerOpenAI`](https://python.langchain.com/docs/integrations/llms/promptlayer_openai)), this callback is the recommended way to integrate PromptLayer with LangChain.\n",
"\n",
"See [our docs](https://docs.promptlayer.com/languages/langchain) for more information."
]
Expand Down
Loading

0 comments on commit 22461dc

Please sign in to comment.