Home / Function/ __init__() — langchain Function Reference

__init__() — langchain Function Reference

Architecture documentation for the __init__() function in hub.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  262b9a7d_777e_c188_bdb5_5a36f6f63968["__init__()"]
  029864be_8e91_0711_fc98_162f845a68d5["HubRunnable"]
  262b9a7d_777e_c188_bdb5_5a36f6f63968 -->|defined in| 029864be_8e91_0711_fc98_162f845a68d5
  style 262b9a7d_777e_c188_bdb5_5a36f6f63968 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/langchain_classic/runnables/hub.py lines 12–42

    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)

Domain

Subdomains

Frequently Asked Questions

What does __init__() do?
__init__() is a function in the langchain codebase, defined in libs/langchain/langchain_classic/runnables/hub.py.
Where is __init__() defined?
__init__() is defined in libs/langchain/langchain_classic/runnables/hub.py at line 12.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free