HubRunnable Class — langchain Architecture
Architecture documentation for the HubRunnable class in hub.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 029864be_8e91_0711_fc98_162f845a68d5["HubRunnable"] e69e7f3a_fce8_c961_81d2_32d3bd45372d["hub.py"] 029864be_8e91_0711_fc98_162f845a68d5 -->|defined in| e69e7f3a_fce8_c961_81d2_32d3bd45372d 262b9a7d_777e_c188_bdb5_5a36f6f63968["__init__()"] 029864be_8e91_0711_fc98_162f845a68d5 -->|method| 262b9a7d_777e_c188_bdb5_5a36f6f63968
Relationship Graph
Source Code
libs/langchain/langchain_classic/runnables/hub.py lines 7–42
class HubRunnable(RunnableBindingBase[Input, Output]): # type: ignore[no-redef]
"""An instance of a runnable stored in the LangChain Hub."""
owner_repo_commit: str
def __init__(
self,
owner_repo_commit: str,
*,
api_url: str | None = None,
api_key: str | None = None,
**kwargs: Any,
) -> None:
"""Initialize the `HubRunnable`.
Args:
owner_repo_commit: The full name of the prompt to pull from in the format of
`owner/prompt_name:commit_hash` or `owner/prompt_name`
or just `prompt_name` if it's your own prompt.
api_url: The URL of the LangChain Hub API.
Defaults to the hosted API service if you have an api key set,
or a localhost instance if not.
api_key: The API key to use to authenticate with the LangChain Hub API.
**kwargs: Additional keyword arguments to pass to the parent class.
"""
from langchain_classic.hub import pull
pulled = pull(owner_repo_commit, api_url=api_url, api_key=api_key)
super_kwargs = {
"kwargs": {},
"config": {},
**kwargs,
"bound": pulled,
"owner_repo_commit": owner_repo_commit,
}
super().__init__(**super_kwargs)
Source
Frequently Asked Questions
What is the HubRunnable class?
HubRunnable is a class in the langchain codebase, defined in libs/langchain/langchain_classic/runnables/hub.py.
Where is HubRunnable defined?
HubRunnable is defined in libs/langchain/langchain_classic/runnables/hub.py at line 7.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free