def generate_env()

in hugegraph-llm/src/hugegraph_llm/config/models/base_config.py [0:0]


    def generate_env(self):
        if os.path.exists(env_path):
            log.info("%s already exists, do you want to override with the default configuration? (y/n)", env_path)
            update = input()
            if update.lower() != "y":
                return
            self.update_env()
        else:
            config_dict = self.model_dump()
            config_dict = {k.upper(): v for k, v in config_dict.items()}
            with open(env_path, "w", encoding="utf-8") as f:
                for k, v in config_dict.items():
                    if v is None:
                        f.write(f"{k}=\n")
                    else:
                        f.write(f"{k}={v}\n")
            log.info("Generate %s successfully!", env_path)