| Name | Type | Description |
|---|---|---|
prompt_identifier* | str | The identifier of the prompt. |
include_model | bool | None | Default: FalseWhether to include model configuration in the loaded prompt. |
secrets | dict[str, str] | None | Default: None |
secrets_from_env | bool | Default: False |
skip_cache | bool | Default: False |
dangerously_pull_public_prompt | bool | Default: False |
Pull a prompt and return it as a LangChain PromptTemplate.
This method requires langchain-core.
Pulled prompts should be treated as executable configuration, not plain text.
The secrets and secrets_from_env arguments only control explicit
serialized LangChain secret references in the manifest. They do not
prevent deserialized model integrations from using their own
environment-based credential defaults during initialization. For example,
a deserialized OpenAI chat model may still use OPENAI_API_KEY from the
environment if its constructor supports that default.
Avoid pulling public prompts or prompts outside your own organization
unless you have reviewed and trust their contents. When you do pull a
trusted external prompt, prefer pinning to a specific commit SHA rather
than following a mutable latest version. This is especially important
when include_model=True.
langsmith 0.5.1Updated to take arguments secrets and secrets_from_env which default
to None and False, respectively.
By default, explicit serialized LangChain secret references in a pulled
manifest are not resolved from environment variables unless you specify
secrets_from_env=True.
These updates were made to remediate vulnerability
GHSA-c67j-w6g6-q2cm
in the langchain-core package which this method (but not the entire
langsmith package) depends on.
A map of secrets to use for explicit serialized LangChain secret
references in the manifest, e.g. {'OPENAI_API_KEY': 'sk-...'}.
If a manifest secret reference is not found in the map, it will be
loaded from the environment only if secrets_from_env is True.
Deserialized model integrations may still use their own
environment-based credential defaults during initialization.
Whether explicit serialized LangChain secret references in the manifest may be loaded from environment variables during deserialization.
Whether to skip the prompt cache. Defaults to False.
Set to True to allow pulling a
public prompt by owner/name (for example, username/promptname).
Only do this for trusted prompts. Defaults to False.