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

WIP: new docs #20363

Closed
wants to merge 125 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
125 commits
Select commit Hold shift + click to select a range
ccf695e
new docs stuff
hwchase17 Apr 12, 2024
79a713c
cr
hwchase17 Apr 12, 2024
d427656
cr
hwchase17 Apr 13, 2024
b34ef12
Adds component concepts
jacoblee93 Apr 13, 2024
a16d409
Link
jacoblee93 Apr 13, 2024
f9d91e9
Fix links, group components by section
jacoblee93 Apr 15, 2024
374016e
Merge branch 'master' of https://github.com/langchain-ai/langchain in…
jacoblee93 Apr 15, 2024
11bc17c
cr
hwchase17 Apr 15, 2024
debb5f7
cr
hwchase17 Apr 15, 2024
353c75f
cr
hwchase17 Apr 15, 2024
2bd051d
cr
hwchase17 Apr 16, 2024
cb2ee22
Adjust headers
jacoblee93 Apr 16, 2024
914e965
Naming
jacoblee93 Apr 16, 2024
aff7719
Jacob/new docs (#20570)
jacoblee93 Apr 18, 2024
74ccad7
Merge
jacoblee93 Apr 18, 2024
75ffacf
Merge
jacoblee93 Apr 18, 2024
8e238e4
Revert core docs
jacoblee93 Apr 18, 2024
dc212ed
Fix scripts
jacoblee93 Apr 18, 2024
aa65827
cr
hwchase17 Apr 19, 2024
d3f1ad9
cr
hwchase17 Apr 19, 2024
4ec3126
cr
hwchase17 Apr 19, 2024
4111112
cr
hwchase17 Apr 19, 2024
92eb0cd
cr
hwchase17 Apr 19, 2024
3bfb519
cr
hwchase17 Apr 19, 2024
2a99bc6
cr
hwchase17 Apr 19, 2024
4b937ec
cr
hwchase17 Apr 19, 2024
c9a7225
cr
hwchase17 Apr 19, 2024
72482a9
Merge branch 'master' of https://github.com/langchain-ai/langchain in…
jacoblee93 Apr 19, 2024
803b2b3
Merge, update structured output guide
jacoblee93 Apr 19, 2024
1ee0551
Merge branch 'harrison/new-docs' of https://github.com/langchain-ai/l…
jacoblee93 Apr 19, 2024
b447678
Revert sidebar for now
jacoblee93 Apr 19, 2024
3cf2677
Fix sidebars
jacoblee93 Apr 19, 2024
be2f080
Ignore broken links for now
jacoblee93 Apr 19, 2024
367dbef
Remove old sidebars
jacoblee93 Apr 19, 2024
88ba5e1
Add prereq component, update guide
jacoblee93 Apr 19, 2024
a2de1f5
Update RAG guide
jacoblee93 Apr 19, 2024
53a85cd
Update RAG tutorial
jacoblee93 Apr 19, 2024
e021f47
Add streaming, structured output, and tool calling how tos
jacoblee93 Apr 19, 2024
9bd75f3
Update some LCEL how-tos
jacoblee93 Apr 19, 2024
f53b395
More runnable how tos
jacoblee93 Apr 20, 2024
c6e4459
Add passthrough guide
jacoblee93 Apr 20, 2024
d962d97
More runnable how-to guides
jacoblee93 Apr 20, 2024
ed207b3
cr
hwchase17 Apr 20, 2024
1ca2138
cr
hwchase17 Apr 20, 2024
c6d0993
cr
hwchase17 Apr 20, 2024
51f1f4b
cr
hwchase17 Apr 20, 2024
ddea365
cr
hwchase17 Apr 20, 2024
5bfa57a
cr
hwchase17 Apr 20, 2024
94c339e
More how tos
jacoblee93 Apr 21, 2024
1385cfa
Merge branch 'harrison/new-docs' of https://github.com/langchain-ai/l…
jacoblee93 Apr 21, 2024
8c4b283
Consolidate decorator how to guide
jacoblee93 Apr 21, 2024
f2fc84c
Consolidate multiple chains how-to guide
jacoblee93 Apr 21, 2024
1927977
More updates
jacoblee93 Apr 21, 2024
103b275
Fix
jacoblee93 Apr 21, 2024
a6895f7
Fix prerequisite link component, add to more guides
jacoblee93 Apr 22, 2024
5a78b09
Update more output parser how to guides
jacoblee93 Apr 22, 2024
78ff039
Update chat model tabs to use one code block
jacoblee93 Apr 22, 2024
abec572
Merge branch 'master' into harrison/new-docs
hwchase17 Apr 22, 2024
234a671
Merge
jacoblee93 Apr 22, 2024
b390f58
Merge branch 'harrison/new-docs' of github.com:hwchase17/langchain in…
hwchase17 Apr 22, 2024
cc9bba5
Merge branch 'master' into harrison/new-docs
hwchase17 Apr 23, 2024
2280fc6
cr
hwchase17 Apr 23, 2024
ea83256
stash
hwchase17 Apr 23, 2024
b399750
cr
hwchase17 Apr 23, 2024
efa3e67
cr
hwchase17 Apr 24, 2024
a19c9cd
cr
hwchase17 Apr 24, 2024
95f7055
cr
hwchase17 Apr 24, 2024
a915f16
cr
hwchase17 Apr 24, 2024
eec4d58
cr
hwchase17 Apr 24, 2024
c6b63c5
cr
hwchase17 Apr 24, 2024
4448825
cr
hwchase17 Apr 24, 2024
0ff7a40
cr
hwchase17 Apr 24, 2024
294e81d
update tutorials (#20854)
ccurme Apr 24, 2024
f04f012
stash
hwchase17 Apr 24, 2024
5aa1347
stash
hwchase17 Apr 24, 2024
601fa45
Merge branch 'master' into harrison/new-docs
hwchase17 Apr 24, 2024
c47f4e6
Merge branch 'harrison/new-docs' of github.com:hwchase17/langchain in…
hwchase17 Apr 24, 2024
3aee2fa
cr
hwchase17 Apr 24, 2024
a1e7692
cr
hwchase17 Apr 24, 2024
b0a3e12
cr
hwchase17 Apr 24, 2024
88bbaba
Merge branch 'master' into harrison/new-docs
hwchase17 Apr 24, 2024
e9eb1e2
cr
hwchase17 Apr 24, 2024
66b2ac6
cr
hwchase17 Apr 25, 2024
1dc9232
(new docs): updates (#20897)
ccurme Apr 25, 2024
be73daa
cr
hwchase17 Apr 27, 2024
19a2f59
docs[patch]: Hide navbar item on old versions (#20953)
jacoblee93 Apr 27, 2024
fd7f041
docs[patch]: Increase line height (#20960)
jacoblee93 Apr 27, 2024
38bd7f4
(new docs): update sidebars alt (#21024)
ccurme Apr 29, 2024
d99a7a6
(new docs): update how-to guides (#21039)
ccurme Apr 29, 2024
81a7868
cr
hwchase17 Apr 29, 2024
8920bcd
Merge branch 'harrison/new-docs' of github.com:hwchase17/langchain in…
hwchase17 Apr 29, 2024
e037446
cr
hwchase17 Apr 29, 2024
392b842
(new docs): organize how-to sidebars (#21029)
ccurme Apr 29, 2024
bc4bb49
(new docs): remove agents from sidebar (#21046)
ccurme Apr 29, 2024
55dd2ea
cr
hwchase17 Apr 29, 2024
86bb3aa
Merge branch 'harrison/new-docs' of github.com:hwchase17/langchain in…
hwchase17 Apr 29, 2024
8a0e71d
Merge branch 'master' into harrison/new-docs
hwchase17 Apr 29, 2024
c3b7933
(new docs): update how-to guides (#21073)
ccurme Apr 30, 2024
df8a2cd
(new docs): update text splitter how-to guides (#21087)
ccurme Apr 30, 2024
7285370
update tutorial
ccurme Apr 30, 2024
7f4397c
format
ccurme Apr 30, 2024
6a20856
(new docs): embedding how-to guides (#21106)
ccurme Apr 30, 2024
c77debf
(new docs): update rag use-case docs (#21164)
ccurme May 1, 2024
8e8a03d
cr
hwchase17 May 1, 2024
cf866ef
Merge branch 'harrison/new-docs' of github.com:hwchase17/langchain in…
hwchase17 May 1, 2024
0522e9d
cr
hwchase17 May 1, 2024
a70459f
cr
hwchase17 May 1, 2024
8987aaf
(new docs): fix (#21217)
ccurme May 2, 2024
b8bd9ed
(new docs): update extraction how-to guides (#21195)
ccurme May 2, 2024
d5b89f3
(new docs): add agents to sidebar (#21221)
ccurme May 2, 2024
507fa94
(new docs): format (#21226)
ccurme May 2, 2024
e894559
(new docs) update links (#21228)
ccurme May 3, 2024
9354444
(new docs): fix build and resolve feedback (#21253)
ccurme May 3, 2024
716a8c8
cr
hwchase17 May 6, 2024
02e86d5
cr
hwchase17 May 6, 2024
dc2491e
cr
hwchase17 May 6, 2024
58e91ea
(new docs): update SQL how-tos (#21325)
ccurme May 6, 2024
c44287e
(new docs): update sidebars (#21329)
ccurme May 6, 2024
50e34f1
add link
ccurme May 6, 2024
2275f05
RAG: A few formatting fixes (#21340)
eyurtsev May 6, 2024
5d5492e
Fix formatting of bullet points in Conversational RAG (#21341)
eyurtsev May 6, 2024
4792f05
(new docs): fix links (#21345)
ccurme May 6, 2024
da48378
(new docs): fix links (#21348)
ccurme May 6, 2024
a27cab6
how to: stream chat models (#21380)
eyurtsev May 7, 2024
b47148b
how to: Update streaming LLM information (#21381)
eyurtsev May 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 9 additions & 0 deletions docs/.local_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@ poetry run python scripts/copy_templates.py
wget -q https://raw.githubusercontent.com/langchain-ai/langserve/main/README.md -O docs/langserve.md
wget -q https://raw.githubusercontent.com/langchain-ai/langgraph/main/README.md -O docs/langgraph.md

# Duplicate changes to 0.2.x version
cp docs/integrations/llms/index.mdx versioned_docs/version-0.2.x/integrations/llms/
cp docs/integrations/chat/index.mdx versioned_docs/version-0.2.x/integrations/chat/
mkdir -p versioned_docs/version-0.2.x/templates
cp -r docs/templates/* versioned_docs/version-0.2.x/templates/
cp docs/langserve.md versioned_docs/version-0.2.x/
cp docs/langgraph.md versioned_docs/version-0.2.x/

poetry run python scripts/resolve_versioned_links_in_markdown.py versioned_docs/version-0.2.x/ /docs/0.2.x/

poetry run quarto render docs
poetry run python scripts/generate_api_reference_links.py --docs_dir docs
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/expression_language/get_started.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.0"
"version": "3.10.1"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/expression_language/primitives/parallel.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.6"
"version": "3.10.1"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/expression_language/primitives/passthrough.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.6"
"version": "3.10.1"
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/expression_language/primitives/sequence.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -235,7 +235,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.5"
"version": "3.10.1"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/get_started/quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ That's a fair amount to cover! Let's dive in.

This guide (and most of the other guides in the documentation) uses [Jupyter notebooks](https://jupyter.org/) and assumes the reader is as well. Jupyter notebooks are perfect for learning how to work with LLM systems because oftentimes things can go wrong (unexpected output, API down, etc) and going through guides in an interactive environment is a great way to better understand them.

You do not NEED to go through the guide in a Jupyter Notebook, but it is recommended. See [here](https://jupyter.org/install) for instructions on how to install.
This and other tutorials are perhaps most conveniently run in a Jupyter notebook. See [here](https://jupyter.org/install) for instructions on how to install.

### Installation

Expand Down
6 changes: 3 additions & 3 deletions docs/docs/modules/model_io/chat/function_calling.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -685,9 +685,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "poetry-venv-2",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "poetry-venv-2"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -699,7 +699,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.1"
"version": "3.10.1"
}
},
"nbformat": 4,
Expand Down
39 changes: 26 additions & 13 deletions docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ const config = {
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: "/",
trailingSlash: true,
onBrokenLinks: "throw",
onBrokenMarkdownLinks: "throw",
onBrokenLinks: "warn",
onBrokenMarkdownLinks: "warn",

themes: ["@docusaurus/theme-mermaid"],
markdown: {
Expand Down Expand Up @@ -81,6 +81,17 @@ const config = {
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
lastVersion: "current",
versions: {
current: {
label: '0.1.x',
badge: false,
},
"0.2.x": {
label: "0.2.x",
banner: "unreleased",
}
},
sidebarPath: require.resolve("./sidebars.js"),
remarkPlugins: [
[require("@docusaurus/remark-plugin-npm2yarn"), { sync: true }],
Expand Down Expand Up @@ -149,21 +160,18 @@ const config = {
logo: {src: "img/brand/wordmark.png", srcDark: "img/brand/wordmark-dark.png"},
items: [
{
to: "/docs/modules",
type: "doc",
docId: "modules/index",
label: "Components",
position: "left",
className: "hidden-0\.2\.x",
},
{
type: "docSidebar",
position: "left",
sidebarId: "integrations",
label: "Integrations",
},
{
to: "/docs/guides",
label: "Guides",
position: "left",
},
{
href: "https://api.python.langchain.com",
label: "API Reference",
Expand All @@ -175,15 +183,18 @@ const config = {
position: "left",
items: [
{
to: "/docs/people/",
type: "doc",
docId: "people",
label: "People",
},
{
to: "/docs/packages",
type: "doc",
docId: "packages",
label: "Versioning",
},
{
to: "/docs/contributing",
type: "doc",
docId: "contributing/index",
label: "Contributing",
},
{
Expand All @@ -196,11 +207,13 @@ const config = {
href: "https://github.com/langchain-ai/langchain/blob/master/cookbook/README.md"
},
{
to: "/docs/additional_resources/tutorials",
type: "doc",
docId: "additional_resources/tutorials",
label: "Tutorials"
},
{
to: "/docs/additional_resources/youtube",
type: "doc",
docId: "additional_resources/youtube",
label: "YouTube"
},
]
Expand Down
2 changes: 2 additions & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"@supabase/supabase-js": "^2.39.7",
"clsx": "^1.2.1",
"cookie": "^0.6.0",
"isomorphic-dompurify": "^2.7.0",
"json-loader": "^0.5.7",
"process": "^0.11.10",
"react": "^17.0.2",
Expand All @@ -50,6 +51,7 @@
"eslint-plugin-jsx-a11y": "^6.6.0",
"eslint-plugin-react": "^7.30.1",
"eslint-plugin-react-hooks": "^4.6.0",
"marked": "^12.0.1",
"prettier": "^2.7.1",
"supabase": "^1.148.6",
"typedoc": "^0.24.4",
Expand Down
23 changes: 23 additions & 0 deletions docs/scripts/resolve_versioned_links_in_markdown.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import os
import re
import sys
from pathlib import Path

DOCS_DIR = Path(os.path.abspath(__file__)).parents[1]


def update_links(doc_path, docs_link):
for path in (DOCS_DIR / doc_path).glob("**/*"):
if path.is_file() and path.suffix in [".md", ".mdx", ".ipynb"]:
with open(path, "r") as f:
content = f.read()

# replace relative links
content = re.sub("\]\(\/docs\/(?!0\.2\.x)", f"]({docs_link}", content)

with open(path, "w") as f:
f.write(content)


if __name__ == "__main__":
update_links(sys.argv[1], sys.argv[2])
10 changes: 9 additions & 1 deletion docs/src/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
--ifm-code-font-size: 95%;
--ifm-font-family-base: 'Public Sans';
--ifm-menu-link-padding-horizontal: 0.5rem;
--ifm-menu-link-padding-vertical: 0.375rem;
--ifm-menu-link-padding-vertical: 0.5rem;
--doc-sidebar-width: 275px !important;
}

Expand All @@ -55,6 +55,10 @@ nav, h1, h2, h3, h4 {
font-family: 'Manrope';
}

.docs-version-0\.2\.x .hidden-0\.2\.x {
display: none;
}

.footer__links {
margin-top: 1rem;
margin-bottom: 3rem;
Expand Down Expand Up @@ -197,6 +201,10 @@ nav, h1, h2, h3, h4 {
opacity: 0.5;
}

.markdown {
line-height: 2em;
}

.markdown > h2 {
margin-top: 2rem;
border-bottom-color: var(--ifm-color-primary);
Expand Down
45 changes: 17 additions & 28 deletions docs/src/theme/ChatModelTabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,6 @@ import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
import CodeBlock from "@theme-original/CodeBlock";

function Setup({ apiKeyName, packageName }) {
const apiKeyText = `import getpass
import os

os.environ["${apiKeyName}"] = getpass.getpass()`;
return (
<>
<h5>Install dependencies</h5>
<CodeBlock language="bash">{`pip install -qU ${packageName}`}</CodeBlock>
<h5>Set environment variables</h5>
<CodeBlock language="python">{apiKeyText}</CodeBlock>
</>
);
}

/**
* @typedef {Object} ChatModelTabsProps - Component props.
* @property {string} [openaiParams] - Parameters for OpenAI chat model. Defaults to `model="gpt-3.5-turbo-0125"`
Expand Down Expand Up @@ -146,19 +131,23 @@ export default function ChatModelTabs(props) {
<Tabs groupId="modelTabs">
{tabItems
.filter((tabItem) => !tabItem.shouldHide)
.map((tabItem) => (
<TabItem
value={tabItem.value}
label={tabItem.label}
default={tabItem.default}
>
<Setup
apiKeyName={tabItem.apiKeyName}
packageName={tabItem.packageName}
/>
<CodeBlock language="python">{tabItem.text}</CodeBlock>
</TabItem>
))}
.map((tabItem) => {
const apiKeyText = `import getpass
import os

os.environ["${tabItem.apiKeyName}"] = getpass.getpass()`;
return (
<TabItem
value={tabItem.value}
label={tabItem.label}
default={tabItem.default}
>
<CodeBlock language="bash">{`pip install -qU ${tabItem.packageName}`}</CodeBlock>
<CodeBlock language="python">{apiKeyText + "\n\n" + tabItem.text}</CodeBlock>
</TabItem>
);
})
}
</Tabs>
);
}
Loading