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
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

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

push_prompt

Copy
push_prompt(
  self,
  prompt_identifier: str,
  *,
  object: Optional[Any] 
View source on GitHub
=
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
,
commit_description
:
Optional
[
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'
is_publicOptional[bool]
Default:None
descriptionOptional[str]
Default:None
readmeOptional[str]
Default:None
tagsOptional[Sequence[str]]
Default:None
commit_tagsOptional[str | list[str]]
Default:None
commit_descriptionOptional[str]
Default:None

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.

The parent commit hash. Defaults to "latest".

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.

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

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

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

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

Optional human-readable description for the commit (max 1000 chars). Defaults to None.