Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs[patch]: Replace prerequisite links component #5430

Merged
merged 2 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions docs/core_docs/docs/how_to/example_selectors.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,14 @@
"source": [
"# How to use example selectors\n",
"\n",
"```{=mdx}\n",
"import PrerequisiteLinks from \"@theme/PrerequisiteLinks\";\n",
":::info Prerequisites\n",
"\n",
"This guide assumes familiarity with the following concepts:\n",
"\n",
"<PrerequisiteLinks\n",
" content={`\n",
"- [Prompt templates](/docs/concepts/#prompt-templates)\n",
"- [Few-shot examples](/docs/how_to/few_shot_examples)\n",
"`}\n",
"/>\n",
"```\n",
"\n",
":::\n",
"\n",
"If you have a large number of examples, you may need to select which ones to include in the prompt. The Example Selector is the class responsible for doing so.\n",
"\n",
Expand Down
12 changes: 5 additions & 7 deletions docs/core_docs/docs/how_to/example_selectors_length_based.mdx
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
# How to select examples by length

```{=mdx}
import PrerequisiteLinks from "@theme/PrerequisiteLinks";
:::info Prerequisites

This guide assumes familiarity with the following concepts:

<PrerequisiteLinks
content={`
- [Prompt templates](/docs/concepts/#prompt-templates)
- [Example selectors](/docs/how_to/example_selectors)
`}
/>
```

:::

This example selector selects which examples to use based on length.
This is useful when you are worried about constructing a prompt that will go over the length of the context window.
Expand Down
12 changes: 5 additions & 7 deletions docs/core_docs/docs/how_to/example_selectors_similarity.mdx
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
# How to select examples by similarity

```{=mdx}
import PrerequisiteLinks from "@theme/PrerequisiteLinks";
:::info Prerequisites

This guide assumes familiarity with the following concepts:

<PrerequisiteLinks
content={`
- [Prompt templates](/docs/concepts/#prompt-templates)
- [Example selectors](/docs/how_to/example_selectors)
- [Vector stores](/docs/concepts#vectorstores)
`}
/>
```

:::

This object selects examples based on similarity to the inputs.
It does this by finding the examples with the embeddings that have the greatest cosine similarity with the inputs.
Expand Down
10 changes: 5 additions & 5 deletions docs/core_docs/docs/how_to/few_shot_examples.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@
"\n",
"This guide will cover few-shotting with string prompt templates. For a guide on few-shotting with chat messages for chat models, see [here](/docs/how_to/few_shot_examples_chat/).\n",
"\n",
"```{=mdx}\n",
"import PrerequisiteLinks from \"@theme/PrerequisiteLinks\";\n",
":::info Prerequisites\n",
"\n",
"This guide assumes familiarity with the following concepts:\n",
"\n",
"<PrerequisiteLinks content={`\n",
"- [Prompt templates](/docs/concepts/#prompt-templates)\n",
"- [Example selectors](/docs/concepts/#example-selectors)\n",
"- [LLMs](/docs/concepts/#llms)\n",
"- [Vectorstores](/docs/concepts/#vectorstores)\n",
"`} />\n",
"```\n",
"\n",
":::\n",
"\n",
"## Create a formatter for the few-shot examples\n",
"\n",
Expand Down
10 changes: 5 additions & 5 deletions docs/core_docs/docs/how_to/few_shot_examples_chat.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@
"\n",
"**Note:** The following code examples are for chat models only, since `FewShotChatMessagePromptTemplates` are designed to output formatted [chat messages](/docs/concepts/#message-types) rather than pure strings. For similar few-shot prompt examples for pure string templates compatible with completion models (LLMs), see the [few-shot prompt templates](/docs/how_to/few_shot_examples/) guide.\n",
"\n",
"```{=mdx}\n",
"import PrerequisiteLinks from \"@theme/PrerequisiteLinks\";\n",
":::info Prerequisites\n",
"\n",
"This guide assumes familiarity with the following concepts:\n",
"\n",
"<PrerequisiteLinks content={`\n",
"- [Prompt templates](/docs/concepts/#prompt-templates)\n",
"- [Example selectors](/docs/concepts/#example-selectors)\n",
"- [Chat models](/docs/concepts/#chat-model)\n",
"- [Vectorstores](/docs/concepts/#vectorstores)\n",
"`} />\n",
"```"
"\n",
":::"
]
},
{
Expand Down
10 changes: 5 additions & 5 deletions docs/core_docs/docs/how_to/output_parser_json.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@
"Keep in mind that large language models are leaky abstractions! You'll have to use an LLM with sufficient capacity to generate well-formed JSON.\n",
":::\n",
"\n",
"```{=mdx}\n",
"import PrerequisiteLinks from \"@theme/PrerequisiteLinks\";\n",
":::info Prerequisites\n",
"\n",
"This guide assumes familiarity with the following concepts:\n",
"\n",
"<PrerequisiteLinks content={`\n",
"- [Chat models](/docs/concepts/#chat-models)\n",
"- [Output parsers](/docs/concepts/#output-parsers)\n",
"- [Prompt templates](/docs/concepts/#prompt-templates)\n",
"- [Structured output](/docs/how_to/structured_output)\n",
"- [Chaining runnables together](/docs/how_to/sequence/)\n",
"`}/>\n",
"```"
"\n",
":::"
]
},
{
Expand Down
10 changes: 6 additions & 4 deletions docs/core_docs/docs/how_to/prompts_composition.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@
"source": [
"# How to compose prompts together\n",
"\n",
"```{=mdx}\n",
"import PrerequisiteLinks from \"@theme/PrerequisiteLinks\";\n",
":::info Prerequisites\n",
"\n",
"<PrerequisiteLinks content={`- [Prompt templates](/docs/concepts/#prompt-templates)`} />\n",
"```\n",
"This guide assumes familiarity with the following concepts:\n",
"\n",
"- [Prompt templates](/docs/concepts/#prompt-templates)\n",
"\n",
":::\n",
"\n",
"LangChain provides a user friendly interface for composing different parts of prompts together. You can do this with either string prompts or chat prompts. Constructing prompts this way allows for easy reuse of components."
]
Expand Down
10 changes: 5 additions & 5 deletions docs/core_docs/docs/how_to/prompts_partial.mdx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# How to partially format prompt templates

import PrerequisiteLinks from "@theme/PrerequisiteLinks";
:::info Prerequisites

This guide assumes familiarity with the following concepts:

<PrerequisiteLinks
content={`
- [Prompt templates](/docs/concepts/#prompt-templates)
`}
/>

:::

Like partially binding arguments to a function, 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.
Expand Down
10 changes: 5 additions & 5 deletions docs/core_docs/docs/how_to/sequence.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@
"\n",
"The resulting [`RunnableSequence`](https://api.js.langchain.com/classes/langchain_core_runnables.RunnableSequence.html) is itself a runnable, which means it can be invoked, streamed, or further chained just like any other runnable. Advantages of chaining runnables in this way are efficient streaming (the sequence will stream output as soon as it is available), and debugging and tracing with tools like [LangSmith](/docs/how_to/debugging).\n",
"\n",
"```{=mdx}\n",
"import PrerequisiteLinks from \"@theme/PrerequisiteLinks\";\n",
":::info Prerequisites\n",
"\n",
"This guide assumes familiarity with the following concepts:\n",
"\n",
"<PrerequisiteLinks content={`\n",
"- [LangChain Expression Language (LCEL)](/docs/concepts/#langchain-expression-language)\n",
"- [Prompt templates](/docs/concepts/#prompt-templates)\n",
"- [Chat models](/docs/concepts/#chat-models)\n",
"- [Output parser](/docs/concepts/#output-parsers)\n",
"`}/>\n",
"```\n",
"\n",
":::\n",
"\n",
"## The pipe method\n",
"\n",
Expand Down
10 changes: 5 additions & 5 deletions docs/core_docs/docs/how_to/streaming.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
"source": [
"# How to stream\n",
"\n",
"```{=mdx}\n",
"import PrerequisiteLinks from \"@theme/PrerequisiteLinks\";\n",
":::info Prerequisites\n",
"\n",
"This guide assumes familiarity with the following concepts:\n",
"\n",
"<PrerequisiteLinks content={`\n",
"- [Chat models](/docs/concepts/#chat-models)\n",
"`} />\n",
"```\n",
"\n",
":::\n",
"\n",
"Streaming is critical in making applications based on LLMs feel responsive to end-users.\n",
"\n",
Expand Down
12 changes: 7 additions & 5 deletions docs/core_docs/docs/how_to/tool_calling.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,16 @@
"LangChain implements standard interfaces for defining tools, passing them to LLMs, \n",
"and representing tool calls. This guide will show you how to use them.\n",
"\n",
"```{=mdx}\n",
"import PrerequisiteLinks from \"@theme/PrerequisiteLinks\";\n",
":::info Prerequisites\n",
"\n",
"This guide assumes familiarity with the following concepts:\n",
"\n",
"<PrerequisiteLinks content={`\n",
"- [Chat models](/docs/concepts/#chat-models)\n",
"- [LangChain Tools](/docs/concepts/#tools)\n",
"`} />\n",
"```\n",
"\n",
":::\n",
"\n",
"\n",
"\n",
"## Passing tools to LLMs\n",
"\n",
Expand Down
20 changes: 0 additions & 20 deletions docs/core_docs/src/theme/PrerequisiteLinks.js

This file was deleted.

Loading