feat: Add a model config option to disable system prompts #1539
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Closes #1432
Some models don't support system prompts, therefore, a new
modelConfig
option has been added:systemRoleSupported
By default, the
systemRoleSupported
option istrue
, where everything behaves as is. However, if thesystemRoleSupported
option is set tofalse
, allrole: "system"
messages are filtered out. And the very firstrole: "system"
message encountered, will have its content preprended to the very first user message.Brief example, let's assume the following is our
messages
array, before processing:After we apply the filtering, and preprending the first
system
message's content into the first user message, we get:This keeps the existing functionality untouched, while giving the option of using a wider range of models, even those that do not support
system
role messages!Please let me know any thoughts or suggestions that may arise!