Changes from https://github.com/juk0de/ChatMastermind.git #1
@ -219,15 +219,10 @@ def main() -> int:
|
|||||||
command = parser.parse_args()
|
command = parser.parse_args()
|
||||||
config = read_config(args.config)
|
config = read_config(args.config)
|
||||||
|
|
||||||
# modify config according to args
|
if type(config['openai']) is dict and type(config['openai']['api_key']) is str:
|
||||||
if type(config['openai']) is dict:
|
openai_api_key(config['openai']['api_key'])
|
||||||
config_openai = config['openai']
|
|
||||||
else:
|
else:
|
||||||
RuntimeError("Configuration openai is not a dict.")
|
raise RuntimeError("Configuration openai.api_key is wrong.")
|
||||||
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.")
|
|
||||||
|
|
||||||
command.func(command, config)
|
command.func(command, config)
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user