mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-05 13:06:03 +00:00
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:
@@ -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
|
||||
+ "."
|
||||
|
@@ -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": "",
|
||||
},
|
||||
"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": "",
|
||||
},
|
||||
"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": "",
|
||||
},
|
||||
"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": "",
|
||||
},
|
||||
"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": "",
|
||||
},
|
||||
"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": "",
|
||||
},
|
||||
"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": "",
|
||||
},
|
||||
}
|
||||
|
@@ -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) |  |  | {js} |"
|
||||
return f"| {provider} | [langchain-{name}](https://python.langchain.com/v0.2/api_reference/{name.replace('-', '_')}/) |  |  | {js} |"
|
||||
|
||||
|
||||
def table() -> str:
|
||||
|
Reference in New Issue
Block a user