[RHOAIENG-28843] Create Huggingface detector package - #43
Open
AmberJBlue wants to merge 9 commits into
Open
Conversation
Contributor
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
|
AmberJBlue
marked this pull request as ready for review
August 1, 2025 14:00
Contributor
There was a problem hiding this comment.
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.
Collaborator
|
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 |
m-misiura
self-requested a review
August 7, 2025 14:12
AmberJBlue
force-pushed
the
RHOAIENG-28843-detector-hf-packages
branch
from
August 26, 2025 17:02
e4bd32a to
cd6cc28
Compare
AmberJBlue
force-pushed
the
RHOAIENG-28843-detector-hf-packages
branch
from
August 26, 2025 17:10
cd6cc28 to
180cc35
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: