docs: provider list from packages.yml (#28677)

This commit is contained in:
Erick Friis 2024-12-11 16:12:30 -08:00 committed by GitHub
parent a4713cab47
commit 0af5ad8262
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 29 additions and 39 deletions

View File

@ -1,4 +1,4 @@
# Robocorp
# Sema4 (fka Robocorp)
>[Robocorp](https://robocorp.com/) helps build and operate Python workers that run seamlessly anywhere at any scale

View File

@ -2,38 +2,31 @@ import glob
import sys
from pathlib import Path
PARTNER_DIR = Path(__file__).parents[2] / "libs" / "partners"
DOCS_DIR = Path(__file__).parents[1]
import yaml
PLATFORMS = {
path.split("/")[-1][:-4]
for path in glob.glob(
str(DOCS_DIR) + "/docs/integrations/providers/*.mdx", recursive=True
DOCS_DIR = Path(__file__).parents[1]
PACKAGE_YML = Path(__file__).parents[2] / "libs" / "packages.yml"
IGNORE_PACKGAGES = {"langchain-experimental"}
# for now, only include packages that are in the langchain-ai org
# because we don't have a policy for inclusion in this table yet,
# and including all packages will make the list too long
with open(PACKAGE_YML) as f:
data = yaml.safe_load(f)
EXTERNAL_PACKAGES = set(
p["name"][10:]
for p in data["packages"]
if p["repo"].startswith("langchain-ai/")
and p["repo"] != "langchain-ai/langchain"
and p["name"] not in IGNORE_PACKGAGES
)
IN_REPO_PACKAGES = set(
p["name"][10:]
for p in data["packages"]
if p["repo"] == "langchain-ai/langchain"
and p["path"].startswith("libs/partners")
and p["name"] not in IGNORE_PACKGAGES
)
}
EXTERNAL_PACKAGES = {
"astradb",
"aws",
"box",
"cohere",
"databricks",
"elasticsearch",
"google-community",
"google-genai",
"google-vertexai",
"nvidia-ai-endpoints",
"postgres",
"redis",
"weaviate",
"upstage",
"mongodb",
"azure-dynamic-sessions",
"ibm",
"unstructured",
"milvus",
"together",
"ai21",
}
JS_PACKAGES = {
"google-gauth",
@ -67,11 +60,6 @@ JS_PACKAGES = {
"ibm",
}
IN_REPO_PACKAGES = {
path.split("/")[-2]
for path in glob.glob(str(PARTNER_DIR) + "/**/pyproject.toml", recursive=True)
}
ALL_PACKAGES = IN_REPO_PACKAGES.union(EXTERNAL_PACKAGES)
CUSTOM_NAME = {
@ -81,14 +69,17 @@ CUSTOM_NAME = {
}
CUSTOM_PROVIDER_PAGES = {
"azure-dynamic-sessions": "/docs/integrations/providers/microsoft/",
"prompty": "/docs/integrations/providers/microsoft/",
"sqlserver": "/docs/integrations/providers/microsoft/",
"google-community": "/docs/integrations/providers/google/",
"google-genai": "/docs/integrations/providers/google/",
"google-vertexai": "/docs/integrations/providers/google/",
"nvidia-ai-endpoints": "/docs/integrations/providers/nvidia/",
"exa": "/docs/integrations/providers/exa_search/",
"mongodb": "/docs/integrations/providers/mongodb_atlas/",
"sema4": "/docs/integrations/providers/robocorp/",
"postgres": "/docs/integrations/providers/pgvector/",
}
PLATFORM_PAGES = {name: f"/docs/integrations/providers/{name}/" for name in PLATFORMS}
PROVIDER_PAGES = {
name: f"/docs/integrations/providers/{name}/"
for name in ALL_PACKAGES
@ -96,10 +87,8 @@ PROVIDER_PAGES = {
}
PROVIDER_PAGES = {
**PROVIDER_PAGES,
**PLATFORM_PAGES,
**CUSTOM_PROVIDER_PAGES,
}
print(PROVIDER_PAGES)
def package_row(name: str) -> str:

View File

@ -3,6 +3,7 @@
-e ../libs/community
-e ../libs/text-splitters
langgraph
pyyaml
langchain-cohere
urllib3==1.26.19
nbconvert==7.16.4