-
Notifications
You must be signed in to change notification settings - Fork 4
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
fix: Disallow additional properties to be added in the filter config #275
Conversation
Co-authored-by: Deeksha Sinha <[email protected]>
@@ -10,7 +11,7 @@ import type { | |||
*/ | |||
export function buildAzureContentFilter( |
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.
Unrelated to this PR, but I realized this util function returns filters: [{ ... }]
instead of just the azure filter config. If we ever have another safety service, the user would have to do:
input: {
filters: [
...buildAzureContentFilter({ Hate: 0 }).filters,
...builderSomeOtherFilter({ key: 'value2' }).filters
]
};
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.
Good point.
Maybe until then, the schema will be changed again and we can reconsider the UX 😄
Context
This PR contains:
Fix the
FilterConfig
to disable additional properties.Rename
FilterConfig
toInputFilterConfig
andOutputFilterCOnfig
wait for fix: Use types instead of interfaces #274 first.
Definition of Done