tak-bro / aicommit2

A Reactive CLI that generates git commit messages with Ollama, ChatGPT, Gemini, Claude, Mistral and other AI
https://www.npmjs.com/package/aicommit2
MIT License
77 stars 4 forks source link

Feature/add Codestral #49

Closed bhodrolok closed 6 days ago

bhodrolok commented 1 week ago

Issue

48

Description

Adds support for Mistral AI's new genAI model, Codestral.

Testing

Manually by staging (adding to the index) multiple files, running the tool, and checking if there was generated commit messages from codestral.mistral.ai.

Also tested it on other projects by publishing it and using it as outlined in the contributing guide.

Development was done on a machine Windows and looks like some of the automatic test cases would have been skipped because of this (a NodeJS bug apparently).

Additional context

I think the current approach here is a more refactored one, in the sense that the preexisting MistralService class is (re)used instead of creating a new CodestralService. Went with this because the only tangible difference was in the domain where the requests were sent to and the fact that this domain also didn't have a List All Models endpoint like api.mistral.ai.


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

bhodrolok commented 1 week ago

Thanks for the review! Updated code as per your suggestions. There is a small issue where the same display provider is shown to the user even if the requests themselves come from Codestral and Mistral's other models separately. image

I suspect it is because of the switch case handling in src/managers/ai-request.manager.ts, specifically here.

Here is the statement that controls the provider to be displayed.

tak-bro commented 6 days ago

Thank you very much. I'm going to look at the issue you mentioned.

tak-bro commented 5 days ago

@bhodrolok Considering the usability of Mistral along with the issues you mentioned, I thought it would be better to divide the CordestralService and MistralService. Please understand.