Skip to content

Commit

Permalink
Merge pull request #677 from pangeachat/handle-cast-bot-model-error
Browse files Browse the repository at this point in the history
Handle case of language level not being int in bot-options state event
  • Loading branch information
ggurdin authored Sep 12, 2024
2 parents 489129f + 4e8000e commit 3972d02
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/pangea/models/bot_options_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ class BotOptionsModel {
//////////////////////////////////////////////////////////////////////////
// General Bot Options
//////////////////////////////////////////////////////////////////////////
languageLevel: json[ModelKey.languageLevel],
languageLevel: json[ModelKey.languageLevel] is int
? json[ModelKey.languageLevel]
: null,
safetyModeration: json[ModelKey.safetyModeration] ?? true,
mode: json[ModelKey.mode] ?? "discussion",

Expand Down

0 comments on commit 3972d02

Please sign in to comment.