Skip to content

Commit e54f457

Browse files
authored
Replace prerequisite links component (#5430)
1 parent 0e52651 commit e54f457

12 files changed

+58
-80
lines changed

docs/core_docs/docs/how_to/example_selectors.ipynb

+5-7
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,14 @@
1717
"source": [
1818
"# How to use example selectors\n",
1919
"\n",
20-
"```{=mdx}\n",
21-
"import PrerequisiteLinks from \"@theme/PrerequisiteLinks\";\n",
20+
":::info Prerequisites\n",
21+
"\n",
22+
"This guide assumes familiarity with the following concepts:\n",
2223
"\n",
23-
"<PrerequisiteLinks\n",
24-
" content={`\n",
2524
"- [Prompt templates](/docs/concepts/#prompt-templates)\n",
2625
"- [Few-shot examples](/docs/how_to/few_shot_examples)\n",
27-
"`}\n",
28-
"/>\n",
29-
"```\n",
26+
"\n",
27+
":::\n",
3028
"\n",
3129
"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",
3230
"\n",

docs/core_docs/docs/how_to/example_selectors_length_based.mdx

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
# How to select examples by length
22

3-
```{=mdx}
4-
import PrerequisiteLinks from "@theme/PrerequisiteLinks";
3+
:::info Prerequisites
4+
5+
This guide assumes familiarity with the following concepts:
56

6-
<PrerequisiteLinks
7-
content={`
87
- [Prompt templates](/docs/concepts/#prompt-templates)
98
- [Example selectors](/docs/how_to/example_selectors)
10-
`}
11-
/>
12-
```
9+
10+
:::
1311

1412
This example selector selects which examples to use based on length.
1513
This is useful when you are worried about constructing a prompt that will go over the length of the context window.

docs/core_docs/docs/how_to/example_selectors_similarity.mdx

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
# How to select examples by similarity
22

3-
```{=mdx}
4-
import PrerequisiteLinks from "@theme/PrerequisiteLinks";
3+
:::info Prerequisites
4+
5+
This guide assumes familiarity with the following concepts:
56

6-
<PrerequisiteLinks
7-
content={`
87
- [Prompt templates](/docs/concepts/#prompt-templates)
98
- [Example selectors](/docs/how_to/example_selectors)
109
- [Vector stores](/docs/concepts#vectorstores)
11-
`}
12-
/>
13-
```
10+
11+
:::
1412

1513
This object selects examples based on similarity to the inputs.
1614
It does this by finding the examples with the embeddings that have the greatest cosine similarity with the inputs.

docs/core_docs/docs/how_to/few_shot_examples.ipynb

+5-5
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,16 @@
2323
"\n",
2424
"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",
2525
"\n",
26-
"```{=mdx}\n",
27-
"import PrerequisiteLinks from \"@theme/PrerequisiteLinks\";\n",
26+
":::info Prerequisites\n",
27+
"\n",
28+
"This guide assumes familiarity with the following concepts:\n",
2829
"\n",
29-
"<PrerequisiteLinks content={`\n",
3030
"- [Prompt templates](/docs/concepts/#prompt-templates)\n",
3131
"- [Example selectors](/docs/concepts/#example-selectors)\n",
3232
"- [LLMs](/docs/concepts/#llms)\n",
3333
"- [Vectorstores](/docs/concepts/#vectorstores)\n",
34-
"`} />\n",
35-
"```\n",
34+
"\n",
35+
":::\n",
3636
"\n",
3737
"## Create a formatter for the few-shot examples\n",
3838
"\n",

docs/core_docs/docs/how_to/few_shot_examples_chat.ipynb

+5-5
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@
2525
"\n",
2626
"**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",
2727
"\n",
28-
"```{=mdx}\n",
29-
"import PrerequisiteLinks from \"@theme/PrerequisiteLinks\";\n",
28+
":::info Prerequisites\n",
29+
"\n",
30+
"This guide assumes familiarity with the following concepts:\n",
3031
"\n",
31-
"<PrerequisiteLinks content={`\n",
3232
"- [Prompt templates](/docs/concepts/#prompt-templates)\n",
3333
"- [Example selectors](/docs/concepts/#example-selectors)\n",
3434
"- [Chat models](/docs/concepts/#chat-model)\n",
3535
"- [Vectorstores](/docs/concepts/#vectorstores)\n",
36-
"`} />\n",
37-
"```"
36+
"\n",
37+
":::"
3838
]
3939
},
4040
{

docs/core_docs/docs/how_to/output_parser_json.ipynb

+5-5
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@
1313
"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",
1414
":::\n",
1515
"\n",
16-
"```{=mdx}\n",
17-
"import PrerequisiteLinks from \"@theme/PrerequisiteLinks\";\n",
16+
":::info Prerequisites\n",
17+
"\n",
18+
"This guide assumes familiarity with the following concepts:\n",
1819
"\n",
19-
"<PrerequisiteLinks content={`\n",
2020
"- [Chat models](/docs/concepts/#chat-models)\n",
2121
"- [Output parsers](/docs/concepts/#output-parsers)\n",
2222
"- [Prompt templates](/docs/concepts/#prompt-templates)\n",
2323
"- [Structured output](/docs/how_to/structured_output)\n",
2424
"- [Chaining runnables together](/docs/how_to/sequence/)\n",
25-
"`}/>\n",
26-
"```"
25+
"\n",
26+
":::"
2727
]
2828
},
2929
{

docs/core_docs/docs/how_to/prompts_composition.ipynb

+6-4
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,13 @@
1717
"source": [
1818
"# How to compose prompts together\n",
1919
"\n",
20-
"```{=mdx}\n",
21-
"import PrerequisiteLinks from \"@theme/PrerequisiteLinks\";\n",
20+
":::info Prerequisites\n",
2221
"\n",
23-
"<PrerequisiteLinks content={`- [Prompt templates](/docs/concepts/#prompt-templates)`} />\n",
24-
"```\n",
22+
"This guide assumes familiarity with the following concepts:\n",
23+
"\n",
24+
"- [Prompt templates](/docs/concepts/#prompt-templates)\n",
25+
"\n",
26+
":::\n",
2527
"\n",
2628
"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."
2729
]

docs/core_docs/docs/how_to/prompts_partial.mdx

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# How to partially format prompt templates
22

3-
import PrerequisiteLinks from "@theme/PrerequisiteLinks";
3+
:::info Prerequisites
4+
5+
This guide assumes familiarity with the following concepts:
46

5-
<PrerequisiteLinks
6-
content={`
77
- [Prompt templates](/docs/concepts/#prompt-templates)
8-
`}
9-
/>
8+
9+
:::
1010

1111
Like partially binding arguments to a function, it can make sense to "partial" a prompt template - e.g. pass in
1212
a subset of the required values, as to create a new prompt template which expects only the remaining subset of values.

docs/core_docs/docs/how_to/sequence.ipynb

+5-5
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,16 @@
1919
"\n",
2020
"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",
2121
"\n",
22-
"```{=mdx}\n",
23-
"import PrerequisiteLinks from \"@theme/PrerequisiteLinks\";\n",
22+
":::info Prerequisites\n",
23+
"\n",
24+
"This guide assumes familiarity with the following concepts:\n",
2425
"\n",
25-
"<PrerequisiteLinks content={`\n",
2626
"- [LangChain Expression Language (LCEL)](/docs/concepts/#langchain-expression-language)\n",
2727
"- [Prompt templates](/docs/concepts/#prompt-templates)\n",
2828
"- [Chat models](/docs/concepts/#chat-models)\n",
2929
"- [Output parser](/docs/concepts/#output-parsers)\n",
30-
"`}/>\n",
31-
"```\n",
30+
"\n",
31+
":::\n",
3232
"\n",
3333
"## The pipe method\n",
3434
"\n",

docs/core_docs/docs/how_to/streaming.ipynb

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
"source": [
77
"# How to stream\n",
88
"\n",
9-
"```{=mdx}\n",
10-
"import PrerequisiteLinks from \"@theme/PrerequisiteLinks\";\n",
9+
":::info Prerequisites\n",
10+
"\n",
11+
"This guide assumes familiarity with the following concepts:\n",
1112
"\n",
12-
"<PrerequisiteLinks content={`\n",
1313
"- [Chat models](/docs/concepts/#chat-models)\n",
14-
"`} />\n",
15-
"```\n",
14+
"\n",
15+
":::\n",
1616
"\n",
1717
"Streaming is critical in making applications based on LLMs feel responsive to end-users.\n",
1818
"\n",

docs/core_docs/docs/how_to/tool_calling.ipynb

+7-5
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,16 @@
4040
"LangChain implements standard interfaces for defining tools, passing them to LLMs, \n",
4141
"and representing tool calls. This guide will show you how to use them.\n",
4242
"\n",
43-
"```{=mdx}\n",
44-
"import PrerequisiteLinks from \"@theme/PrerequisiteLinks\";\n",
43+
":::info Prerequisites\n",
44+
"\n",
45+
"This guide assumes familiarity with the following concepts:\n",
4546
"\n",
46-
"<PrerequisiteLinks content={`\n",
4747
"- [Chat models](/docs/concepts/#chat-models)\n",
4848
"- [LangChain Tools](/docs/concepts/#tools)\n",
49-
"`} />\n",
50-
"```\n",
49+
"\n",
50+
":::\n",
51+
"\n",
52+
"\n",
5153
"\n",
5254
"## Passing tools to LLMs\n",
5355
"\n",

docs/core_docs/src/theme/PrerequisiteLinks.js

-20
This file was deleted.

0 commit comments

Comments
 (0)