Adds experimental.OpenAIModel#2637
Merged
eamodio merged 2 commits intogitkraken:mainfrom May 17, 2023
Merged
Conversation
5b66a96 to
e7fb3e4
Compare
683e92c to
8bb61b5
Compare
Contributor
Author
|
This builds, linting passes, I was able to debug it and to see the model reflect in the debugger after specifying it in the configs (I tested with Untitled.mov |
d13
reviewed
Apr 17, 2023
src/ai/openaiProvider.ts
Outdated
| dispose() {} | ||
|
|
||
| async generateCommitMessage(diff: string, options?: { context?: string }): Promise<string | undefined> { | ||
| this.model = configuration.get('experimental.openAIModel') || 'gpt-3.5-turbo'; |
Member
There was a problem hiding this comment.
Could pull this code into its own method (something like ensureModel) which is (force = false): void.
Suggested change
| this.model = configuration.get('experimental.openAIModel') || 'gpt-3.5-turbo'; | |
| this.ensureModel(); |
Member
There was a problem hiding this comment.
To take that a step further, you could hook up a listener for config changes in the constructor. Something like:
constructor(private readonly container: Container) {
this._disposable = [
configuration.onDidChange(this.onConfigurationChanged, this),
];
}
private onConfigurationChanged(e?: ConfigurationChangeEvent) {
if (!configuration.changed(e, 'experimental.openAIModel')) return;
this.ensureModel(true);
}
Contributor
Author
There was a problem hiding this comment.
Sorry, @d13 ! I focused on something else. I should have followed up sooner.
- Moves AI settings into a new AI section - Renames new setting into a `gitlens.ai` namespace and changes it to be an enum for easier selection - Updates max characters to be dependent on selected model
8bb61b5 to
3b83b25
Compare
Member
Contributor
Author
|
Thank you all! I'll try to come back to this repo more often 🙇♂️ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Adds a
gitlens.experimental.OpenAIModelsetting to specify the OpenAI model to use to generate commit messages when using theGitLens: Generate Commit Messagecommand.Fixes #2636
Checklist
Fixes $XXX -orCloses #XXX -prefix to auto-close the issue that your PR addresses