def METHOD_NAME(naive_automl, config):
    artifacts = config.framework_params.get('_save_artifacts', ['history'])
    try:
        artifacts_dir = Path(output_subdir("artifacts", config))
        if 'history' in artifacts:
            naive_automl.history.to_csv(artifacts_dir / "history.csv", index=False)
        if 'model' in artifacts:
            (artifacts_dir / "model_str.txt").write_text(str(naive_automl.chosen_model))
            with open(artifacts_dir / "model.pkl", 'wb') as fh:
                pickle.dump(naive_automl.chosen_model, fh)
    except Exception:
        log.warning("Error when saving artifacts.", exc_info=True)