Skip to content

Commit 06a78ec

Browse files
Merge pull request #4609 from PatrickFarley/openai-updates-2
update term
2 parents b69313c + c8fa94e commit 06a78ec

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

articles/ai-services/openai/concepts/content-filter.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ The table below outlines the various ways content filtering can appear:
275275

276276
**HTTP Response Code** | **Response behavior**
277277
|------------------------|----------------------|
278-
| 200 | If the content filtering system is down or otherwise unable to complete the operation in time, your request will still complete without content filtering. You can determine that the filtering wasn't applied by looking for an error message in the `content_filter_result` object.|
278+
| 200 | If the content filtering system is down or otherwise unable to complete the operation in time, your request will still complete without content filtering. You can determine that the filtering wasn't applied by looking for an error message in the `content_filter_results` object.|
279279

280280
**Example request payload:**
281281

@@ -301,7 +301,7 @@ The table below outlines the various ways content filtering can appear:
301301
"index": 0,
302302
"finish_reason": "length",
303303
"logprobs": null,
304-
"content_filter_result": {
304+
"content_filter_results": {
305305
"error": {
306306
"code": "content_filter_error",
307307
"message": "The contents are not filtered"
@@ -597,12 +597,12 @@ try:
597597

598598
except openai.error.InvalidRequestError as e:
599599
if e.error.code == "content_filter" and e.error.innererror:
600-
content_filter_result = e.error.innererror.content_filter_result
600+
content_filter_results = e.error.innererror.content_filter_result
601601
# print the formatted JSON
602-
print(content_filter_result)
602+
print(content_filter_results)
603603

604604
# or access the individual categories and details
605-
for category, details in content_filter_result.items():
605+
for category, details in content_filter_results.items():
606606
print(f"{category}:\n filtered={details['filtered']}\n severity={details['severity']}")
607607

608608
```
@@ -765,7 +765,7 @@ Blocks completion content when ungrounded completion content was detected.
765765
"status": 400,
766766
"innererror": {
767767
"code": "ResponsibleAIPolicyViolation",
768-
"content_filter_result": {
768+
"content_filter_results": {
769769
"hate": {
770770
"filtered": true,
771771
"severity": "high"
@@ -1040,7 +1040,7 @@ As part of your application design, consider the following best practices to del
10401040
10411041
- Decide how you want to handle scenarios where your users send prompts containing content that is classified at a filtered category and severity level or otherwise misuse your application.
10421042
- Check the `finish_reason` to see if a completion is filtered.
1043-
- Check that there's no error object in the `content_filter_result` (indicating that content filters didn't run).
1043+
- Check that there's no error object in the `content_filter_results` (indicating that content filters didn't run).
10441044
- If you're using the protected material code model in annotate mode, display the citation URL when you're displaying the code in your application.
10451045
10461046
## Next steps

articles/ai-services/openai/how-to/use-blocklists.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ In the below example, a GPT-35-Turbo deployment with a blocklist is blocking the
148148
"status": 400,
149149
"innererror": {
150150
"code": "ResponsibleAIPolicyViolation",
151-
"content_filter_result": {
151+
"content_filter_results": {
152152
"custom_blocklists": [
153153
{
154154
"filtered": true,

articles/ai-services/openai/includes/language-overview/python.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ print(completion.model_dump_json(indent=2))
336336
"prompt_filter_results": [
337337
{
338338
"prompt_index": 0,
339-
"content_filter_result": {
339+
"content_filter_results": {
340340
"jailbreak": {
341341
"filtered": false,
342342
"detected": false
@@ -345,7 +345,7 @@ print(completion.model_dump_json(indent=2))
345345
},
346346
{
347347
"prompt_index": 1,
348-
"content_filter_result": {
348+
"content_filter_results": {
349349
"sexual": {
350350
"filtered": false,
351351
"severity": "safe"

0 commit comments

Comments
 (0)