magic-commit
magic-commit copied to clipboard
📦 new: add ollama as model provider
This pull request includes changes to the package.json, source/app.js, source/utils/commit.js, source/utils/config.json, and source/utils/openai.js files to enhance code readability, promote a component-based structure, remove unused code, and adhere to the DRY principle.
As suggested, we introduced modifications for the Ollama provider, necessitating substantial changes that I believe are essential. Additionally, we added source/utils/ollama.js and source/utils/modelSelection.js.
Enhancements:
package.json: Improved script condition to handle missing directories.source/app.js: Moved OpenAI configuration toutils/openAI.jsfor better readability; implemented a modal selection component for choosing the provider.source/utils/commit.js: Consolidated all Git-related functions and modules into this file.source/utils/config.json: Enhanced configuration with clearer names and added support for additional models.source/utils/generateCommitMessage.js: Created a separate module for prompt generation based on provider.source/utils/modelSelection.js: Developed a component for provider selection.source/utils/ollama.js: Integrated Ollama configuration and prompt response handling.source/utils/openai.js: Updated existing OpenAI configuration for improved readability.
@warengonzaga, I'm awaiting your code review and would appreciate your feedback to enhance the code.
You have some git conflicts @promiseer also I think it's time to make another folder called "models" so we can keep adding supported models for the tool.
You have some git conflicts @promiseer also I think it's time to make another folder called "models" so we can keep adding supported models for the tool.
Merge conflicts are fixed; now I'm adding the models folder.
All the mentioned changes have been completed, @warengonzaga.
Hey @promiseer, did you add an option to the CLI for which model to use? Do you have a demo?
@warengonzaga here is the demo video
https://github.com/user-attachments/assets/bf257b82-35e3-494e-b076-c9d2fa3cc5dc
Interesting, does that mean @promiseer everytime you command "magicc" it will ask for which model? I'm thinking of adding a flag for selecting modal then save the config with "Conf" so that everytime we use "magicc" command it will not ask for model.
You are correct, as users to click each time will lead to a poor experience. let me fix this
You are correct, as users to click each time will lead to a poor experience. let me fix this
You can use the package "Conf" to save configuration we can use that to store some data of the user.
What's the update here, @promiseer? Let's add the ability to select a model by defining it as a flag.
Hey, @promiseer, just checking if we can add it to your PR. Otherwise, I will continue it.
Okay I will merge this to the dev branch and then from there I will fix your update.