Skip to content

Commit dce54b6

Browse files
feat(api): api update
1 parent 5532433 commit dce54b6

2 files changed

Lines changed: 23 additions & 3 deletions

File tree

‎.stats.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 27
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/moderation-api%2Fmoderation-api-c8e66e827fc2b1465b740a29e87da71c3b1ddca1a4bdb1023aa96c569b80e9be.yml
3-
openapi_spec_hash: 35fdc3e34feb56cafaf4de2834201978
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/moderation-api%2Fmoderation-api-5cee858ce17e48e25e7503767dd979c6570a485511274e48129a1922eae67098.yml
3+
openapi_spec_hash: 54c716ac4e888bfddc2c6402192bb33a
44
config_hash: 13d10207114afb65f7ac4e21f4c0e358

‎src/moderation_api/types/content_submit_response.py‎

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"PolicyEntityMatcherOutputMatchSignals",
3030
"PolicyEntityMatcherOutputMatchSignalsBrandImpersonation",
3131
"Recommendation",
32+
"RecommendationMatchedRule",
3233
"Error",
3334
]
3435

@@ -321,20 +322,39 @@ class PolicyEntityMatcherOutput(BaseModel):
321322
Policy: TypeAlias = Union[PolicyClassifierOutput, PolicyEntityMatcherOutput]
322323

323324

325+
class RecommendationMatchedRule(BaseModel):
326+
key: str
327+
328+
name: str
329+
330+
324331
class Recommendation(BaseModel):
325332
"""The recommendation for the content based on the evaluation."""
326333

327334
action: Literal["review", "allow", "reject"]
328335
"""The action to take based on the recommendation"""
329336

330337
reason_codes: List[
331-
Literal["severity_reject", "severity_review", "author_block", "dry_run", "trusted_allow", "untrusted_severity"]
338+
Literal[
339+
"severity_reject",
340+
"severity_review",
341+
"author_block",
342+
"dry_run",
343+
"trusted_allow",
344+
"untrusted_severity",
345+
"rule_match",
346+
"rule_default",
347+
"rule_fallback",
348+
]
332349
]
333350
"""The reason code for the recommendation.
334351
335352
Can be used to display a reason to the user.
336353
"""
337354

355+
matched_rules: Optional[List[RecommendationMatchedRule]] = None
356+
"""Rules that matched during evaluation, if rules engine is active."""
357+
338358

339359
class Error(BaseModel):
340360
id: str

0 commit comments

Comments
 (0)