Check if a prompt exists.
promptExists(promptIdentifier: string): Promise<boolean>| Name | Type | Description |
|---|---|---|
promptIdentifier* | string | The identifier of the prompt. Can be in the format:
|
// Check if a prompt exists before creating a commit
if (await client.promptExists("my-prompt")) {
await client.createCommit("my-prompt", template);
} else {
await client.createPrompt("my-prompt");
}