Skip to content

Commit 36811f8

Browse files
committed
fix(breaking!): correct broken type names in moderation categories (openai#811)
Migration: - `self_minus_harm_intent` -> `self_harm_intent` - `self_minus_harm_instructions` -> `self_harm_instructions` - `self_minus_harm` -> `self_harm`
1 parent facf354 commit 36811f8

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/openai/types/moderation.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,20 @@ class Categories(BaseModel):
3535
orientation, disability status, or caste.
3636
"""
3737

38-
self_minus_harm: bool = FieldInfo(alias="self-harm")
38+
self_harm: bool = FieldInfo(alias="self-harm")
3939
"""
4040
Content that promotes, encourages, or depicts acts of self-harm, such as
4141
suicide, cutting, and eating disorders.
4242
"""
4343

44-
self_minus_harm_instructions: bool = FieldInfo(alias="self-harm/instructions")
44+
self_harm_instructions: bool = FieldInfo(alias="self-harm/instructions")
4545
"""
4646
Content that encourages performing acts of self-harm, such as suicide, cutting,
4747
and eating disorders, or that gives instructions or advice on how to commit such
4848
acts.
4949
"""
5050

51-
self_minus_harm_intent: bool = FieldInfo(alias="self-harm/intent")
51+
self_harm_intent: bool = FieldInfo(alias="self-harm/intent")
5252
"""
5353
Content where the speaker expresses that they are engaging or intend to engage
5454
in acts of self-harm, such as suicide, cutting, and eating disorders.
@@ -84,13 +84,13 @@ class CategoryScores(BaseModel):
8484
hate_threatening: float = FieldInfo(alias="hate/threatening")
8585
"""The score for the category 'hate/threatening'."""
8686

87-
self_minus_harm: float = FieldInfo(alias="self-harm")
87+
self_harm: float = FieldInfo(alias="self-harm")
8888
"""The score for the category 'self-harm'."""
8989

90-
self_minus_harm_instructions: float = FieldInfo(alias="self-harm/instructions")
90+
self_harm_instructions: float = FieldInfo(alias="self-harm/instructions")
9191
"""The score for the category 'self-harm/instructions'."""
9292

93-
self_minus_harm_intent: float = FieldInfo(alias="self-harm/intent")
93+
self_harm_intent: float = FieldInfo(alias="self-harm/intent")
9494
"""The score for the category 'self-harm/intent'."""
9595

9696
sexual: float

0 commit comments

Comments
 (0)