Skip to content

Commit 8ff9538

Browse files
authored
docs: prompt webhooks (#805)
1 parent f188ee7 commit 8ff9538

File tree

4 files changed

+51
-0
lines changed

4 files changed

+51
-0
lines changed

docs/prompt_engineering/how_to_guides/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Organize and manage prompts in LangSmith to streamline your LLM development work
1111
- [Manage prompts programmatically](./how_to_guides/manage_prompts_programatically)
1212
- [Prompt tags](./how_to_guides/prompt_tags)
1313
- [LangChain Hub](./how_to_guides/langchain_hub)
14+
- [Trigger a webhook on prompt commit](./how_to_guides/trigger_webhook)
1415

1516
## Playground
1617

Loading
Loading
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
sidebar_position: 10
3+
---
4+
5+
# Trigger a webhook on prompt commit
6+
7+
You can configure a webhook to be triggered whenever a commit is made to a prompt.
8+
9+
Some common use cases of this include:
10+
11+
- Triggering a CI/CD pipeline when prompts are updated
12+
- Synchronizing prompts with a GitHub repository
13+
- Notifying team members about prompt modifications
14+
15+
## Configure a webhook
16+
17+
Navigate to the **Prompts** section in the left-hand sidebar or from the application homepage.
18+
In the top right corner, click on the `+ Webhook` button.
19+
20+
Add a webhook **url** and any required **headers**.
21+
22+
:::note
23+
You can only configure one webhook per workspace. If you want to configure multiple per workspace or set up a different webhook for each prompt, let us know in our [Community Slack](https://langchaincommunity.slack.com/) (sign up [here](https://www.langchain.com/join-community) if you're not already a member).
24+
:::
25+
26+
To test out your webhook, click the "Send test notification" button. This will send a test notification to the webhook url you provided with a sample payload.
27+
28+
The sample payload is a JSON object with the following fields:
29+
30+
- `prompt_id`: The id of the prompt that was committed.
31+
- `prompt_name`: The name of the prompt that was committed.
32+
- `commit_hash`: The commit hash of the prompt.
33+
- `created_at`: The date of the commit.
34+
- `created_by`: The author of the commit.
35+
- `manifest`: The manifest of the prompt.
36+
37+
## Trigger the webhook
38+
39+
Commit to a prompt to trigger the webhooks you've configured.
40+
41+
### Using the Playground
42+
43+
If you do this in the Playground, you'll be prompted to deselect any webhooks you'd like to avoid triggering.
44+
45+
![](./static/commit_prompt_playground.png)
46+
47+
### Using the API
48+
49+
If you commit via the API, you can specify to skip triggering all webhooks by setting the `skip_webhooks` parameter to `true` or to specify specific webhooks to trigger by setting the `ignore_webhook_ids` parameter to a list of webhook ids.
50+
See API docs [here](https://api.smith.langchain.com/redoc#tag/commits/operation/create_commit_api_v1_commits__owner___repo__post) for more information.

0 commit comments

Comments
 (0)