Closed ekaj2 closed 9 months ago
@ekaj2 In this PR, since not all loadConfigFromEnv
calls are updated to include a callback function, the callback
passed can be nil. Could you please make the necessary changes for them? More specifically here and here. If possible, maybe loading the OPENAI_API_TYPE
can also be modified to support reading from command. Thanks a lot!
@jackyu1996 Not sure I'll have any more time this weekend, but I'll hopefully come back to that over the week. What we really need is some sort of unit testing. It's already quite hard to manually check all routes here.
Also a refactor of this code so it's not a bunch of params and callbacks getting passed all the way down would help reduce the bugs
@ekaj2 Sure, thank you all the same, and I totally agree with your suggestions. Have a nice weekend!
@ekaj2 @jackyu1996 I've raised the PR https://github.com/jackMort/ChatGPT.nvim/pull/306.
curl: option -H: requires parameter error
Seems to be related to this change here from this PR that tries to add support for AZURE environment variables as well.
https://github.com/jackMort/ChatGPT.nvim/pull/293/files
Api.AUTHORIZATION_HEADER is nil in Api.chat_completions...
The callback passed to loadApiKey is not guaranteed to be called in the case that the environment variable for OPENAI_API_KEY exists.
A simple solution is to pass the callback function in to handle handle if the environment variable is picked up in the config. I'm making a PR for that now.