Skip to content

Commit 72f31e6

Browse files
committed
Fix: Resolve nullable String type mismatch warnings in fromJson
1 parent dae20f4 commit 72f31e6

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

ai-module/src/main/java/com/nano/ai_module/model/ModelsData.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,9 @@ fun ModelData.Companion.fromJson(jsonString: String): ModelData {
193193
mirostatEta = json.optDouble("mirostatEta", 0.1).toFloat(),
194194
seed = json.optInt("seed", -1),
195195
isImported = json.optBoolean("isImported", false),
196-
modelUrl = json.optString("modelUrl", null),
196+
modelUrl = json.optString("modelUrl", "").takeIf { it.isNotEmpty() },
197197
isToolCalling = json.optBoolean("isToolCalling", false),
198198
systemPrompt = json.optString("systemPrompt", "You are a helpful assistant."),
199-
chatTemplate = json.optString("chatTemplate", null)
199+
chatTemplate = json.optString("chatTemplate", "").takeIf { it.isNotEmpty() }
200200
)
201201
}

0 commit comments

Comments
 (0)