From facfd42768485d92777608e5d62d705550c1a5c4 Mon Sep 17 00:00:00 2001 From: ccurme Date: Thu, 9 Jan 2025 10:37:15 -0500 Subject: [PATCH] docs[patch]: fix links in partner package table (#29112) Integrations in external repos are not built into [API ref](https://python.langchain.com/api_reference/), so currently [the table](https://python.langchain.com/docs/integrations/providers/#integration-packages) includes broken links. Here we update the links for this type of package to point to PyPi. --- docs/scripts/partner_pkg_table.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/scripts/partner_pkg_table.py b/docs/scripts/partner_pkg_table.py index a7bdc34be7fd3..cf3084b136e66 100644 --- a/docs/scripts/partner_pkg_table.py +++ b/docs/scripts/partner_pkg_table.py @@ -76,6 +76,13 @@ def _enrich_package(p: dict) -> dict | None: ) raise ValueError(msg) + if p["type"] in ("B", "C"): + p["package_url"] = ( + f"https://python.langchain.com/api_reference/{p['name_short'].replace('-', '_')}/" + ) + else: + p["package_url"] = f"https://pypi.org/project/{p['name']}/" + return p @@ -94,7 +101,7 @@ def package_row(p: dict) -> str: link = p["provider_page"] title = p["name_title"] provider = f"[{title}]({link})" if link else title - return f"| {provider} | [{p['name']}](https://python.langchain.com/api_reference/{p['name_short'].replace('-', '_')}/) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/{p['name']}?style=flat-square&label=%20&color=blue) | ![PyPI - Version](https://img.shields.io/pypi/v/{p['name']}?style=flat-square&label=%20&color=orange) | {js} |" + return f"| {provider} | [{p['name']}]({p['package_url']}) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/{p['name']}?style=flat-square&label=%20&color=blue) | ![PyPI - Version](https://img.shields.io/pypi/v/{p['name']}?style=flat-square&label=%20&color=orange) | {js} |" def table() -> str: