def test_ai_config_from_dict_defaults():
    from inference import ai_config_from_dict

    cfg = ai_config_from_dict({})
    assert cfg.model_batch_size == 8
    assert cfg.frame_period_recognition == 4
    assert cfg.frame_recognition_seconds == 2
    assert cfg.has_altitude is False


def test_ai_config_from_dict_altitude_override_sets_flag():
    from inference import ai_config_from_dict

    cfg = ai_config_from_dict({"altitude": 400})
    assert cfg.has_altitude is True
    assert cfg.altitude == 400


def test_ai_config_from_dict_overrides():
    from inference import ai_config_from_dict

    cfg = ai_config_from_dict({"model_batch_size": 4, "probability_threshold": 0.5})
    assert cfg.model_batch_size == 4
    assert cfg.probability_threshold == 0.5
