Skip to content

GLW-1: Add OpenAI provider integration #7

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cmgriffing-at-gitkraken
Copy link
Owner

Introduced a new OpenAI provider module to handle AI-driven operations such as generating commit messages and explaining code changes. This integration leverages configurable models and handles API key management, request retries, and rate limit handling. The implementation supports handling large diffs by adjusting request size based on model constraints and providing user feedback if truncation occurs.

❤ Thank you for contributing to GitLens! ❤

🚨 IMPORTANT 🚨

  • Please create an issue before creating a Pull Request
  • Please use the following Git commit message style
    • Use future tense ("Adds feature" not "Added feature")
    • Use a "Fixes #xxx -" or "Closes #xxx -" prefix to auto-close the issue that your PR addresses
    • Limit the first line to 72 characters or less
    • Reference issues and pull requests liberally after the first line

↑👆 DELETE above before submitting 👆↑


Description

Checklist

  • I have followed the guidelines in the Contributing document
  • My changes follow the coding style of this project
  • My changes build without any errors or warnings
  • My changes have been formatted and linted
  • My changes include any required corresponding changes to the documentation (including CHANGELOG.md and README.md)
  • My changes have been rebased and squashed to the minimal number (typically 1) of relevant commits
  • My changes have a descriptive commit message with a short title, including a Fixes $XXX - or Closes #XXX - prefix to auto-close the issue that your PR addresses

Introduced a new OpenAI provider module to handle AI-driven operations such as generating commit messages and explaining code changes. This integration leverages configurable models and handles API key management, request retries, and rate limit handling. The implementation supports handling large diffs by adjusting request size based on model constraints and providing user feedback if truncation occurs.
@cmgriffing-at-gitkraken
Copy link
Owner Author

Hey @cmgriffing-at-gitkraken, while reviewing your PR, I'd suggest the following code changes:

👉 Fixes type errors for otherai models

OtherAI allows custom model names so we must support string

You can also review and apply these suggestions locally on your machine.

Learn more about GitKraken Code Suggest

Code Suggest liberates your code reviews from GitHub's restrictive, comment-only feedback style. As simple as suggesting changes in a Google-doc, provide real code suggestions from where you code, e.g. your IDE, and on anything in your project — not just on the lines of code changed in the PR.

Join your team on GitKraken to speed up PR review.

@cmgriffing-at-gitkraken
Copy link
Owner Author

Hey @cmgriffing-at-gitkraken, while reviewing your PR, I'd suggest the following code changes:

👉 Fixes type errors for otherai models

OtherAI allows custom model names so we must support string

You can also review and apply these suggestions locally on your machine.

Learn more about GitKraken Code Suggest

Code Suggest liberates your code reviews from GitHub's restrictive, comment-only feedback style. As simple as suggesting changes in a Google-doc, provide real code suggestions from where you code, e.g. your IDE, and on anything in your project — not just on the lines of code changed in the PR.

Join your team on GitKraken to speed up PR review.

@cmgriffing-at-gitkraken
Copy link
Owner Author

Hey @cmgriffing-at-gitkraken, while reviewing your PR, I'd suggest the following code changes:

👉 Trying this again

You can also review and apply these suggestions locally on your machine.

Learn more about GitKraken Code Suggest

Code Suggest liberates your code reviews from GitHub's restrictive, comment-only feedback style. As simple as suggesting changes in a Google-doc, provide real code suggestions from where you code, e.g. your IDE, and on anything in your project — not just on the lines of code changed in the PR.

Join your team on GitKraken to speed up PR review.

@cmgriffing-at-gitkraken
Copy link
Owner Author

Hey @cmgriffing-at-gitkraken, while reviewing your PR, I'd suggest the following code changes:

👉 Trying this again

You can also review and apply these suggestions locally on your machine.

Learn more about GitKraken Code Suggest

Code Suggest liberates your code reviews from GitHub's restrictive, comment-only feedback style. As simple as suggesting changes in a Google-doc, provide real code suggestions from where you code, e.g. your IDE, and on anything in your project — not just on the lines of code changed in the PR.

Join your team on GitKraken to speed up PR review.

@cmgriffing
Copy link

Hey @cmgriffing-at-gitkraken, while reviewing your PR, I'd suggest the following code changes:

👉 TESTING

You can also review and apply these suggestions locally on your machine.

Learn more about GitKraken Code Suggest

Code Suggest liberates your code reviews from GitHub's restrictive, comment-only feedback style. As simple as suggesting changes in a Google-doc, provide real code suggestions from where you code, e.g. your IDE, and on anything in your project — not just on the lines of code changed in the PR.

Join your team on GitKraken to speed up PR review.

@cmgriffing-at-gitkraken
Copy link
Owner Author

Hey @cmgriffing-at-gitkraken, while reviewing your PR, I'd suggest the following code changes:

👉 Code Suggestion for #7

#7

You can also review and apply these suggestions locally on your machine.

Learn more about GitKraken Code Suggest

Code Suggest liberates your code reviews from GitHub's restrictive, comment-only feedback style. As simple as suggesting changes in a Google-doc, provide real code suggestions from where you code, e.g. your IDE, and on anything in your project — not just on the lines of code changed in the PR.

Join your team on GitKraken to speed up PR review.

@cmgriffing-at-gitkraken
Copy link
Owner Author

Hey @cmgriffing-at-gitkraken, while reviewing your PR, I'd suggest the following code changes:

👉 Improve type support

Code Suggestion from Chris Griffing
to Pull Request #7 made on 05/14/2024

You can also review and apply these suggestions locally on your machine.

Learn more about GitKraken Code Suggest

Code Suggest liberates your code reviews from GitHub's restrictive, comment-only feedback style. As simple as suggesting changes in a Google-doc, provide real code suggestions from where you code, e.g. your IDE, and on anything in your project — not just on the lines of code changed in the PR.

Join your team on GitKraken to speed up PR review.

@cmgriffing-at-gitkraken
Copy link
Owner Author

Hey @cmgriffing-at-gitkraken, while reviewing your PR, I'd suggest the following code changes:

👉 Improve type support

Code Suggestion from Chris Griffing
to Pull Request #7 made on 05/14/2024

You can also review and apply these suggestions locally on your machine.

Learn more about GitKraken Code Suggest

Code Suggest liberates your code reviews from GitHub's restrictive, comment-only feedback style. As simple as suggesting changes in a Google-doc, provide real code suggestions from where you code, e.g. your IDE, and on anything in your project — not just on the lines of code changed in the PR.

Join your team on GitKraken to speed up PR review.


dispose() {}

private get model(): OtherAIModels | null {
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this really be null?

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