diff --git a/docs/prompt_engineering/how_to_guides/index.md b/docs/prompt_engineering/how_to_guides/index.md index 65c975618..a8ff86c9a 100644 --- a/docs/prompt_engineering/how_to_guides/index.md +++ b/docs/prompt_engineering/how_to_guides/index.md @@ -11,6 +11,7 @@ Organize and manage prompts in LangSmith to streamline your LLM development work - [Manage prompts programmatically](./how_to_guides/manage_prompts_programatically) - [Prompt tags](./how_to_guides/prompt_tags) - [LangChain Hub](./how_to_guides/langchain_hub) +- [Trigger a webhook on prompt commit](./how_to_guides/trigger_webhook) ## Playground diff --git a/docs/prompt_engineering/how_to_guides/static/commit_prompt_playground.png b/docs/prompt_engineering/how_to_guides/static/commit_prompt_playground.png new file mode 100644 index 000000000..aba63c42b Binary files /dev/null and b/docs/prompt_engineering/how_to_guides/static/commit_prompt_playground.png differ diff --git a/docs/prompt_engineering/how_to_guides/static/create_webhook.png b/docs/prompt_engineering/how_to_guides/static/create_webhook.png new file mode 100644 index 000000000..595f12c98 Binary files /dev/null and b/docs/prompt_engineering/how_to_guides/static/create_webhook.png differ diff --git a/docs/prompt_engineering/how_to_guides/trigger_webhook.mdx b/docs/prompt_engineering/how_to_guides/trigger_webhook.mdx new file mode 100644 index 000000000..3c90bb3ec --- /dev/null +++ b/docs/prompt_engineering/how_to_guides/trigger_webhook.mdx @@ -0,0 +1,50 @@ +--- +sidebar_position: 10 +--- + +# Trigger a webhook on prompt commit + +You can configure a webhook to be triggered whenever a commit is made to a prompt. + +Some common use cases of this include: + +- Triggering a CI/CD pipeline when prompts are updated +- Synchronizing prompts with a GitHub repository +- Notifying team members about prompt modifications + +## Configure a webhook + +Navigate to the **Prompts** section in the left-hand sidebar or from the application homepage. +In the top right corner, click on the `+ Webhook` button. + +Add a webhook **url** and any required **headers**. + +:::note +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). +::: + +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. + +The sample payload is a JSON object with the following fields: + +- `prompt_id`: The id of the prompt that was committed. +- `prompt_name`: The name of the prompt that was committed. +- `commit_hash`: The commit hash of the prompt. +- `created_at`: The date of the commit. +- `created_by`: The author of the commit. +- `manifest`: The manifest of the prompt. + +## Trigger the webhook + +Commit to a prompt to trigger the webhooks you've configured. + +### Using the Playground + +If you do this in the Playground, you'll be prompted to deselect any webhooks you'd like to avoid triggering. + +![](./static/commit_prompt_playground.png) + +### Using the API + +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. +See API docs [here](https://api.smith.langchain.com/redoc#tag/commits/operation/create_commit_api_v1_commits__owner___repo__post) for more information.