Skip to content

Commit

Permalink
docs[patch]: fix links in partner package table (#29112)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ccurme authored Jan 9, 2025
1 parent 815bfa1 commit facfd42
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion docs/scripts/partner_pkg_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -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:
Expand Down

0 comments on commit facfd42

Please sign in to comment.