Mercurial > repos > bgruening > chatgpt_openai_api
comparison chatgpt.py @ 1:db316ead4bda 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:36 +0000 |
| parents | b5971fa941dd |
| children | 329bdb05dd90 |
comparison
equal
deleted
inserted
replaced
| 0:b5971fa941dd | 1:db316ead4bda |
|---|---|
| 7 question = sys.argv[2] | 7 question = sys.argv[2] |
| 8 model = sys.argv[3] | 8 model = sys.argv[3] |
| 9 with open(sys.argv[4], "r") as f: | 9 with open(sys.argv[4], "r") as f: |
| 10 openai_api_key = f.read().strip() | 10 openai_api_key = f.read().strip() |
| 11 if not openai_api_key: | 11 if not openai_api_key: |
| 12 raise Exception("OpenAI API key is not provided in user preferences!") | 12 print("OpenAI API key is not provided in user preferences!") |
| 13 sys.exit(1) | |
| 13 | 14 |
| 14 client = OpenAI(api_key=openai_api_key) | 15 client = OpenAI(api_key=openai_api_key) |
| 15 | 16 |
| 16 file_search_sup_ext = [ | 17 file_search_sup_ext = [ |
| 17 "c", | 18 "c", |
