package il.co.organicai.agent

import org.json.JSONObject

/** org.json's optString(key, null) trips Kotlin's nullability inference; this is the clean form. */
internal fun JSONObject.optStringOrNull(key: String): String? =
    if (has(key) && !isNull(key)) getString(key) else null
