Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: support language for commit message generation #605

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dougcunha wants to merge 0 commits into sourcegit-scm:develop from dougcunha:develop

Conversation

Copy link
Contributor

@dougcunha dougcunha commented Oct 27, 2024

  • 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.

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.

dougcunha reacted with thumbs up emoji

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

Copy link
Collaborator

love-linger commented Oct 28, 2024
edited
Loading

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

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.

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.

Copy link
Contributor Author

dougcunha commented Oct 28, 2024
edited
Loading

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.

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.

Copy link
Contributor Author

dougcunha commented Oct 28, 2024 via email

Thanks leo. Let me know if you need any help. Em seg., 28 de out. de 2024 às 09:46, leo ***@***.***> escreveu:
...
Thanks. I agree with you that having a per-repository setting for prefered AI service. I will try to add this feature myself tomorrow. — Reply to this email directly, view it on GitHub <#605 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAFVZ7CYWMJQOTAXRNDX4CDZ5YWZVAVCNFSM6AAAAABQWBOHKWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINBRGQ4TEMZUHE> . You are receiving this because you authored the thread.Message ID: ***@***.***>

Copy link
Collaborator

Done.

image

dougcunha reacted with thumbs up emoji dougcunha reacted with hooray emoji dougcunha reacted with rocket emoji

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
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /