-
Notifications
You must be signed in to change notification settings - Fork 486
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 mistral as a new guardrail provider #756
base: main
Are you sure you want to change the base?
Conversation
Example curl Request: curl --request POST \
--url http://localhost:8787/v1/chat/completions \
--header 'authorization: <api_key>' \
--header 'content-type: application/json' \
--header 'x-portkey-config: {"before_request_hooks": [ {"type":"guardrail", "name": "test", "checks": [ {"id": "mistral.pii", "parameters": { "credentials": {"apiKey":"<mistral_api_key>" }}} ]} ]}' \
--header 'x-portkey-provider: groq' \
--data '{
"messages": [
{
"role": "user",
"content": "Say Hi. My name is Jhon Doe and my email is user@example.com"
}
]
}' Supported guardrails are
|
Hey @b4s36t4 - Can you please add tests as well like other plugins |
…to feat/mistral-guardrail
…to feat/mistral-guardrail
d3d96da
to
08cd951
Compare
@@ -261,7 +261,8 @@ export class HooksManager { | |||
context, | |||
check.parameters, | |||
eventType, | |||
options | |||
options, | |||
fn |
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.
We can remove this arg because it is no longer required with the new approach.
@@ -80,4 +94,11 @@ export const plugins = { | |||
toxicity: patronustoxicity, | |||
custom: patronuscustom, | |||
}, | |||
mistral: mistralGuardCategories.reduce( |
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.
We can convert this to a single plugin like portkey.moderateContent and accept all the required categories in it
Added 2 comments. Everything else LGTM |
Title:
Related Issues: (optional)