Mercurial > repos > bgruening > chatgpt_openai_api
diff chatgpt.py @ 1:08c658e9aa9e draft
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/chatgpt commit 13c168a7d6a2d5050c04253754fb86321ad57d54
author | bgruening |
---|---|
date | Wed, 14 Aug 2024 11:33:44 +0000 |
parents | f256dc85e1a0 |
children | dab494dce303 |
line wrap: on
line diff
--- a/chatgpt.py Tue Aug 13 14:25:19 2024 +0000 +++ b/chatgpt.py Wed Aug 14 11:33:44 2024 +0000 @@ -9,7 +9,8 @@ with open(sys.argv[4], "r") as f: openai_api_key = f.read().strip() if not openai_api_key: - raise Exception("OpenAI API key is not provided in user preferences!") + print("OpenAI API key is not provided in user preferences!") + sys.exit(1) client = OpenAI(api_key=openai_api_key)