Remove wrong comment and make it more readable.

This commit is contained in:
Oleksandr Kozachuk 2023-08-12 12:30:07 +02:00
parent e4d055b900
commit 4b2f634b79

View File

@ -219,15 +219,10 @@ def main() -> int:
command = parser.parse_args()
config = read_config(args.config)
# modify config according to args
if type(config['openai']) is dict:
config_openai = config['openai']
if type(config['openai']) is dict and type(config['openai']['api_key']) is str:
openai_api_key(config['openai']['api_key'])
else:
RuntimeError("Configuration openai is not a dict.")
if type(config_openai['api_key']) is str:
openai_api_key(config_openai['api_key'])
else:
raise RuntimeError("Configuration openai.api_key is not a string.")
raise RuntimeError("Configuration openai.api_key is wrong.")
command.func(command, config)