-
Notifications
You must be signed in to change notification settings - Fork 15
[RHOAIENG-28843] Create Huggingface detector package #43
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
base: main
Are you sure you want to change the base?
[RHOAIENG-28843] Create Huggingface detector package #43
Conversation
Reviewer's GuideThis PR modularizes detector logic by extracting shared APIs and models into a new common library, introduces a standalone Huggingface-based detector package built on that common module, and refactors existing detectors to consume the shared components, while setting up packaging and documentation for both new packages. Entity relationship diagram for shared ContentAnalysis* modelserDiagram
CONTENTANALYSISHTTPREQUEST ||--o{ CONTENTANALYSISRESPONSE : triggers
CONTENTANALYSISRESPONSE ||--o{ EVIDENCE : contains
CONTENTANALYSISRESPONSE ||--o{ ERROR : may_have
CONTENTSANALYSISRESPONSE ||--o{ CONTENTANALYSISRESPONSE : aggregates
Class diagram for the new guardrails-detector-common packageclassDiagram
class DetectorBaseAPI
class logger
class RoleEnum
class Message
class TextDetectionHttpRequest
class TextDetectionResponse
class GenerationDetectionHttpRequest
class GenerationDetectionResponse
class ChatDetectionHttpRequest
class ContextBasedDetectionHttpRequest
class AttributionBasedDetectionResponse
class DetectionHttpRequest
class DetectionResponseSpan
class DetectionResponse
class Evidence
class EvidenceType
class EvidenceObj
class ContentAnalysisHttpRequest
class ContentAnalysisResponse
class ContentsAnalysisResponse
class Error
DetectorBaseAPI <|-- logger
DetectorBaseAPI <|-- ContentAnalysisHttpRequest
DetectorBaseAPI <|-- ContentAnalysisResponse
ContentAnalysisResponse o-- Evidence
Evidence o-- EvidenceType
DetectionResponse o-- DetectionResponseSpan
DetectionResponse o-- EvidenceObj
DetectionHttpRequest o-- Message
TextDetectionHttpRequest <|-- DetectionHttpRequest
GenerationDetectionHttpRequest <|-- DetectionHttpRequest
ChatDetectionHttpRequest <|-- DetectionHttpRequest
ContextBasedDetectionHttpRequest <|-- DetectionHttpRequest
AttributionBasedDetectionResponse <|-- DetectionResponse
ContentsAnalysisResponse o-- ContentAnalysisResponse
Class diagram for the new Huggingface detector packageclassDiagram
class Detector
class app
class ContentAnalysisHttpRequest
class ContentAnalysisResponse
class ContentsAnalysisResponse
class Error
Detector <|-- app
app o-- ContentAnalysisHttpRequest
app o-- ContentAnalysisResponse
ContentsAnalysisResponse o-- ContentAnalysisResponse
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Hey @AmberJBlue - I've reviewed your changes and they look great!
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
thanks for your work @AmberJBlue ; any chance you could please rebase the PR? For more information, see e.g. https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork |
Summary by Sourcery
Create and package a shared guardrails-detector-common library and a new guardrails-detector-huggingface module, refactor existing detectors to use the common library, and add necessary packaging, documentation, and dependency updates
New Features:
Enhancements:
Build:
Documentation:
Chores: