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

update safety client app to use new register flow #111

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dineshyv
Copy link
Contributor

@dineshyv dineshyv commented Nov 8, 2024

This can only land after the sdk has been updated
Testing:

PYTHONPATH=. python -m examples.safety.client localhost 5000 <bedrockprovideid>
{
    "identifier": "shield_id",
    "params": {
        "guardrailVersion": "DRAFT"
    },
    "provider_id": "remote::bedrock",
    "provider_resource_id": "<bedrockprovideid>",
    "shield_type": "generic_content_shield",
    "type": "shield"
}
RunShieldResponse(violation=SafetyViolation(metadata={'contentPolicy': {'filters': [{'type': 'VIOLENCE', 'confidence': 'LOW', 'filterStrength': 'HIGH', 'action': 'BLOCKED'}]}, 'invocationMetrics': {'guardrailProcessingLatency': 346, 'usage': {'topicPolicyUnits': 0, 'contentPolicyUnits': 1, 'wordPolicyUnits': 0, 'sensitiveInformationPolicyUnits': 0, 'sensitiveInformationPolicyFreeUnits': 0, 'contextualGroundingPolicyUnits': 0}, 'guardrailCoverage': {'textCharacters': {'guarded': 93, 'total': 93}}}}, violation_level='error', user_message='Sorry, the model cannot answer this question.'))

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Meta Open Source bot.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants