From c6b62dc466661ba90231b4764edf1d6f5942b0a3 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Sun, 18 Oct 2026 04:19:05 +0000 Subject: [PATCH] chore(api): use neutral moderation examples Castiron-Internal-PR: https://github.com/openai/openai-node-internal/pull/324 Castiron-Source-SHA: 4cc4e2441126957375bbb002ffc64d5b8ac5b42c Castiron-Public-Base-SHA: e989fc07033981150d68c4e06e8600452b46494c --- .castiron.stats.yml | 12 ++-- api_reference/openapi.transformed.yml | 95 ++----------------------- scripts/castiron/generated-files.json | 2 +- tests/api-resources/moderations.test.ts | 4 +- 4 files changed, 16 insertions(+), 97 deletions(-) diff --git a/.castiron.stats.yml b/.castiron.stats.yml index 51905aa555..1e4a3d95b3 100644 --- a/.castiron.stats.yml +++ b/.castiron.stats.yml @@ -1,8 +1,8 @@ schema_version: 1 -generation_id: ad1a1341-4ead-4bab-a79b-e66f7fe5b5ef -openapi_spec_hash: 64820aedcf0a6d3776224cb1f9460be6 -openapi_transformed_spec_hash: 3ee2167e4445ca49fde24cff2244f5c3 +generation_id: 1ec90ff0-46f6-46e7-9b41-e4d26f449d4a +openapi_spec_hash: 56dec1d7f0146f0334e214d4c389da55 +openapi_transformed_spec_hash: 58406901d14d2ff99a923c64274ed949 config_hash: 22678292630564aa7033f38fece5b88e -codegen_sha: a7099862397f70f7d948b92cad367fd3b25468b1 -codegen_hash: c790646e7fe521f62f65fb0ca73023294b53448f910e492fcc81a17399782c06 -public_codegen_sha: 9b9488d034bbbbc1c37dbb7fd012b575cca558ba +codegen_sha: a84f02d05cb0a05a1675d51f1ede962c3e1b6da7 +codegen_hash: 508e64dd6f387285e9f3ebfe1e60057f7d5c216f10fbd378ccd4c0628f69417c +public_codegen_sha: 4f35fe8c63cb8d9deb93cd3ac6055e601efc8076 diff --git a/api_reference/openapi.transformed.yml b/api_reference/openapi.transformed.yml index effafebe8d..151b40c3c0 100644 --- a/api_reference/openapi.transformed.yml +++ b/api_reference/openapi.transformed.yml @@ -9617,7 +9617,7 @@ paths: -H "Authorization: Bearer $OPENAI_API_KEY" \ -d '{ "model": "omni-moderation-latest", - "input": "I want to kill them." + "input": "...text to classify goes here..." }' python: | from openai import OpenAI @@ -9625,7 +9625,7 @@ paths: moderation = client.moderations.create( model="omni-moderation-latest", - input="I want to kill them.", + input="...text to classify goes here...", ) print(moderation) javascript: | @@ -9636,7 +9636,7 @@ paths: async function main() { const moderation = await openai.moderations.create({ model: "omni-moderation-latest", - input: "I want to kill them.", + input: "...text to classify goes here...", }); console.log(moderation); @@ -9653,88 +9653,7 @@ paths: apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY") ); - ClientResult moderation = client.ClassifyText("I want to kill them."); - response: | - { - "id": "modr-AB8CjOTu2jiq12hp1AQPfeqFWaORR", - "model": "omni-moderation-latest", - "results": [ - { - "flagged": true, - "categories": { - "sexual": false, - "hate": false, - "harassment": true, - "self-harm": false, - "sexual/minors": false, - "hate/threatening": false, - "violence/graphic": false, - "self-harm/intent": false, - "self-harm/instructions": false, - "harassment/threatening": true, - "violence": true, - "illicit": false, - "illicit/violent": false - }, - "category_scores": { - "sexual": 1.1726012417057063e-05, - "hate": 0.22706663608551025, - "harassment": 0.5215635299682617, - "self-harm": 2.227119921371923e-06, - "sexual/minors": 7.107352217872176e-08, - "hate/threatening": 0.023547329008579254, - "violence/graphic": 3.391829886822961e-05, - "self-harm/intent": 1.646940972932498e-06, - "self-harm/instructions": 1.1198755256458526e-09, - "harassment/threatening": 0.5694745779037476, - "violence": 0.9971134662628174, - "illicit": 0.001, - "illicit/violent": 0.001 - }, - "category_applied_input_types": { - "sexual": [ - "text" - ], - "hate": [ - "text" - ], - "harassment": [ - "text" - ], - "self-harm": [ - "text" - ], - "sexual/minors": [ - "text" - ], - "hate/threatening": [ - "text" - ], - "violence/graphic": [ - "text" - ], - "self-harm/intent": [ - "text" - ], - "self-harm/instructions": [ - "text" - ], - "harassment/threatening": [ - "text" - ], - "violence": [ - "text" - ], - "illicit": [ - "text" - ], - "illicit/violent": [ - "text" - ] - } - } - ] - } + ClientResult moderation = client.ClassifyText("...text to classify goes here..."); - title: Image and text request: curl: | @@ -43752,13 +43671,13 @@ components: - type: string description: A string of text to classify for moderation. default: '' - example: I want to kill them. + example: '...text to classify goes here...' - type: array description: An array of strings to classify for moderation. items: type: string default: '' - example: I want to kill them. + example: '...text to classify goes here...' - type: array description: An array of multi-modal inputs to the moderation model. items: @@ -107246,7 +107165,7 @@ components: text: description: A string of text to classify. type: string - example: I want to kill them + example: '...text to classify goes here...' required: - type - text diff --git a/scripts/castiron/generated-files.json b/scripts/castiron/generated-files.json index 172ab92871..449acf2197 100644 --- a/scripts/castiron/generated-files.json +++ b/scripts/castiron/generated-files.json @@ -1367,7 +1367,7 @@ }, "tests/api-resources/moderations.test.ts": { "mode": "100644", - "sha256": "572834ddb67a64ccd69b6cf3736b432cb085fe138ee01521aff3c511d9db312a" + "sha256": "9fdad0e0bbc9e20f61ab13de0c1239755a41e633a6c8a5f29515b484a954ecba" }, "tests/api-resources/realtime/calls.test.ts": { "mode": "100644", diff --git a/tests/api-resources/moderations.test.ts b/tests/api-resources/moderations.test.ts index 21487ff2b5..24a36981d9 100644 --- a/tests/api-resources/moderations.test.ts +++ b/tests/api-resources/moderations.test.ts @@ -10,7 +10,7 @@ const client = new OpenAI({ describe('resource moderations', () => { test('create: only required params', async () => { - const responsePromise = client.moderations.create({ input: 'I want to kill them.' }); + const responsePromise = client.moderations.create({ input: '...text to classify goes here...' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -22,7 +22,7 @@ describe('resource moderations', () => { test('create: required and optional params', async () => { await client.moderations.create({ - input: 'I want to kill them.', + input: '...text to classify goes here...', model: 'omni-moderation-2024-09-26', }); });