docs: api ref to new site somewheres (#25679)

```
https://api\.python\.langchain\.com/en/latest/([^/]*)/langchain_([^.]*)\.(.*)\.html([^"]*)
https://python.langchain.com/v0.2/api_reference/$2/$1/langchain_$2.$3.html$4
```

---------

Co-authored-by: Bagatur <baskaryan@gmail.com>
This commit is contained in:
Erick Friis
2024-08-23 10:01:16 -07:00
committed by GitHub
parent 6a60a2a435
commit 580fbd9ada
217 changed files with 612 additions and 618 deletions

View File

@@ -10,7 +10,7 @@ from pathlib import Path
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
# Base URL for all class documentation
_BASE_URL = "https://api.python.langchain.com/en/latest/"
_BASE_URL = "https://python.langchain.com/v0.2/api_reference/"
# Regular expression to match Python code blocks
code_block_re = re.compile(r"^(```\s?python\n)(.*?)(```)", re.DOTALL | re.MULTILINE)
@@ -158,9 +158,13 @@ def replace_imports(file):
continue
if len(module_path.split(".")) < 2:
continue
pkg = module_path.split(".")[0].replace("langchain_", "")
top_level_mod = module_path.split(".")[1]
url = (
_BASE_URL
+ module_path.split(".")[1]
+ pkg
+ "/"
+ top_level_mod
+ "/"
+ module_path
+ "."

View File

@@ -33,45 +33,45 @@ The following table shows information on all available key-value stores.
KV_STORE_FEAT_TABLE = {
"AstraDBByteStore": {
"class": "[AstraDBByteStore](https://api.python.langchain.com/en/latest/storage/langchain_astradb.storage.AstraDBByteStore.html)",
"class": "[AstraDBByteStore](https://python.langchain.com/v0.2/api_reference/astradb/storage/langchain_astradb.storage.AstraDBByteStore.html)",
"local": False,
"package": "[langchain_astradb](https://api.python.langchain.com/en/latest/astradb_api_reference.html)",
"package": "[langchain_astradb](https://python.langchain.com/v0.2/api_reference/astradb/)",
"downloads": "![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain_astradb?style=flat-square&label=%20)",
},
"CassandraByteStore": {
"class": "[CassandraByteStore](https://api.python.langchain.com/en/latest/storage/langchain_community.storage.cassandra.CassandraByteStore.html)",
"class": "[CassandraByteStore](https://python.langchain.com/v0.2/api_reference/community/storage/langchain_community.storage.cassandra.CassandraByteStore.html)",
"local": False,
"package": "[langchain_community](https://api.python.langchain.com/en/latest/community_api_reference.html)",
"package": "[langchain_community](https://python.langchain.com/v0.2/api_reference/community/)",
"downloads": "![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain_community?style=flat-square&label=%20)",
},
"ElasticsearchEmbeddingsCache": {
"class": "[ElasticsearchEmbeddingsCache](https://api.python.langchain.com/en/latest/cache/langchain_elasticsearch.cache.ElasticsearchEmbeddingsCache.html)",
"class": "[ElasticsearchEmbeddingsCache](https://python.langchain.com/v0.2/api_reference/elasticsearch/cache/langchain_elasticsearch.cache.ElasticsearchEmbeddingsCache.html)",
"local": True,
"package": "[langchain_elasticsearch](https://api.python.langchain.com/en/latest/elasticsearch_api_reference.html)",
"package": "[langchain_elasticsearch](https://python.langchain.com/v0.2/api_reference/elasticsearch/)",
"downloads": "![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain_elasticsearch?style=flat-square&label=%20)",
},
"LocalFileStore": {
"class": "[LocalFileStore](https://api.python.langchain.com/en/latest/storage/langchain.storage.file_system.LocalFileStore.html)",
"class": "[LocalFileStore](https://python.langchain.com/v0.2/api_reference/storage/langchain.storage.file_system.LocalFileStore.html)",
"local": True,
"package": "[langchain](https://api.python.langchain.com/en/latest/langchain_api_reference.html)",
"package": "[langchain](https://python.langchain.com/v0.2/api_reference/langchain/)",
"downloads": "![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain?style=flat-square&label=%20)",
},
"InMemoryByteStore": {
"class": "[InMemoryByteStore](https://api.python.langchain.com/en/latest/stores/langchain_core.stores.InMemoryByteStore.html)",
"class": "[InMemoryByteStore](https://python.langchain.com/v0.2/api_reference/core/stores/langchain_core.stores.InMemoryByteStore.html)",
"local": True,
"package": "[langchain_core](https://api.python.langchain.com/en/latest/core_api_reference.html)",
"package": "[langchain_core](https://python.langchain.com/v0.2/api_reference/core/)",
"downloads": "![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain_core?style=flat-square&label=%20)",
},
"RedisStore": {
"class": "[RedisStore](https://api.python.langchain.com/en/latest/storage/langchain_community.storage.redis.RedisStore.html)",
"class": "[RedisStore](https://python.langchain.com/v0.2/api_reference/community/storage/langchain_community.storage.redis.RedisStore.html)",
"local": True,
"package": "[langchain_community](https://api.python.langchain.com/en/latest/community_api_reference.html)",
"package": "[langchain_community](https://python.langchain.com/v0.2/api_reference/community/)",
"downloads": "![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain_community?style=flat-square&label=%20)",
},
"UpstashRedisByteStore": {
"class": "[UpstashRedisByteStore](https://api.python.langchain.com/en/latest/storage/langchain_community.storage.upstash_redis.UpstashRedisByteStore.html)",
"class": "[UpstashRedisByteStore](https://python.langchain.com/v0.2/api_reference/community/storage/langchain_community.storage.upstash_redis.UpstashRedisByteStore.html)",
"local": False,
"package": "[langchain_community](https://api.python.langchain.com/en/latest/community_api_reference.html)",
"package": "[langchain_community](https://python.langchain.com/v0.2/api_reference/community/)",
"downloads": "![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain_community?style=flat-square&label=%20)",
},
}

View File

@@ -99,7 +99,7 @@ def package_row(name: str) -> str:
"db", "DB"
).replace("Db", "DB").replace("ai", "AI").replace("Ai", "AI")
provider = f"[{title}]({link})" if link else title
return f"| {provider} | [langchain-{name}](https://api.python.langchain.com/en/latest/{name.replace('-', '_')}_api_reference.html) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain-{name}?style=flat-square&label=%20&color=blue) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain-{name}?style=flat-square&label=%20&color=orange) | {js} |"
return f"| {provider} | [langchain-{name}](https://python.langchain.com/v0.2/api_reference/{name.replace('-', '_')}/) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain-{name}?style=flat-square&label=%20&color=blue) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain-{name}?style=flat-square&label=%20&color=orange) | {js} |"
def table() -> str: