mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-03 03:59:42 +00:00
multiple: pydantic 2 compatibility, v0.3 (#26443)
Signed-off-by: ChengZi <chen.zhang@zilliz.com> Co-authored-by: Eugene Yurtsev <eyurtsev@gmail.com> Co-authored-by: Bagatur <22008038+baskaryan@users.noreply.github.com> Co-authored-by: Dan O'Donovan <dan.odonovan@gmail.com> Co-authored-by: Tom Daniel Grande <tomdgrande@gmail.com> Co-authored-by: Grande <Tom.Daniel.Grande@statsbygg.no> Co-authored-by: Bagatur <baskaryan@gmail.com> Co-authored-by: ccurme <chester.curme@gmail.com> Co-authored-by: Harrison Chase <hw.chase.17@gmail.com> Co-authored-by: Tomaz Bratanic <bratanic.tomaz@gmail.com> Co-authored-by: ZhangShenao <15201440436@163.com> Co-authored-by: Friso H. Kingma <fhkingma@gmail.com> Co-authored-by: ChengZi <chen.zhang@zilliz.com> Co-authored-by: Nuno Campos <nuno@langchain.dev> Co-authored-by: Morgante Pell <morgantep@google.com>
This commit is contained in:
@@ -378,18 +378,18 @@ class ArxivAPIWrapper(BaseModel):
|
||||
abstract=result.summary,
|
||||
url=result.entry_id,
|
||||
published_date=str(result.published.date()),
|
||||
referencing_doc2url=type2key2urls["docs"]
|
||||
if "docs" in type2key2urls
|
||||
else {},
|
||||
referencing_api_ref2url=type2key2urls["apis"]
|
||||
if "apis" in type2key2urls
|
||||
else {},
|
||||
referencing_template2url=type2key2urls["templates"]
|
||||
if "templates" in type2key2urls
|
||||
else {},
|
||||
referencing_cookbook2url=type2key2urls["cookbooks"]
|
||||
if "cookbooks" in type2key2urls
|
||||
else {},
|
||||
referencing_doc2url=(
|
||||
type2key2urls["docs"] if "docs" in type2key2urls else {}
|
||||
),
|
||||
referencing_api_ref2url=(
|
||||
type2key2urls["apis"] if "apis" in type2key2urls else {}
|
||||
),
|
||||
referencing_template2url=(
|
||||
type2key2urls["templates"] if "templates" in type2key2urls else {}
|
||||
),
|
||||
referencing_cookbook2url=(
|
||||
type2key2urls["cookbooks"] if "cookbooks" in type2key2urls else {}
|
||||
),
|
||||
)
|
||||
for result, type2key2urls in zip(results, arxiv_id2type2key2urls.values())
|
||||
]
|
||||
@@ -397,7 +397,7 @@ class ArxivAPIWrapper(BaseModel):
|
||||
|
||||
|
||||
def _format_doc_url(doc_path: str) -> str:
|
||||
return f"https://{LANGCHAIN_PYTHON_URL}/v0.2/{doc_path}"
|
||||
return f"https://{LANGCHAIN_PYTHON_URL}/{doc_path}"
|
||||
|
||||
|
||||
def _format_api_ref_url(doc_path: str, compact: bool = False) -> str:
|
||||
|
@@ -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://python.langchain.com/v0.2/api_reference/"
|
||||
_BASE_URL = "https://python.langchain.com/api_reference/"
|
||||
|
||||
# Regular expression to match Python code blocks
|
||||
code_block_re = re.compile(r"^(```\s?python\n)(.*?)(```)", re.DOTALL | re.MULTILINE)
|
||||
@@ -85,7 +85,7 @@ def main():
|
||||
.replace(".md", "/")
|
||||
)
|
||||
|
||||
doc_url = f"https://python.langchain.com/v0.2/docs/{relative_path}"
|
||||
doc_url = f"https://python.langchain.com/docs/{relative_path}"
|
||||
for import_info in file_imports:
|
||||
doc_title = import_info["title"]
|
||||
class_name = import_info["imported"]
|
||||
|
@@ -33,45 +33,45 @@ The following table shows information on all available key-value stores.
|
||||
|
||||
KV_STORE_FEAT_TABLE = {
|
||||
"AstraDBByteStore": {
|
||||
"class": "[AstraDBByteStore](https://python.langchain.com/v0.2/api_reference/astradb/storage/langchain_astradb.storage.AstraDBByteStore.html)",
|
||||
"class": "[AstraDBByteStore](https://python.langchain.com/api_reference/astradb/storage/langchain_astradb.storage.AstraDBByteStore.html)",
|
||||
"local": False,
|
||||
"package": "[langchain_astradb](https://python.langchain.com/v0.2/api_reference/astradb/)",
|
||||
"package": "[langchain_astradb](https://python.langchain.com/api_reference/astradb/)",
|
||||
"downloads": "",
|
||||
},
|
||||
"CassandraByteStore": {
|
||||
"class": "[CassandraByteStore](https://python.langchain.com/v0.2/api_reference/community/storage/langchain_community.storage.cassandra.CassandraByteStore.html)",
|
||||
"class": "[CassandraByteStore](https://python.langchain.com/api_reference/community/storage/langchain_community.storage.cassandra.CassandraByteStore.html)",
|
||||
"local": False,
|
||||
"package": "[langchain_community](https://python.langchain.com/v0.2/api_reference/community/)",
|
||||
"package": "[langchain_community](https://python.langchain.com/api_reference/community/)",
|
||||
"downloads": "",
|
||||
},
|
||||
"ElasticsearchEmbeddingsCache": {
|
||||
"class": "[ElasticsearchEmbeddingsCache](https://python.langchain.com/v0.2/api_reference/elasticsearch/cache/langchain_elasticsearch.cache.ElasticsearchEmbeddingsCache.html)",
|
||||
"class": "[ElasticsearchEmbeddingsCache](https://python.langchain.com/api_reference/elasticsearch/cache/langchain_elasticsearch.cache.ElasticsearchEmbeddingsCache.html)",
|
||||
"local": True,
|
||||
"package": "[langchain_elasticsearch](https://python.langchain.com/v0.2/api_reference/elasticsearch/)",
|
||||
"package": "[langchain_elasticsearch](https://python.langchain.com/api_reference/elasticsearch/)",
|
||||
"downloads": "",
|
||||
},
|
||||
"LocalFileStore": {
|
||||
"class": "[LocalFileStore](https://python.langchain.com/v0.2/api_reference/storage/langchain.storage.file_system.LocalFileStore.html)",
|
||||
"class": "[LocalFileStore](https://python.langchain.com/api_reference/storage/langchain.storage.file_system.LocalFileStore.html)",
|
||||
"local": True,
|
||||
"package": "[langchain](https://python.langchain.com/v0.2/api_reference/langchain/)",
|
||||
"package": "[langchain](https://python.langchain.com/api_reference/langchain/)",
|
||||
"downloads": "",
|
||||
},
|
||||
"InMemoryByteStore": {
|
||||
"class": "[InMemoryByteStore](https://python.langchain.com/v0.2/api_reference/core/stores/langchain_core.stores.InMemoryByteStore.html)",
|
||||
"class": "[InMemoryByteStore](https://python.langchain.com/api_reference/core/stores/langchain_core.stores.InMemoryByteStore.html)",
|
||||
"local": True,
|
||||
"package": "[langchain_core](https://python.langchain.com/v0.2/api_reference/core/)",
|
||||
"package": "[langchain_core](https://python.langchain.com/api_reference/core/)",
|
||||
"downloads": "",
|
||||
},
|
||||
"RedisStore": {
|
||||
"class": "[RedisStore](https://python.langchain.com/v0.2/api_reference/community/storage/langchain_community.storage.redis.RedisStore.html)",
|
||||
"class": "[RedisStore](https://python.langchain.com/api_reference/community/storage/langchain_community.storage.redis.RedisStore.html)",
|
||||
"local": True,
|
||||
"package": "[langchain_community](https://python.langchain.com/v0.2/api_reference/community/)",
|
||||
"package": "[langchain_community](https://python.langchain.com/api_reference/community/)",
|
||||
"downloads": "",
|
||||
},
|
||||
"UpstashRedisByteStore": {
|
||||
"class": "[UpstashRedisByteStore](https://python.langchain.com/v0.2/api_reference/community/storage/langchain_community.storage.upstash_redis.UpstashRedisByteStore.html)",
|
||||
"class": "[UpstashRedisByteStore](https://python.langchain.com/api_reference/community/storage/langchain_community.storage.upstash_redis.UpstashRedisByteStore.html)",
|
||||
"local": False,
|
||||
"package": "[langchain_community](https://python.langchain.com/v0.2/api_reference/community/)",
|
||||
"package": "[langchain_community](https://python.langchain.com/api_reference/community/)",
|
||||
"downloads": "",
|
||||
},
|
||||
}
|
||||
|
@@ -100,11 +100,11 @@ 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://python.langchain.com/v0.2/api_reference/{name.replace('-', '_')}/) |  |  | {js} |"
|
||||
return f"| {provider} | [langchain-{name}](https://python.langchain.com/api_reference/{name.replace('-', '_')}/) |  |  | {js} |"
|
||||
|
||||
|
||||
def table() -> str:
|
||||
header = """| Provider | Package | Downloads | Latest | [JS](https://js.langchain.com/v0.2/docs/integrations/platforms/) |
|
||||
header = """| Provider | Package | Downloads | Latest | [JS](https://js.langchain.com/docs/integrations/platforms/) |
|
||||
| :--- | :---: | :---: | :---: | :---: |
|
||||
"""
|
||||
return header + "\n".join(package_row(name) for name in sorted(ALL_PACKAGES))
|
||||
|
Reference in New Issue
Block a user