Breaking Changes Guide
We usually come up with inputs (aka Variables) and outputs (format and schema) early during development. While the actual prompt is getting tunned over a longer period of time, often after the feature is already in production and we see users interacting with it. Mensa allows updates of the prompt without code change and service deployment.
But what to do if you need to add a new variable or change the output format?
- if we deploy new prompt version before the code was not updated production service will be broken ❌
- if we deploy new code before deploying new prompt version production service will be broken ❌
A workaround would be to create a new prompt (instead of a new version) with some suffix like v2, v3 and so on. But Mensa has a better solution!
Mensa differentiates between prompt version and schema version (yes, naming is confusing, I’m working on it).
During prompt integration we require to specify schema version
const params = await mensa.toGenerateText({ promptId: 'unhelpful-assistant', schemaVersion: 1,});As long as we modify only instruction without changing inputs or outputs, the latest deployed prompt version will be used by the sdk.
But when Mensa detects breaking change, it notifies user and increases schemaVersion that needs to be updated in the code (together with new input/output handling).
What we consider a breaking change?
Section titled “What we consider a breaking change?”- New variable was introduced
- Output type was changed
- Output schema was changed