mirror of
				https://github.com/hwchase17/langchain.git
				synced 2025-11-04 02:03:32 +00:00 
			
		
		
		
	Thank you for contributing to LangChain!
- [ ] **PR title**: "package: description"
- Where "package" is whichever of langchain, core, etc. is being
modified. Use "docs: ..." for purely docs changes, "infra: ..." for CI
changes.
  - Example: "core: add foobar LLM"
- [ ] **PR message**: ***Delete this entire checklist*** and replace
with
    - **Description:** a description of the change
    - **Issue:** the issue # it fixes, if applicable
    - **Dependencies:** any dependencies required for this change
- **Twitter handle:** if your PR gets announced, and you'd like a
mention, we'll gladly shout you out!
- [ ] **Add tests and docs**: If you're adding a new integration, please
include
1. a test for the integration, preferably unit tests that do not rely on
network access,
2. an example notebook showing its use. It lives in
`docs/docs/integrations` directory.
- [ ] **Lint and test**: Run `make format`, `make lint` and `make test`
from the root of the package(s) you've modified. See contribution
guidelines for more: https://python.langchain.com/docs/contributing/
Additional guidelines:
- Make sure optional dependencies are imported within a function.
- Please do not add dependencies to pyproject.toml files (even optional
ones) unless they are required for unit tests.
- Most PRs should not touch more than one package.
- Changes should be backwards compatible.
If no one reviews your PR within a few days, please @-mention one of
baskaryan, eyurtsev, ccurme, vbarda, hwchase17.
		
	
		
			
				
	
	
		
			332 lines
		
	
	
		
			9.2 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			332 lines
		
	
	
		
			9.2 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
/* eslint-disable global-require,import/no-extraneous-dependencies */
 | 
						|
 | 
						|
// @ts-check
 | 
						|
// Note: type annotations allow type checking and IDEs autocompletion
 | 
						|
// eslint-disable-next-line import/no-extraneous-dependencies
 | 
						|
const { ProvidePlugin } = require("webpack");
 | 
						|
require("dotenv").config();
 | 
						|
 | 
						|
const prism = require("prism-react-renderer");
 | 
						|
 | 
						|
const baseLightCodeBlockTheme = prism.themes.vsLight;
 | 
						|
const baseDarkCodeBlockTheme = prism.themes.vsDark;
 | 
						|
 | 
						|
const baseUrl = "/";
 | 
						|
 | 
						|
/** @type {import('@docusaurus/types').Config} */
 | 
						|
const config = {
 | 
						|
  title: "🦜️🔗 LangChain",
 | 
						|
  tagline: "LangChain Python Docs",
 | 
						|
  favicon: "img/brand/favicon.png",
 | 
						|
  // Set the production url of your site here
 | 
						|
  url: "https://python.langchain.com",
 | 
						|
  // Set the /<baseUrl>/ pathname under which your site is served
 | 
						|
  // For GitHub pages deployment, it is often '/<projectName>/'
 | 
						|
  baseUrl: baseUrl,
 | 
						|
  trailingSlash: true,
 | 
						|
  onBrokenLinks: "throw",
 | 
						|
  onBrokenMarkdownLinks: "throw",
 | 
						|
  onBrokenAnchors: "throw",
 | 
						|
 | 
						|
  themes: ["@docusaurus/theme-mermaid"],
 | 
						|
  markdown: {
 | 
						|
    mermaid: true,
 | 
						|
  },
 | 
						|
 | 
						|
  plugins: [
 | 
						|
    () => ({
 | 
						|
      name: "custom-webpack-config",
 | 
						|
      configureWebpack: () => ({
 | 
						|
        plugins: [
 | 
						|
          new ProvidePlugin({
 | 
						|
            process: require.resolve("process/browser"),
 | 
						|
          }),
 | 
						|
        ],
 | 
						|
        resolve: {
 | 
						|
          fallback: {
 | 
						|
            path: false,
 | 
						|
            url: false,
 | 
						|
          },
 | 
						|
        },
 | 
						|
        module: {
 | 
						|
          rules: [
 | 
						|
            {
 | 
						|
              test: /\.m?js/,
 | 
						|
              resolve: {
 | 
						|
                fullySpecified: false,
 | 
						|
              },
 | 
						|
            },
 | 
						|
            {
 | 
						|
              test: /\.py$/,
 | 
						|
              loader: "raw-loader",
 | 
						|
              resolve: {
 | 
						|
                fullySpecified: false,
 | 
						|
              },
 | 
						|
            },
 | 
						|
            {
 | 
						|
              test: /\.ya?ml$/,
 | 
						|
              use: 'yaml-loader'
 | 
						|
            },
 | 
						|
            {
 | 
						|
              test: /\.ipynb$/,
 | 
						|
              loader: "raw-loader",
 | 
						|
              resolve: {
 | 
						|
                fullySpecified: false,
 | 
						|
              },
 | 
						|
            },
 | 
						|
          ],
 | 
						|
        },
 | 
						|
      }),
 | 
						|
    }),
 | 
						|
  ],
 | 
						|
 | 
						|
  presets: [
 | 
						|
    [
 | 
						|
      "classic",
 | 
						|
      /** @type {import('@docusaurus/preset-classic').Options} */
 | 
						|
      ({
 | 
						|
        docs: {
 | 
						|
          editUrl: "https://github.com/langchain-ai/langchain/edit/master/docs/",
 | 
						|
          sidebarPath: require.resolve("./sidebars.js"),
 | 
						|
          remarkPlugins: [
 | 
						|
            [require("@docusaurus/remark-plugin-npm2yarn"), { sync: true }],
 | 
						|
          ],
 | 
						|
          async sidebarItemsGenerator({
 | 
						|
            defaultSidebarItemsGenerator,
 | 
						|
            ...args
 | 
						|
          }) {
 | 
						|
            const sidebarItems = await defaultSidebarItemsGenerator(args);
 | 
						|
            sidebarItems.forEach((subItem) => {
 | 
						|
              // This allows breaking long sidebar labels into multiple lines
 | 
						|
              // by inserting a zero-width space after each slash.
 | 
						|
              if (
 | 
						|
                "label" in subItem &&
 | 
						|
                subItem.label &&
 | 
						|
                subItem.label.includes("/")
 | 
						|
              ) {
 | 
						|
                // eslint-disable-next-line no-param-reassign
 | 
						|
                subItem.label = subItem.label.replace(/\//g, "/\u200B");
 | 
						|
              }
 | 
						|
              if (args.item.className) {
 | 
						|
                subItem.className = args.item.className;
 | 
						|
              }
 | 
						|
            });
 | 
						|
            return sidebarItems;
 | 
						|
          },
 | 
						|
        },
 | 
						|
        pages: {
 | 
						|
          remarkPlugins: [require("@docusaurus/remark-plugin-npm2yarn")],
 | 
						|
        },
 | 
						|
        theme: {
 | 
						|
          customCss: require.resolve("./src/css/custom.css"),
 | 
						|
        },
 | 
						|
      }),
 | 
						|
    ],
 | 
						|
  ],
 | 
						|
 | 
						|
  themeConfig:
 | 
						|
    /** @type {import('@docusaurus/preset-classic').ThemeConfig} */
 | 
						|
    ({
 | 
						|
      docs: {
 | 
						|
        sidebar: {
 | 
						|
          hideable: true,
 | 
						|
          autoCollapseCategories: true,
 | 
						|
        },
 | 
						|
      },
 | 
						|
      colorMode: {
 | 
						|
        disableSwitch: false,
 | 
						|
        respectPrefersColorScheme: true,
 | 
						|
      },
 | 
						|
      announcementBar: {
 | 
						|
        content:
 | 
						|
          '<strong>Our <a href="https://academy.langchain.com/courses/ambient-agents/?utm_medium=internal&utm_source=docs&utm_campaign=q2-2025_ambient-agents_co" target="_blank">Building Ambient Agents with LangGraph</a> course is now available on LangChain Academy!</strong>',
 | 
						|
          backgroundColor: '#d0c9fe'
 | 
						|
      },
 | 
						|
      prism: {
 | 
						|
        theme: {
 | 
						|
          ...baseLightCodeBlockTheme,
 | 
						|
          plain: {
 | 
						|
            ...baseLightCodeBlockTheme.plain,
 | 
						|
            backgroundColor: "#F5F5F5",
 | 
						|
          },
 | 
						|
        },
 | 
						|
        darkTheme: {
 | 
						|
          ...baseDarkCodeBlockTheme,
 | 
						|
          plain: {
 | 
						|
            ...baseDarkCodeBlockTheme.plain,
 | 
						|
            backgroundColor: "#222222",
 | 
						|
          },
 | 
						|
        },
 | 
						|
      },
 | 
						|
      image: "img/brand/theme-image.png",
 | 
						|
      navbar: {
 | 
						|
        logo: {src: "img/brand/wordmark.png", srcDark: "img/brand/wordmark-dark.png"},
 | 
						|
        items: [
 | 
						|
          {
 | 
						|
            type: "docSidebar",
 | 
						|
            position: "left",
 | 
						|
            sidebarId: "integrations",
 | 
						|
            label: "Integrations",
 | 
						|
          },
 | 
						|
          {
 | 
						|
            label: "API Reference",
 | 
						|
            to: "https://python.langchain.com/api_reference/",
 | 
						|
          },
 | 
						|
          {
 | 
						|
            type: "dropdown",
 | 
						|
            label: "More",
 | 
						|
            position: "left",
 | 
						|
            items: [
 | 
						|
              {
 | 
						|
                type: "doc",
 | 
						|
                docId: "contributing/index",
 | 
						|
                label: "Contributing",
 | 
						|
              },
 | 
						|
              {
 | 
						|
                type: "doc",
 | 
						|
                docId: "people",
 | 
						|
                label: "People",
 | 
						|
              },
 | 
						|
              {
 | 
						|
                type: "doc",
 | 
						|
                docId: "troubleshooting/errors/index",
 | 
						|
                label: "Error reference",
 | 
						|
              },
 | 
						|
              {
 | 
						|
                type: 'html',
 | 
						|
                value: '<hr class="dropdown-separator" style="margin-top: 0.5rem; margin-bottom: 0.5rem">',
 | 
						|
              },
 | 
						|
              {
 | 
						|
                href: "https://docs.smith.langchain.com",
 | 
						|
                label: "LangSmith",
 | 
						|
              },
 | 
						|
              {
 | 
						|
                href: "https://langchain-ai.github.io/langgraph/",
 | 
						|
                label: "LangGraph",
 | 
						|
              },
 | 
						|
              {
 | 
						|
                href: "https://smith.langchain.com/hub",
 | 
						|
                label: "LangChain Hub",
 | 
						|
              },
 | 
						|
              {
 | 
						|
                href: "https://js.langchain.com",
 | 
						|
                label: "LangChain JS/TS",
 | 
						|
              },
 | 
						|
            ]
 | 
						|
          },
 | 
						|
          {
 | 
						|
            type: "dropdown",
 | 
						|
            label: "v0.3",
 | 
						|
            position: "right",
 | 
						|
            items: [
 | 
						|
              {
 | 
						|
                label: "v0.3",
 | 
						|
                href: "/docs/introduction"
 | 
						|
              },
 | 
						|
              {
 | 
						|
                label: "v0.2",
 | 
						|
                href: "https://python.langchain.com/v0.2/docs/introduction"
 | 
						|
              },
 | 
						|
              {
 | 
						|
                label: "v0.1",
 | 
						|
                href: "https://python.langchain.com/v0.1/docs/get_started/introduction"
 | 
						|
              }
 | 
						|
            ]
 | 
						|
          },
 | 
						|
          {
 | 
						|
            to: "https://chat.langchain.com",
 | 
						|
            label: "💬",
 | 
						|
            position: "right",
 | 
						|
          },
 | 
						|
          // Please keep GitHub link to the right for consistency.
 | 
						|
          {
 | 
						|
            href: "https://github.com/langchain-ai/langchain",
 | 
						|
            position: "right",
 | 
						|
            className: "header-github-link",
 | 
						|
            "aria-label": "GitHub repository",
 | 
						|
          },
 | 
						|
        ],
 | 
						|
      },
 | 
						|
      footer: {
 | 
						|
        style: "light",
 | 
						|
        links: [
 | 
						|
          {
 | 
						|
            title: "Community",
 | 
						|
            items: [
 | 
						|
              {
 | 
						|
                label: "LangChain Forum",
 | 
						|
                href: "https://forum.langchain.com/",
 | 
						|
              },
 | 
						|
              {
 | 
						|
                label: "Twitter",
 | 
						|
                href: "https://twitter.com/LangChainAI",
 | 
						|
              },
 | 
						|
            ],
 | 
						|
          },
 | 
						|
          {
 | 
						|
            title: "GitHub",
 | 
						|
            items: [
 | 
						|
              {
 | 
						|
                label: "Organization",
 | 
						|
                href: "https://github.com/langchain-ai",
 | 
						|
              },
 | 
						|
              {
 | 
						|
                label: "Python",
 | 
						|
                href: "https://github.com/langchain-ai/langchain",
 | 
						|
              },
 | 
						|
              {
 | 
						|
                label: "JS/TS",
 | 
						|
                href: "https://github.com/langchain-ai/langchainjs",
 | 
						|
              },
 | 
						|
            ],
 | 
						|
          },
 | 
						|
          {
 | 
						|
            title: "More",
 | 
						|
            items: [
 | 
						|
              {
 | 
						|
                label: "Homepage",
 | 
						|
                href: "https://langchain.com",
 | 
						|
              },
 | 
						|
              {
 | 
						|
                label: "Blog",
 | 
						|
                href: "https://blog.langchain.dev",
 | 
						|
              },
 | 
						|
              {
 | 
						|
                label: "YouTube",
 | 
						|
                href: "https://www.youtube.com/@LangChain",
 | 
						|
              },
 | 
						|
            ],
 | 
						|
          },
 | 
						|
        ],
 | 
						|
        copyright: `Copyright © ${new Date().getFullYear()} LangChain, Inc.`,
 | 
						|
      },
 | 
						|
      algolia: {
 | 
						|
        // The application ID provided by Algolia
 | 
						|
        appId: "VAU016LAWS",
 | 
						|
 | 
						|
        // Public API key: it is safe to commit it
 | 
						|
        // this is linked to erick@langchain.dev currently
 | 
						|
        apiKey: "6c01842d6a88772ed2236b9c85806441",
 | 
						|
 | 
						|
        indexName: "python-langchain-latest",
 | 
						|
 | 
						|
        contextualSearch: false,
 | 
						|
      },
 | 
						|
    }),
 | 
						|
 | 
						|
  scripts: [
 | 
						|
    baseUrl + "js/google_analytics.js",
 | 
						|
    {
 | 
						|
      src: "https://www.googletagmanager.com/gtag/js?id=G-9B66JQQH2F",
 | 
						|
      async: true,
 | 
						|
    },
 | 
						|
  ],
 | 
						|
 | 
						|
  customFields: {
 | 
						|
    supabasePublicKey: process.env.NEXT_PUBLIC_SUPABASE_PUBLIC_KEY,
 | 
						|
    supabaseUrl: process.env.NEXT_PUBLIC_SUPABASE_URL,
 | 
						|
  },
 | 
						|
};
 | 
						|
 | 
						|
module.exports = config;
 |