Skip to content

Commit 1780f89

Browse files
feat(api): api update
1 parent 0d7eaf6 commit 1780f89

3 files changed

Lines changed: 46 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: 27
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/moderation-api%2Fmoderation-api-df0281b1aec24ed19b928d7e5912db35455378fa59390c6c3bf8d6700425d922.yml
3-
openapi_spec_hash: 03107bb438d4b42d77fbabae3cfd3d79
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/moderation-api%2Fmoderation-api-00324cd69f885e08708180c380317fd48101cb81c36f0bfaf7f8248d951d92f7.yml
3+
openapi_spec_hash: 47c828ded2fac0ded969760340b6b6fa
44
config_hash: 6a52f6ae7d55cf3b4e91538cc7752aeb

‎src/moderation_api/types/content_submit_params.py‎

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,120 +178,160 @@ class PolicyToxicity(TypedDict, total=False):
178178

179179
flag: Required[bool]
180180

181+
threshold: float
182+
181183

182184
class PolicyPersonalInformation(TypedDict, total=False):
183185
id: Required[Literal["personal_information"]]
184186

185187
flag: Required[bool]
186188

189+
threshold: float
190+
187191

188192
class PolicyToxicitySevere(TypedDict, total=False):
189193
id: Required[Literal["toxicity_severe"]]
190194

191195
flag: Required[bool]
192196

197+
threshold: float
198+
193199

194200
class PolicyHate(TypedDict, total=False):
195201
id: Required[Literal["hate"]]
196202

197203
flag: Required[bool]
198204

205+
threshold: float
206+
199207

200208
class PolicyIllicit(TypedDict, total=False):
201209
id: Required[Literal["illicit"]]
202210

203211
flag: Required[bool]
204212

213+
threshold: float
214+
205215

206216
class PolicyIllicitDrugs(TypedDict, total=False):
207217
id: Required[Literal["illicit_drugs"]]
208218

209219
flag: Required[bool]
210220

221+
threshold: float
222+
211223

212224
class PolicyIllicitAlcohol(TypedDict, total=False):
213225
id: Required[Literal["illicit_alcohol"]]
214226

215227
flag: Required[bool]
216228

229+
threshold: float
230+
217231

218232
class PolicyIllicitFirearms(TypedDict, total=False):
219233
id: Required[Literal["illicit_firearms"]]
220234

221235
flag: Required[bool]
222236

237+
threshold: float
238+
223239

224240
class PolicyIllicitTobacco(TypedDict, total=False):
225241
id: Required[Literal["illicit_tobacco"]]
226242

227243
flag: Required[bool]
228244

245+
threshold: float
246+
229247

230248
class PolicyIllicitGambling(TypedDict, total=False):
231249
id: Required[Literal["illicit_gambling"]]
232250

233251
flag: Required[bool]
234252

253+
threshold: float
254+
235255

236256
class PolicySexual(TypedDict, total=False):
237257
id: Required[Literal["sexual"]]
238258

239259
flag: Required[bool]
240260

261+
threshold: float
262+
241263

242264
class PolicyFlirtation(TypedDict, total=False):
243265
id: Required[Literal["flirtation"]]
244266

245267
flag: Required[bool]
246268

269+
threshold: float
270+
247271

248272
class PolicyProfanity(TypedDict, total=False):
249273
id: Required[Literal["profanity"]]
250274

251275
flag: Required[bool]
252276

277+
threshold: float
278+
253279

254280
class PolicyViolence(TypedDict, total=False):
255281
id: Required[Literal["violence"]]
256282

257283
flag: Required[bool]
258284

285+
threshold: float
286+
259287

260288
class PolicySelfHarm(TypedDict, total=False):
261289
id: Required[Literal["self_harm"]]
262290

263291
flag: Required[bool]
264292

293+
threshold: float
294+
265295

266296
class PolicySpam(TypedDict, total=False):
267297
id: Required[Literal["spam"]]
268298

269299
flag: Required[bool]
270300

301+
threshold: float
302+
271303

272304
class PolicySelfPromotion(TypedDict, total=False):
273305
id: Required[Literal["self_promotion"]]
274306

275307
flag: Required[bool]
276308

309+
threshold: float
310+
277311

278312
class PolicyPolitical(TypedDict, total=False):
279313
id: Required[Literal["political"]]
280314

281315
flag: Required[bool]
282316

317+
threshold: float
318+
283319

284320
class PolicyReligion(TypedDict, total=False):
285321
id: Required[Literal["religion"]]
286322

287323
flag: Required[bool]
288324

325+
threshold: float
326+
289327

290328
class PolicyCodeAbuse(TypedDict, total=False):
291329
id: Required[Literal["code_abuse"]]
292330

293331
flag: Required[bool]
294332

333+
threshold: float
334+
295335

296336
class PolicyPiiMaskingEntities(TypedDict, total=False):
297337
id: Required[
@@ -342,6 +382,8 @@ class PolicyGuideline(TypedDict, total=False):
342382

343383
instructions: Required[str]
344384

385+
threshold: float
386+
345387

346388
Policy: TypeAlias = Union[
347389
PolicyToxicity,

‎tests/api_resources/test_content.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ def test_method_submit_with_all_params(self, client: ModerationAPI) -> None:
4747
{
4848
"id": "toxicity",
4949
"flag": True,
50+
"threshold": 0,
5051
}
5152
],
5253
)
@@ -120,6 +121,7 @@ async def test_method_submit_with_all_params(self, async_client: AsyncModeration
120121
{
121122
"id": "toxicity",
122123
"flag": True,
124+
"threshold": 0,
123125
}
124126
],
125127
)

0 commit comments

Comments
 (0)