-
Notifications
You must be signed in to change notification settings - Fork 12
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: Add convenience function for LlamaGuard Filter #555
base: main
Are you sure you want to change the base?
Conversation
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.
A suggestion:
Since the default for is false for all properties of the filter, the user only needs to set categories which they want to enable. As such, setting to true
seems like a redundant effort. We could allow the user to just pass an array of strings (from union type of all existing properties) and we set them to true.
The pro here would be less typing and less confusion (setting false makes no sense, but this might not very obvious).
The con is it deviates from azure filter a bit where we have a key: value
style of input.
I would personally prefer if the user explicitly sets the properties to buildLlamaGuardFilter({ hate: true, sexual_content: true}) //Very clear
buildLlamaGuardFilter([hate', 'sexual_content']) //Not clear, if we are enabling or disabling the category |
…P/ai-sdk-js into feat/add-llama-guard-filtering-option
From my understanding of the filter, you basically can enable a category, the default is false for all the rest categories. What I personally find more confusing is allowing to disable something thats going to be disabled anyway. |
…P/ai-sdk-js into feat/add-llama-guard-filtering-option
Context
Closes SAP/ai-sdk-js-backlog#205.
What this PR does and why it is needed
This PR adds a convenience function to enable filter categories for Llama guard filter.
The built filter can then be used in the filtering configuration of the Orchestration client.