Managing prompts in code
If you already have prompts stored in code, you can use the the Prompt
object in the SDK to sync these prompts with the library.
This allows you to store the prompt text in your code while also having it versioned and stored in the library:
Prompts stored in code
Prompts stored in a file
The prompt will now be stored in the library and versioned:

The Prompt
object will create a new prompt in the library if this prompt doesn’t already exist, otherwise it will return the existing prompt.
This means you can safely run the above code multiple times without creating duplicate prompts.