Spaces:
Sleeping
Sleeping
Rename config.py to models.py
Browse files
config.py
DELETED
File without changes
|
models.py
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
class GuardrailsConfig(BaseModel):
|
2 |
+
factual_consistency: bool = True
|
3 |
+
toxicity: bool = True
|
4 |
+
# Extend with more flags for additional guardrails
|
5 |
+
|
6 |
+
# Request model now includes both the response and the configuration.
|
7 |
+
class CheckRequest(BaseModel):
|
8 |
+
response: str
|
9 |
+
config: GuardrailsConfig = GuardrailsConfig() # Default config if not provided
|
10 |
+
|
11 |
+
class CheckResponse(BaseModel):
|
12 |
+
grounded: bool
|
13 |
+
details: dict
|