Hub¶
langchain-classic documentation
These docs cover the langchain-classic package. This package will be maintained for security vulnerabilities until December 2026. Users are encouraged to migrate to the langchain package for the latest features and improvements. See docs for langchain
langchain_classic.hub
¶
Interface with the LangChain Hub.
| FUNCTION | DESCRIPTION |
|---|---|
push |
Push an object to the hub and returns the URL it can be viewed at in a browser. |
pull |
Pull an object from the hub and returns it as a LangChain object. |
push
¶
push(
repo_full_name: str,
object: Any,
*,
api_url: str | None = None,
api_key: str | None = None,
parent_commit_hash: str | None = None,
new_repo_is_public: bool = False,
new_repo_description: str | None = None,
readme: str | None = None,
tags: Sequence[str] | None = None,
) -> str
Push an object to the hub and returns the URL it can be viewed at in a browser.
| PARAMETER | DESCRIPTION |
|---|---|
repo_full_name
|
The full name of the prompt to push to in the format of
TYPE:
|
object
|
The LangChain object to serialize and push to the hub.
TYPE:
|
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.
TYPE:
|
api_key
|
The API key to use to authenticate with the LangChain Hub API.
TYPE:
|
parent_commit_hash
|
The commit hash of the parent commit to push to. Defaults to the latest commit automatically.
TYPE:
|
new_repo_is_public
|
Whether the prompt should be public.
TYPE:
|
new_repo_description
|
The description of the prompt.
TYPE:
|
readme
|
README content for the repository.
TYPE:
|
tags
|
Tags to associate with the prompt. |
| RETURNS | DESCRIPTION |
|---|---|
str
|
URL where the pushed object can be viewed in a browser. |
pull
¶
pull(
owner_repo_commit: str,
*,
include_model: bool | None = None,
api_url: str | None = None,
api_key: str | None = None,
) -> Any
Pull an object from the hub and returns it as a LangChain object.
| PARAMETER | DESCRIPTION |
|---|---|
owner_repo_commit
|
The full name of the prompt to pull from in the format of
TYPE:
|
include_model
|
Whether to include the model configuration in the pulled prompt.
TYPE:
|
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.
TYPE:
|
api_key
|
The API key to use to authenticate with the LangChain Hub API.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Any
|
The pulled LangChain object. |