account for pre-1a difficulty in bot options fromJson method (#1042)

This commit is contained in:
ggurdin 2024-11-18 16:41:30 -05:00 committed by GitHub
parent 9060fd84f8
commit 6655e240ab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -64,7 +64,9 @@ class BotOptionsModel {
//////////////////////////////////////////////////////////////////////////
languageLevel: json[ModelKey.languageLevel] is int
? json[ModelKey.languageLevel]
: null,
: json[ModelKey] == "PREA1"
? 0
: null,
safetyModeration: json[ModelKey.safetyModeration] ?? true,
mode: json[ModelKey.mode] ?? BotMode.discussion,
targetLanguage: json[ModelKey.targetLanguage],