opencommit icon indicating copy to clipboard operation
opencommit copied to clipboard

✨ feat(api.ts): add support for Azure OpenAI API

Open takuya-o opened this issue 2 years ago • 12 comments
trafficstars

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

takuya-o avatar May 06 '23 19:05 takuya-o

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.

takuya-o avatar May 09 '23 15:05 takuya-o

Refactoring has been completed, resulting in a simpler implementation. @di-sukharev I would appreciate it if you could review the code again.

takuya-o avatar May 09 '23 16:05 takuya-o

@di-sukharev Will this be merged into the master branch soon? I would like to use OpenCommit with Azure OpenAI

SamOyeAH avatar May 24 '23 09:05 SamOyeAH

Stale pull request message

github-actions[bot] avatar Jul 03 '23 21:07 github-actions[bot]

@takuya-o hey 👋 sorry for being so late, could you please fix the conflicts and I will merge it :)

di-sukharev avatar Jul 05 '23 06:07 di-sukharev

Stale pull request message

github-actions[bot] avatar Aug 15 '23 21:08 github-actions[bot]

please solve conflicts @takuya-o <3 then build it npm run build and test build locally npm run start -- config set ....

di-sukharev avatar Feb 29 '24 14:02 di-sukharev

@SamOyeAH any chance you could fork this project and add your Azure OpenAI support please ?

JayDoubleu avatar Mar 06 '24 15:03 JayDoubleu

cant wait to integrate once it is released. thank you.

YunchuWang avatar Mar 15 '24 19:03 YunchuWang

@takuya-o hi again, please resolve the conflict and i will merge this

di-sukharev avatar Mar 18 '24 04:03 di-sukharev

@takuya-o hello, please follow up, let's merge it when comments are addressed and conflicts are solved ❤️

di-sukharev avatar Aug 18 '24 11:08 di-sukharev

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

di-sukharev avatar Aug 27 '24 14:08 di-sukharev