Skip to content
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

feat: stop word model setting #4113

Merged
merged 4 commits into from
Nov 25, 2024
Merged

feat: stop word model setting #4113

merged 4 commits into from
Nov 25, 2024

Conversation

urmauur
Copy link
Member

@urmauur urmauur commented Nov 25, 2024

Describe Your Changes

Type Modifications:

In settingComponent.ts, the ControllerType type now includes 'tag' as a possible value. The InputComponentProps type has been adjusted to allow value to be either string or string[].
ModelConfigInput Component:

The code in ModelConfigInput/index.tsx has been refactored to use a return statement with curly brackets {} instead of an implicit return, although its logic remains largely unchanged.
SettingComponent Component:

In ModelSetting/SettingComponent.tsx, added support for the 'tag' controller type, including handling for the value to be string[] and modifying the onValueUpdated function to handle arrays of strings.
ModelSetting Component:

In ModelSetting/index.tsx, the onValueChanged function signature was updated to accept string[].
TagInput Component:

A new component TagInput was created in TagInput/index.tsx. It provides the ability to enter tag-like data, allowing users to add strings to an array and render them as badges with an option to remove them.
ThreadRightPanel Component:

In ThreadRightPanel/index.tsx, the onValueChanged function now supports receiving string[] values.

Component Utilities:
In componentSettings.ts, support was added for the 'tag' controller type, setting its value from keySetting.
In predefinedComponent.ts, the existing 'stop' setting was switched from an input type to a tag type, with a default value of an empty string array and a new placeholder.

Fixes Issues

default
Screenshot 2024-11-25 at 15 13 14

adding custom
Screenshot 2024-11-25 at 15 24 33

Thread json
Screenshot 2024-11-25 at 15 24 27

No Stop word
Screenshot 2024-11-25 at 15 27 04

Self Checklist

  • Added relevant comments, esp in complex areas
  • Updated docs (for bug fixes / features)
  • Created issues for follow-up changes or refactoring needed

Copy link
Contributor

@louis-jan louis-jan left a comment

Choose a reason for hiding this comment

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

Love it.

@urmauur urmauur merged commit 314cb03 into dev Nov 25, 2024
19 checks passed
@urmauur urmauur deleted the feat/stop-word branch November 25, 2024 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: User can use Stop Words presets and add custom bug: Stop words input merges spaces with tokens
2 participants