-
Notifications
You must be signed in to change notification settings - Fork 15.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
core: fix try_load_from_hub for older langchain versions load_chain (#…
- Loading branch information
Showing
2 changed files
with
17 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,28 @@ | ||
"""Utilities for loading configurations from langchain_core-hub.""" | ||
|
||
import warnings | ||
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( | ||
*args: Any, | ||
**kwargs: Any, | ||
) -> Any: | ||
raise RuntimeError( | ||
warnings.warn( | ||
"Loading from the deprecated github-based Hub is no longer supported. " | ||
"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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters