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: add mistral as a new guardrail provider #756

Merged
merged 19 commits into from
Dec 26, 2024

Conversation

b4s36t4
Copy link
Contributor

@b4s36t4 b4s36t4 commented Nov 20, 2024

Title:

  • Mistral Moderations support for guardrail plugins.

Related Issues: (optional)

@b4s36t4
Copy link
Contributor Author

b4s36t4 commented Nov 20, 2024

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 [email protected]"
    }
  ]
}'

Supported guardrails are

'sexual', 'hate_and_discrimination', 'violence_and_threats', 'dangerous_and_criminal_content', 'selfharm', 'health', 'financial', 'law', 'pii',

narengogi
narengogi previously approved these changes Nov 22, 2024
plugins/mistral/manifest.json Show resolved Hide resolved
@VisargD
Copy link
Collaborator

VisargD commented Nov 27, 2024

Hey @b4s36t4 - Can you please add tests as well like other plugins

narengogi
narengogi previously approved these changes Dec 12, 2024
@b4s36t4 b4s36t4 force-pushed the feat/mistral-guardrail branch from d3d96da to 08cd951 Compare December 20, 2024 12:10
plugins/index.ts Outdated Show resolved Hide resolved
@VisargD
Copy link
Collaborator

VisargD commented Dec 24, 2024

Added 2 comments. Everything else LGTM

@VisargD VisargD merged commit 66e9213 into Portkey-AI:main Dec 26, 2024
2 checks passed
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.

[Feature] Add Mistral Moderations API as a guardrail Provider
3 participants