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

fix: Disallow additional properties to be added in the filter config #275

Merged
merged 7 commits into from
Nov 7, 2024

Conversation

jjtang1985
Copy link
Contributor

@jjtang1985 jjtang1985 commented Nov 7, 2024

Context

This PR contains:

Definition of Done

  • Code is tested (Unit, E2E)
  • (Optional) Release notes updated

@jjtang1985 jjtang1985 changed the title fix: disallow additional properties to be added in the filter config fix: Disallow additional properties to be added in the filter config Nov 7, 2024
@jjtang1985 jjtang1985 marked this pull request as ready for review November 7, 2024 14:57
.changeset/filter.md Outdated Show resolved Hide resolved
Co-authored-by: Deeksha Sinha <[email protected]>
@@ -10,7 +11,7 @@ import type {
*/
export function buildAzureContentFilter(
Copy link
Contributor

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
  ]
};

Copy link
Contributor Author

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 😄

@jjtang1985 jjtang1985 merged commit bf17e17 into main Nov 7, 2024
10 checks passed
@jjtang1985 jjtang1985 deleted the update-orc-filter branch November 7, 2024 16:00
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