docs[minor]: lcel why page (#14089)

This commit is contained in:
Bagatur 2023-12-01 16:13:31 -08:00 committed by GitHub
parent cbe4753e1a
commit 340b42d8ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 1167 additions and 10 deletions

View File

@ -13,6 +13,8 @@ rsync -ruv . ../_dist
cd ../_dist cd ../_dist
poetry run python scripts/model_feat_table.py poetry run python scripts/model_feat_table.py
poetry run nbdoc_build --srcdir docs --pause 0 poetry run nbdoc_build --srcdir docs --pause 0
mkdir docs/templates
cp ../templates/docs/INDEX.md docs/templates/index.md
cp ../cookbook/README.md src/pages/cookbook.mdx cp ../cookbook/README.md src/pages/cookbook.mdx
cp ../.github/CONTRIBUTING.md docs/contributing.md cp ../.github/CONTRIBUTING.md docs/contributing.md
mkdir -p docs/templates mkdir -p docs/templates

View File

@ -13,6 +13,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "befa7fd1",
"metadata": {}, "metadata": {},
"source": [ "source": [
"LCEL makes it easy to build complex chains from basic components, and supports out of the box functionality such as streaming, parallelism, and logging." "LCEL makes it easy to build complex chains from basic components, and supports out of the box functionality such as streaming, parallelism, and logging."
@ -77,6 +78,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "aa1b77fa",
"metadata": {}, "metadata": {},
"source": [ "source": [
"### 1. Prompt\n", "### 1. Prompt\n",
@ -87,6 +89,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 8, "execution_count": 8,
"id": "b8656990",
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -108,6 +111,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 9, "execution_count": 9,
"id": "e6034488",
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -128,6 +132,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 10, "execution_count": 10,
"id": "60565463",
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -147,6 +152,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "577f0f76",
"metadata": {}, "metadata": {},
"source": [ "source": [
"### 2. Model\n", "### 2. Model\n",
@ -157,6 +163,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 11, "execution_count": 11,
"id": "33cf5f72",
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -177,6 +184,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "327e7db8",
"metadata": {}, "metadata": {},
"source": [ "source": [
"If our `model` was an `LLM`, it would output a string." "If our `model` was an `LLM`, it would output a string."
@ -185,6 +193,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 12, "execution_count": 12,
"id": "8feb05da",
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -207,6 +216,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "91847478",
"metadata": {}, "metadata": {},
"source": [ "source": [
"### 3. Output parser\n", "### 3. Output parser\n",
@ -218,6 +228,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 13, "execution_count": 13,
"id": "533e59a8",
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -237,6 +248,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "9851e842",
"metadata": {}, "metadata": {},
"source": [ "source": [
"### 4. Entire Pipeline\n", "### 4. Entire Pipeline\n",
@ -251,6 +263,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "c4873109",
"metadata": {}, "metadata": {},
"source": [ "source": [
"```mermaid\n", "```mermaid\n",
@ -264,6 +277,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "fe63534d",
"metadata": {}, "metadata": {},
"source": [ "source": [
":::info\n", ":::info\n",
@ -445,12 +459,14 @@
] ]
}, },
{ {
"cell_type": "code", "cell_type": "markdown",
"execution_count": null, "id": "8c2438df-164e-4bbe-b5f4-461695e45b0f",
"id": "3ffdde6e-67c9-430d-ac14-28f18f01de04",
"metadata": {}, "metadata": {},
"outputs": [], "source": [
"source": [] "## Next steps\n",
"\n",
"We recommend reading our [Why use LCEL](/docs/expression_language/why) section next to see a side-by-side comparison of the code needed to produce common functionality with and without LCEL."
]
} }
], ],
"metadata": { "metadata": {
@ -469,7 +485,7 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
"version": "3.11.6" "version": "3.9.1"
} }
}, },
"nbformat": 4, "nbformat": 4,

File diff suppressed because it is too large Load Diff

17
docs/src/theme/Columns.js Normal file
View File

@ -0,0 +1,17 @@
import React from "react";
export function ColumnContainer({children}) {
return (
<div style={{ display: "flex", flexWrap: "wrap" }}>
{children}
</div>
)
}
export function Column({children}) {
return (
<div style={{ flex: "1 0 300px", padding: "10px", overflowX: "clip" }}>
{children}
</div>
)
}

View File

@ -56,10 +56,6 @@
"source": "/docs/modules/model_io/chat/human_input_chat_model", "source": "/docs/modules/model_io/chat/human_input_chat_model",
"destination": "/cookbook" "destination": "/cookbook"
}, },
{
"source": "/docs/expression_language/why",
"destination": "/docs/expression_language/"
},
{ {
"source": "/docs/modules/model_io/chat/llm_chain", "source": "/docs/modules/model_io/chat/llm_chain",
"destination": "/docs/modules/chains/foundational/llm_chain" "destination": "/docs/modules/chains/foundational/llm_chain"

View File

@ -59,6 +59,9 @@ ignore-words-list = 'momento,collison,ned,foor,reworkd,parth,whats,aapply,mysogy
[tool.ruff] [tool.ruff]
extend-include = ["*.ipynb"] extend-include = ["*.ipynb"]
extend-exclude = [
"docs/docs/expression_language/why.ipynb" # TODO: look into why linter errors
]
[tool.ruff.lint.per-file-ignores] [tool.ruff.lint.per-file-ignores]
"**/{cookbook,docs}/*" = [ "**/{cookbook,docs}/*" = [