Skip to content

Conversation

dougcunha
Copy link
Contributor

  • Extend the GenerateCommitMessage constructor to include a language parameter and use it in the selected language prompt logic.
  • Add property for commit message language with default value "English".
  • Add integration related configuration strings for commit message language.
  • Add property for CommitMessageLanguage in RepositoryConfigure.
  • Add language parameter to AIAssistant constructor and propagate it to GenerateCommitMessage.
  • Add integration configuration options in the repository settings view.

SourceGit_e1QzjvGHnn

@love-linger I’d like to hear your thoughts on this approach. Please let me know if you’ve considered any alternatives. I also just noticed your comment on the other pull request.

@love-linger
Copy link
Collaborator

I'm very sorry, I'm rewriting the integration method of OpenAI. I will reply under this PR after my modifications are completed. At that time, you can test and make new modifications.

@love-linger
Copy link
Collaborator

Now, we support to configure multiple OpenAI services.

image

  • If there's only one service available, clicking the Use OpenAI to generate commit message button will directly generate commit message by it.
  • If there're multiple services available, clicking the Use OpenAI to generate commit message button will show a context menu to select
    image

@love-linger
Copy link
Collaborator

love-linger commented Oct 28, 2024

So, you can configure multiple services (for example, one using English and another using Português) and the select the one you want when generate commit message in different repositories.

PS: You can also test different models and finally find the most suitable for you

@dougcunha
Copy link
Contributor Author

I think your solution looks great. Perhaps an improvement could be having a per-repository setting for which pre-configured AI service I want to use. If it's set, the context menu wouldn't open, generating the message directly.

I'll sync your changes and test it on my end as well.

@love-linger
Copy link
Collaborator

I think your solution looks great. Perhaps an improvement could be having a per-repository setting for which pre-configured AI service I want to use. If it's set, the context menu wouldn't open, generating the message directly.

I'll sync your changes and test it on my end as well.

At present, since there are many AI models to choose from, and they are updated relatively quickly, I am testing different models myself, such as: some are better at understanding Chinese, and some are more inclined to understand source code. I personally prefer to keep the context menu for multiple services (multiple prompts), so that there is more choice, or the opportunity to compare multiple outputs and adopt the best results.

@dougcunha
Copy link
Contributor Author

dougcunha commented Oct 28, 2024

At present, since there are many AI models to choose from, and they are updated relatively quickly, I am testing different models myself, such as: some are better at understanding Chinese, and some are more inclined to understand source code. I personally prefer to keep the context menu for multiple services (multiple prompts), so that there is more choice, or the opportunity to compare multiple outputs and adopt the best results.

I understand your point of view, and the idea of comparing results from different models before choosing the best is interesting. While this might not be as necessary when using paid models like GPT-4 or Claude 3.5, it makes more sense for those using local models like Ollama. However, it would still be beneficial to have an optional configuration per repository for those who don't need to test multiple models.

I can implement this on top of your commit later if you agree. We could even leverage the changes from this pull request.

@love-linger
Copy link
Collaborator

Thanks. I agree with you that having a per-repository setting for prefered AI service. I will try to add this feature myself tomorrow.

@dougcunha
Copy link
Contributor Author

dougcunha commented Oct 28, 2024 via email

@love-linger
Copy link
Collaborator

Done.

image

@dougcunha
Copy link
Contributor Author

That's great! Well done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants