Files
vienteck-ComfyUI-Chat-GPT-I…/__init__.py
T
2023-12-14 15:18:16 -08:00

17 lines
657 B
Python

import json
import os
from .chat_gpt_integration import NODE_CLASS_MAPPINGS
from .chat_gpt_integration import NODE_DISPLAY_NAME_MAPPINGS
__all__ = ['NODE_CLASS_MAPPINGS', 'NODE_DISPLAY_NAME_MAPPINGS']
#check if config file exists
if not os.path.isfile(os.path.join(os.path.dirname(os.path.realpath(__file__)),"config.json")):
#create config file
print(f'config file not found. Creating one for you')
config = {
"openAI_API_Key": "sk-#########################################"
}
with open(os.path.join(os.path.dirname(os.path.realpath(__file__)),"config.json"), "w") as f:
json.dump(config, f, indent=4)