mirror of
https://github.com/hwchase17/langchain.git
synced 2026-01-30 13:50:11 +00:00
Compare commits
8 Commits
langchain-
...
langchain-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
51fd70be63 | ||
|
|
7d2753fbd6 | ||
|
|
cfd11b2c34 | ||
|
|
8b7843b343 | ||
|
|
ffefaa6490 | ||
|
|
8ecef68b10 | ||
|
|
13a6847478 | ||
|
|
064b891454 |
2
.github/workflows/_release.yml
vendored
2
.github/workflows/_release.yml
vendored
@@ -85,7 +85,7 @@ jobs:
|
||||
path: langchain
|
||||
sparse-checkout: | # this only grabs files for relevant dir
|
||||
${{ inputs.working-directory }}
|
||||
ref: master # this scopes to just master branch
|
||||
ref: ${{ github.ref }} # this scopes to just ref'd branch
|
||||
fetch-depth: 0 # this fetches entire commit history
|
||||
- name: Check Tags
|
||||
id: check-tags
|
||||
|
||||
3
.github/workflows/codespell.yml
vendored
3
.github/workflows/codespell.yml
vendored
@@ -3,9 +3,8 @@ name: CI / cd . / make spell_check
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master, v0.1]
|
||||
branches: [master, v0.1, v0.2]
|
||||
pull_request:
|
||||
branches: [master, v0.1]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
@@ -82,7 +82,7 @@ vercel-build: install-vercel-deps build generate-references
|
||||
mv $(OUTPUT_NEW_DOCS_DIR) docs
|
||||
rm -rf build
|
||||
mkdir static/api_reference
|
||||
git clone --depth=1 https://github.com/baskaryan/langchain-api-docs-build.git
|
||||
git clone --depth=1 -b v0.2 https://github.com/baskaryan/langchain-api-docs-build.git
|
||||
mv langchain-api-docs-build/api_reference_build/html/* static/api_reference/
|
||||
rm -rf langchain-api-docs-build
|
||||
NODE_OPTIONS="--max-old-space-size=5000" yarn run docusaurus build
|
||||
|
||||
@@ -126,10 +126,8 @@ const config = {
|
||||
({
|
||||
announcementBar: {
|
||||
content:
|
||||
'Share your thoughts on AI agents. <a target="_blank" href="https://langchain.typeform.com/state-of-agents">Take the 3-min survey</a>.',
|
||||
isCloseable: true,
|
||||
backgroundColor: "rgba(53, 151, 147, 0.1)",
|
||||
textColor: "rgb(53, 151, 147)",
|
||||
'A newer LangChain version is out! Check out the <a href="https://python.langchain.com/docs/introduction">latest version</a>.',
|
||||
isCloseable: false,
|
||||
},
|
||||
docs: {
|
||||
sidebar: {
|
||||
@@ -222,6 +220,10 @@ const config = {
|
||||
label: "v0.2",
|
||||
position: "right",
|
||||
items: [
|
||||
{
|
||||
label: "Latest",
|
||||
href: "https://python.langchain.com/docs/introduction/"
|
||||
},
|
||||
{
|
||||
label: "v0.2",
|
||||
href: "/docs/introduction"
|
||||
|
||||
@@ -4,20 +4,25 @@ echo "VERCEL_ENV: $VERCEL_ENV"
|
||||
echo "VERCEL_GIT_COMMIT_REF: $VERCEL_GIT_COMMIT_REF"
|
||||
|
||||
|
||||
if [ "$VERCEL_ENV" == "production" ] || [ "$VERCEL_GIT_COMMIT_REF" == "master" ] || [ "$VERCEL_GIT_COMMIT_REF" == "v0.1" ]; then
|
||||
echo "✅ Production build - proceeding with build"
|
||||
exit 1;
|
||||
else
|
||||
echo "Checking for changes in docs/"
|
||||
if [ "$VERCEL_ENV" == "production" ] || \
|
||||
[ "$VERCEL_GIT_COMMIT_REF" == "master" ] || \
|
||||
[ "$VERCEL_GIT_COMMIT_REF" == "v0.1" ] || \
|
||||
[ "$VERCEL_GIT_COMMIT_REF" == "v0.2" ]
|
||||
then
|
||||
echo "✅ Production build - proceeding with build"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
echo "Checking for changes in docs/"
|
||||
echo "---"
|
||||
git log -n 50 --pretty=format:"%s" -- . | grep -v '(#'
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "---"
|
||||
git log -n 50 --pretty=format:"%s" -- . | grep -v '(#'
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "---"
|
||||
echo "✅ Changes detected in docs/ - proceeding with build"
|
||||
exit 1
|
||||
else
|
||||
echo "---"
|
||||
echo "🛑 No changes detected in docs/ - ignoring build"
|
||||
exit 0
|
||||
fi
|
||||
echo "✅ Changes detected in docs/ - proceeding with build"
|
||||
exit 1
|
||||
else
|
||||
echo "---"
|
||||
echo "🛑 No changes detected in docs/ - ignoring build"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
@@ -248,16 +248,26 @@ nav, h1, h2, h3, h4 {
|
||||
no-repeat;
|
||||
}
|
||||
|
||||
div[class^=announcementBar_] {
|
||||
height:40px !important;
|
||||
font-size: 20px !important;
|
||||
}
|
||||
div[class^='announcementBar_'] {
|
||||
font-size: 20px;
|
||||
|
||||
[data-theme='dark'] div[class^=announcementBar_] {
|
||||
background-color: #1b1b1b;
|
||||
color: #fff;
|
||||
}
|
||||
/*
|
||||
--site-announcement-bar-stripe-color1: hsl(
|
||||
var(--site-primary-hue-saturation) 85%
|
||||
);
|
||||
--site-announcement-bar-stripe-color2: hsl(
|
||||
var(--site-primary-hue-saturation) 95%
|
||||
);
|
||||
*/
|
||||
--site-announcement-bar-stripe-color1: rgb(197,186,254);
|
||||
--site-announcement-bar-stripe-color2: rgb(255,246,224);
|
||||
|
||||
[data-theme='dark'] div[class^=announcementBar_] button {
|
||||
color: #fff;
|
||||
background: repeating-linear-gradient(
|
||||
-35deg,
|
||||
var(--site-announcement-bar-stripe-color1),
|
||||
var(--site-announcement-bar-stripe-color1) 20px,
|
||||
var(--site-announcement-bar-stripe-color2) 10px,
|
||||
var(--site-announcement-bar-stripe-color2) 40px
|
||||
);
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
@@ -3,18 +3,10 @@
|
||||
|
||||
import React from 'react';
|
||||
import clsx from 'clsx';
|
||||
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
|
||||
import Link from '@docusaurus/Link';
|
||||
import Translate from '@docusaurus/Translate';
|
||||
import {
|
||||
useActivePlugin,
|
||||
useDocVersionSuggestions,
|
||||
} from '@docusaurus/plugin-content-docs/client';
|
||||
import {ThemeClassNames} from '@docusaurus/theme-common';
|
||||
import {
|
||||
useDocsPreferredVersion,
|
||||
useDocsVersion,
|
||||
} from '@docusaurus/theme-common/internal';
|
||||
import { useLocalPathname } from '@docusaurus/theme-common/internal';
|
||||
function UnreleasedVersionLabel({siteTitle, versionMetadata}) {
|
||||
return (
|
||||
<Translate
|
||||
@@ -79,123 +71,40 @@ function LatestVersionSuggestionLabel({versionLabel, to, onClick}) {
|
||||
</Translate>
|
||||
);
|
||||
}
|
||||
function DocVersionBannerEnabled({className, versionMetadata}) {
|
||||
const {
|
||||
siteConfig: {title: siteTitle},
|
||||
} = useDocusaurusContext();
|
||||
const {pluginId} = useActivePlugin({failfast: true});
|
||||
const getVersionMainDoc = (version) =>
|
||||
version.docs.find((doc) => doc.id === version.mainDocId);
|
||||
const {savePreferredVersionName} = useDocsPreferredVersion(pluginId);
|
||||
const {latestDocSuggestion, latestVersionSuggestion} =
|
||||
useDocVersionSuggestions(pluginId);
|
||||
// Try to link to same doc in latest version (not always possible), falling
|
||||
// back to main doc of latest version
|
||||
const latestVersionSuggestedDoc =
|
||||
latestDocSuggestion ?? getVersionMainDoc(latestVersionSuggestion);
|
||||
return (
|
||||
<div
|
||||
className={clsx(
|
||||
className,
|
||||
ThemeClassNames.docs.docVersionBanner,
|
||||
'alert alert--warning margin-bottom--md',
|
||||
)}
|
||||
role="alert">
|
||||
<div>
|
||||
<BannerLabel siteTitle={siteTitle} versionMetadata={versionMetadata} />
|
||||
</div>
|
||||
<div className="margin-top--md">
|
||||
<LatestVersionSuggestionLabel
|
||||
versionLabel={latestVersionSuggestion.label}
|
||||
to={latestVersionSuggestedDoc.path}
|
||||
onClick={() => savePreferredVersionName(latestVersionSuggestion.name)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function LatestDocVersionBanner({className, versionMetadata}) {
|
||||
const {
|
||||
siteConfig: {title: siteTitle},
|
||||
} = useDocusaurusContext();
|
||||
const {pluginId} = useActivePlugin({failfast: true});
|
||||
const getVersionMainDoc = (version) =>
|
||||
version.docs.find((doc) => doc.id === version.mainDocId);
|
||||
const {savePreferredVersionName} = useDocsPreferredVersion(pluginId);
|
||||
const {latestDocSuggestion, latestVersionSuggestion} =
|
||||
useDocVersionSuggestions(pluginId);
|
||||
// Try to link to same doc in latest version (not always possible), falling
|
||||
// back to main doc of latest version
|
||||
const latestVersionSuggestedDoc =
|
||||
latestDocSuggestion ?? getVersionMainDoc(latestVersionSuggestion);
|
||||
const canaryPath = `/docs/0.2.x/${latestVersionSuggestedDoc.path.slice("/docs/".length)}`;
|
||||
return (
|
||||
<div
|
||||
className={clsx(
|
||||
className,
|
||||
ThemeClassNames.docs.docVersionBanner,
|
||||
'alert alert--info margin-bottom--md',
|
||||
)}
|
||||
role="alert">
|
||||
<div>
|
||||
<Translate
|
||||
id="theme.docs.versions.unmaintainedVersionLabel"
|
||||
description="The label used to encourage the user to view the experimental 0.2.x version"
|
||||
values={{
|
||||
siteTitle,
|
||||
versionLabel: <b>{versionMetadata.label}</b>,
|
||||
}}>
|
||||
{
|
||||
'This is a stable version of documentation for {siteTitle}\'s version {versionLabel}.'
|
||||
}
|
||||
</Translate>
|
||||
</div>
|
||||
<div className="margin-top--md">
|
||||
<Translate
|
||||
id="theme.docs.versions.latestVersionSuggestionLabel"
|
||||
description="The label used to tell the user to check the experimental version"
|
||||
values={{
|
||||
versionLabel: <b>{versionMetadata.label}</b>,
|
||||
latestVersionLink: (
|
||||
<b>
|
||||
<Link to={canaryPath} onClick={() => savePreferredVersionName("0.2.x")}>
|
||||
<Translate
|
||||
id="theme.docs.versions.latestVersionLinkLabel"
|
||||
description="The label used for the latest version suggestion link label">
|
||||
this experimental version
|
||||
</Translate>
|
||||
</Link>
|
||||
</b>
|
||||
),
|
||||
}}>
|
||||
{
|
||||
'You can also check out {latestVersionLink} for an updated experience.'
|
||||
}
|
||||
</Translate>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default function DocVersionBanner({className}) {
|
||||
const versionMetadata = useDocsVersion();
|
||||
const versionMetadata = {
|
||||
badge: false,
|
||||
banner: 'unmaintained',
|
||||
isLast: false,
|
||||
label: 'v0.2',
|
||||
noIndex: false,
|
||||
pluginId: 'default',
|
||||
version: 'Latest',
|
||||
}
|
||||
console.log({versionMetadata});
|
||||
const localPathname = useLocalPathname();
|
||||
if (versionMetadata.banner) {
|
||||
return (
|
||||
<DocVersionBannerEnabled
|
||||
className={className}
|
||||
versionMetadata={versionMetadata}
|
||||
/>
|
||||
<div
|
||||
className={clsx(
|
||||
className,
|
||||
ThemeClassNames.docs.docVersionBanner,
|
||||
'alert alert--warning margin-bottom--md',
|
||||
)}
|
||||
role="alert">
|
||||
<div>
|
||||
<BannerLabel siteTitle={"LangChain"} versionMetadata={versionMetadata} />
|
||||
</div>
|
||||
<div className="margin-top--md">
|
||||
<LatestVersionSuggestionLabel
|
||||
versionLabel={"Latest"}
|
||||
to={`https://python.langchain.com${localPathname}`}
|
||||
onClick={() => {}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
} else if (versionMetadata.isLast) {
|
||||
// Uncomment when we are ready to direct people to new build
|
||||
// return (
|
||||
// <LatestDocVersionBanner
|
||||
// className={className}
|
||||
// versionMetadata={versionMetadata}
|
||||
// />
|
||||
// );
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
120
docs/src/theme/SiteMetadata/index.js
Normal file
120
docs/src/theme/SiteMetadata/index.js
Normal file
@@ -0,0 +1,120 @@
|
||||
import React from 'react';
|
||||
import Head from '@docusaurus/Head';
|
||||
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
|
||||
import useBaseUrl from '@docusaurus/useBaseUrl';
|
||||
import {PageMetadata, useThemeConfig} from '@docusaurus/theme-common';
|
||||
import {
|
||||
DEFAULT_SEARCH_TAG,
|
||||
useAlternatePageUtils,
|
||||
keyboardFocusedClassName,
|
||||
} from '@docusaurus/theme-common/internal';
|
||||
import {useLocation} from '@docusaurus/router';
|
||||
import {applyTrailingSlash} from '@docusaurus/utils-common';
|
||||
import SearchMetadata from '@theme/SearchMetadata';
|
||||
// TODO move to SiteMetadataDefaults or theme-common ?
|
||||
// Useful for i18n/SEO
|
||||
// See https://developers.google.com/search/docs/advanced/crawling/localized-versions
|
||||
// See https://github.com/facebook/docusaurus/issues/3317
|
||||
function AlternateLangHeaders() {
|
||||
const {
|
||||
i18n: {defaultLocale, localeConfigs},
|
||||
} = useDocusaurusContext();
|
||||
const alternatePageUtils = useAlternatePageUtils();
|
||||
// Note: it is fine to use both "x-default" and "en" to target the same url
|
||||
// See https://www.searchviu.com/en/multiple-hreflang-tags-one-url/
|
||||
return (
|
||||
<Head>
|
||||
{Object.entries(localeConfigs).map(([locale, {htmlLang}]) => (
|
||||
<link
|
||||
key={locale}
|
||||
rel="alternate"
|
||||
href={alternatePageUtils.createUrl({
|
||||
locale,
|
||||
fullyQualified: true,
|
||||
})}
|
||||
hrefLang={htmlLang}
|
||||
/>
|
||||
))}
|
||||
<link
|
||||
rel="alternate"
|
||||
href={alternatePageUtils.createUrl({
|
||||
locale: defaultLocale,
|
||||
fullyQualified: true,
|
||||
})}
|
||||
hrefLang="x-default"
|
||||
/>
|
||||
</Head>
|
||||
);
|
||||
}
|
||||
// Default canonical url inferred from current page location pathname
|
||||
function useDefaultCanonicalUrl() {
|
||||
const {
|
||||
siteConfig: {url: siteUrl, baseUrl, trailingSlash},
|
||||
} = useDocusaurusContext();
|
||||
// TODO using useLocation().pathname is not a super idea
|
||||
// See https://github.com/facebook/docusaurus/issues/9170
|
||||
const {pathname} = useLocation();
|
||||
const baseUrlPathname = useBaseUrl(pathname);
|
||||
const canonicalPathname = applyTrailingSlash(baseUrlPathname, {
|
||||
trailingSlash,
|
||||
baseUrl,
|
||||
});
|
||||
const canonicalPathnameNoVersion = canonicalPathname.startsWith('/v0.') ? "/"+canonicalPathname.split('/').slice(2).join('/') : canonicalPathname;
|
||||
return siteUrl + canonicalPathnameNoVersion;
|
||||
}
|
||||
|
||||
// TODO move to SiteMetadataDefaults or theme-common ?
|
||||
function CanonicalUrlHeaders({permalink}) {
|
||||
const {
|
||||
siteConfig: {url: siteUrl},
|
||||
} = useDocusaurusContext();
|
||||
const defaultCanonicalUrl = useDefaultCanonicalUrl();
|
||||
const canonicalUrl = permalink
|
||||
? `${siteUrl}${permalink}`
|
||||
: defaultCanonicalUrl;
|
||||
return (
|
||||
<Head>
|
||||
<meta property="og:url" content={canonicalUrl} />
|
||||
<link rel="canonical" href={canonicalUrl} />
|
||||
</Head>
|
||||
);
|
||||
}
|
||||
export default function SiteMetadata() {
|
||||
const {
|
||||
i18n: {currentLocale},
|
||||
} = useDocusaurusContext();
|
||||
// TODO maybe move these 2 themeConfig to siteConfig?
|
||||
// These seems useful for other themes as well
|
||||
const {metadata, image: defaultImage} = useThemeConfig();
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
<meta name="twitter:card" content="summary_large_image" />
|
||||
{/* The keyboard focus class name need to be applied when SSR so links
|
||||
are outlined when JS is disabled */}
|
||||
<body className={keyboardFocusedClassName} />
|
||||
</Head>
|
||||
|
||||
{defaultImage && <PageMetadata image={defaultImage} />}
|
||||
|
||||
<CanonicalUrlHeaders />
|
||||
|
||||
<AlternateLangHeaders />
|
||||
|
||||
<SearchMetadata tag={DEFAULT_SEARCH_TAG} locale={currentLocale} />
|
||||
|
||||
{/*
|
||||
It's important to have an additional <Head> element here, as it allows
|
||||
react-helmet to override default metadata values set in previous <Head>
|
||||
like "twitter:card". In same Head, the same meta would appear twice
|
||||
instead of overriding.
|
||||
*/}
|
||||
<Head>
|
||||
{/* Yes, "metadatum" is the grammatically correct term */}
|
||||
{metadata.map((metadatum, i) => (
|
||||
<meta key={i} {...metadatum} />
|
||||
))}
|
||||
</Head>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
|
||||
|
||||
[tool.poetry]
|
||||
name = "langchain-robocorp"
|
||||
version = "0.0.10"
|
||||
version = "0.0.10.post1"
|
||||
description = "An integration package connecting Robocorp Action Server and LangChain"
|
||||
authors = []
|
||||
readme = "README.md"
|
||||
@@ -15,7 +15,7 @@ license = "MIT"
|
||||
disallow_untyped_defs = "True"
|
||||
|
||||
[tool.poetry.urls]
|
||||
"Source Code" = "https://github.com/langchain-ai/langchain/tree/master/libs/partners/robocorp"
|
||||
"Source Code" = "https://github.com/langchain-ai/langchain/tree/v0.2/libs/partners/robocorp"
|
||||
|
||||
[tool.poetry.dependencies]
|
||||
python = ">=3.8.1,<4.0"
|
||||
|
||||
Reference in New Issue
Block a user