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

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

Draft
PeterDaveHello wants to merge 1 commit into ChatGPTBox-dev:master
base: master
Choose a base branch
Loading
from PeterDaveHello:add-penalty-parameters

Conversation

Copy link
Member

@PeterDaveHello PeterDaveHello commented Aug 14, 2024

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:

Copy link
Member Author

Screenshot:

screenshot

Copy link
Member Author

@josStorer please let me know what do you think ;)

Copy link
Member

josStorer commented Jan 31, 2025
edited
Loading

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

Copy link
Member Author

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

Copy link

@Copilot Copilot AI left a 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

Copy link
Member Author

/review

qodo-merge-pro[bot] reacted with eyes emoji

Copy link
Contributor

qodo-merge-pro bot commented Jun 2, 2025

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:

⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
No major issues detected

Copy link
Member Author

/improve

qodo-merge-pro[bot] reacted with eyes emoji

Copy link
Contributor

qodo-merge-pro bot commented Jun 2, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot Copilot left review comments

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

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