mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-19 09:30:15 +00:00
core: fix try_load_from_hub for older langchain versions load_chain (#19964)
This commit is contained in:
parent
09a0ecd000
commit
83f62fdacf
@ -1,13 +1,28 @@
|
|||||||
"""Utilities for loading configurations from langchain_core-hub."""
|
"""Utilities for loading configurations from langchain_core-hub."""
|
||||||
|
|
||||||
|
import warnings
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
|
from langchain_core._api.deprecation import deprecated
|
||||||
|
|
||||||
|
|
||||||
|
@deprecated(
|
||||||
|
since="0.1.30",
|
||||||
|
removal="0.2",
|
||||||
|
message=(
|
||||||
|
"Using the hwchase17/langchain-hub "
|
||||||
|
"repo for prompts is deprecated. Please use "
|
||||||
|
"https://smith.langchain.com/hub instead."
|
||||||
|
),
|
||||||
|
)
|
||||||
def try_load_from_hub(
|
def try_load_from_hub(
|
||||||
*args: Any,
|
*args: Any,
|
||||||
**kwargs: Any,
|
**kwargs: Any,
|
||||||
) -> Any:
|
) -> Any:
|
||||||
raise RuntimeError(
|
warnings.warn(
|
||||||
"Loading from the deprecated github-based Hub is no longer supported. "
|
"Loading from the deprecated github-based Hub is no longer supported. "
|
||||||
"Please use the new LangChain Hub at https://smith.langchain.com/hub instead."
|
"Please use the new LangChain Hub at https://smith.langchain.com/hub instead."
|
||||||
)
|
)
|
||||||
|
# return None, which indicates that we shouldn't load from old hub
|
||||||
|
# and might just be a filepath for e.g. load_chain
|
||||||
|
return None
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "langchain-core"
|
name = "langchain-core"
|
||||||
version = "0.1.39"
|
version = "0.1.40"
|
||||||
description = "Building applications with LLMs through composability"
|
description = "Building applications with LLMs through composability"
|
||||||
authors = []
|
authors = []
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
Loading…
Reference in New Issue
Block a user