LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • Client
  • AsyncClient
  • Run Helpers
  • Run Trees
  • Evaluation
  • Schemas
  • Utilities
  • Wrappers
  • Anonymizer
  • Testing
  • Expect API
  • Middleware
  • Pytest Plugin
  • Deployment SDK
  • RemoteGraph
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

OverviewClientAsyncClientRun HelpersRun TreesEvaluationSchemasUtilitiesWrappersAnonymizerTestingExpect APIMiddlewarePytest PluginDeployment SDKRemoteGraph
Language
Theme
PythonlangsmithclientClientpush_prompt
Method●Since v0.1

push_prompt

Push a prompt to the LangSmith API.

Can be used to update prompt metadata or prompt content.

If the prompt does not exist, it will be created. If the prompt exists, it will be updated.

Copy
push_prompt(
  self,
  prompt_identifier: str,
  *,
  object: Optional[Any] = None,
  parent_commit_hash: str = 'latest',
  is_public: Optional[bool] = None,
  description: Optional[str] = None,
  readme: Optional[str] = None,
  tags: Optional[Sequence[str]] = None,
  commit_tags: Optional[str | list[str]] = None
) -> str

Parameters

NameTypeDescription
prompt_identifier*str

The identifier of the prompt.

objectOptional[Any]
Default:None

The LangChain object to push.

parent_commit_hashstr
Default:'latest'

The parent commit hash. Defaults to "latest".

is_publicOptional[bool]
Default:None

Whether the prompt should be public. If None (default), the current visibility status is maintained for existing prompts. For new prompts, None defaults to private. Set to True to make public, or False to make private.

descriptionOptional[str]
Default:None

A description of the prompt. Defaults to an empty string.

readmeOptional[str]
Default:None

A readme for the prompt. Defaults to an empty string.

tagsOptional[Sequence[str]]
Default:None

A list of tags for the prompt. Defaults to an empty list.

commit_tagsOptional[str | list[str]]
Default:None

A single tag or list of tags for the prompt commit. Defaults to an empty list.

View source on GitHub