load_agent#

langchain.agents.loading.load_agent(path: str | Path, **kwargs: Any) BaseSingleActionAgent | BaseMultiActionAgent[source]#

Deprecated since version 0.1.0: It will be removed in None==1.0.

Unified method for loading an agent from LangChainHub or local fs.

Parameters:
  • path (str | Path) – Path to the agent file.

  • kwargs (Any) – Additional keyword arguments passed to the agent executor.

Returns:

An agent executor.

Raises:

RuntimeError – If loading from the deprecated github-based Hub is attempted.

Return type:

BaseSingleActionAgent | BaseMultiActionAgent