-
Notifications
You must be signed in to change notification settings - Fork 820
Add support of presence_penalty and frequency_penalty parameter #773
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
base: master
Are you sure you want to change the base?
Add support of presence_penalty and frequency_penalty parameter #773
Conversation
@josStorer please let me know what do you think ;) |
Different APIs have varying default values for presence/frequency penalty. Typically, the default values used by APIs are sufficient for common application scenarios. Setting a global default value for these two parameters might be helpful for specific user scenarios, but it could also negatively impact the performance of certain APIs. Of course, there's nothing wrong with this PR itself. The default values for these two parameters in the OpenAI API are both 0, but this could affect users who utilize custom APIs. In contrast, the temperature parameter is more commonly used, its impact is more predictable, and it is sufficient for most users, which can also reduce the complexity of the software itself. I believe that the target users of ChatGPTBox will hardly ever need to modify these two parameters. If we do decide to provide this feature, it would be best to add a CheckBox component to make it optional, or even better, allow each API to configure these parameters individually. However, due to my personal laziness, and considering the increase in software complexity, along with the fact that I don't think this feature is very important, I have been procrastinating on implementing it. 🤣 |
You're right, I can see how to add a CheckBox component for them. Hopefully, with some help from AI assistants, it won’t take much time. 😆 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for the presence_penalty and frequency_penalty parameters to various OpenAI API integrations and updates the UI to allow users to adjust these settings while localizing the associated labels.
- Added penalty parameters in the OpenAI, Azure OpenAI, and ChatGPT API calls.
- Updated the configuration defaults and UI controls (including sliders) for these parameters.
- Enhanced localization files for multiple languages to include the new penalty labels.
Reviewed Changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
src/services/apis/openai-api.mjs | Added penalty parameters to the GPT API calls |
src/services/apis/azure-openai-api.mjs | Added penalty parameters to the Azure OpenAI API |
src/popup/sections/AdvancedPart.jsx | Introduced UI sliders for adjusting penalty values |
src/config/index.mjs | Updated default configuration with penalty values |
src/_locales/*/main.json | Updated localization files to include penalty labels |
/review |
Qodo Merge was enabled for this repository. To continue using it, please link your Git account with your Qodo account here. PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
/improve |
Qodo Merge was enabled for this repository. To continue using it, please link your Git account with your Qodo account here. PR Code Suggestions ✨No code suggestions found for the PR. |
The frequency and presence penalties help reduce the likelihood of repetitive token sequences, allowing for more varied and contextually appropriate outputs.
By implementing these options, we can gain finer control over the AI's behavior, leading to improved content generation.
Reference docs: