From 591011df01c93d94cc3ee3a5bf94c91a72bfeb5a Mon Sep 17 00:00:00 2001 From: jacoblee93 Date: Wed, 15 Jan 2025 14:38:44 -0800 Subject: [PATCH 01/13] Pull API ref build --- Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index eabd8090..9fcc1dbf 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ install-vercel-deps: PYTHON = .venv/bin/python build-api-ref: - git clone --depth=1 https://github.com/langchain-ai/langsmith-sdk.git + git clone --depth=1 -b jacob/api_refs https://github.com/langchain-ai/langsmith-sdk.git python3 -m venv .venv . .venv/bin/activate $(PYTHON) -m pip install --upgrade pip @@ -14,11 +14,13 @@ build-api-ref: $(PYTHON) langsmith-sdk/python/docs/create_api_rst.py LC_ALL=C $(PYTHON) -m sphinx -T -E -b html -d langsmith-sdk/python/docs/_build/doctrees -c langsmith-sdk/python/docs langsmith-sdk/python/docs langsmith-sdk/python/docs/_build/html -j auto $(PYTHON) langsmith-sdk/python/docs/scripts/custom_formatter.py langsmith-sdk/docs/_build/html/ - + cd js && yarn + yarn run build:typedoc vercel-build: install-vercel-deps build-api-ref mkdir -p static/reference/python mv langsmith-sdk/python/docs/_build/html/* static/reference/python/ + mv langsmith-sdk/js/_build/api_refs/* static/reference/js/ rm -rf langsmith-sdk NODE_OPTIONS="--max-old-space-size=5000" yarn run docusaurus build From ff8c0a1923596c41cb19a4c8f5520f73254f7d2c Mon Sep 17 00:00:00 2001 From: jacoblee93 Date: Wed, 15 Jan 2025 15:08:44 -0800 Subject: [PATCH 02/13] Fix --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 9fcc1dbf..d7204daa 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ install-vercel-deps: PYTHON = .venv/bin/python build-api-ref: - git clone --depth=1 -b jacob/api_refs https://github.com/langchain-ai/langsmith-sdk.git + git clone --depth=1 https://github.com/langchain-ai/langsmith-sdk.git python3 -m venv .venv . .venv/bin/activate $(PYTHON) -m pip install --upgrade pip From 885318be1a62dba0aea7558a5c4be0d28bfa7bdb Mon Sep 17 00:00:00 2001 From: jacoblee93 Date: Wed, 15 Jan 2025 15:14:46 -0800 Subject: [PATCH 03/13] cr --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d7204daa..eb2517a1 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ build-api-ref: $(PYTHON) langsmith-sdk/python/docs/create_api_rst.py LC_ALL=C $(PYTHON) -m sphinx -T -E -b html -d langsmith-sdk/python/docs/_build/doctrees -c langsmith-sdk/python/docs langsmith-sdk/python/docs langsmith-sdk/python/docs/_build/html -j auto $(PYTHON) langsmith-sdk/python/docs/scripts/custom_formatter.py langsmith-sdk/docs/_build/html/ - cd js && yarn + cd langsmith-sdk/js && yarn yarn run build:typedoc vercel-build: install-vercel-deps build-api-ref From aaafea609f9450fc73b3d157cd6016c7aaba91ca Mon Sep 17 00:00:00 2001 From: Jacob Lee Date: Wed, 15 Jan 2025 15:20:38 -0800 Subject: [PATCH 04/13] Update Makefile --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index eb2517a1..f49c81b0 100644 --- a/Makefile +++ b/Makefile @@ -15,6 +15,7 @@ build-api-ref: LC_ALL=C $(PYTHON) -m sphinx -T -E -b html -d langsmith-sdk/python/docs/_build/doctrees -c langsmith-sdk/python/docs langsmith-sdk/python/docs langsmith-sdk/python/docs/_build/html -j auto $(PYTHON) langsmith-sdk/python/docs/scripts/custom_formatter.py langsmith-sdk/docs/_build/html/ cd langsmith-sdk/js && yarn + cat package.json yarn run build:typedoc vercel-build: install-vercel-deps build-api-ref From d03d847a6324aeef877193873ae756430d35bf79 Mon Sep 17 00:00:00 2001 From: Jacob Lee Date: Wed, 15 Jan 2025 15:22:33 -0800 Subject: [PATCH 05/13] Update Makefile --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f49c81b0..87ceafea 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ build-api-ref: LC_ALL=C $(PYTHON) -m sphinx -T -E -b html -d langsmith-sdk/python/docs/_build/doctrees -c langsmith-sdk/python/docs langsmith-sdk/python/docs langsmith-sdk/python/docs/_build/html -j auto $(PYTHON) langsmith-sdk/python/docs/scripts/custom_formatter.py langsmith-sdk/docs/_build/html/ cd langsmith-sdk/js && yarn - cat package.json + cat package.json yarn run build:typedoc vercel-build: install-vercel-deps build-api-ref From f5b0af0213547454b1e97a8188e444667045ff18 Mon Sep 17 00:00:00 2001 From: Jacob Lee Date: Wed, 15 Jan 2025 15:26:35 -0800 Subject: [PATCH 06/13] Update Makefile --- Makefile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 87ceafea..5bb5154a 100644 --- a/Makefile +++ b/Makefile @@ -14,9 +14,7 @@ build-api-ref: $(PYTHON) langsmith-sdk/python/docs/create_api_rst.py LC_ALL=C $(PYTHON) -m sphinx -T -E -b html -d langsmith-sdk/python/docs/_build/doctrees -c langsmith-sdk/python/docs langsmith-sdk/python/docs langsmith-sdk/python/docs/_build/html -j auto $(PYTHON) langsmith-sdk/python/docs/scripts/custom_formatter.py langsmith-sdk/docs/_build/html/ - cd langsmith-sdk/js && yarn - cat package.json - yarn run build:typedoc + cd langsmith-sdk/js && yarn && cat package.json && yarn run build:typedoc vercel-build: install-vercel-deps build-api-ref mkdir -p static/reference/python From 5c1badbf8ff055342fa850d23901a4e06bf422c6 Mon Sep 17 00:00:00 2001 From: Jacob Lee Date: Wed, 15 Jan 2025 15:30:22 -0800 Subject: [PATCH 07/13] Update Makefile --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 5bb5154a..5b4314fb 100644 --- a/Makefile +++ b/Makefile @@ -14,11 +14,12 @@ build-api-ref: $(PYTHON) langsmith-sdk/python/docs/create_api_rst.py LC_ALL=C $(PYTHON) -m sphinx -T -E -b html -d langsmith-sdk/python/docs/_build/doctrees -c langsmith-sdk/python/docs langsmith-sdk/python/docs langsmith-sdk/python/docs/_build/html -j auto $(PYTHON) langsmith-sdk/python/docs/scripts/custom_formatter.py langsmith-sdk/docs/_build/html/ - cd langsmith-sdk/js && yarn && cat package.json && yarn run build:typedoc + cd langsmith-sdk/js && yarn && yarn run build:typedoc vercel-build: install-vercel-deps build-api-ref mkdir -p static/reference/python mv langsmith-sdk/python/docs/_build/html/* static/reference/python/ + mkdir -p static/reference/js mv langsmith-sdk/js/_build/api_refs/* static/reference/js/ rm -rf langsmith-sdk NODE_OPTIONS="--max-old-space-size=5000" yarn run docusaurus build From b55d8f1c358c5ebc9d3d67fe32e0d3505d7507c5 Mon Sep 17 00:00:00 2001 From: jacoblee93 Date: Wed, 15 Jan 2025 15:44:37 -0800 Subject: [PATCH 08/13] Fix trailing slash behavior --- vercel.json | 44 ++++++++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/vercel.json b/vercel.json index 1eaffd1b..79eb8195 100644 --- a/vercel.json +++ b/vercel.json @@ -87,7 +87,7 @@ "destination": "/old/category/proxy/:path*" }, { - "source": "/category/release-notes", + "source": "/category/release-notes", "destination": "/self_hosting/release_notes" }, { @@ -187,37 +187,45 @@ "destination": "/prompt_engineering/tutorials/optimize_classifier" }, { - "source": "/evaluation/how_to_guides/evaluation/evaluate_llm_application#evaluate-on-a-particular-version-of-a-dataset", - "destination": "/evaluation/how_to_guides/evaluation/dataset_version" + "source": "/evaluation/how_to_guides/evaluation/evaluate_llm_application#evaluate-on-a-particular-version-of-a-dataset", + "destination": "/evaluation/how_to_guides/evaluation/dataset_version" }, { - "source": "/evaluation/how_to_guides/evaluation/:path*", - "destination": "/evaluation/how_to_guides/:path*" + "source": "/evaluation/how_to_guides/evaluation/:path*", + "destination": "/evaluation/how_to_guides/:path*" }, { - "source": "/evaluation/how_to_guides/datasets/:path*", - "destination": "/evaluation/how_to_guides/:path*" + "source": "/evaluation/how_to_guides/datasets/:path*", + "destination": "/evaluation/how_to_guides/:path*" }, { - "source": "/evaluation/how_to_guides/human_feedback/:path*", - "destination": "/evaluation/how_to_guides/:path*" + "source": "/evaluation/how_to_guides/human_feedback/:path*", + "destination": "/evaluation/how_to_guides/:path*" }, { - "source": "/reference/python(/?)", - "destination": "/reference/python/reference" + "source": "/reference/python(/?)", + "destination": "/reference/python/reference" }, { - "source": "/reference/sdk_reference(/?)", - "destination": "/reference/" + "source": "/reference/js/:path*(/)?", + "destination": "/reference/js/:path*/" + }, + { + "source": "/reference/js(/?)", + "destination": "/reference/js/" + }, + { + "source": "/reference/sdk_reference(/?)", + "destination": "/reference/" }, { "source": "/administration/pricing", "destination": "https://www.langchain.com/pricing-langsmith" - }, - { - "source": "/pricing/plans", - "destination": "https://www.langchain.com/pricing-langsmith" - } + }, + { + "source": "/pricing/plans", + "destination": "https://www.langchain.com/pricing-langsmith" + } ], "builds": [ { From 768b566a209316ed97378a1f81f2691828545be8 Mon Sep 17 00:00:00 2001 From: jacoblee93 Date: Wed, 15 Jan 2025 16:16:37 -0800 Subject: [PATCH 09/13] Fix --- vercel.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vercel.json b/vercel.json index 79eb8195..357c49cc 100644 --- a/vercel.json +++ b/vercel.json @@ -207,11 +207,11 @@ "destination": "/reference/python/reference" }, { - "source": "/reference/js/:path*(/)?", + "source": "/reference/js/:path*([^/]$)", "destination": "/reference/js/:path*/" }, { - "source": "/reference/js(/?)", + "source": "/reference/js([^/]$)", "destination": "/reference/js/" }, { From 7369e6da62a794a0a8cadaef14661fa23cb83a4d Mon Sep 17 00:00:00 2001 From: jacoblee93 Date: Wed, 15 Jan 2025 16:17:32 -0800 Subject: [PATCH 10/13] Add to dropdown --- docusaurus.config.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docusaurus.config.js b/docusaurus.config.js index 1a3cff6c..6acb59c3 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -150,6 +150,10 @@ const config = { label: "Python", to: "https://docs.smith.langchain.com/reference/python", }, + { + label: "JS/TS", + to: "https://docs.smith.langchain.com/reference/js/", + }, ], }, ], From 66711d8d550281c1a437380d30161c2f68c0e825 Mon Sep 17 00:00:00 2001 From: jacoblee93 Date: Wed, 15 Jan 2025 16:40:42 -0800 Subject: [PATCH 11/13] Update reference links, fix --- Makefile | 3 +-- docs/evaluation/concepts/index.mdx | 4 ++-- docs/reference/index.md | 1 + docusaurus.config.js | 2 +- vercel.json | 8 -------- 5 files changed, 5 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 5b4314fb..5a5d92b0 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ build-api-ref: $(PYTHON) langsmith-sdk/python/docs/create_api_rst.py LC_ALL=C $(PYTHON) -m sphinx -T -E -b html -d langsmith-sdk/python/docs/_build/doctrees -c langsmith-sdk/python/docs langsmith-sdk/python/docs langsmith-sdk/python/docs/_build/html -j auto $(PYTHON) langsmith-sdk/python/docs/scripts/custom_formatter.py langsmith-sdk/docs/_build/html/ - cd langsmith-sdk/js && yarn && yarn run build:typedoc + cd langsmith-sdk/js && yarn && yarn run build:typedoc --useHostedBaseUrlForAbsoluteLinks true https://${VERCEL_URL:-docs.smith.langchain.com}/reference/js/ vercel-build: install-vercel-deps build-api-ref mkdir -p static/reference/python @@ -23,4 +23,3 @@ vercel-build: install-vercel-deps build-api-ref mv langsmith-sdk/js/_build/api_refs/* static/reference/js/ rm -rf langsmith-sdk NODE_OPTIONS="--max-old-space-size=5000" yarn run docusaurus build - diff --git a/docs/evaluation/concepts/index.mdx b/docs/evaluation/concepts/index.mdx index 36000d7a..d04eef4f 100644 --- a/docs/evaluation/concepts/index.mdx +++ b/docs/evaluation/concepts/index.mdx @@ -101,7 +101,7 @@ There are a number of ways to define and run evaluators: - **Custom code**: Define [custom evaluators](/evaluation/how_to_guides/custom_evaluator) as Python or TypeScript functions and run them client-side using the SDKs or server-side via the UI. - **Built-in evaluators**: LangSmith has a number of built-in evaluators that you can configure and run via the UI. -You can run evaluators using the LangSmith SDK ([Python](https://docs.smith.langchain.com/reference/python) and TypeScript), via the [Prompt Playground](../../prompt_engineering/concepts#prompt-playground), or by configuring [Rules](../../observability/how_to_guides/monitoring/rules) to automatically run them on particular tracing projects or datasets. +You can run evaluators using the LangSmith SDK ([Python](https://docs.smith.langchain.com/reference/python) and [TypeScript](https://docs.smith.langchain.com/reference/js)), via the [Prompt Playground](../../prompt_engineering/concepts#prompt-playground), or by configuring [Rules](../../observability/how_to_guides/monitoring/rules) to automatically run them on particular tracing projects or datasets. #### Evaluation techniques @@ -165,7 +165,7 @@ It is offline because we're evaluating on a pre-compiled set of data. An online evaluation, on the other hand, is one in which we evaluate a deployed application's outputs on real traffic, in near realtime. Offline evaluations are used for testing a version(s) of your application pre-deployment. -You can run offline evaluations client-side using the LangSmith SDK ([Python](https://docs.smith.langchain.com/reference/python) and TypeScript). You can run them server-side via the [Prompt Playground](../../prompt_engineering/concepts#prompt-playground) or by configuring [automations](/observability/how_to_guides/monitoring/rules) to run certain evaluators on every new experiment against a specific dataset. +You can run offline evaluations client-side using the LangSmith SDK ([Python](https://docs.smith.langchain.com/reference/python) and [TypeScript](https://docs.smith.langchain.com/reference/js)). You can run them server-side via the [Prompt Playground](../../prompt_engineering/concepts#prompt-playground) or by configuring [automations](/observability/how_to_guides/monitoring/rules) to run certain evaluators on every new experiment against a specific dataset. ![Offline](./static/offline.png) diff --git a/docs/reference/index.md b/docs/reference/index.md index 6f4e073c..21e62da6 100644 --- a/docs/reference/index.md +++ b/docs/reference/index.md @@ -15,6 +15,7 @@ Technical reference that covers components, APIs, and other aspects of LangSmith ### SDK - [Python SDK Reference](https://docs.smith.langchain.com/reference/python) +- [JS/TS SDK Reference](https://docs.smith.langchain.com/reference/js) - [LangChain off-the-shelf evaluators (Python only)](./reference/sdk_reference/langchain_evaluators) ### Common data types diff --git a/docusaurus.config.js b/docusaurus.config.js index 6acb59c3..51d542ae 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -152,7 +152,7 @@ const config = { }, { label: "JS/TS", - to: "https://docs.smith.langchain.com/reference/js/", + to: "https://docs.smith.langchain.com/reference/js", }, ], }, diff --git a/vercel.json b/vercel.json index 357c49cc..6c299c4a 100644 --- a/vercel.json +++ b/vercel.json @@ -206,14 +206,6 @@ "source": "/reference/python(/?)", "destination": "/reference/python/reference" }, - { - "source": "/reference/js/:path*([^/]$)", - "destination": "/reference/js/:path*/" - }, - { - "source": "/reference/js([^/]$)", - "destination": "/reference/js/" - }, { "source": "/reference/sdk_reference(/?)", "destination": "/reference/" From 256d2f98ff38aa4a4b40546dc7cfb28534f52d01 Mon Sep 17 00:00:00 2001 From: jacoblee93 Date: Wed, 15 Jan 2025 16:44:27 -0800 Subject: [PATCH 12/13] Fix --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 5a5d92b0..32ed1e61 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ build-api-ref: $(PYTHON) langsmith-sdk/python/docs/create_api_rst.py LC_ALL=C $(PYTHON) -m sphinx -T -E -b html -d langsmith-sdk/python/docs/_build/doctrees -c langsmith-sdk/python/docs langsmith-sdk/python/docs langsmith-sdk/python/docs/_build/html -j auto $(PYTHON) langsmith-sdk/python/docs/scripts/custom_formatter.py langsmith-sdk/docs/_build/html/ - cd langsmith-sdk/js && yarn && yarn run build:typedoc --useHostedBaseUrlForAbsoluteLinks true https://${VERCEL_URL:-docs.smith.langchain.com}/reference/js/ + cd langsmith-sdk/js && yarn && yarn run build:typedoc --useHostedBaseUrlForAbsoluteLinks true --hostedBaseUrl https://${VERCEL_URL:-docs.smith.langchain.com}/reference/js/ vercel-build: install-vercel-deps build-api-ref mkdir -p static/reference/python From 9c26cbf0fe4c5d2f6423cd75b3a08b9434fb2bf1 Mon Sep 17 00:00:00 2001 From: jacoblee93 Date: Wed, 15 Jan 2025 16:48:21 -0800 Subject: [PATCH 13/13] Fix --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 32ed1e61..b7ddf381 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ build-api-ref: $(PYTHON) langsmith-sdk/python/docs/create_api_rst.py LC_ALL=C $(PYTHON) -m sphinx -T -E -b html -d langsmith-sdk/python/docs/_build/doctrees -c langsmith-sdk/python/docs langsmith-sdk/python/docs langsmith-sdk/python/docs/_build/html -j auto $(PYTHON) langsmith-sdk/python/docs/scripts/custom_formatter.py langsmith-sdk/docs/_build/html/ - cd langsmith-sdk/js && yarn && yarn run build:typedoc --useHostedBaseUrlForAbsoluteLinks true --hostedBaseUrl https://${VERCEL_URL:-docs.smith.langchain.com}/reference/js/ + cd langsmith-sdk/js && yarn && yarn run build:typedoc --useHostedBaseUrlForAbsoluteLinks true --hostedBaseUrl "https://$${VERCEL_URL:-docs.smith.langchain.com}/reference/js/" vercel-build: install-vercel-deps build-api-ref mkdir -p static/reference/python