opencommit
opencommit copied to clipboard
✨ feat(api.ts): add support for Azure OpenAI API
The Azure OpenAI API is now supported in addition to the OpenAI API. The API type can be specified in the configuration file using the OPENAI_API_TYPE key. If the key is not specified, the default value is 'openai'. The AzureOpenAIApi class is added to the utils folder to handle the Azure OpenAI API calls. The createChatCompletion method is implemented in the AzureOpenAIApi class to handle the chat completion requests. The method is called in the generateCommitMessage method in the OpenAi class if the apiType is set to 'azure'.
Related: #150 comment
I found a simpler way utilizing the OpenAI npm package. Also, I forgot to patch the length of the API_KEY. Please wait next commit.
Refactoring has been completed, resulting in a simpler implementation. @di-sukharev I would appreciate it if you could review the code again.
@di-sukharev Will this be merged into the master branch soon? I would like to use OpenCommit with Azure OpenAI
Stale pull request message
@takuya-o hey 👋 sorry for being so late, could you please fix the conflicts and I will merge it :)
Stale pull request message
please solve conflicts @takuya-o <3
then build it npm run build and test build locally npm run start -- config set ....
@SamOyeAH any chance you could fork this project and add your Azure OpenAI support please ?
cant wait to integrate once it is released. thank you.
@takuya-o hi again, please resolve the conflict and i will merge this
@takuya-o hello, please follow up, let's merge it when comments are addressed and conflicts are solved ❤️
there was a refactoring to AzureAiEngine done, please refer to this PR for details there was a refactoring https://github.com/di-sukharev/opencommit/pull/391, your changes should follow the same implementation