Skip to content

Commit f3e8b80

Browse files
feat(api): api update
1 parent 22104ad commit f3e8b80

2 files changed

Lines changed: 65 additions & 2 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: 34
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/moderation-api/moderation-api-c71ba49247240f25460ea025f4cabbee8032cb2e30bbd04b52dd10853fabb3bf.yml
3-
openapi_spec_hash: 6f03994848e51532cb4d268d9542958d
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/moderation-api/moderation-api-249bb8b527da76961b59a5b6c7d38ce38b3f02d8b79bcb2ee50e371f6a546e59.yml
3+
openapi_spec_hash: 8dbdf350a026301960c74d8045398ea2
44
config_hash: 6e090a71f4d354167d93b4534a0e7f05

‎src/moderation_api/types/content_submit_response.py‎

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
"Author",
1313
"AuthorBlock",
1414
"AuthorTrustLevel",
15+
"Casebook",
16+
"CasebookTopic",
1517
"Content",
1618
"ContentModifiedModifiedNestedObjectContentContentModifiedModifiedNestedObjectContentItem",
1719
"ContentModifiedModifiedNestedObjectContentContentModifiedModifiedNestedObjectContentItemText",
@@ -75,6 +77,57 @@ class Author(BaseModel):
7577
"""The author's ID from your system"""
7678

7779

80+
class CasebookTopic(BaseModel):
81+
"""
82+
The topic the closest matching case is filed under, or null when it has not been grouped into one yet.
83+
"""
84+
85+
id: str
86+
87+
label: str
88+
89+
90+
class Casebook(BaseModel):
91+
"""
92+
What your casebook — the record of your past moderation decisions — found for this content, or null when it had nothing close enough to say, when the matching cases disagreed, or when casebook lookups are not switched on for this channel. Reports what the casebook found; whether it decided the outcome is shown in `recommendation`, where a higher-priority rule may have settled the item first.
93+
"""
94+
95+
agreement: float
96+
"""
97+
How unanimous the matching cases are, from 0 to 1: the share of them that
98+
decided this way, ignoring how many there are. Always at least 0.8 when a ruling
99+
is returned — below that the casebook reports a disagreement instead of picking
100+
a side — so it tells you how clean the consensus was, and is not a threshold to
101+
re-apply yourself.
102+
"""
103+
104+
case_count: float
105+
"""How many of your past cases backed this ruling."""
106+
107+
confidence: float
108+
"""
109+
How strongly the casebook holds this ruling, from 0 to 1: the agreement scaled
110+
by how much evidence backs it, so a handful of close, recent cases outweighs one
111+
distant one. Older cases count for less, halving in weight roughly every 180
112+
days. This is the number to use in rules when you want a strength condition.
113+
"""
114+
115+
similarity: float
116+
"""How close the nearest matching case is, from 0 to 1.
117+
118+
1 means the content is identical to something you have already decided.
119+
"""
120+
121+
topic: Optional[CasebookTopic] = None
122+
"""
123+
The topic the closest matching case is filed under, or null when it has not been
124+
grouped into one yet.
125+
"""
126+
127+
verdict: Literal["allow", "reject"]
128+
"""The ruling your past decisions point to for this content."""
129+
130+
78131
class ContentModifiedModifiedNestedObjectContentContentModifiedModifiedNestedObjectContentItemText(BaseModel):
79132
"""Text"""
80133

@@ -364,6 +417,7 @@ class Recommendation(BaseModel):
364417
"rule_default",
365418
"rule_fallback",
366419
"client_override",
420+
"casebook_match",
367421
],
368422
str,
369423
]
@@ -391,6 +445,15 @@ class ContentSubmitResponse(BaseModel):
391445
Requires you to send authorId when submitting content.
392446
"""
393447

448+
casebook: Optional[Casebook] = None
449+
"""
450+
What your casebook — the record of your past moderation decisions — found for
451+
this content, or null when it had nothing close enough to say, when the matching
452+
cases disagreed, or when casebook lookups are not switched on for this channel.
453+
Reports what the casebook found; whether it decided the outcome is shown in
454+
`recommendation`, where a higher-priority rule may have settled the item first.
455+
"""
456+
394457
content: Content
395458
"""Potentially modified content."""
396459

0 commit comments

Comments
 (0)