mirror of
https://github.com/langchain-ai/docs.git
synced 2026-07-18 16:04:43 -04:00
delete reference/ (#3109)
delete folder relocate `packages.yml` and update corresponding scripts
This commit is contained in:
@@ -102,7 +102,7 @@ jobs:
|
||||
echo "This file is auto-generated by pipeline/tools/partner_pkg_table.py"
|
||||
echo "Please do not manually edit this file. If you need to make changes:"
|
||||
echo "1. Update the generation script at pipeline/tools/partner_pkg_table.py"
|
||||
echo "2. Or update the package metadata in reference/packages.yml"
|
||||
echo "2. Or update the package metadata in packages.yml"
|
||||
echo "3. Then run: uv run python pipeline/tools/partner_pkg_table.py"
|
||||
exit 1
|
||||
else
|
||||
|
||||
@@ -43,7 +43,7 @@ jobs:
|
||||
with:
|
||||
name: packages-yml
|
||||
path: |
|
||||
reference/packages.yml
|
||||
packages.yml
|
||||
src/oss/python/integrations/providers/overview.mdx
|
||||
retention-days: 1
|
||||
|
||||
@@ -71,7 +71,7 @@ jobs:
|
||||
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
||||
|
||||
# Check if there are changes
|
||||
if git diff --quiet reference/packages.yml src/oss/python/integrations/providers/overview.mdx; then
|
||||
if git diff --quiet packages.yml src/oss/python/integrations/providers/overview.mdx; then
|
||||
echo "No changes to commit"
|
||||
exit 0
|
||||
fi
|
||||
@@ -81,7 +81,7 @@ jobs:
|
||||
git checkout -b "$BRANCH_NAME"
|
||||
|
||||
# Commit changes
|
||||
git add reference/packages.yml src/oss/python/integrations/providers/overview.mdx
|
||||
git add packages.yml src/oss/python/integrations/providers/overview.mdx
|
||||
git commit -m "$(cat <<'EOF'
|
||||
chore: update package download counts
|
||||
|
||||
@@ -103,7 +103,7 @@ jobs:
|
||||
Automated update of package download statistics from pepy.tech
|
||||
|
||||
## Details
|
||||
- Updates download counts in `reference/packages.yml`
|
||||
- Updates download counts in `packages.yml`
|
||||
- Regenerates provider overview page at `src/oss/python/integrations/providers/overview.mdx`
|
||||
- Generated by GitHub Actions workflow `update-package-downloads.yml`
|
||||
- Scheduled to run every Sunday at 11:59 PM UTC
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.PHONY: all dev build format lint test install clean lint_md lint_md_fix lint_prose broken-links broken-links-with-anchors build-references preview-references format-check code-snippets test-code-samples
|
||||
.PHONY: all dev build format lint test install clean lint_md lint_md_fix lint_prose broken-links broken-links-with-anchors format-check code-snippets test-code-samples
|
||||
|
||||
# Default target
|
||||
all: help
|
||||
@@ -135,9 +135,6 @@ check-openapi: build
|
||||
@command -v mint >/dev/null 2>&1 || { echo "Error: mint is not installed. Run 'npm install -g mint@4.2.406'"; exit 1; }
|
||||
@cd build && output=$$(mint openapi-check langsmith/agent-server-openapi.json) && echo "$$output"
|
||||
|
||||
check-pnpm:
|
||||
@command -v pnpm >/dev/null 2>&1 || { echo >&2 "pnpm is not installed. Please install pnpm to proceed (https://pnpm.io/installation)"; exit 1; }
|
||||
|
||||
# Extract code snippets from src/code-samples using Bluehawk
|
||||
code-snippets:
|
||||
@echo "Extracting code snippets with Bluehawk..."
|
||||
@@ -152,23 +149,12 @@ test-code-samples:
|
||||
@if [ -f src/code-samples/package.json ]; then (cd src/code-samples && npm install --silent) || true; fi
|
||||
@FILES="$(FILES)" PYTHONPATH=$(CURDIR) python scripts/test_code_samples.py
|
||||
|
||||
# Reference docs commands (in reference/ subdirectory)
|
||||
build-references: check-pnpm
|
||||
@echo "Building references..."
|
||||
cd reference && pnpm i && pnpm build
|
||||
|
||||
preview-references: check-pnpm
|
||||
@echo "Previewing references..."
|
||||
cd reference && pnpm i && pnpm run preview
|
||||
|
||||
help:
|
||||
@echo "Available commands:"
|
||||
@echo " make dev - Start development mode with file watching and mint dev"
|
||||
@echo " make build - Build documentation to ./build directory"
|
||||
@echo " make broken-links - Check for broken links in built documentation"
|
||||
@echo " make broken-links-with-anchors - Same as above, also validates anchor links"
|
||||
@echo " make build-references - Build reference docs"
|
||||
@echo " make preview-references - Preview reference docs"
|
||||
@echo " make format - Format code"
|
||||
@echo " make lint - Lint code"
|
||||
@echo " make lint_md - Lint markdown files"
|
||||
|
||||
@@ -35,7 +35,7 @@ MIN_DOWNLOADS = 100_000
|
||||
DOCS_DIR = Path(__file__).parents[2]
|
||||
PROVIDERS_PATH = Path() / "src" / "oss" / "python" / "integrations" / "providers"
|
||||
REFERENCE_INTEGRATIONS_PATH = Path() / "reference" / "python" / "docs" / "integrations"
|
||||
PACKAGE_YML = Path() / "reference" / "packages.yml"
|
||||
PACKAGE_YML = Path() / "packages.yml"
|
||||
|
||||
# Load package registry
|
||||
with PACKAGE_YML.open() as f:
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
.vercel
|
||||
.cache
|
||||
@@ -1,33 +0,0 @@
|
||||
# LangChain Reference Docs
|
||||
|
||||
Reference documentation is not consolidated into our primary Mintlify website ([`docs.langchain.com`](https://docs.langchain.com)) due to limitations in the Mintlify platform. Instead, we deploy static documentation sites for our Python and JavaScript/TypeScript references.
|
||||
|
||||
Currently, a Vercel project serves the built HTML from the `dist/language` directories at [`reference.langchain.com/python`](https://reference.langchain.com/python) and [`reference.langchain.com/javascript`](https://reference.langchain.com/javascript).
|
||||
|
||||
See the [`reference/python/README.md`](./python/README.md) and [`reference/javascript/README.md`](./javascript/README.md) files for more information on how each are built and deployed.
|
||||
|
||||
## v0.3 Python HTML Reference Docs
|
||||
|
||||
The v0.3 Python HTML reference docs are served at `/v0.3/python` and are maintained as a git submodule pointing to the [`langchain-api-docs-html`](https://github.com/langchain-ai/langchain-api-docs-html) repository.
|
||||
|
||||
### Setup
|
||||
|
||||
On first clone or when the submodule is added, initialize it:
|
||||
|
||||
```bash
|
||||
git submodule update --init --recursive
|
||||
```
|
||||
|
||||
### Updating v0.3 Python HTML Reference Docs
|
||||
|
||||
```bash
|
||||
cd reference/external/html-docs
|
||||
git pull origin main
|
||||
cd ../..
|
||||
git add external/html-docs
|
||||
git commit -m "Update v0.3 Python HTML reference docs"
|
||||
```
|
||||
|
||||
### Build Process
|
||||
|
||||
The build script (`pnpm build:html-v03`) copies files from `external/html-docs/api_reference_build/html/` to `dist/v0.3/python/` during deployment.
|
||||
Vendored
-1
Submodule reference/external/html-docs deleted from cbbf216c1b
@@ -1,14 +0,0 @@
|
||||
*
|
||||
node_modules
|
||||
!plugins
|
||||
!plugins/**
|
||||
!.gitignore
|
||||
!.prettierrc
|
||||
!.prettierignore
|
||||
!eslint.config.mjs
|
||||
!build.ts
|
||||
!Makefile
|
||||
!package.json
|
||||
!pnpm-lock.yaml
|
||||
!tsconfig.json
|
||||
!README.md
|
||||
@@ -1,6 +0,0 @@
|
||||
node_modules
|
||||
public
|
||||
remotes
|
||||
dist
|
||||
pnpm-lock.yaml
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/prettierrc",
|
||||
"printWidth": 80,
|
||||
"tabWidth": 2,
|
||||
"useTabs": false,
|
||||
"semi": true,
|
||||
"singleQuote": false,
|
||||
"quoteProps": "as-needed",
|
||||
"jsxSingleQuote": false,
|
||||
"trailingComma": "es5",
|
||||
"bracketSpacing": true,
|
||||
"arrowParens": "always",
|
||||
"requirePragma": false,
|
||||
"insertPragma": false,
|
||||
"proseWrap": "preserve",
|
||||
"htmlWhitespaceSensitivity": "css",
|
||||
"vueIndentScriptAndStyle": false,
|
||||
"endOfLine": "lf"
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
# LangChain TypeScript Reference Documentation
|
||||
|
||||
This directory contains the source code and build process for the TypeScript reference documentation site, hosted at [`reference.langchain.com/javascript`](https://reference.langchain.com/javascript). This site serves references for LangChain, LangGraph, LangSmith, and LangChain integration packages (such as [`@langchain/anthropic`](https://npm.com/package/@langchain/anthropic), [`@langchain/openai`](https://npm.com/package/@langchain/openai), etc.).
|
||||
@@ -1,600 +0,0 @@
|
||||
import { execSync } from "child_process";
|
||||
import { installDependencies } from "nypm";
|
||||
import { type TypeDocOptions, Application } from "typedoc";
|
||||
import fs from "fs";
|
||||
import path from "path";
|
||||
|
||||
/**
|
||||
* A reference to a remote repository
|
||||
*/
|
||||
type Remote = {
|
||||
/**
|
||||
* The GitHub repository in the format "owner/repo".
|
||||
*/
|
||||
repo: string;
|
||||
/**
|
||||
* The branch to use from the repository. Defaults to "main" if not specified.
|
||||
*/
|
||||
branch?: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* A reference to a package in a remote repository that should be included in reference docs.
|
||||
*/
|
||||
type Package = Remote & {
|
||||
/**
|
||||
* The name of the package (as published to npm).
|
||||
*/
|
||||
package: string;
|
||||
/**
|
||||
* The relative path to the package within the repository.
|
||||
*/
|
||||
path: string;
|
||||
/**
|
||||
* Whether to run package installation for this package.
|
||||
* If true, dependencies will be installed from the package directory
|
||||
* instead of the remote's root directory
|
||||
*/
|
||||
packageInstall?: boolean;
|
||||
};
|
||||
|
||||
type PackageGroup = {
|
||||
group: string;
|
||||
items: Package[];
|
||||
};
|
||||
|
||||
type Source = PackageGroup | Package;
|
||||
|
||||
const DIST_DIR = path.resolve(__dirname, "..", "dist", "javascript");
|
||||
|
||||
const SOURCES: Source[] = [
|
||||
{
|
||||
package: "langchain",
|
||||
path: "libs/langchain",
|
||||
repo: "langchain-ai/langchainjs",
|
||||
branch: "main",
|
||||
},
|
||||
{
|
||||
package: "@langchain/core",
|
||||
path: "libs/langchain-core",
|
||||
repo: "langchain-ai/langchainjs",
|
||||
branch: "main",
|
||||
},
|
||||
{
|
||||
package: "@langchain/textsplitters",
|
||||
path: "libs/langchain-textsplitters",
|
||||
repo: "langchain-ai/langchainjs",
|
||||
branch: "main",
|
||||
},
|
||||
{
|
||||
package: "@langchain/classic",
|
||||
path: "libs/langchain-classic",
|
||||
repo: "langchain-ai/langchainjs",
|
||||
branch: "main",
|
||||
},
|
||||
{
|
||||
group: "Integrations",
|
||||
items: [
|
||||
{
|
||||
package: "@langchain/community",
|
||||
path: "libs/langchain-community",
|
||||
repo: "langchain-ai/langchainjs",
|
||||
branch: "main",
|
||||
},
|
||||
{
|
||||
package: "@langchain/anthropic",
|
||||
path: "libs/providers/langchain-anthropic",
|
||||
repo: "langchain-ai/langchainjs",
|
||||
branch: "main",
|
||||
},
|
||||
{
|
||||
package: "@langchain/aws",
|
||||
path: "libs/providers/langchain-aws",
|
||||
repo: "langchain-ai/langchainjs",
|
||||
branch: "main",
|
||||
},
|
||||
{
|
||||
package: "@langchain/deepseek",
|
||||
path: "libs/providers/langchain-deepseek",
|
||||
repo: "langchain-ai/langchainjs",
|
||||
branch: "main",
|
||||
},
|
||||
{
|
||||
package: "@langchain/google-genai",
|
||||
path: "libs/providers/langchain-google-genai",
|
||||
repo: "langchain-ai/langchainjs",
|
||||
branch: "main",
|
||||
},
|
||||
{
|
||||
package: "@langchain/google-vertexai-web",
|
||||
path: "libs/providers/langchain-google-vertexai-web",
|
||||
repo: "langchain-ai/langchainjs",
|
||||
branch: "main",
|
||||
},
|
||||
{
|
||||
package: "@langchain/google-vertexai",
|
||||
path: "libs/providers/langchain-google-vertexai",
|
||||
repo: "langchain-ai/langchainjs",
|
||||
branch: "main",
|
||||
},
|
||||
{
|
||||
package: "@langchain/groq",
|
||||
path: "libs/providers/langchain-groq",
|
||||
repo: "langchain-ai/langchainjs",
|
||||
branch: "main",
|
||||
},
|
||||
{
|
||||
package: "@langchain/mistralai",
|
||||
path: "libs/providers/langchain-mistralai",
|
||||
repo: "langchain-ai/langchainjs",
|
||||
branch: "main",
|
||||
},
|
||||
{
|
||||
package: "@langchain/ollama",
|
||||
path: "libs/providers/langchain-ollama",
|
||||
repo: "langchain-ai/langchainjs",
|
||||
branch: "main",
|
||||
},
|
||||
{
|
||||
package: "@langchain/openai",
|
||||
path: "libs/providers/langchain-openai",
|
||||
repo: "langchain-ai/langchainjs",
|
||||
branch: "main",
|
||||
},
|
||||
{
|
||||
package: "@langchain/xai",
|
||||
path: "libs/providers/langchain-xai",
|
||||
repo: "langchain-ai/langchainjs",
|
||||
branch: "main",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
group: "LangGraph",
|
||||
items: [
|
||||
{
|
||||
package: "@langchain/langgraph-checkpoint-mongodb",
|
||||
path: "libs/checkpoint-mongodb",
|
||||
repo: "langchain-ai/langgraphjs",
|
||||
branch: "main",
|
||||
},
|
||||
{
|
||||
package: "@langchain/langgraph-checkpoint-postgres",
|
||||
path: "libs/checkpoint-postgres",
|
||||
repo: "langchain-ai/langgraphjs",
|
||||
branch: "main",
|
||||
},
|
||||
{
|
||||
package: "@langchain/langgraph-checkpoint-redis",
|
||||
path: "libs/checkpoint-redis",
|
||||
repo: "langchain-ai/langgraphjs",
|
||||
branch: "main",
|
||||
},
|
||||
{
|
||||
package: "@langchain/langgraph-checkpoint-sqlite",
|
||||
path: "libs/checkpoint-sqlite",
|
||||
repo: "langchain-ai/langgraphjs",
|
||||
branch: "main",
|
||||
},
|
||||
{
|
||||
package: "@langchain/langgraph-checkpoint",
|
||||
path: "libs/checkpoint",
|
||||
repo: "langchain-ai/langgraphjs",
|
||||
branch: "main",
|
||||
},
|
||||
{
|
||||
package: "@langchain/langgraph-api",
|
||||
path: "libs/langgraph-api",
|
||||
repo: "langchain-ai/langgraphjs",
|
||||
branch: "main",
|
||||
},
|
||||
{
|
||||
package: "@langchain/langgraph-cli",
|
||||
path: "libs/langgraph-cli",
|
||||
repo: "langchain-ai/langgraphjs",
|
||||
branch: "main",
|
||||
},
|
||||
{
|
||||
package: "@langchain/langgraph-cua",
|
||||
path: "libs/langgraph-cua",
|
||||
repo: "langchain-ai/langgraphjs",
|
||||
branch: "main",
|
||||
},
|
||||
{
|
||||
package: "@langchain/langgraph-supervisor",
|
||||
path: "libs/langgraph-supervisor",
|
||||
repo: "langchain-ai/langgraphjs",
|
||||
branch: "main",
|
||||
},
|
||||
{
|
||||
package: "@langchain/langgraph-swarm",
|
||||
path: "libs/langgraph-swarm",
|
||||
repo: "langchain-ai/langgraphjs",
|
||||
branch: "main",
|
||||
},
|
||||
{
|
||||
package: "@langchain/langgraph-ui",
|
||||
path: "libs/langgraph-ui",
|
||||
repo: "langchain-ai/langgraphjs",
|
||||
branch: "main",
|
||||
},
|
||||
{
|
||||
package: "@langchain/langgraph",
|
||||
path: "libs/langgraph-core",
|
||||
repo: "langchain-ai/langgraphjs",
|
||||
branch: "main",
|
||||
},
|
||||
{
|
||||
package: "@langchain/langgraph-sdk",
|
||||
path: "libs/sdk",
|
||||
repo: "langchain-ai/langgraphjs",
|
||||
branch: "main",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
group: "LangSmith",
|
||||
items: [
|
||||
{
|
||||
package: "langsmith",
|
||||
path: "js",
|
||||
repo: "langchain-ai/langsmith-sdk",
|
||||
branch: "main",
|
||||
packageInstall: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
package: "deepagents",
|
||||
path: "libs/deepagents",
|
||||
repo: "langchain-ai/deepagentsjs",
|
||||
branch: "main",
|
||||
}
|
||||
];
|
||||
|
||||
const ROOT_TYPEDOC_CONFIG: TypeDocOptions = {
|
||||
out: "public",
|
||||
sort: [
|
||||
"kind",
|
||||
"visibility",
|
||||
"instance-first",
|
||||
"required-first",
|
||||
"alphabetical",
|
||||
],
|
||||
plugin: ["typedoc-plugin-expand-object-like-types", path.join(__dirname, "plugins/gtm")],
|
||||
gtmId: "GTM-MBBX68ST",
|
||||
logLevel: "Error",
|
||||
name: "langchain.js",
|
||||
hostedBaseUrl: "https://reference.langchain.com/javascript",
|
||||
useHostedBaseUrlForAbsoluteLinks: false,
|
||||
readme: "none",
|
||||
entryPointStrategy: "packages",
|
||||
includeVersion: true,
|
||||
};
|
||||
|
||||
const PACKAGE_TYPEDOC_CONFIG: TypeDocOptions = {
|
||||
excludePrivate: true,
|
||||
excludeInternal: true,
|
||||
excludeExternals: true,
|
||||
excludeNotDocumented: false,
|
||||
includeVersion: true,
|
||||
categorizeByGroup: true,
|
||||
skipErrorChecking: true,
|
||||
};
|
||||
|
||||
const iife = <T>(fn: () => T) => fn();
|
||||
|
||||
const exec = (args: string[]) =>
|
||||
execSync(args.join(" "), { encoding: "utf-8", stdio: "inherit" });
|
||||
|
||||
/**
|
||||
* Reads a JSON file, applies a transformation function to its contents, and writes the result back to the file.
|
||||
*
|
||||
* @param {string} relativePath - The path to the JSON file, relative to the current working directory.
|
||||
* @param {(json: any) => any} fn - A function that takes the parsed JSON object and returns the modified object.
|
||||
*/
|
||||
const updateJsonFile = (relativePath: string, fn: (json: any) => any) => {
|
||||
const contents = fs.readFileSync(relativePath).toString();
|
||||
const res = fn(JSON.parse(contents));
|
||||
fs.writeFileSync(relativePath, JSON.stringify(res, null, 2) + "\n");
|
||||
};
|
||||
|
||||
/**
|
||||
* Constructs the target filesystem path for a given remote repository and branch.
|
||||
*
|
||||
* @param {Remote} remote - The remote repository object containing the repo name and optional branch.
|
||||
* @returns {string} The absolute path to the target directory for the specified remote and branch.
|
||||
*/
|
||||
const remotePath = (remote: Remote) =>
|
||||
path.join(__dirname, "remotes", remote.repo, remote.branch ?? "main");
|
||||
|
||||
/**
|
||||
* Constructs the absolute filesystem path for a given package.
|
||||
*
|
||||
* @param {Package} pkg - The package object containing the path and remote information.
|
||||
* @returns {string} The absolute path to the package directory.
|
||||
*/
|
||||
const packagePath = (pkg: Package) => path.join(remotePath(pkg), pkg.path);
|
||||
|
||||
/**
|
||||
* Recursively iterates over a list of sources, yielding each individual package.
|
||||
*
|
||||
* If a source is a group (i.e., has a "group" property), this function will recursively
|
||||
* iterate over its items. Otherwise, it yields the source as a package.
|
||||
*
|
||||
* @param {Source[]} sources - The array of sources to iterate over. Each source can be either a group or a package.
|
||||
* @yields {Package} Each package found in the sources, including those nested within groups.
|
||||
*/
|
||||
function* iteratePackages(sources: Source[]): Iterable<Package> {
|
||||
for (const source of sources) {
|
||||
if ("group" in source) {
|
||||
yield* iteratePackages(source.items);
|
||||
} else {
|
||||
yield source;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reduces all packages found in the given sources into a single accumulated value.
|
||||
*
|
||||
* This function flattens all packages (recursively, if sources contain groups) and applies
|
||||
* the provided reducer function to accumulate a result.
|
||||
*
|
||||
* @template T The type of the accumulated value.
|
||||
* @param {Source[]} sources - The array of sources to process. Each source can be a group or a package.
|
||||
* @param {(acc: T, pkg: Package) => T} fn - The reducer function, called with the accumulator and each package.
|
||||
* @param {T} initial - The initial value for the accumulator.
|
||||
* @returns {T} The final accumulated value after processing all packages.
|
||||
*/
|
||||
function reducePackages<T>(
|
||||
sources: Source[],
|
||||
fn: (acc: T, pkg: Package) => T,
|
||||
initial: T
|
||||
): T {
|
||||
return Array.from(iteratePackages(sources)).reduce(fn, initial);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches the latest commit SHA for a given remote GitHub repository and branch.
|
||||
*
|
||||
* Includes retry logic with exponential backoff to handle transient network errors.
|
||||
*
|
||||
* @param {Remote} remote - The remote repository object containing:
|
||||
* - repo: The GitHub repository in the format "owner/repo".
|
||||
* - branch (optional): The branch to fetch the latest commit SHA from. Defaults to "main" if not specified.
|
||||
* @returns {Promise<string>} The SHA of the latest commit on the specified branch.
|
||||
* @throws {Error} If all retry attempts fail.
|
||||
*/
|
||||
async function getLatestRemoteSha(remote: Remote): Promise<string> {
|
||||
const branch = remote.branch ?? "main";
|
||||
const apiUrl = `https://api.github.com/repos/${remote.repo}/commits/${branch}`;
|
||||
// These headers aren't explicitly required by GitHub, but we include them
|
||||
// if they are present to avoid rate limiting.
|
||||
const headers: Record<string, string> = process.env.GITHUB_TOKEN
|
||||
? {
|
||||
Authorization: `Bearer ${process.env.GITHUB_TOKEN}`,
|
||||
"X-GitHub-Api-Version": "2022-11-28",
|
||||
}
|
||||
: {};
|
||||
|
||||
const maxRetries = 3;
|
||||
let lastError: Error | null = null;
|
||||
|
||||
for (let attempt = 0; attempt < maxRetries; attempt++) {
|
||||
try {
|
||||
const res = await fetch(apiUrl, { headers });
|
||||
const data = await res.json();
|
||||
return data.sha;
|
||||
} catch (error) {
|
||||
lastError = error as Error;
|
||||
if (attempt < maxRetries - 1) {
|
||||
const delay = Math.pow(2, attempt) * 1000; // 1s, 2s, 4s
|
||||
console.error(
|
||||
`GitHub API fetch failed (attempt ${attempt + 1}/${maxRetries}), retrying in ${delay}ms...`
|
||||
);
|
||||
await new Promise((resolve) => setTimeout(resolve, delay));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
throw lastError;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the locally cached commit SHA for the specified remote branch.
|
||||
*
|
||||
* Reads the SHA stored in a `.sha` file inside the `remotePath(remote)` directory.
|
||||
* If the cache file does not exist, returns an empty string.
|
||||
*
|
||||
* @param {Remote} remote - The remote repository reference.
|
||||
* @returns {Promise<string>} The cached SHA string, or an empty string if not present.
|
||||
*/
|
||||
async function getLocalRemoteSha(remote: Remote) {
|
||||
const shaFile = path.join(remotePath(remote), ".sha");
|
||||
if (fs.existsSync(shaFile)) {
|
||||
try {
|
||||
const res = fs.readFileSync(shaFile, "utf-8");
|
||||
return res.toString().trim();
|
||||
} catch {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensures that the local copy of a remote GitHub repository branch is up to date.
|
||||
*
|
||||
* - Compares the latest remote commit SHA with a locally cached SHA (stored in `.sha`).
|
||||
* - If up to date, no action is taken. Otherwise, downloads and extracts the branch tarball.
|
||||
* - If GitHub is unreachable, falls back to using the cached local copy if available.
|
||||
*
|
||||
* @param {Remote} remote - The remote repository reference.
|
||||
* @returns {Promise<void>} Resolves when the local copy is ensured to be up to date.
|
||||
*/
|
||||
async function ensureLatestRemote(remote: Remote) {
|
||||
let latestSha: string;
|
||||
try {
|
||||
latestSha = await getLatestRemoteSha(remote);
|
||||
} catch (error) {
|
||||
const localSha = await getLocalRemoteSha(remote);
|
||||
if (fs.existsSync(remotePath(remote)) && localSha) {
|
||||
console.error(
|
||||
`Warning: Could not fetch latest SHA for ${remote.repo}, using cached version (${localSha.slice(0, 7)})`
|
||||
);
|
||||
return;
|
||||
}
|
||||
throw new Error(
|
||||
`Failed to fetch ${remote.repo} from GitHub and no local cache exists: ${error}`
|
||||
);
|
||||
}
|
||||
|
||||
const localSha = await getLocalRemoteSha(remote);
|
||||
if (fs.existsSync(remotePath(remote)) && latestSha === localSha) return;
|
||||
pullRemote(remote, latestSha);
|
||||
}
|
||||
|
||||
/**
|
||||
* Downloads a GitHub branch tarball and extracts it to the target directory.
|
||||
*
|
||||
* @param {Remote} remote - The remote repository reference.
|
||||
* @param {string} latestSha - The latest commit SHA for the target branch to cache locally.
|
||||
*
|
||||
* The tarball at `https://github.com/<repo>/archive/refs/heads/<branch>.tar.gz` is
|
||||
* streamed to `tar` with `--strip-components=1` so the contents are extracted directly
|
||||
* into the directory returned by `remotePath(remote)`.
|
||||
*/
|
||||
function pullRemote(remote: Remote, latestSha: string) {
|
||||
const branch = remote.branch ?? "main";
|
||||
const target = remotePath(remote);
|
||||
const url = `https://github.com/${remote.repo}/archive/refs/heads/${branch}.tar.gz`;
|
||||
console.info(`Fetching remote tarball ${remote.repo}/${branch}`);
|
||||
if (fs.existsSync(target)) {
|
||||
fs.rmSync(target, { recursive: true, force: true });
|
||||
}
|
||||
exec(["mkdir -p", target]);
|
||||
exec([`curl -L -s`, url, `| tar -xz --strip-components=1 -C`, target]);
|
||||
const shaFile = path.join(target, ".sha");
|
||||
fs.writeFileSync(shaFile, `${latestSha}\n`);
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensures that the TypeDoc configuration file (`typedoc.json`) exists and is properly configured
|
||||
* for the given package. This function reads the package's `package.json` to determine its entry points
|
||||
* (based on the "exports" field), and then writes or updates the `typedoc.json` file in the package's
|
||||
* directory to include these entry points and extend from the root TypeDoc config.
|
||||
*
|
||||
* - If `typedoc.json` does not exist, it will be created as an empty object before updating.
|
||||
* - The "entryPoints" field in the config will be set to the entry points found in the package's exports.
|
||||
* - The "extends" field will be set to reference the root TypeDoc config.
|
||||
*
|
||||
* @param {Package} pkg - The package for which to flush (write/update) the TypeDoc config.
|
||||
*/
|
||||
function ensurePackageTypedocConfig(pkg: Package) {
|
||||
const packageJsonPath = path.join(remotePath(pkg), pkg.path, "package.json");
|
||||
const typedocConfigPath = path.join(
|
||||
remotePath(pkg),
|
||||
pkg.path,
|
||||
"typedoc.json"
|
||||
);
|
||||
|
||||
const packageEntrypoints = iife(() => {
|
||||
const packageJson = require(packageJsonPath);
|
||||
const exports: Record<string, any> =
|
||||
"exports" in packageJson && typeof packageJson.exports === "object"
|
||||
? packageJson.exports
|
||||
: {};
|
||||
return Object.values(exports).reduce<string[]>((acc, value) => {
|
||||
if (
|
||||
typeof value === "object" &&
|
||||
"input" in value &&
|
||||
typeof value.input === "string"
|
||||
) {
|
||||
acc.push(value.input);
|
||||
}
|
||||
return acc;
|
||||
}, []);
|
||||
});
|
||||
|
||||
if (!fs.existsSync(typedocConfigPath)) {
|
||||
fs.writeFileSync(typedocConfigPath, "{}");
|
||||
}
|
||||
updateJsonFile(typedocConfigPath, () => ({
|
||||
...PACKAGE_TYPEDOC_CONFIG,
|
||||
entryPoints: packageEntrypoints,
|
||||
includeVersion: true,
|
||||
}));
|
||||
}
|
||||
|
||||
async function build() {
|
||||
const remotes = reducePackages<Remote[]>(
|
||||
SOURCES,
|
||||
(acc, pkg) => {
|
||||
const existing = acc.find(
|
||||
(r) => r.repo === pkg.repo && r.branch === pkg.branch
|
||||
);
|
||||
if (!existing) acc.push({ repo: pkg.repo, branch: pkg.branch });
|
||||
return acc;
|
||||
},
|
||||
[]
|
||||
);
|
||||
const packages = Array.from(iteratePackages(SOURCES));
|
||||
|
||||
await Promise.all(remotes.map((r) => ensureLatestRemote(r)));
|
||||
|
||||
const installTargets = reducePackages<Array<Package | Remote>>(
|
||||
SOURCES,
|
||||
(acc, pkg) => {
|
||||
if (pkg.packageInstall) acc.push(pkg);
|
||||
else {
|
||||
const existingRemote = acc.find(
|
||||
(r) => r.repo === pkg.repo && r.branch === pkg.branch
|
||||
);
|
||||
if (!existingRemote) acc.push({ repo: pkg.repo, branch: pkg.branch });
|
||||
}
|
||||
return acc;
|
||||
},
|
||||
[]
|
||||
);
|
||||
|
||||
await Promise.all(
|
||||
installTargets.map(async (t) => {
|
||||
console.info(
|
||||
`Installing dependencies for ${t.repo}/${t.branch ?? "main"}`
|
||||
);
|
||||
if ("package" in t) {
|
||||
await installDependencies({ cwd: packagePath(t), silent: true });
|
||||
} else {
|
||||
await installDependencies({ cwd: remotePath(t), silent: true });
|
||||
}
|
||||
})
|
||||
);
|
||||
|
||||
for (const p of packages) {
|
||||
ensurePackageTypedocConfig(p);
|
||||
}
|
||||
|
||||
const entrypoints = packages.map((pkg) =>
|
||||
path.join(remotePath(pkg), pkg.path)
|
||||
);
|
||||
|
||||
console.info(`Generating docs for ${entrypoints.length} entrypoints`);
|
||||
|
||||
const app = await Application.bootstrapWithPlugins({
|
||||
...ROOT_TYPEDOC_CONFIG,
|
||||
entryPoints: entrypoints,
|
||||
});
|
||||
|
||||
const reflection = await app.convert();
|
||||
if (reflection) {
|
||||
console.info(`Writing docs to ${DIST_DIR}`);
|
||||
await app.generateDocs(reflection, DIST_DIR);
|
||||
}
|
||||
|
||||
console.info("Done");
|
||||
}
|
||||
|
||||
if (require.main === module) {
|
||||
build();
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
import { defineConfig } from "eslint/config";
|
||||
import tseslint from "typescript-eslint";
|
||||
import eslintJs from "@eslint/js";
|
||||
|
||||
export default defineConfig([
|
||||
eslintJs.configs.recommended,
|
||||
...tseslint.configs.recommended,
|
||||
{
|
||||
ignores: ["node_modules", "public", "remotes", "dist"],
|
||||
},
|
||||
{
|
||||
languageOptions: {
|
||||
ecmaVersion: "latest",
|
||||
sourceType: "module",
|
||||
},
|
||||
rules: {
|
||||
"@typescript-eslint/no-explicit-any": "off",
|
||||
"@typescript-eslint/no-require-imports": "off",
|
||||
},
|
||||
},
|
||||
]);
|
||||
@@ -1,26 +0,0 @@
|
||||
{
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "tsx build.ts",
|
||||
"lint": "eslint . --ext .ts,.tsx",
|
||||
"lint:fix": "eslint . --ext .ts,.tsx --fix",
|
||||
"format": "prettier . --write",
|
||||
"format:check": "prettier . --check"
|
||||
},
|
||||
"packageManager": "pnpm@10.14.0",
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.13.0",
|
||||
"@types/node": "^24.5.2",
|
||||
"@typescript-eslint/eslint-plugin": "^8.8.1",
|
||||
"@typescript-eslint/parser": "^8.8.1",
|
||||
"eslint": "^9.12.0",
|
||||
"eslint-config-prettier": "^9.1.0",
|
||||
"nypm": "^0.6.2",
|
||||
"prettier": "^3.3.3",
|
||||
"tsx": "^4.20.5",
|
||||
"typedoc": "^0.28.13",
|
||||
"typedoc-github-theme": "^0.3.1",
|
||||
"typedoc-plugin-expand-object-like-types": "^0.1.2",
|
||||
"typescript-eslint": "^8.8.1"
|
||||
}
|
||||
}
|
||||
@@ -1,80 +0,0 @@
|
||||
import { Application, JSX, ParameterType, RendererEvent } from "typedoc";
|
||||
|
||||
/**
|
||||
* TypeDoc plugin that injects Google Tag Manager (GTM) script into generated documentation.
|
||||
*
|
||||
* This plugin adds the GTM container script to the <head> and initializes the data layer
|
||||
* in all generated HTML pages.
|
||||
*
|
||||
* Configuration:
|
||||
* Add to build.ts ROOT_TYPEDOC_CONFIG:
|
||||
* ```typescript
|
||||
* const ROOT_TYPEDOC_CONFIG: TypeDocOptions = {
|
||||
* ...
|
||||
* plugin: ["./plugins/gtm"],
|
||||
* gtmId: "GTM-XXXXXXX",
|
||||
* };
|
||||
* ```
|
||||
*/
|
||||
|
||||
declare module "typedoc" {
|
||||
export interface TypeDocOptionMap {
|
||||
gtmId: string;
|
||||
}
|
||||
}
|
||||
|
||||
export function load(app: Application) {
|
||||
// Register the GTM ID option
|
||||
app.options.addDeclaration({
|
||||
name: "gtmId",
|
||||
help: "Google Tag Manager ID (e.g., GTM-XXXXXXX)",
|
||||
type: ParameterType.String,
|
||||
defaultValue: "",
|
||||
});
|
||||
|
||||
// Hook into the renderer begin event to set up the injection hooks
|
||||
app.renderer.on(RendererEvent.BEGIN, () => {
|
||||
const gtmId = app.options.getValue("gtmId") as string | undefined;
|
||||
|
||||
if (!gtmId) {
|
||||
app.logger.warn(
|
||||
"[GTM Plugin] No GTM ID provided. Set 'gtmId' in your TypeDoc configuration."
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
// Validate GTM ID format
|
||||
if (!gtmId.match(/^GTM-[A-Z0-9]+$/)) {
|
||||
app.logger.error(
|
||||
`[GTM Plugin] Invalid GTM ID format: "${gtmId}". Expected format: GTM-XXXXXXX`
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
app.logger.info(`[GTM Plugin] Injecting GTM ID: ${gtmId}`);
|
||||
|
||||
// Hook to inject GTM script into <head>
|
||||
app.renderer.hooks.on("head.end", () => {
|
||||
const gtmHeadScript = `<!-- Google Tag Manager -->
|
||||
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
|
||||
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
|
||||
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
|
||||
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
|
||||
})(window,document,'script','dataLayer','${gtmId}');</script>
|
||||
<!-- End Google Tag Manager -->`;
|
||||
|
||||
return JSX.createElement(JSX.Raw, { html: gtmHeadScript });
|
||||
});
|
||||
|
||||
// Hook to inject GTM noscript fallback after <body>
|
||||
app.renderer.hooks.on("body.begin", () => {
|
||||
const gtmBodyScript = `<!-- Google Tag Manager (noscript) -->
|
||||
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=${gtmId}"
|
||||
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
|
||||
<!-- End Google Tag Manager (noscript) -->`;
|
||||
|
||||
return JSX.createElement(JSX.Raw, { html: gtmBodyScript });
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Generated
-1577
File diff suppressed because it is too large
Load Diff
@@ -1,114 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
/* Visit https://aka.ms/tsconfig to read more about this file */
|
||||
|
||||
/* Projects */
|
||||
// "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
|
||||
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
|
||||
// "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
|
||||
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
|
||||
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
|
||||
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
|
||||
|
||||
/* Language and Environment */
|
||||
"target": "esnext" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
|
||||
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
|
||||
// "jsx": "preserve", /* Specify what JSX code is generated. */
|
||||
// "libReplacement": true, /* Enable lib replacement. */
|
||||
// "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */
|
||||
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
|
||||
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
|
||||
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
|
||||
// "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
|
||||
// "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
|
||||
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
|
||||
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
|
||||
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
|
||||
|
||||
/* Modules */
|
||||
"module": "nodenext" /* Specify what module code is generated. */,
|
||||
// "rootDir": "./", /* Specify the root folder within your source files. */
|
||||
// "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */
|
||||
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
|
||||
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
|
||||
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
|
||||
// "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
|
||||
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
|
||||
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
||||
// "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
|
||||
// "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */
|
||||
// "rewriteRelativeImportExtensions": true, /* Rewrite '.ts', '.tsx', '.mts', and '.cts' file extensions in relative import paths to their JavaScript equivalent in output files. */
|
||||
// "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */
|
||||
// "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */
|
||||
// "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */
|
||||
// "noUncheckedSideEffectImports": true, /* Check side effect imports. */
|
||||
// "resolveJsonModule": true, /* Enable importing .json files. */
|
||||
// "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */
|
||||
// "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
|
||||
|
||||
/* JavaScript Support */
|
||||
// "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
|
||||
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
|
||||
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
|
||||
|
||||
/* Emit */
|
||||
// "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
|
||||
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
|
||||
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
|
||||
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
|
||||
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
|
||||
// "noEmit": true, /* Disable emitting files from a compilation. */
|
||||
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
|
||||
// "outDir": "./", /* Specify an output folder for all emitted files. */
|
||||
// "removeComments": true, /* Disable emitting comments. */
|
||||
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
|
||||
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
|
||||
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
|
||||
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
|
||||
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
|
||||
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
|
||||
// "newLine": "crlf", /* Set the newline character for emitting files. */
|
||||
// "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
|
||||
// "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
|
||||
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
|
||||
// "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
|
||||
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
|
||||
|
||||
/* Interop Constraints */
|
||||
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
|
||||
// "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */
|
||||
// "isolatedDeclarations": true, /* Require sufficient annotation on exports so other tools can trivially generate declaration files. */
|
||||
// "erasableSyntaxOnly": true, /* Do not allow runtime constructs that are not part of ECMAScript. */
|
||||
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
|
||||
"esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */,
|
||||
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
|
||||
"forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
|
||||
|
||||
/* Type Checking */
|
||||
"strict": true /* Enable all strict type-checking options. */,
|
||||
// "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
|
||||
// "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
|
||||
// "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
|
||||
// "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
|
||||
// "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
|
||||
// "strictBuiltinIteratorReturn": true, /* Built-in iterators are instantiated with a 'TReturn' type of 'undefined' instead of 'any'. */
|
||||
// "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
|
||||
// "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
|
||||
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
|
||||
// "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
|
||||
// "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
|
||||
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
|
||||
// "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
|
||||
// "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
|
||||
// "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
|
||||
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
|
||||
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
|
||||
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
|
||||
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
|
||||
|
||||
/* Completeness */
|
||||
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
|
||||
"skipLibCheck": true /* Skip type checking all .d.ts files. */
|
||||
},
|
||||
"exclude": ["node_modules", "remotes"]
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
{
|
||||
"name": "langchain-reference-docs",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"postinstall": "pnpm -C ./javascript install",
|
||||
"build": "concurrently \"pnpm build:js\" \"pnpm build:py\" \"pnpm build:html-v03\"",
|
||||
"build:js": "pnpm -C ./javascript build",
|
||||
"build:py": "make -C ./python build",
|
||||
"build:html-v03": "mkdir -p dist/v0.3/python && cp -r external/html-docs/api_reference_build/html/* dist/v0.3/python/",
|
||||
"preview": "vercel dev"
|
||||
},
|
||||
"packageManager": "pnpm@10.14.0",
|
||||
"dependencies": {
|
||||
"concurrently": "^9.2.1",
|
||||
"serve": "^14.2.5",
|
||||
"vercel": "^50.23.2"
|
||||
},
|
||||
"pnpm": {
|
||||
"overrides": {
|
||||
"minimatch@<3.1.4": "3.1.4",
|
||||
"minimatch@>=10.0.0 <10.2.3": "10.2.3",
|
||||
"ajv@>=7.0.0-alpha.0 <8.18.0": "8.18.0",
|
||||
"tar@<7.5.8": "7.5.8",
|
||||
"path-to-regexp@>=4.0.0 <6.3.0": "6.3.0",
|
||||
"undici@>=4.5.0 <5.29.0": "5.29.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
-3452
File diff suppressed because it is too large
Load Diff
@@ -1,4 +0,0 @@
|
||||
site/
|
||||
.cache
|
||||
pyproject.prod.toml # Backup file created by switch-config.sh
|
||||
mkdocs.subset.yml
|
||||
@@ -1,27 +0,0 @@
|
||||
# API Reference Documentation
|
||||
|
||||
These are auto-generated API reference files. **Do NOT apply the standard documentation guidelines to these files.**
|
||||
|
||||
## Important
|
||||
|
||||
- Do not modify these files manually - they are generated from source code
|
||||
- Do not apply custom formatting rules from `copilot-instructions.md`
|
||||
- Do not suggest changes to structure, style, or content
|
||||
- Do not add frontmatter or reformat existing content
|
||||
- Do not apply the style guide or content strategy from the main instructions
|
||||
|
||||
## What you CAN do
|
||||
|
||||
- Fix broken links if they point to incorrect URLs
|
||||
- Report issues with the generation process
|
||||
- Suggest improvements to the source code that generates these files
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
- If you encounter errors like "could not collect package XYZ", ensure the mkdocstrings syntax used has underscores for package names (e.g., `langchain_ollama` instead of `langchain-ollama`). This applies to the `.md` files used to generate these references.
|
||||
|
||||
## Icons
|
||||
|
||||
Icons from Material for MkDocs are available for use in documentation with integrated search:
|
||||
|
||||
- [Material for MkDocs Icons Reference](https://squidfunk.github.io/mkdocs-material/reference/icons-emojis/)
|
||||
@@ -1 +0,0 @@
|
||||
AGENTS.md
|
||||
@@ -1,80 +0,0 @@
|
||||
.PHONY: dev-install prod-install config-status build serve-clean-docs serve-docs
|
||||
# .PHONY: build-docs serve-clean-docs serve-docs format-docs lint-docs tests
|
||||
|
||||
# ---------------------------------------
|
||||
# Python reference documentation Makefile
|
||||
# ---------------------------------------
|
||||
|
||||
all: help
|
||||
|
||||
# Install dependencies using local editable packages (for development)
|
||||
dev-install:
|
||||
@./switch-config.sh dev
|
||||
@echo "Installing dependencies..."
|
||||
uv sync
|
||||
|
||||
# Install dependencies using git sources (for production/CI)
|
||||
prod-install:
|
||||
@./switch-config.sh prod
|
||||
@echo "Installing dependencies..."
|
||||
uv sync
|
||||
|
||||
# Show current configuration
|
||||
config-status:
|
||||
@./switch-config.sh status
|
||||
|
||||
# Build files for deployment (uses current venv)
|
||||
build:
|
||||
@echo "Syncing dependencies..."
|
||||
@uv sync
|
||||
@./install-mkdocs.sh
|
||||
@echo "Building documentation..."
|
||||
@uv run --no-sync python -m mkdocs build -c -f mkdocs.yml
|
||||
|
||||
# To preview what the docs will look like when built
|
||||
serve-clean-docs:
|
||||
@./install-mkdocs.sh
|
||||
@port=8000; \
|
||||
while lsof -ti:$$port > /dev/null 2>&1; do \
|
||||
port=$$((port + 1)); \
|
||||
done; \
|
||||
echo "Starting MkDocs server on port $$port..."; \
|
||||
uv run --no-sync python -m mkdocs serve -c -f mkdocs.yml --strict -a 127.0.0.1:$$port
|
||||
|
||||
# For local development; uses --dirty to avoid rebuilding unchanged files
|
||||
serve-docs:
|
||||
@./install-mkdocs.sh
|
||||
@port=8000; \
|
||||
while lsof -ti:$$port > /dev/null 2>&1; do \
|
||||
port=$$((port + 1)); \
|
||||
done; \
|
||||
echo "Starting MkDocs server on port $$port..."; \
|
||||
uv run --no-sync python -m mkdocs serve -f mkdocs.yml --dirty -a 127.0.0.1:$$port
|
||||
|
||||
# format-docs:
|
||||
# uv run ruff format docs
|
||||
# uv run ruff check --fix docs
|
||||
|
||||
# lint-docs:
|
||||
# uv run ruff format --check docs
|
||||
# uv run ruff check docs
|
||||
|
||||
# tests:
|
||||
# uv run pytest tests/unit_tests
|
||||
|
||||
help:
|
||||
@echo "Available targets:"
|
||||
@echo ""
|
||||
@echo "Setup:"
|
||||
@echo " dev-install - Switch to dev config & install with local editable packages"
|
||||
@echo " prod-install - Switch to prod config & install from git sources"
|
||||
@echo " config-status - Show current configuration (dev or prod)"
|
||||
@echo ""
|
||||
@echo "Building & Serving:"
|
||||
@echo " build - Build the documentation for deployment"
|
||||
@echo " serve-clean-docs - Serve the documentation with a clean build (for previewing)"
|
||||
@echo " serve-docs - Serve the documentation for local development (faster)"
|
||||
@echo ""
|
||||
@echo "Typical workflows:"
|
||||
@echo " Development: make dev-install && make serve-docs"
|
||||
@echo " Production: make prod-install && make build"
|
||||
@@ -1,617 +0,0 @@
|
||||
# LangChain Python Reference Documentation
|
||||
|
||||
This directory contains the source code and build process for the Python reference documentation site, hosted at [`reference.langchain.com/python`](https://reference.langchain.com/python). This site serves references for LangChain, LangGraph, LangSmith, and LangChain integration packages (such as [`langchain-anthropic`](https://pypi.org/project/langchain-anthropic/), [`langchain-openai`](https://pypi.org/project/langchain-openai/), etc.).
|
||||
|
||||
The site is built using [MkDocs](https://www.mkdocs.org/) with the [Material for MkDocs](https://squidfunk.github.io/mkdocs-material/) theme and the [mkdocstrings](https://mkdocstrings.github.io/) plugin for generating API reference documentation from docstrings. See all config options in the [`mkdocs.yml`](./mkdocs.yml) file.
|
||||
|
||||
The `docs/` directory contains the markdown files for the site, with the main entry point being `index.md`. At build time, the stubs provided in each file are substituted with the generated API reference documentation by `mkdocstrings`. This allows us to architect content ordering, layout, etc. in markdown, while still generating the API reference documentation automatically from the source code. Consequently, to make content changes to the API references themselves, you need to make changes in the source code (e.g., docstrings, class/method names, etc.) and then rebuild the site.
|
||||
|
||||
---
|
||||
|
||||
## Contributing
|
||||
|
||||
As these docs are built from the source code, the best way to contribute is to **make changes in the source code** itself. This can include:
|
||||
|
||||
- Improving docstrings
|
||||
- Adding missing docstrings
|
||||
- Fixing typos
|
||||
- etc.
|
||||
|
||||
You will notice that at the top of each page are two icons: one to view the page source, and the other to edit the page. The "view source" icon takes you to the markdown file for that page, while the "edit page" icon takes you to the relevant source code file in GitHub. Use these links to help you navigate to the right place to make your contributions.
|
||||
|
||||
---
|
||||
|
||||
## Cross-reference in your project
|
||||
|
||||
If you maintain a project that depends on LangChain or LangGraph and would like to reference classes, methods, functions, and more from these docs, you can do so! These pages include an `objects.inv` file that certain docs platforms, such as MkDocs, can use to automatically create links to these docs.
|
||||
|
||||
To reference these docs in your project, add the following to your `mkdocs.yml` file:
|
||||
|
||||
```yaml
|
||||
mkdocstrings:
|
||||
handlers:
|
||||
python:
|
||||
import:
|
||||
- https://reference.langchain.com/python/objects.inv
|
||||
- ... # any other inventories you want to include
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## TODO
|
||||
|
||||
This site is currently being migrated from a previous Sphinx-based implementation, so there are still some rough edges to be smoothed out. Here are some known issues and potential improvements:
|
||||
|
||||
- [ ] [Backlinks](https://mkdocstrings.github.io/python/usage/configuration/general/#backlinks)
|
||||
- [ ] [More xref](https://github.com/analog-garage/mkdocstrings-python-xref)
|
||||
- [ ] [Modernize annotations](https://mkdocstrings.github.io/python/usage/configuration/signatures/#modernize_annotations)
|
||||
- [ ] ???
|
||||
- [ ] Consider using [inherited docstrings](https://mkdocstrings.github.io/griffe/extensions/official/inherited-docstrings/)
|
||||
- [ ] Fix TOC shadow overflow (started in `reference/python/docs/stylesheets/toc.css`) but was funky
|
||||
- [ ] Fix `navigation.path` feature/plugin in `mkdocs.yml` not working
|
||||
- [ ] ???
|
||||
- [ ] "Module last updated" auto-generation for module pages using source file commit timestamps or the MkDocs plugin [git-revision-date-localized](https://github.com/timvink/mkdocs-git-revision-date-localized-plugin)
|
||||
- [ ] Fix search magnifying glass icon color in dark mode
|
||||
- [ ] [Show keyboard shortcut in search window](https://github.com/squidfunk/mkdocs-material/issues/2574#issuecomment-821979698) - also add cmd + k to match Mintlify
|
||||
|
||||
---
|
||||
|
||||
## Paths
|
||||
|
||||
For packages that live in the `langchain-ai/langchain` monorepo, the path to the package should exist at `https://reference.langchain.com/python/{PACKAGE}/` where `PACKAGE` is the package name as defined in the `pyproject.toml` file, with hyphens replaced by underscores. For example, the `langchain-openai` package should be documented at `https://reference.langchain.com/python/langchain_openai/`.
|
||||
|
||||
## Local Development
|
||||
|
||||
### Setup
|
||||
|
||||
This project supports two installation modes:
|
||||
|
||||
1. **Development mode** (`pyproject.dev.toml`) - Uses local editable installs from cloned repositories
|
||||
2. **Production mode** (`pyproject.toml`) - Uses git sources directly
|
||||
|
||||
### Development Workflow
|
||||
|
||||
For local development with live source code:
|
||||
|
||||
```bash
|
||||
# 1. Ensure repos are cloned in the expected structure (see below)
|
||||
|
||||
# 2. Switch to development mode and install
|
||||
make dev-install
|
||||
|
||||
# 3. Serve the docs locally
|
||||
make serve-docs
|
||||
|
||||
# Check current configuration anytime
|
||||
make config-status
|
||||
```
|
||||
|
||||
When you edit source code in the local repositories, changes will be reflected immediately since packages are installed as editable.
|
||||
|
||||
**How it works:** The `make dev-install` command:
|
||||
|
||||
1. Switches `pyproject.toml` to use local editable installs (via `switch-config.sh`)
|
||||
2. Backs up the production config to `pyproject.prod.toml`
|
||||
3. Installs all packages from local repos with `uv sync`
|
||||
|
||||
### Production/CI Workflow
|
||||
|
||||
For production builds or CI:
|
||||
|
||||
```bash
|
||||
# Switch to production mode and install
|
||||
make prod-install
|
||||
|
||||
# Build the documentation
|
||||
make build
|
||||
```
|
||||
|
||||
**How it works:** The `make prod-install` command:
|
||||
|
||||
1. Restores `pyproject.toml` to use git sources
|
||||
2. Installs all packages from git with `uv sync`
|
||||
|
||||
### Manual Configuration Switching
|
||||
|
||||
You can also use the script directly:
|
||||
|
||||
```bash
|
||||
# Switch to development mode
|
||||
./switch-config.sh dev
|
||||
|
||||
# Switch to production mode
|
||||
./switch-config.sh prod
|
||||
|
||||
# Check current mode
|
||||
./switch-config.sh status
|
||||
```
|
||||
|
||||
### Required Repository Structure
|
||||
|
||||
The `pyproject.dev.toml` file expects repositories to be cloned in this structure:
|
||||
|
||||
```txt
|
||||
/some-parent-folder/
|
||||
├── docs/ # This repository
|
||||
│ └── reference/python/
|
||||
├── langchain/ # Main LangChain monorepo
|
||||
├── langgraph/ # Main LangGraph monorepo
|
||||
├── langchain-community/
|
||||
├── langchain-mcp-adapters/
|
||||
├── langchain-datastax/
|
||||
├── langchain-ai21/
|
||||
├── langchain-aws/
|
||||
├── langchain-azure/
|
||||
├── langchain-cerebras/
|
||||
├── langchain-cohere/
|
||||
├── langchain-ibm/
|
||||
├── langchain-elastic/
|
||||
├── langchain-google/
|
||||
├── langchain-milvus/
|
||||
├── langchain-neo4j/
|
||||
├── langchain-nvidia/
|
||||
├── langchain-pinecone/
|
||||
├── langchain-postgres/
|
||||
├── langchain-redis/
|
||||
├── langchain-sema4/
|
||||
├── langchain-snowflake/
|
||||
├── langchain-tavily/ # (External org)
|
||||
├── langchain-together/
|
||||
├── langchain-unstructured/
|
||||
├── langchain-upstage/
|
||||
├── langchain-weaviate/
|
||||
├── langgraph-supervisor-py/
|
||||
└── langgraph-swarm-py/
|
||||
```
|
||||
|
||||
`langchain-mongodb` is not included as it is maintained and hosted separately by the MongoDB team.
|
||||
|
||||
If you only need to work on specific packages, you can comment out the others in `pyproject.dev.toml`.
|
||||
|
||||
### Build a subset of the whole reference site
|
||||
|
||||
For faster development and testing of specific sections, use the `serve_subset.py` script to serve only a subset of the documentation:
|
||||
|
||||
```bash
|
||||
# Serve only the LangGraph documentation
|
||||
python serve_subset.py langgraph
|
||||
|
||||
# Use a custom port
|
||||
python serve_subset.py langgraph --port 8080
|
||||
|
||||
# Build without dirty reload (clean build)
|
||||
python serve_subset.py langgraph --clean
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## MkDocs/mkdocstrings Python Cross-Reference Linking Syntax
|
||||
|
||||
### Basic Syntax
|
||||
|
||||
The general format for cross-references in mkdocstrings is:
|
||||
|
||||
```markdown
|
||||
[display text][python.path.to.object]
|
||||
```
|
||||
|
||||
If you want the object name as the display text, use backticks:
|
||||
|
||||
```markdown
|
||||
[`object_name`][python.path.to.object]
|
||||
```
|
||||
|
||||
### Linking to Different Python Objects
|
||||
|
||||
#### Modules
|
||||
|
||||
```markdown
|
||||
[`langchain.agents`][langchain.agents]
|
||||
|
||||
# or
|
||||
|
||||
[agents module][langchain.agents]
|
||||
```
|
||||
|
||||
#### Classes
|
||||
|
||||
```markdown
|
||||
[`ChatOpenAI`][langchain_openai.ChatOpenAI]
|
||||
|
||||
# or
|
||||
|
||||
[the ChatOpenAI class][langchain_openai.ChatOpenAI]
|
||||
```
|
||||
|
||||
#### Functions
|
||||
|
||||
```markdown
|
||||
[`init_chat_model`][langchain.chat_models.init_chat_model]
|
||||
|
||||
# or
|
||||
|
||||
[initialization function][langchain.chat_models.init_chat_model]
|
||||
```
|
||||
|
||||
#### Methods
|
||||
|
||||
```markdown
|
||||
[`invoke`][langchain_openai.ChatOpenAI.invoke]
|
||||
|
||||
# or
|
||||
|
||||
[the invoke method][langchain_openai.ChatOpenAI.invoke]
|
||||
```
|
||||
|
||||
#### Class Attributes
|
||||
|
||||
```markdown
|
||||
[`temperature`][langchain_openai.ChatOpenAI.temperature]
|
||||
|
||||
# or
|
||||
|
||||
[the temperature attribute][langchain_openai.ChatOpenAI.temperature]
|
||||
```
|
||||
|
||||
#### Function/Method Parameters
|
||||
|
||||
**Note:** Parameter linking requires the `parameter_headings` option to be enabled in the `mkdocstrings` config (in `mkdocs.yml`). This generates permalinks and TOC entries for each parameter, so don't disable it.
|
||||
|
||||
Use `(parameter_name)` syntax to link to specific parameters:
|
||||
|
||||
```markdown
|
||||
[`model_provider`][langchain.chat_models.init_chat_model(model_provider)]
|
||||
|
||||
# or
|
||||
|
||||
[the model_provider parameter][langchain.chat_models.init_chat_model(model_provider)]
|
||||
```
|
||||
|
||||
For method parameters:
|
||||
|
||||
```markdown
|
||||
[`max_tokens`][langchain_openai.ChatOpenAI.invoke(max_tokens)]
|
||||
```
|
||||
|
||||
For class `__init__` parameters (when using `merge_init_into_class`):
|
||||
|
||||
```markdown
|
||||
[`temperature`][langchain_openai.ChatOpenAI(temperature)]
|
||||
```
|
||||
|
||||
For variadic parameters:
|
||||
|
||||
```markdown
|
||||
[`*args`][package.module.function(*args)]
|
||||
[`**kwargs`][package.module.function(**kwargs)]
|
||||
```
|
||||
|
||||
#### Return Values
|
||||
|
||||
Not directly linkable, but you can link to the return type class:
|
||||
|
||||
```markdown
|
||||
Returns a [`ChatResult`][langchain_core.outputs.ChatResult] object.
|
||||
```
|
||||
|
||||
#### Nested Classes
|
||||
|
||||
```markdown
|
||||
[`Config`][langchain_core.runnables.Runnable.Config]
|
||||
```
|
||||
|
||||
### Advanced Patterns
|
||||
|
||||
#### Linking Within Same Module
|
||||
|
||||
If you're documenting within the same module, you can use relative paths:
|
||||
|
||||
```markdown
|
||||
See also [`.other_method`][.other_method]
|
||||
```
|
||||
|
||||
#### Linking to Exceptions
|
||||
|
||||
```markdown
|
||||
Raises [`ValueError`][ValueError] if input is invalid.
|
||||
Raises [`CustomError`][my_package.exceptions.CustomError]
|
||||
```
|
||||
|
||||
#### Linking to Type Aliases
|
||||
|
||||
```markdown
|
||||
[`RunnableConfig`][langchain_core.runnables.config.RunnableConfig]
|
||||
```
|
||||
|
||||
#### Multiple Links in Args Documentation
|
||||
|
||||
```python
|
||||
def create_agent(
|
||||
model: BaseChatModel,
|
||||
tools: Sequence[BaseTool],
|
||||
) -> AgentExecutor:
|
||||
"""
|
||||
Create an agent executor.
|
||||
|
||||
Args:
|
||||
model: A [`BaseChatModel`][langchain_core.language_models.BaseChatModel]
|
||||
instance. You can use [`init_chat_model`][langchain.chat_models.init_chat_model]
|
||||
to initialize from a string identifier (see the
|
||||
[`model_provider`][langchain.chat_models.init_chat_model(model_provider)]
|
||||
parameter for available providers).
|
||||
tools: A sequence of [`BaseTool`][langchain_core.tools.BaseTool] instances.
|
||||
Use the [`@tool`][langchain_core.tools.tool] decorator to create tools.
|
||||
|
||||
Returns:
|
||||
An [`AgentExecutor`][langchain.agents.AgentExecutor] instance.
|
||||
"""
|
||||
```
|
||||
|
||||
### Best Practices
|
||||
|
||||
#### 1. Use Backticks for Code Identifiers
|
||||
|
||||
```markdown
|
||||
✅ [`init_chat_model`][langchain.chat_models.init_chat_model]
|
||||
❌ [init_chat_model][langchain.chat_models.init_chat_model]
|
||||
```
|
||||
|
||||
#### 2. Use Full Paths for Clarity
|
||||
|
||||
```markdown
|
||||
✅ [`BaseChatModel`][langchain_core.language_models.BaseChatModel]
|
||||
❌ [`BaseChatModel`][BaseChatModel] # May not resolve correctly
|
||||
```
|
||||
|
||||
#### 3. Link to Public APIs Only
|
||||
|
||||
Only link to public, exported APIs that users should interact with. Avoid linking to internal implementation details (e.g., objects prefixed with `_`).
|
||||
|
||||
#### 4. Use Descriptive Text for Complex References
|
||||
|
||||
```markdown
|
||||
✅ See the [`model_provider`][langchain.chat_models.init_chat_model(model_provider)]
|
||||
parameter for available providers.
|
||||
❌ See [`model_provider`][langchain.chat_models.init_chat_model(model_provider)].
|
||||
```
|
||||
|
||||
#### 5. Verify Links Build Correctly
|
||||
|
||||
Build and manually check the generated HTML to ensure links resolve correctly.
|
||||
|
||||
### Quick Reference Table
|
||||
|
||||
| Object Type | Syntax | Example |
|
||||
|------------|--------|---------|
|
||||
| Module | `[text][module.path]` | ``[`agents`][langchain.agents]`` |
|
||||
| Class | `[text][module.Class]` | ``[`ChatOpenAI`][langchain_openai.ChatOpenAI]`` |
|
||||
| Function | `[text][module.function]` | ``[`init_chat_model`][langchain.chat_models.init_chat_model]`` |
|
||||
| Method | `[text][module.Class.method]` | ``[`invoke`][langchain_openai.ChatOpenAI.invoke]`` |
|
||||
| Attribute | `[text][module.Class.attr]` | ``[`temperature`][langchain_openai.ChatOpenAI.temperature]`` |
|
||||
| Function Param | `[text][module.function(param)]` | ``[`model_provider`][langchain.chat_models.init_chat_model(model_provider)]`` |
|
||||
| Method Param | `[text][module.Class.method(param)]` | ``[`max_tokens`][langchain_openai.ChatOpenAI.invoke(max_tokens)]`` |
|
||||
| Class Param | `[text][module.Class(param)]` | ``[`temperature`][langchain_openai.ChatOpenAI(temperature)]`` |
|
||||
|
||||
### Testing Links
|
||||
|
||||
To test if a link will work:
|
||||
|
||||
1. Check the object is in `__init__.py` exports
|
||||
2. Verify the import path: `from module.path import Object`
|
||||
3. Build docs with `--strict` mode
|
||||
4. Check the generated HTML for broken links
|
||||
|
||||
```bash
|
||||
mkdocs build --strict
|
||||
mkdocs serve # Preview at http://127.0.0.1:8000/
|
||||
```
|
||||
|
||||
This syntax works with the `mkdocstrings` plugin for MkDocs using the Python handler. Adjust paths according to your package structure and exports.
|
||||
|
||||
---
|
||||
|
||||
## Page Titles: Navigation, Frontmatter, and H1 Headings
|
||||
|
||||
MkDocs uses multiple sources for page titles, each serving a different purpose. Here's how to understand how they interact:
|
||||
|
||||
### Three Types of Titles
|
||||
|
||||
#### 1. Navigation Title (in `mkdocs.yml`)
|
||||
|
||||
Defined in the `nav` section of `mkdocs.yml`:
|
||||
|
||||
```yaml
|
||||
nav:
|
||||
- Deployment:
|
||||
- SDK: langsmith/deployment/sdk.md
|
||||
```
|
||||
|
||||
- **Purpose**: Label in the sidebar navigation
|
||||
- **Usage**: `page.title` in templates (see below)
|
||||
- **Scope**: Navigation menu
|
||||
|
||||
#### 2. Frontmatter Title (in the `.md` file)
|
||||
|
||||
Defined in YAML frontmatter at the top of each markdown file:
|
||||
|
||||
```markdown
|
||||
---
|
||||
title: LangSmith Deployment SDK
|
||||
---
|
||||
```
|
||||
|
||||
- **Purpose**: SEO metadata, HTML `<title>` tag
|
||||
- **Usage**: `page.meta.title` in templates (see below)
|
||||
- **Scope**: Browser tab, search engines, social sharing
|
||||
|
||||
#### 3. H1 Heading (in the `.md` file)
|
||||
|
||||
The first `#` heading in the markdown content:
|
||||
|
||||
```markdown
|
||||
# LangSmith Deployment SDK reference
|
||||
```
|
||||
|
||||
- **Purpose**: Page heading visible to users
|
||||
- **Usage**: Rendered as `<h1>` in the page content!
|
||||
- **Scope**: Main page content area
|
||||
|
||||
### How They Interact
|
||||
|
||||
Using the `langsmith/deployment/sdk.md` file as an example:
|
||||
|
||||
```yaml
|
||||
# In mkdocs.yml
|
||||
nav:
|
||||
- Deployment:
|
||||
- SDK: langsmith/deployment/sdk.md
|
||||
```
|
||||
|
||||
```markdown
|
||||
# In langsmith/deployment/sdk.md
|
||||
---
|
||||
title: LangSmith Deployment SDK
|
||||
---
|
||||
|
||||
# LangSmith Deployment SDK reference
|
||||
```
|
||||
|
||||
**Result:**
|
||||
|
||||
- **Navigation sidebar**: Shows "SDK" (from nav)
|
||||
- **Browser tab/HTML `<title>`**: Shows "LangSmith Deployment SDK | LangChain Reference" (from frontmatter + site name)
|
||||
- **Page heading**: Shows "LangSmith Deployment SDK reference" (from H1)
|
||||
|
||||
### HTML `<title>` Tag Priority
|
||||
|
||||
The HTML `<title>` tag (what appears in browser tabs) follows this priority system in `overrides/main.html`:
|
||||
|
||||
1. **If `page.meta.title` exists** (from YAML frontmatter):
|
||||
2.
|
||||
```html
|
||||
<title>{{ page.meta.title }} | {{ config.site_name }}</title>
|
||||
```
|
||||
Example: `LangSmith Deployment SDK | LangChain Reference`
|
||||
|
||||
3. **Else if `page.title` exists** (from nav or inferred from filename):
|
||||
4.
|
||||
```html
|
||||
<title>{{ page.title | striptags }} | {{ config.site_name }}</title>
|
||||
```
|
||||
Example: `SDK | LangChain Reference`
|
||||
|
||||
5. **Otherwise** (homepage fallback):
|
||||
6.
|
||||
```html
|
||||
<title>{{ config.site_name }}</title>
|
||||
```
|
||||
Example: `LangChain Reference`
|
||||
|
||||
### Best Practices
|
||||
|
||||
```yaml
|
||||
# mkdocs.yml - short, concise navigation label
|
||||
nav:
|
||||
- Deployment:
|
||||
- SDK: langsmith/deployment/sdk.md
|
||||
```
|
||||
|
||||
```markdown
|
||||
# File: langsmith/deployment/sdk.md
|
||||
---
|
||||
title: LangSmith Deployment SDK # SEO-friendly, descriptive
|
||||
---
|
||||
|
||||
# LangSmith Deployment SDK reference # Clear page heading
|
||||
```
|
||||
|
||||
**Why?**
|
||||
|
||||
- **Nav title ("SDK")**: Short and scannable in sidebar
|
||||
- **Frontmatter title ("LangSmith Deployment SDK")**: Descriptive for SEO and browser tabs
|
||||
- **H1 heading ("LangSmith Deployment SDK reference")**: Clear context when viewing the page
|
||||
|
||||
**Don't make nav titles too long:**
|
||||
|
||||
```yaml
|
||||
nav:
|
||||
- Deployment:
|
||||
# ❌ Too verbose for navigation
|
||||
- LangSmith Deployment SDK Reference Documentation: langsmith/deployment/sdk.md
|
||||
```
|
||||
|
||||
If the H1 is identical to the nav title, consider omitting it from the `.md` file to avoid redundancy. The nav title will render as the H1 automatically.
|
||||
|
||||
Similarly, if two pages have the same nav title, differentiate them with distinct frontmatter titles for SEO. Defer to the core LangChain packages as canonical. For instance,:
|
||||
|
||||
- `langchain/agents/`
|
||||
- `langgraph/agents/`
|
||||
|
||||
Each would share the same nav title "Agents". To differentiate, use a frontmatter title "Agents (LangGraph)". The LangChain page would use "Agents" as the frontmatter title since it's the primary source.
|
||||
|
||||
If you wish for both the page heading and browser title to be different from the nav title, set both the frontmatter title and H1 accordingly, e.g.:
|
||||
|
||||
```markdown
|
||||
# File: langchain_classic/chat_models.md
|
||||
---
|
||||
title: Chat models (Classic)
|
||||
---
|
||||
|
||||
# Chat models (Classic)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Icons
|
||||
|
||||
Icons from Material for MkDocs are available for use in documentation with integrated search. This includes thousands of icons from popular icon sets like Material Design Icons, FontAwesome, Octicons, and more.
|
||||
|
||||
See the [Material for MkDocs Icons Reference](https://squidfunk.github.io/mkdocs-material/reference/icons-emojis/) for the complete icon catalog and usage instructions.
|
||||
|
||||
---
|
||||
|
||||
## In-code documentation
|
||||
|
||||
### Language and style
|
||||
|
||||
> [!NOTE]
|
||||
> Use [Google-style docstrings](https://google.github.io/styleguide/pyguide.html) with complete type hints for all public functions. This documentation is parsed using [Griffe](https://mkdocstrings.github.io/griffe/reference/docstrings/#google-style).
|
||||
|
||||
Follow these standards for all documentation:
|
||||
|
||||
- **Voice**: Use second person ("you") for instructions
|
||||
- **Tense**: Use active voice and present tense
|
||||
- **Clarity**: Write clear, direct language for technical audiences
|
||||
- **Consistency**: Use consistent terminology throughout
|
||||
- **Conciseness**: Keep sentences concise while providing necessary context
|
||||
|
||||
### Code examples
|
||||
|
||||
> [!WARNING]
|
||||
> Always test code examples before publishing. Never include real API keys or secrets.
|
||||
|
||||
Requirements for code examples:
|
||||
|
||||
- **Completeness**: Include complete, runnable examples that users can copy and execute without errors
|
||||
- **Realism**: Use realistic data instead of placeholder values like "foo" or "example"
|
||||
- **Error handling**: Show proper error handling and edge case management
|
||||
- **Documentation**: Add explanatory comments for complex logic
|
||||
|
||||
Example of a well-documented function:
|
||||
|
||||
```python
|
||||
def filter_unknown_users(users: list[str], known_users: set[str]) -> list[str]:
|
||||
"""Filter out users that are not in the known users set.
|
||||
|
||||
Args:
|
||||
users: List of user identifiers to filter.
|
||||
known_users: Set of known/valid user identifiers.
|
||||
|
||||
Returns:
|
||||
List of users that are not in the known_users set.
|
||||
|
||||
Raises:
|
||||
ValueError: If users list contains invalid identifiers.
|
||||
"""
|
||||
return [user for user in users if user not in known_users]
|
||||
```
|
||||
@@ -1,3 +0,0 @@
|
||||
!!! danger "`langchain-classic` documentation"
|
||||
|
||||
These docs cover the `langchain-classic` package. This package will be maintained for security vulnerabilities [until December 2026](https://docs.langchain.com/oss/python/release-policy). Users are encouraged to migrate to the [`langchain`](https://pypi.org/project/langchain/) package for the latest features and improvements. [See docs for `langchain`](/python/langchain/langchain)
|
||||
@@ -1,3 +0,0 @@
|
||||
!!! warning "Work in progress"
|
||||
|
||||
This page is a work in progress, and we appreciate your patience as we continue to expand and improve the content.
|
||||
@@ -1,7 +0,0 @@
|
||||
---
|
||||
title: CompositeBackend
|
||||
---
|
||||
|
||||
# `CompositeBackend`
|
||||
|
||||
::: deepagents.backends.composite.CompositeBackend
|
||||
@@ -1,7 +0,0 @@
|
||||
---
|
||||
title: FilesystemBackend
|
||||
---
|
||||
|
||||
# `FilesystemBackend`
|
||||
|
||||
::: deepagents.backends.filesystem.FilesystemBackend
|
||||
@@ -1,65 +0,0 @@
|
||||
---
|
||||
title: Backends
|
||||
hide:
|
||||
- toc
|
||||
---
|
||||
|
||||
# Backends
|
||||
|
||||
!!! note "Reference docs"
|
||||
|
||||
This page contains **reference documentation** for Backends. See [the docs](https://docs.langchain.com/oss/python/deepagents/backends) for conceptual guides, tutorials, and examples.
|
||||
|
||||
Backends provide a unified interface for file operations across different storage types. All backends implement the `BackendProtocol`, enabling agents to work with files regardless of where they're stored.
|
||||
|
||||
<div class="grid cards" markdown>
|
||||
|
||||
- :material-memory:{ .lg .middle } __`BackendProtocol`__
|
||||
|
||||
---
|
||||
|
||||
Abstract protocol defining the interface all backends must implement.
|
||||
|
||||
[:octicons-arrow-right-24: Reference](protocol.md)
|
||||
|
||||
- :material-state-machine:{ .lg .middle } __`StateBackend`__
|
||||
|
||||
---
|
||||
|
||||
In-memory backend using LangGraph state. Ephemeral, thread-local storage.
|
||||
|
||||
[:octicons-arrow-right-24: Reference](state.md)
|
||||
|
||||
- :material-database:{ .lg .middle } __`StoreBackend`__
|
||||
|
||||
---
|
||||
|
||||
Persistent backend using LangGraph's BaseStore. Cross-thread storage.
|
||||
|
||||
[:octicons-arrow-right-24: Reference](store.md)
|
||||
|
||||
- :material-folder:{ .lg .middle } __`FilesystemBackend`__
|
||||
|
||||
---
|
||||
|
||||
Real filesystem access with optional virtual mode.
|
||||
|
||||
[:octicons-arrow-right-24: Reference](filesystem.md)
|
||||
|
||||
- :material-bash:{ .lg .middle } __`BaseSandbox`__
|
||||
|
||||
---
|
||||
|
||||
Base class for backends supporting shell command execution.
|
||||
|
||||
[:octicons-arrow-right-24: Reference](sandbox.md)
|
||||
|
||||
- :material-source-branch:{ .lg .middle } __`CompositeBackend`__
|
||||
|
||||
---
|
||||
|
||||
Router that delegates operations to different backends by path prefix.
|
||||
|
||||
[:octicons-arrow-right-24: Reference](composite.md)
|
||||
|
||||
</div>
|
||||
@@ -1,9 +0,0 @@
|
||||
---
|
||||
title: BackendProtocol
|
||||
---
|
||||
|
||||
# `BackendProtocol`
|
||||
|
||||
::: deepagents.backends.protocol.BackendProtocol
|
||||
|
||||
::: deepagents.backends.protocol.SandboxBackendProtocol
|
||||
@@ -1,7 +0,0 @@
|
||||
---
|
||||
title: BaseSandbox
|
||||
---
|
||||
|
||||
# `BaseSandbox`
|
||||
|
||||
::: deepagents.backends.sandbox.BaseSandbox
|
||||
@@ -1,7 +0,0 @@
|
||||
---
|
||||
title: StateBackend
|
||||
---
|
||||
|
||||
# `StateBackend`
|
||||
|
||||
::: deepagents.backends.state.StateBackend
|
||||
@@ -1,7 +0,0 @@
|
||||
---
|
||||
title: StoreBackend
|
||||
---
|
||||
|
||||
# `StoreBackend`
|
||||
|
||||
::: deepagents.backends.store.StoreBackend
|
||||
@@ -1,7 +0,0 @@
|
||||
---
|
||||
title: create_deep_agent
|
||||
---
|
||||
|
||||
# `create_deep_agent`
|
||||
|
||||
::: deepagents.graph.create_deep_agent
|
||||
@@ -1,45 +0,0 @@
|
||||
---
|
||||
title: Deep Agents overview
|
||||
hide:
|
||||
- toc
|
||||
---
|
||||
|
||||
# Deep Agents
|
||||
|
||||
[](https://pypi.org/project/deepagents/#history)
|
||||
[](https://opensource.org/licenses/MIT)
|
||||
[](https://pypistats.org/packages/deepagents)
|
||||
|
||||
Welcome to the [Deep Agents](https://github.com/langchain-ai/deepagents) reference documentation!
|
||||
|
||||
!!! note "Reference docs"
|
||||
|
||||
This page contains **reference documentation** for Deep Agents. See [the docs](https://docs.langchain.com/oss/python/deepagents) for conceptual guides, tutorials, and examples.
|
||||
|
||||
<div class="grid cards" markdown>
|
||||
|
||||
- :material-robot:{ .lg .middle } __`create_deep_agent`__
|
||||
|
||||
---
|
||||
|
||||
Factory function to create a deep agent with planning, filesystem, and subagent capabilities.
|
||||
|
||||
[:octicons-arrow-right-24: Reference](graph.md)
|
||||
|
||||
- :material-harddisk:{ .lg .middle } __Backends__
|
||||
|
||||
---
|
||||
|
||||
Pluggable storage backends for file operations across different storage types.
|
||||
|
||||
[:octicons-arrow-right-24: Reference](backends/index.md)
|
||||
|
||||
- :material-layers:{ .lg .middle } __Middleware__
|
||||
|
||||
---
|
||||
|
||||
Composable middleware components that add capabilities to agents.
|
||||
|
||||
[:octicons-arrow-right-24: Reference](middleware/index.md)
|
||||
|
||||
</div>
|
||||
@@ -1,7 +0,0 @@
|
||||
---
|
||||
title: FilesystemMiddleware
|
||||
---
|
||||
|
||||
# `FilesystemMiddleware`
|
||||
|
||||
::: deepagents.middleware.filesystem.FilesystemMiddleware
|
||||
@@ -1,57 +0,0 @@
|
||||
---
|
||||
title: Middleware - Deep Agents
|
||||
hide:
|
||||
- toc
|
||||
---
|
||||
|
||||
# Deep Agents Middleware
|
||||
|
||||
!!! note "Reference docs"
|
||||
|
||||
This page contains **reference documentation** for Middleware. See [the docs](https://docs.langchain.com/oss/python/deepagents/middleware) for conceptual guides, tutorials, and examples.
|
||||
|
||||
Middleware components add capabilities to deep agents through a composable architecture. Each middleware can provide tools, modify state, and inject system prompts.
|
||||
|
||||
<div class="grid cards" markdown>
|
||||
|
||||
- :material-folder-open:{ .lg .middle } __`FilesystemMiddleware`__
|
||||
|
||||
---
|
||||
|
||||
File operation tools: `ls`, `read_file`, `write_file`, `edit_file`, `glob`, `grep`.
|
||||
|
||||
[:octicons-arrow-right-24: Reference](filesystem.md)
|
||||
|
||||
- :material-account-multiple:{ .lg .middle } __`SubAgentMiddleware`__
|
||||
|
||||
---
|
||||
|
||||
Spawn specialized subagents via the `task` tool for context-isolated work.
|
||||
|
||||
[:octicons-arrow-right-24: Reference](subagents.md)
|
||||
|
||||
- :material-brain:{ .lg .middle } __`MemoryMiddleware`__
|
||||
|
||||
---
|
||||
|
||||
Load agent context from `AGENTS.md` files at startup.
|
||||
|
||||
[:octicons-arrow-right-24: Reference](memory.md)
|
||||
|
||||
- :material-lightning-bolt:{ .lg .middle } __`SkillsMiddleware`__
|
||||
|
||||
---
|
||||
|
||||
Discover and expose reusable skills from `SKILL.md` files.
|
||||
|
||||
[:octicons-arrow-right-24: Reference](skills.md)
|
||||
|
||||
- :material-text-box-outline:{ .lg .middle } __`SummarizationMiddleware`__
|
||||
|
||||
---
|
||||
|
||||
Offload conversation history to backend storage to preserve context.
|
||||
|
||||
[:octicons-arrow-right-24: Reference](summarization.md)
|
||||
|
||||
</div>
|
||||
@@ -1,7 +0,0 @@
|
||||
---
|
||||
title: MemoryMiddleware
|
||||
---
|
||||
|
||||
# `MemoryMiddleware`
|
||||
|
||||
::: deepagents.middleware.memory.MemoryMiddleware
|
||||
@@ -1,7 +0,0 @@
|
||||
---
|
||||
title: SkillsMiddleware
|
||||
---
|
||||
|
||||
# `SkillsMiddleware`
|
||||
|
||||
::: deepagents.middleware.skills.SkillsMiddleware
|
||||
@@ -1,11 +0,0 @@
|
||||
---
|
||||
title: SubAgentMiddleware
|
||||
---
|
||||
|
||||
# `SubAgentMiddleware`
|
||||
|
||||
::: deepagents.middleware.subagents.SubAgentMiddleware
|
||||
|
||||
::: deepagents.middleware.subagents.SubAgent
|
||||
|
||||
::: deepagents.middleware.subagents.CompiledSubAgent
|
||||
@@ -1,7 +0,0 @@
|
||||
---
|
||||
title: SummarizationMiddleware
|
||||
---
|
||||
|
||||
# `SummarizationMiddleware`
|
||||
|
||||
::: deepagents.middleware.summarization.SummarizationMiddleware
|
||||
@@ -1,21 +0,0 @@
|
||||
---
|
||||
title: Home
|
||||
---
|
||||
|
||||
Welcome to the [LangChain](https://langchain.com) Python reference documentation!
|
||||
|
||||
These pages detail the core interfaces you will use when building applications with LangChain and LangGraph. Each section covers a different part of the ecosystem. Use the navigation header to view documentation for specific packages.
|
||||
|
||||
!!! note "Reference docs"
|
||||
|
||||
This site contains **Python reference documentation**. You can find **conceptual guides, tutorials, and more** in the [main LangChain documentation site](https://docs.langchain.com).
|
||||
|
||||
JavaScript/TypeScript reference documentation is available on the [JS/TS reference site](https://reference.langchain.com/javascript).
|
||||
|
||||
<h2>Contributing and cross-referencing</h2>
|
||||
|
||||
For information on how these docs are built, how to contribute, and how to automatically cross-reference in your project(s), please see the [README](https://github.com/langchain-ai/docs/blob/main/reference/python/README.md).
|
||||
|
||||
<h2>Old versions</h2>
|
||||
|
||||
API reference documentation for LangChain v0.3.x can be found at [reference.langchain.com/v0.3/python/](https://reference.langchain.com/v0.3/python/).
|
||||
@@ -1,86 +0,0 @@
|
||||
---
|
||||
title: Integrations overview
|
||||
hide:
|
||||
- toc
|
||||
---
|
||||
|
||||
Welcome! These pages include reference documentation for all `langchain-*` Python integration packages.
|
||||
|
||||
To learn more about integrations in LangChain, visit the [Integrations overview](https://docs.langchain.com/oss/python/integrations/providers/overview).
|
||||
|
||||
!!! tip "Model Context Protocol (MCP)"
|
||||
LangChain supports the Model Context Protocol (MCP). This lets external tools work with LangChain and LangGraph applications through a standard interface.
|
||||
|
||||
To use MCP tools in your project, see [`langchain-mcp-adapters`](../langchain_mcp_adapters/index.md).
|
||||
|
||||
---
|
||||
|
||||
## Popular providers
|
||||
|
||||
<div class="grid cards" markdown>
|
||||
|
||||
- :fontawesome-brands-openai:{ .lg .middle } __`langchain-openai`__
|
||||
|
||||
---
|
||||
|
||||
Interact with OpenAI (completions, responses) and OpenAI compatible APIs.
|
||||
|
||||
[:octicons-arrow-right-24: Reference](./langchain_openai/index.md)
|
||||
|
||||
- :simple-claude:{ .lg .middle } __`langchain-anthropic`__
|
||||
|
||||
---
|
||||
|
||||
Interact with Claude (Anthropic) APIs.
|
||||
|
||||
[:octicons-arrow-right-24: Reference](./langchain_anthropic/index.md)
|
||||
|
||||
- :simple-googlegemini:{ .lg .middle } __`langchain-google-genai`__
|
||||
|
||||
---
|
||||
|
||||
Access Google Gemini models via the Google Gen AI SDK.
|
||||
|
||||
[:octicons-arrow-right-24: Reference](./langchain_google_genai/index.md)
|
||||
|
||||
- :material-aws:{ .lg .middle } __`langchain-aws`__
|
||||
|
||||
---
|
||||
|
||||
Use integrations related to the AWS platform such as Bedrock, S3, and more.
|
||||
|
||||
[:octicons-arrow-right-24: Reference](./langchain_aws.md)
|
||||
|
||||
- :simple-huggingface:{ .lg .middle } __`langchain-huggingface`__
|
||||
|
||||
---
|
||||
|
||||
Access HuggingFace-hosted models in LangChain.
|
||||
|
||||
[:octicons-arrow-right-24: Reference](./langchain_huggingface.md)
|
||||
|
||||
- :material-message:{ .lg .middle } __`langchain-groq`__
|
||||
|
||||
---
|
||||
|
||||
Interface to Groq Cloud.
|
||||
|
||||
[:octicons-arrow-right-24: Reference](./langchain_groq.md)
|
||||
|
||||
- :simple-ollama:{ .lg .middle } __`langchain-ollama`__
|
||||
|
||||
---
|
||||
|
||||
Use locally hosted models via Ollama.
|
||||
|
||||
[:octicons-arrow-right-24: Reference](./langchain_ollama.md)
|
||||
|
||||
</div>
|
||||
|
||||
Other providers, including `langchain-community`, are listed in the section navigation (left sidebar).
|
||||
|
||||
!!! question ""I don't see the integration I'm looking for""
|
||||
LangChain has hundreds of integrations, but not all are documented on this site. If you don't see the integration you're looking for, refer to their [provider page in the LangChain docs](https://docs.langchain.com/oss/python/integrations/providers/all_providers). Furthermore, many community maintained integrations are available in the [`langchain-community`](./langchain_community/index.md) package.
|
||||
|
||||
!!! note "Create new integrations"
|
||||
For information on contributing new integrations, see [the guide](https://docs.langchain.com/oss/python/contributing/integrations-langchain).
|
||||
@@ -1,11 +0,0 @@
|
||||
---
|
||||
title: ChatAmazonNova
|
||||
---
|
||||
|
||||
# :material-aws:{ .lg .middle } `ChatAmazonNova`
|
||||
|
||||
!!! warning "Reference docs"
|
||||
|
||||
This page contains **reference documentation** for `ChatAmazonNova`. See [the docs](https://docs.langchain.com/oss/python/integrations/chat/amazon_nova) for conceptual guides, tutorials, and examples on using `ChatAmazonNova`.
|
||||
|
||||
::: langchain_amazon_nova.chat_models.ChatAmazonNova
|
||||
@@ -1,27 +0,0 @@
|
||||
---
|
||||
title: Amazon Nova
|
||||
---
|
||||
|
||||
# :material-aws:{ .lg .middle } `langchain-amazon-nova`
|
||||
|
||||
[](https://pypi.org/project/langchain-amazon-nova/#history)
|
||||
[](https://opensource.org/licenses/Apache-2.0)
|
||||
[](https://pypistats.org/packages/langchain-amazon-nova)
|
||||
|
||||
## Modules
|
||||
|
||||
!!! note "Usage documentation"
|
||||
|
||||
Refer to [the docs](https://docs.langchain.com/oss/python/integrations/chat/amazon_nova) for a high-level guide on how to use each module. These reference pages contain auto-generated API documentation for each module, focusing on the "what" rather than the "how" or "why" (i.e. no end-to-end tutorials or conceptual overviews).
|
||||
|
||||
<div class="grid cards" markdown>
|
||||
|
||||
- :material-message-text:{ .lg .middle } __`ChatAmazonNova`__
|
||||
|
||||
---
|
||||
|
||||
Amazon Nova chat models.
|
||||
|
||||
[:octicons-arrow-right-24: Reference](./ChatAmazonNova.md)
|
||||
|
||||
</div>
|
||||
@@ -1,10 +0,0 @@
|
||||
---
|
||||
title: AnthropicLLM (Legacy LLM)
|
||||
---
|
||||
|
||||
# :simple-claude:{ .lg .middle } `AnthropicLLM` (Legacy LLM)
|
||||
|
||||
!!! note "Reference docs"
|
||||
This page contains **reference documentation** for the legacy `AnthropicLLM` LLM. See [the docs](https://docs.langchain.com/oss/python/integrations/llms/anthropic) for conceptual guides, tutorials, and examples on using `AnthropicLLM`.
|
||||
|
||||
::: langchain_anthropic.llms.AnthropicLLM
|
||||
@@ -1,10 +0,0 @@
|
||||
---
|
||||
title: ChatAnthropic
|
||||
---
|
||||
|
||||
# :simple-claude:{ .lg .middle } `ChatAnthropic`
|
||||
|
||||
!!! note "Reference docs"
|
||||
This page contains **reference documentation** for `ChatAnthropic`. See [the docs](https://docs.langchain.com/oss/python/integrations/chat/anthropic) for conceptual guides, tutorials, and examples on using `ChatAnthropic`.
|
||||
|
||||
::: langchain_anthropic.chat_models.ChatAnthropic
|
||||
@@ -1,42 +0,0 @@
|
||||
---
|
||||
title: Anthropic
|
||||
---
|
||||
|
||||
# :simple-claude:{ .lg .middle } `langchain-anthropic`
|
||||
|
||||
[](https://pypi.org/project/langchain-anthropic/#history)
|
||||
[](https://opensource.org/licenses/MIT)
|
||||
[](https://pypistats.org/packages/langchain-anthropic)
|
||||
|
||||
## Modules
|
||||
|
||||
!!! note "Usage documentation"
|
||||
Refer to [the docs](https://docs.langchain.com/oss/python/integrations/providers/anthropic) for a high-level guide on how to use each module. These reference pages contain auto-generated API documentation for each module, focusing on the "what" rather than the "how" or "why" (i.e. no end-to-end tutorials or conceptual overviews).
|
||||
|
||||
<div class="grid cards" markdown>
|
||||
|
||||
- :material-message-text:{ .lg .middle } __`ChatAnthropic`__
|
||||
|
||||
---
|
||||
|
||||
Anthropic chat models.
|
||||
|
||||
[:octicons-arrow-right-24: Reference](./ChatAnthropic.md)
|
||||
|
||||
- :material-message-text:{ .lg .middle } __`AnthropicLLM`__
|
||||
|
||||
---
|
||||
|
||||
(Legacy) Anthropic text completion models.
|
||||
|
||||
[:octicons-arrow-right-24: Reference](./AnthropicLLM.md)
|
||||
|
||||
- :material-middleware:{ .lg .middle } __Middleware__
|
||||
|
||||
---
|
||||
|
||||
Anthropic-specific middleware for Claude models.
|
||||
|
||||
[:octicons-arrow-right-24: Reference](./middleware.md)
|
||||
|
||||
</div>
|
||||
@@ -1,77 +0,0 @@
|
||||
---
|
||||
title: Anthropic Middleware
|
||||
---
|
||||
|
||||
# :simple-claude:{ .lg .middle } Anthropic Middleware
|
||||
|
||||
!!! note "Reference docs"
|
||||
|
||||
This page contains **reference documentation** for Anthropic Middleware. See [the docs](https://docs.langchain.com/oss/python/langchain/middleware/built-in#anthropic) for conceptual guides, tutorials, and examples on using Anthropic Middleware.
|
||||
|
||||
Provider-specific middleware for Anthropic's Claude models:
|
||||
|
||||
| CLASS | DESCRIPTION |
|
||||
| ----- | ----------- |
|
||||
| [`AnthropicPromptCachingMiddleware`](#langchain_anthropic.middleware.AnthropicPromptCachingMiddleware) | Reduce costs by caching repetitive prompt prefixes |
|
||||
| [`ClaudeBashToolMiddleware`](#langchain_anthropic.middleware.ClaudeBashToolMiddleware) | Execute Claude's native bash tool with local command execution |
|
||||
| [`StateClaudeTextEditorMiddleware`](#langchain_anthropic.middleware.StateClaudeTextEditorMiddleware) | Provide Claude's text editor tool for state-based file editing |
|
||||
| [`FilesystemClaudeTextEditorMiddleware`](#langchain_anthropic.middleware.FilesystemClaudeTextEditorMiddleware) | Provide Claude's text editor tool for filesystem-based file editing |
|
||||
| [`StateClaudeMemoryMiddleware`](#langchain_anthropic.middleware.StateClaudeMemoryMiddleware) | Provide Claude's memory tool for state-based persistent agent memory |
|
||||
| [`FilesystemClaudeMemoryMiddleware`](#langchain_anthropic.middleware.FilesystemClaudeMemoryMiddleware) | Provide Claude's memory tool for filesystem-based persistent agent memory |
|
||||
| [`StateFileSearchMiddleware`](#langchain_anthropic.middleware.StateFileSearchMiddleware) | Search tools for state-based file systems |
|
||||
|
||||
<!-- TODO: `ignore_init_summary` doesn't seem to work. -->
|
||||
|
||||
<!-- `"^__init__$"` used to exclude everything other than `__init__` -->
|
||||
|
||||
::: langchain_anthropic.middleware.AnthropicPromptCachingMiddleware
|
||||
options:
|
||||
docstring_options:
|
||||
ignore_init_summary: true
|
||||
merge_init_into_class: true
|
||||
filters: ["^__init__$"]
|
||||
|
||||
::: langchain_anthropic.middleware.ClaudeBashToolMiddleware
|
||||
options:
|
||||
docstring_options:
|
||||
ignore_init_summary: true
|
||||
merge_init_into_class: true
|
||||
filters: ["^__init__$"]
|
||||
|
||||
::: langchain_anthropic.middleware.StateClaudeTextEditorMiddleware
|
||||
options:
|
||||
docstring_options:
|
||||
ignore_init_summary: true
|
||||
merge_init_into_class: true
|
||||
filters: ["^__init__$"]
|
||||
|
||||
::: langchain_anthropic.middleware.FilesystemClaudeTextEditorMiddleware
|
||||
options:
|
||||
docstring_options:
|
||||
ignore_init_summary: true
|
||||
merge_init_into_class: true
|
||||
filters: ["^__init__$"]
|
||||
|
||||
::: langchain_anthropic.middleware.StateClaudeMemoryMiddleware
|
||||
options:
|
||||
docstring_options:
|
||||
ignore_init_summary: true
|
||||
merge_init_into_class: true
|
||||
filters: ["^__init__$"]
|
||||
|
||||
::: langchain_anthropic.middleware.FilesystemClaudeMemoryMiddleware
|
||||
options:
|
||||
docstring_options:
|
||||
ignore_init_summary: true
|
||||
merge_init_into_class: true
|
||||
filters: ["^__init__$"]
|
||||
|
||||
::: langchain_anthropic.middleware.StateFileSearchMiddleware
|
||||
options:
|
||||
docstring_options:
|
||||
ignore_init_summary: true
|
||||
merge_init_into_class: true
|
||||
filters: ["^__init__$"]
|
||||
|
||||
<!-- Copy and paste the above for each new entry -->
|
||||
<!-- (Don't use "members") -->
|
||||
@@ -1,14 +0,0 @@
|
||||
---
|
||||
title: AstraDB
|
||||
---
|
||||
|
||||
# :simple-datastax:{ .lg .middle } `langchain-astradb`
|
||||
|
||||
[](https://pypi.org/project/langchain-astradb/#history)
|
||||
[](https://opensource.org/licenses/MIT)
|
||||
[](https://pypistats.org/packages/langchain-astradb)
|
||||
|
||||
!!! note "Reference docs"
|
||||
This page contains **reference documentation** for AstraDB. See [the docs](https://docs.langchain.com/oss/python/integrations/providers/astradb) for conceptual guides, tutorials, and examples on using AstraDB.
|
||||
|
||||
::: langchain_astradb
|
||||
@@ -1,17 +0,0 @@
|
||||
---
|
||||
title: AWS
|
||||
---
|
||||
|
||||
# :material-aws:{ .lg .middle } `langchain-aws`
|
||||
|
||||
[](https://pypi.org/project/langchain-aws/#history)
|
||||
[](https://opensource.org/licenses/MIT)
|
||||
[](https://pypistats.org/packages/langchain-aws)
|
||||
|
||||
!!! note
|
||||
This package ref has not yet been fully migrated to v1.
|
||||
|
||||
!!! note "Reference docs"
|
||||
This page contains **reference documentation** for AWS. See [the docs](https://docs.langchain.com/oss/python/integrations/providers/aws) for conceptual guides, tutorials, and examples on using AWS modules.
|
||||
|
||||
::: langchain_aws
|
||||
@@ -1,12 +0,0 @@
|
||||
---
|
||||
title: Azure
|
||||
---
|
||||
|
||||
# :material-microsoft-azure:{ .lg .middle } Azure integrations
|
||||
|
||||
## Modules
|
||||
|
||||
--8<-- "wip.md"
|
||||
|
||||
!!! note "Usage documentation"
|
||||
Refer to [the docs](https://docs.langchain.com/oss/python/integrations/providers/microsoft) for a high-level guide on how to use each module. These reference pages contain auto-generated API documentation for each module, focusing on the "what" rather than the "how" or "why" (i.e. no end-to-end tutorials or conceptual overviews).
|
||||
@@ -1,27 +0,0 @@
|
||||
---
|
||||
title: Azure AI
|
||||
---
|
||||
|
||||
# :material-microsoft-azure:{ .lg .middle } `langchain-azure-ai`
|
||||
|
||||
[](https://pypi.org/project/langchain-azure-ai/#history)
|
||||
[](https://opensource.org/licenses/MIT)
|
||||
[](https://pypistats.org/packages/langchain-azure-ai)
|
||||
|
||||
!!! note "Reference docs"
|
||||
This page contains **reference documentation** for `Azure AI`. See [the docs](https://docs.langchain.com/oss/python/integrations/providers/microsoft) for conceptual guides, tutorials, and examples on using `Azure AI`.
|
||||
|
||||
::: langchain_azure_ai.agents
|
||||
::: langchain_azure_ai.callbacks.tracers
|
||||
::: langchain_azure_ai.chat_message_histories
|
||||
::: langchain_azure_ai.chat_models
|
||||
options:
|
||||
members:
|
||||
- AzureAIChatCompletionsModel
|
||||
::: langchain_azure_ai.embeddings
|
||||
options:
|
||||
members:
|
||||
- AzureAIEmbeddingsModel
|
||||
::: langchain_azure_ai.retrievers
|
||||
::: langchain_azure_ai.tools
|
||||
::: langchain_azure_ai.vectorstores
|
||||
@@ -1,17 +0,0 @@
|
||||
---
|
||||
title: Azure Dynamic Sessions
|
||||
---
|
||||
|
||||
# :material-microsoft-azure:{ .lg .middle } `langchain-azure-dynamic-sessions`
|
||||
|
||||
[](https://pypi.org/project/langchain-azure-dynamic-sessions/#history)
|
||||
[](https://opensource.org/licenses/MIT)
|
||||
[](https://pypistats.org/packages/langchain-azure-dynamic-sessions)
|
||||
|
||||
!!! note
|
||||
This package ref has not yet been migrated to v1. It will be updated pending the release of `langchain-azure-dynamic-sessions` v1.0.
|
||||
|
||||
<!-- !!! note "Reference docs"
|
||||
This page contains **reference documentation** for `Azure AI`. See [the docs](https://docs.langchain.com/oss/python/integrations/providers/microsoft) for conceptual guides, tutorials, and examples on using `Azure AI`. -->
|
||||
|
||||
<!-- ::: langchain_azure_dynamic_sessions -->
|
||||
@@ -1,14 +0,0 @@
|
||||
---
|
||||
title: Azure Postgres
|
||||
---
|
||||
|
||||
# :material-microsoft-azure:{ .lg .middle } `langchain-azure-postgresql`
|
||||
|
||||
[](https://pypi.org/project/langchain-azure-postgresql/#history)
|
||||
[](https://opensource.org/licenses/MIT)
|
||||
[](https://pypistats.org/packages/langchain-azure-postgresql)
|
||||
|
||||
!!! note "Reference docs"
|
||||
This page contains **reference documentation** for `Azure AI`. See [the docs](https://docs.langchain.com/oss/python/integrations/providers/microsoft) for conceptual guides, tutorials, and examples on using `Azure AI`.
|
||||
|
||||
::: langchain_azure_postgresql
|
||||
@@ -1,14 +0,0 @@
|
||||
---
|
||||
title: Azure Storage
|
||||
---
|
||||
|
||||
# :material-microsoft-azure:{ .lg .middle } `langchain-azure-storage`
|
||||
|
||||
[](https://pypi.org/project/langchain-azure-storage/#history)
|
||||
[](https://opensource.org/licenses/MIT)
|
||||
[](https://pypistats.org/packages/langchain-azure-storage)
|
||||
|
||||
!!! note "Reference docs"
|
||||
This page contains **reference documentation** for `Azure Storage`. See [the docs](https://docs.langchain.com/oss/python/integrations/providers/microsoft) for conceptual guides, tutorials, and examples on using `Azure Storage`.
|
||||
|
||||
::: langchain_azure_storage.document_loaders
|
||||
@@ -1,11 +0,0 @@
|
||||
---
|
||||
title: Cerebras
|
||||
---
|
||||
|
||||
# `langchain-cerebras`
|
||||
|
||||
[](https://pypi.org/project/langchain-cerebras/#history)
|
||||
[](https://opensource.org/licenses/MIT)
|
||||
[](https://pypistats.org/packages/langchain-cerebras)
|
||||
|
||||
::: langchain_cerebras
|
||||
@@ -1,14 +0,0 @@
|
||||
---
|
||||
title: Chroma
|
||||
---
|
||||
|
||||
# `langchain-chroma`
|
||||
|
||||
[](https://pypi.org/project/langchain-chroma/#history)
|
||||
[](https://opensource.org/licenses/MIT)
|
||||
[](https://pypistats.org/packages/langchain-chroma)
|
||||
|
||||
!!! note "Reference docs"
|
||||
This page contains **reference documentation** for Chroma. See [the docs](https://docs.langchain.com/oss/python/integrations/providers/chroma) for conceptual guides, tutorials, and examples on using Chroma modules.
|
||||
|
||||
::: langchain_chroma
|
||||
@@ -1,14 +0,0 @@
|
||||
---
|
||||
title: Cohere
|
||||
---
|
||||
|
||||
# `langchain-cohere`
|
||||
|
||||
[](https://pypi.org/project/langchain-cohere/#history)
|
||||
[](https://opensource.org/licenses/MIT)
|
||||
[](https://pypistats.org/packages/langchain-cohere)
|
||||
|
||||
!!! note "Reference docs"
|
||||
This page contains **reference documentation** for Cohere. See [the docs](https://docs.langchain.com/oss/python/integrations/providers/cohere) for conceptual guides, tutorials, and examples on using Cohere modules.
|
||||
|
||||
::: langchain_cohere
|
||||
@@ -1,13 +0,0 @@
|
||||
---
|
||||
title: LangChain Community home
|
||||
---
|
||||
|
||||
# :fontawesome-solid-people-group:{ .lg .middle } `langchain-community`
|
||||
|
||||
[](https://pypi.org/project/langchain-community/#history)
|
||||
[](https://opensource.org/licenses/MIT)
|
||||
[](https://pypistats.org/packages/langchain-community)
|
||||
|
||||
Reference documentation for the [`langchain-community`](https://pypi.org/project/langchain-community/) package.
|
||||
|
||||
--8<-- "wip.md"
|
||||
@@ -1,14 +0,0 @@
|
||||
---
|
||||
title: Db2
|
||||
---
|
||||
|
||||
# `langchain-db2`
|
||||
|
||||
[](https://pypi.org/project/langchain-db2/#history)
|
||||
[](https://opensource.org/licenses/MIT)
|
||||
[](https://pypistats.org/packages/langchain-db2)
|
||||
|
||||
!!! note "Reference docs"
|
||||
This page contains **reference documentation** for IBM DB2. See [the docs](https://docs.langchain.com/oss/python/integrations/providers/ibm#db2) for conceptual guides, tutorials, and examples on using DB2 modules.
|
||||
|
||||
::: langchain_db2
|
||||
@@ -1,14 +0,0 @@
|
||||
---
|
||||
title: DeepSeek
|
||||
---
|
||||
|
||||
# `langchain-deepseek`
|
||||
|
||||
[](https://pypi.org/project/langchain-deepseek/#history)
|
||||
[](https://opensource.org/licenses/MIT)
|
||||
[](https://pypistats.org/packages/langchain-deepseek)
|
||||
|
||||
!!! note "Reference docs"
|
||||
This page contains **reference documentation** for DeepSeek. See [the docs](https://docs.langchain.com/oss/python/integrations/chat/deepseek) for conceptual guides, tutorials, and examples on using `ChatDeepSeek`.
|
||||
|
||||
::: langchain_deepseek
|
||||
@@ -1,22 +0,0 @@
|
||||
---
|
||||
title: Elasticsearch
|
||||
---
|
||||
|
||||
# :simple-elasticsearch:{ .lg .middle } `langchain-elasticsearch`
|
||||
|
||||
[](https://pypi.org/project/langchain-elasticsearch/#history)
|
||||
[](https://opensource.org/licenses/MIT)
|
||||
[](https://pypistats.org/packages/langchain-elasticsearch)
|
||||
|
||||
::: langchain_elasticsearch._async.embeddings.AsyncElasticsearchEmbeddings
|
||||
::: langchain_elasticsearch._async.vectorstores.AsyncElasticsearchStore
|
||||
::: langchain_elasticsearch._async.retrievers.AsyncElasticsearchRetriever
|
||||
::: langchain_elasticsearch._async.cache.AsyncElasticsearchCache
|
||||
::: langchain_elasticsearch._async.cache.AsyncElasticsearchEmbeddingsCache
|
||||
::: langchain_elasticsearch._async.chat_history.AsyncElasticsearchChatMessageHistory
|
||||
::: langchain_elasticsearch._sync.embeddings.ElasticsearchEmbeddings
|
||||
::: langchain_elasticsearch._sync.vectorstores.ElasticsearchStore
|
||||
::: langchain_elasticsearch._sync.retrievers.ElasticsearchRetriever
|
||||
::: langchain_elasticsearch._sync.cache.ElasticsearchCache
|
||||
::: langchain_elasticsearch._sync.cache.ElasticsearchEmbeddingsCache
|
||||
::: langchain_elasticsearch._sync.chat_history.ElasticsearchChatMessageHistory
|
||||
@@ -1,14 +0,0 @@
|
||||
---
|
||||
title: Exa
|
||||
---
|
||||
|
||||
# `langchain-exa`
|
||||
|
||||
[](https://pypi.org/project/langchain-exa/#history)
|
||||
[](https://opensource.org/licenses/MIT)
|
||||
[](https://pypistats.org/packages/langchain-exa)
|
||||
|
||||
!!! note "Reference docs"
|
||||
This page contains **reference documentation** for Exa. See [the docs](https://docs.langchain.com/oss/python/integrations/providers/exa_search) for conceptual guides, tutorials, and examples on using Exa modules.
|
||||
|
||||
::: langchain_exa
|
||||
@@ -1,14 +0,0 @@
|
||||
---
|
||||
title: Fireworks
|
||||
---
|
||||
|
||||
# `langchain-fireworks`
|
||||
|
||||
[](https://pypi.org/project/langchain-fireworks/#history)
|
||||
[](https://opensource.org/licenses/MIT)
|
||||
[](https://pypistats.org/packages/langchain-fireworks)
|
||||
|
||||
!!! note "Reference docs"
|
||||
This page contains **reference documentation** for Fireworks. See [the docs](https://docs.langchain.com/oss/python/integrations/providers/fireworks) for conceptual guides, tutorials, and examples on using Fireworks modules.
|
||||
|
||||
::: langchain_fireworks
|
||||
@@ -1,40 +0,0 @@
|
||||
---
|
||||
title: Google
|
||||
---
|
||||
|
||||
# :material-google:{ .lg .middle } Google integrations
|
||||
|
||||
## Modules
|
||||
|
||||
!!! note "Usage documentation"
|
||||
Refer to [the docs](https://docs.langchain.com/oss/python/integrations/providers/google) for a high-level guide on how to use each module. These reference pages contain auto-generated API documentation for each module, focusing on the "what" rather than the "how" or "why" (i.e. no end-to-end tutorials or conceptual overviews).
|
||||
|
||||
LangChain's Google integrations include the following packages:
|
||||
|
||||
<div class="grid cards" markdown>
|
||||
|
||||
- :simple-googlegemini:{ .lg .middle } __Gemini__
|
||||
|
||||
---
|
||||
|
||||
`langchain-google-genai` contains integrations for interacting with Google's Gemini API.
|
||||
|
||||
[:octicons-arrow-right-24: Reference](../langchain_google_genai/index.md)
|
||||
|
||||
- :simple-googlecloud:{ .lg .middle } __Vertex AI Platform__
|
||||
|
||||
---
|
||||
|
||||
`langchain-google-vertexai` offers integrations for working with Google Cloud's Vertex AI platform.
|
||||
|
||||
[:octicons-arrow-right-24: Reference](../langchain_google_vertexai/index.md)
|
||||
|
||||
- :fontawesome-solid-people-group:{ .lg .middle } __Community__
|
||||
|
||||
---
|
||||
|
||||
`langchain-google-community` hosts community-contributed integrations for various Google services not included in their AI offerings.
|
||||
|
||||
[:octicons-arrow-right-24: Reference](../langchain_google_community/index.md)
|
||||
|
||||
</div>
|
||||
@@ -1,14 +0,0 @@
|
||||
---
|
||||
title: Google (Community)
|
||||
---
|
||||
|
||||
# :fontawesome-solid-people-group:{ .lg .middle } `langchain-google-community`
|
||||
|
||||
[](https://pypi.org/project/langchain-google-community/#history)
|
||||
[](https://opensource.org/licenses/MIT)
|
||||
[](https://pypistats.org/packages/langchain-google-community)
|
||||
|
||||
!!! note "Reference docs"
|
||||
This page contains **reference documentation** for Google Community. See [the docs](https://docs.langchain.com/oss/python/integrations/providers/google) for conceptual guides, tutorials, and examples on using Google Community modules.
|
||||
|
||||
::: langchain_google_community
|
||||
@@ -1,10 +0,0 @@
|
||||
---
|
||||
title: ChatGoogleGenerativeAI
|
||||
---
|
||||
|
||||
# :simple-googlegemini:{ .lg .middle } `ChatGoogleGenerativeAI`
|
||||
|
||||
!!! note "Reference docs"
|
||||
This page contains **reference documentation** for `ChatGoogleGenerativeAI`. See [the docs](https://docs.langchain.com/oss/python/integrations/chat/google_generative_ai) for conceptual guides, tutorials, and examples on using `ChatGoogleGenerativeAI`.
|
||||
|
||||
::: langchain_google_genai.ChatGoogleGenerativeAI
|
||||
@@ -1,10 +0,0 @@
|
||||
---
|
||||
title: GoogleGenerativeAI (Legacy LLM)
|
||||
---
|
||||
|
||||
# :simple-googlegemini:{ .lg .middle } `GoogleGenerativeAI` (Legacy LLM)
|
||||
|
||||
!!! note "Reference docs"
|
||||
This page contains **reference documentation** for the legacy `GoogleGenerativeAI` LLM. See [the docs](https://docs.langchain.com/oss/python/integrations/chat/google_generative_ai) for conceptual guides, tutorials, and examples on using `GoogleGenerativeAI`.
|
||||
|
||||
::: langchain_google_genai.GoogleGenerativeAI
|
||||
-10
@@ -1,10 +0,0 @@
|
||||
---
|
||||
title: GoogleGenerativeAIEmbeddings
|
||||
---
|
||||
|
||||
# :simple-googlegemini:{ .lg .middle } `GoogleGenerativeAIEmbeddings`
|
||||
|
||||
!!! note "Reference docs"
|
||||
This page contains **reference documentation** for `GoogleGenerativeAIEmbeddings`. See [the docs](https://docs.langchain.com/oss/python/integrations/embeddings/google_generative_ai) for conceptual guides, tutorials, and examples on using `GoogleGenerativeAIEmbeddings`.
|
||||
|
||||
::: langchain_google_genai.GoogleGenerativeAIEmbeddings
|
||||
@@ -1,50 +0,0 @@
|
||||
---
|
||||
title: Google (GenAI)
|
||||
---
|
||||
|
||||
# :simple-googlegemini:{ .lg .middle } `langchain-google-genai`
|
||||
|
||||
[](https://pypi.org/project/langchain-google-genai/#history)
|
||||
[](https://opensource.org/licenses/MIT)
|
||||
[](https://pypistats.org/packages/langchain-google-genai)
|
||||
|
||||
LangChain integration for Google's Generative AI models, providing access to Gemini models via both the **Gemini Developer API** and **Vertex AI**.
|
||||
|
||||
!!! note "Vertex AI consolidation"
|
||||
|
||||
As of `langchain-google-genai` 4.0.0, this package uses the consolidated [`google-genai`](https://googleapis.github.io/python-genai/) SDK instead of the legacy [`google-ai-generativelanguage`](https://googleapis.dev/python/generativelanguage/latest/) SDK.
|
||||
|
||||
This migration brings support for Gemini models both via the Gemini Developer API and Gemini API in Vertex AI, superseding certain classes in `langchain-google-vertexai`, such as `ChatVertexAI`. Refer to [the provider docs](https://docs.langchain.com/oss/python/integrations/providers/google) and [release notes](https://github.com/langchain-ai/langchain-google/discussions/1422) for more information.
|
||||
|
||||
## Modules
|
||||
|
||||
!!! note "Usage documentation"
|
||||
Refer to [the docs](https://docs.langchain.com/oss/python/integrations/providers/google) for a high-level guide on how to use each module. These reference pages contain auto-generated API documentation for each module, focusing on the "what" rather than the "how" or "why" (i.e. no end-to-end tutorials or conceptual overviews).
|
||||
|
||||
<div class="grid cards" markdown>
|
||||
|
||||
- :material-message-text:{ .lg .middle } __`ChatGoogleGenerativeAI`__
|
||||
|
||||
---
|
||||
|
||||
Gemini chat models.
|
||||
|
||||
[:octicons-arrow-right-24: Reference](./ChatGoogleGenerativeAI.md)
|
||||
|
||||
- :material-message-text:{ .lg .middle } __`GoogleGenerativeAI`__
|
||||
|
||||
---
|
||||
|
||||
(Legacy) Google text completion abstraction.
|
||||
|
||||
[:octicons-arrow-right-24: Reference](./GoogleGenerativeAI.md)
|
||||
|
||||
- :fontawesome-solid-layer-group:{ .lg .middle } __`GoogleGenerativeAIEmbeddings`__
|
||||
|
||||
---
|
||||
|
||||
Gemini embedding models.
|
||||
|
||||
[:octicons-arrow-right-24: Reference](./GoogleGenerativeAIEmbeddings.md)
|
||||
|
||||
</div>
|
||||
@@ -1,10 +0,0 @@
|
||||
---
|
||||
title: ChatVertexAI
|
||||
---
|
||||
|
||||
# :simple-googlecloud:{ .lg .middle } `ChatVertexAI`
|
||||
|
||||
!!! note "Reference docs"
|
||||
This page contains **reference documentation** for `ChatVertexAI`. See [the docs](https://docs.langchain.com/oss/python/integrations/chat/google_vertex_ai) for conceptual guides, tutorials, and examples on using `ChatVertexAI`.
|
||||
|
||||
::: langchain_google_vertexai.ChatVertexAI
|
||||
@@ -1,10 +0,0 @@
|
||||
---
|
||||
title: VertexAI (Legacy LLM)
|
||||
---
|
||||
|
||||
# :simple-googlecloud:{ .lg .middle } `VertexAI`
|
||||
|
||||
!!! note "Reference docs"
|
||||
This page contains **reference documentation** for the legacy `VertexAI` LLM. See [the docs](https://docs.langchain.com/oss/python/integrations/llms/google_vertex_ai) for conceptual guides, tutorials, and examples on using `VertexAI`.
|
||||
|
||||
::: langchain_google_vertexai.VertexAI
|
||||
@@ -1,10 +0,0 @@
|
||||
---
|
||||
title: VertexAIEmbeddings
|
||||
---
|
||||
|
||||
# :simple-googlecloud:{ .lg .middle } `VertexAIEmbeddings`
|
||||
|
||||
!!! note "Reference docs"
|
||||
This page contains **reference documentation** for `VertexAIEmbeddings`. See [the docs](https://docs.langchain.com/oss/python/integrations/embeddings/google_vertex_ai) for conceptual guides, tutorials, and examples on using `VertexAIEmbeddings`.
|
||||
|
||||
::: langchain_google_vertexai.VertexAIEmbeddings
|
||||
@@ -1,56 +0,0 @@
|
||||
---
|
||||
title: Google (VertexAI)
|
||||
---
|
||||
|
||||
# :simple-googlecloud:{ .lg .middle } `langchain-google-vertexai`
|
||||
|
||||
[](https://pypi.org/project/langchain-google-vertexai/#history)
|
||||
[](https://opensource.org/licenses/MIT)
|
||||
[](https://pypistats.org/packages/langchain-google-vertexai)
|
||||
|
||||
LangChain integration for Google's Vertex AI Platform.
|
||||
|
||||
!!! note "Vertex AI consolidation"
|
||||
|
||||
As of `langchain-google-vertexai` 3.2.0, certain classes are deprecated in favor of equivalents in `langchain-google-genai` 4.0.0, which uses the consolidated [`google-genai`](https://googleapis.github.io/python-genai/) SDK.
|
||||
|
||||
Refer to [the provider docs](https://docs.langchain.com/oss/python/integrations/providers/google) and [release notes](https://github.com/langchain-ai/langchain-google/discussions/1422) for more information.
|
||||
|
||||
## Modules
|
||||
|
||||
!!! note "Usage documentation"
|
||||
Refer to [the docs](https://docs.langchain.com/oss/python/integrations/providers/google) for a high-level guide on how to use each module. These reference pages contain auto-generated API documentation for each module, focusing on the "what" rather than the "how" or "why" (i.e. no end-to-end tutorials or conceptual overviews).
|
||||
|
||||
<div class="grid cards" markdown>
|
||||
|
||||
- :material-message-text:{ .lg .middle } **`ChatVertexAI`**
|
||||
|
||||
---
|
||||
|
||||
**Deprecated:** Use `ChatGoogleGenerativeAI` from `langchain-google-genai` instead.
|
||||
|
||||
[:octicons-arrow-right-24: Reference](./ChatVertexAI.md)
|
||||
|
||||
- :material-message-text:{ .lg .middle } **`VertexAI`**
|
||||
|
||||
---
|
||||
|
||||
**Deprecated:** Use `GoogleGenerativeAI` from `langchain-google-genai` instead.
|
||||
|
||||
[:octicons-arrow-right-24: Reference](./VertexAI.md)
|
||||
|
||||
- :fontawesome-solid-layer-group:{ .lg .middle } **`VertexAIEmbeddings`**
|
||||
|
||||
---
|
||||
|
||||
**Deprecated:** Use `GoogleGenerativeAIEmbeddings` from `langchain-google-genai` instead.
|
||||
|
||||
[:octicons-arrow-right-24: Reference](./VertexAIEmbeddings.md)
|
||||
|
||||
- **Other**
|
||||
|
||||
---
|
||||
|
||||
[:octicons-arrow-right-24: Reference](./other.md)
|
||||
|
||||
</div>
|
||||
@@ -1,15 +0,0 @@
|
||||
---
|
||||
title: Other Vertex AI Integrations
|
||||
---
|
||||
|
||||
# :simple-googlecloud:{ .lg .middle } `Other Vertex AI Integrations`
|
||||
|
||||
::: langchain_google_vertexai
|
||||
options:
|
||||
docstring_options:
|
||||
ignore_init_summary: true
|
||||
merge_init_into_class: true
|
||||
filters:
|
||||
- "!^ChatVertexAI$"
|
||||
- "!^VertexAI$"
|
||||
- "!^VertexAIEmbeddings$"
|
||||
@@ -1,14 +0,0 @@
|
||||
---
|
||||
title: Groq
|
||||
---
|
||||
|
||||
# `langchain-groq`
|
||||
|
||||
[](https://pypi.org/project/langchain-groq/#history)
|
||||
[](https://opensource.org/licenses/MIT)
|
||||
[](https://pypistats.org/packages/langchain-groq)
|
||||
|
||||
!!! note "Reference docs"
|
||||
This page contains **reference documentation** for Groq. See [the docs](https://docs.langchain.com/oss/python/integrations/providers/groq) for conceptual guides, tutorials, and examples on using Groq modules.
|
||||
|
||||
::: langchain_groq
|
||||
@@ -1,14 +0,0 @@
|
||||
---
|
||||
title: HuggingFace
|
||||
---
|
||||
|
||||
# :simple-huggingface:{ .lg .middle } `langchain-huggingface`
|
||||
|
||||
[](https://pypi.org/project/langchain-huggingface/#history)
|
||||
[](https://opensource.org/licenses/MIT)
|
||||
[](https://pypistats.org/packages/langchain-huggingface)
|
||||
|
||||
!!! note "Reference docs"
|
||||
This page contains **reference documentation** for Hugging Face. See [the docs](https://docs.langchain.com/oss/python/integrations/providers/huggingface) for conceptual guides, tutorials, and examples on using Hugging Face modules.
|
||||
|
||||
::: langchain_huggingface
|
||||
@@ -1,10 +0,0 @@
|
||||
---
|
||||
title: ChatWatsonx
|
||||
---
|
||||
|
||||
# `ChatWatsonx`
|
||||
|
||||
!!! note "Reference docs"
|
||||
This page contains **reference documentation** for `ChatWatsonx`. See [the docs](https://docs.langchain.com/oss/python/integrations/chat/ibm_watsonx) for conceptual guides, tutorials, and examples on using `ChatWatsonx`.
|
||||
|
||||
::: langchain_ibm.chat_models.ChatWatsonx
|
||||
@@ -1,10 +0,0 @@
|
||||
---
|
||||
title: WatsonxEmbeddings
|
||||
---
|
||||
|
||||
# `WatsonxEmbeddings`
|
||||
|
||||
!!! note "Reference docs"
|
||||
This page contains **reference documentation** for `WatsonxEmbeddings`. See [the docs](https://docs.langchain.com/oss/python/integrations/embeddings/ibm_watsonx) for conceptual guides, tutorials, and examples on using `WatsonxEmbeddings`.
|
||||
|
||||
::: langchain_ibm.embeddings.WatsonxEmbeddings
|
||||
@@ -1,10 +0,0 @@
|
||||
---
|
||||
title: WatsonxLLM
|
||||
---
|
||||
|
||||
# `WatsonxLLM`
|
||||
|
||||
!!! note "Reference docs"
|
||||
This page contains **reference documentation** for `WatsonxLLM`. See [the docs](https://docs.langchain.com/oss/python/integrations/llms/ibm_watsonx) for conceptual guides, tutorials, and examples on using `WatsonxLLM`.
|
||||
|
||||
::: langchain_ibm.llms.WatsonxLLM
|
||||
@@ -1,10 +0,0 @@
|
||||
---
|
||||
title: WatsonxRerank
|
||||
---
|
||||
|
||||
# `WatsonxRerank`
|
||||
|
||||
!!! note "Reference docs"
|
||||
This page contains **reference documentation** for `WatsonxRerank`. See [the docs](https://docs.langchain.com/oss/python/integrations/retrievers/ibm_watsonx_ranker) for conceptual guides, tutorials, and examples on using `WatsonxRerank`.
|
||||
|
||||
::: langchain_ibm.rerank.WatsonxRerank
|
||||
@@ -1,10 +0,0 @@
|
||||
---
|
||||
title: WatsonxSQLDatabaseToolkit
|
||||
---
|
||||
|
||||
# `WatsonxSQLDatabaseToolkit`
|
||||
|
||||
!!! note "Reference docs"
|
||||
This page contains **reference documentation** for `WatsonxSQLDatabaseToolkit`.
|
||||
|
||||
::: langchain_ibm.agent_toolkits.sql.toolkit.WatsonxSQLDatabaseToolkit
|
||||
@@ -1,10 +0,0 @@
|
||||
---
|
||||
title: WatsonxToolkit
|
||||
---
|
||||
|
||||
# `WatsonxToolkit`
|
||||
|
||||
!!! note "Reference docs"
|
||||
This page contains **reference documentation** for `WatsonxToolkit`. See [the docs](https://docs.langchain.com/oss/python/integrations/tools/ibm_watsonx) for conceptual guides, tutorials, and examples on using `WatsonxToolkit`.
|
||||
|
||||
::: langchain_ibm.agent_toolkits.utility.toolkit.WatsonxToolkit
|
||||
@@ -1,66 +0,0 @@
|
||||
---
|
||||
title: IBM
|
||||
---
|
||||
|
||||
# `langchain-ibm`
|
||||
|
||||
[](https://pypi.org/project/langchain-ibm/#history)
|
||||
[](https://opensource.org/licenses/MIT)
|
||||
[](https://pypistats.org/packages/langchain-ibm)
|
||||
|
||||
## Modules
|
||||
|
||||
!!! note "Usage documentation"
|
||||
Refer to [the docs](https://docs.langchain.com/oss/python/integrations/providers/ibm) for a high-level guide on how to use each module. These reference pages contain auto-generated API documentation for each module, focusing on the "what" rather than the "how" or "why" (i.e. no end-to-end tutorials or conceptual overviews).
|
||||
|
||||
<div class="grid cards" markdown>
|
||||
|
||||
- :material-message-text:{ .lg .middle } __`ChatWatsonx`__
|
||||
|
||||
---
|
||||
|
||||
IBM watsonx.ai chat models.
|
||||
|
||||
[:octicons-arrow-right-24: Reference](./ChatWatsonx.md)
|
||||
|
||||
- :fontawesome-solid-i-cursor:{ .lg .middle } __`WatsonxLLM`__
|
||||
|
||||
---
|
||||
|
||||
(Legacy) IBM watsonx.ai text completion models.
|
||||
|
||||
[:octicons-arrow-right-24: Reference](./WatsonxLLM.md)
|
||||
|
||||
- :fontawesome-solid-layer-group:{ .lg .middle } __`WatsonxEmbeddings`__
|
||||
|
||||
---
|
||||
|
||||
IBM watsonx.ai embedding models.
|
||||
|
||||
[:octicons-arrow-right-24: Reference](./WatsonxEmbeddings.md)
|
||||
|
||||
- :fontawesome-solid-download:{ .lg .middle } __`WatsonxRerank`__
|
||||
|
||||
---
|
||||
|
||||
IBM watsonx.ai document retriever.
|
||||
|
||||
[:octicons-arrow-right-24: Reference](./WatsonxRerank.md)
|
||||
|
||||
- :fontawesome-solid-screwdriver-wrench:{ .lg .middle } __`WatsonxToolkit`__
|
||||
|
||||
---
|
||||
|
||||
IBM watsonx.ai toolkit.
|
||||
|
||||
[:octicons-arrow-right-24: Reference](./WatsonxToolkit.md)
|
||||
|
||||
- :fontawesome-solid-screwdriver-wrench:{ .lg .middle } __`WatsonxSQLDatabaseToolkit`__
|
||||
|
||||
---
|
||||
|
||||
IBM watsonx.ai SQL database toolkit.
|
||||
|
||||
[:octicons-arrow-right-24: Reference](./WatsonxSQLDatabaseToolkit.md)
|
||||
|
||||
</div>
|
||||
@@ -1,14 +0,0 @@
|
||||
---
|
||||
title: Milvus
|
||||
---
|
||||
|
||||
# :simple-milvus:{ .lg .middle } `langchain-milvus`
|
||||
|
||||
[](https://pypi.org/project/langchain-milvus/#history)
|
||||
[](https://opensource.org/licenses/MIT)
|
||||
[](https://pypistats.org/packages/langchain-milvus)
|
||||
|
||||
!!! note "Reference docs"
|
||||
This page contains **reference documentation** for Milvus. See [the docs](https://docs.langchain.com/oss/python/integrations/providers/milvus) for conceptual guides, tutorials, and examples on using Milvus modules.
|
||||
|
||||
::: langchain_milvus
|
||||
@@ -1,14 +0,0 @@
|
||||
---
|
||||
title: MistralAI
|
||||
---
|
||||
|
||||
# :simple-mistralai:{ .lg .middle } `langchain-mistralai`
|
||||
|
||||
[](https://pypi.org/project/langchain-mistralai/#history)
|
||||
[](https://opensource.org/licenses/MIT)
|
||||
[](https://pypistats.org/packages/langchain-mistralai)
|
||||
|
||||
!!! note "Reference docs"
|
||||
This page contains **reference documentation** for Mistral AI. See [the docs](https://docs.langchain.com/oss/python/integrations/providers/mistralai) for conceptual guides, tutorials, and examples on using Mistral AI modules.
|
||||
|
||||
::: langchain_mistralai
|
||||
@@ -1,7 +0,0 @@
|
||||
---
|
||||
title: MongoDB
|
||||
---
|
||||
|
||||
# :simple-mongodb:{ .lg .middle } `langchain-mongodb`
|
||||
|
||||
Documentation for `langchain-mongodb` is hosted separately by the MongoDB team. Visit their [official API reference site](https://langchain-mongodb.readthedocs.io/en/latest/index.html) to get started with this integration.
|
||||
@@ -1,14 +0,0 @@
|
||||
---
|
||||
title: Neo4J
|
||||
---
|
||||
|
||||
# :simple-neo4j:{ .lg .middle } `langchain-neo4j`
|
||||
|
||||
[](https://pypi.org/project/langchain-neo4j/#history)
|
||||
[](https://opensource.org/licenses/MIT)
|
||||
[](https://pypistats.org/packages/langchain-neo4j)
|
||||
|
||||
!!! note "Reference docs"
|
||||
This page contains **reference documentation** for Neo4j. See [the docs](https://docs.langchain.com/oss/python/integrations/providers/neo4j) for conceptual guides, tutorials, and examples on using Neo4j modules.
|
||||
|
||||
::: langchain_neo4j
|
||||
@@ -1,14 +0,0 @@
|
||||
---
|
||||
title: Nomic
|
||||
---
|
||||
|
||||
# `langchain-nomic`
|
||||
|
||||
[](https://pypi.org/project/langchain-nomic/#history)
|
||||
[](https://opensource.org/licenses/MIT)
|
||||
[](https://pypistats.org/packages/langchain-nomic)
|
||||
|
||||
!!! note "Reference docs"
|
||||
This page contains **reference documentation** for Nomic. See [the docs](https://docs.langchain.com/oss/python/integrations/providers/nomic) for conceptual guides, tutorials, and examples on using Nomic modules.
|
||||
|
||||
::: langchain_nomic
|
||||
@@ -1,11 +0,0 @@
|
||||
---
|
||||
title: Nvidia AI Endpoints
|
||||
---
|
||||
|
||||
# :simple-nvidia:{ .lg .middle } `langchain-nvidia-ai-endpoints`
|
||||
|
||||
[](https://pypi.org/project/langchain-nvidia-ai-endpoints/#history)
|
||||
[](https://opensource.org/licenses/MIT)
|
||||
[](https://pypistats.org/packages/langchain-nvidia-ai-endpoints)
|
||||
|
||||
::: langchain_nvidia_ai_endpoints
|
||||
@@ -1,14 +0,0 @@
|
||||
---
|
||||
title: Ollama
|
||||
---
|
||||
|
||||
# :simple-ollama:{ .lg .middle } `langchain-ollama`
|
||||
|
||||
[](https://pypi.org/project/langchain-ollama/#history)
|
||||
[](https://opensource.org/licenses/MIT)
|
||||
[](https://pypistats.org/packages/langchain-ollama)
|
||||
|
||||
!!! note "Reference docs"
|
||||
This page contains **reference documentation** for Ollama. See [the docs](https://docs.langchain.com/oss/python/integrations/providers/ollama) for conceptual guides, tutorials, and examples on using Ollama modules.
|
||||
|
||||
::: langchain_ollama
|
||||
@@ -1,10 +0,0 @@
|
||||
---
|
||||
title: AzureChatOpenAI
|
||||
---
|
||||
|
||||
# :material-microsoft-azure:{ .lg .middle } `AzureChatOpenAI`
|
||||
|
||||
!!! note "Reference docs"
|
||||
This page contains **reference documentation** for `AzureChatOpenAI`. See [the docs](https://docs.langchain.com/oss/python/integrations/chat/azure_chat_openai) for conceptual guides, tutorials, and examples on using `AzureChatOpenAI`.
|
||||
|
||||
::: langchain_openai.AzureChatOpenAI
|
||||
@@ -1,10 +0,0 @@
|
||||
---
|
||||
title: AzureOpenAI (Legacy LLM)
|
||||
---
|
||||
|
||||
# :material-microsoft-azure:{ .lg .middle } `AzureOpenAI` (Legacy LLM)
|
||||
|
||||
!!! note "Reference docs"
|
||||
This page contains **reference documentation** for the legacy `AzureOpenAI` LLM. See [the docs](https://docs.langchain.com/oss/python/integrations/llms/azure_openai) for conceptual guides, tutorials, and examples on using `AzureOpenAI`.
|
||||
|
||||
::: langchain_openai.AzureOpenAI
|
||||
@@ -1,10 +0,0 @@
|
||||
---
|
||||
title: AzureOpenAIEmbeddings
|
||||
---
|
||||
|
||||
# :material-microsoft-azure:{ .lg .middle } `AzureOpenAIEmbeddings`
|
||||
|
||||
!!! note "Reference docs"
|
||||
This page contains **reference documentation** for `AzureOpenAIEmbeddings`. See [the docs](https://docs.langchain.com/oss/python/integrations/embeddings/azure_openai) for conceptual guides, tutorials, and examples on using `AzureOpenAIEmbeddings`.
|
||||
|
||||
::: langchain_openai.AzureOpenAIEmbeddings
|
||||
@@ -1,7 +0,0 @@
|
||||
---
|
||||
title: BaseChatOpenAI
|
||||
---
|
||||
|
||||
# :fontawesome-brands-openai:{ .lg .middle } `BaseChatOpenAI`
|
||||
|
||||
::: langchain_openai.chat_models.base.BaseChatOpenAI
|
||||
@@ -1,10 +0,0 @@
|
||||
---
|
||||
title: ChatOpenAI
|
||||
---
|
||||
|
||||
# :fontawesome-brands-openai:{ .lg .middle } `ChatOpenAI`
|
||||
|
||||
!!! note "Reference docs"
|
||||
This page contains **reference documentation** for `ChatOpenAI`. See [the docs](https://docs.langchain.com/oss/python/integrations/chat/openai) for conceptual guides, tutorials, and examples on using `ChatOpenAI`.
|
||||
|
||||
::: langchain_openai.ChatOpenAI
|
||||
@@ -1,10 +0,0 @@
|
||||
---
|
||||
title: OpenAI (Legacy LLM)
|
||||
---
|
||||
|
||||
# :fontawesome-brands-openai:{ .lg .middle } `OpenAI` (Legacy LLM)
|
||||
|
||||
!!! note "Reference docs"
|
||||
This page contains **reference documentation** for the legacy `OpenAI` LLM. See [the docs](https://docs.langchain.com/oss/python/integrations/llms/openai) for conceptual guides, tutorials, and examples on using `OpenAI`.
|
||||
|
||||
::: langchain_openai.OpenAI
|
||||
@@ -1,10 +0,0 @@
|
||||
---
|
||||
title: OpenAIEmbeddings
|
||||
---
|
||||
|
||||
# :fontawesome-brands-openai:{ .lg .middle } `OpenAIEmbeddings`
|
||||
|
||||
!!! note "Reference docs"
|
||||
This page contains **reference documentation** for `OpenAIEmbeddings`. See [the docs](https://docs.langchain.com/oss/python/integrations/embeddings/openai) for conceptual guides, tutorials, and examples on using `OpenAIEmbeddings`.
|
||||
|
||||
::: langchain_openai.OpenAIEmbeddings
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user