Follow Discord
Sweep 22 Oct 2026 · 04:32Z Build v2.1.308 527 read Stable v2.1.308 Latest v2.1.308 Next v2.1.308 Feeds RSS JSON llms.txt llms-full.txt Unofficial
One change · api

content-moderation changedabout-claude/use-case-guides/content-moderation

Recorded here
Lines+4added
Lines−4removed
From line 781 where the diff opens
First seen 14 Aug 2026 this site's first read of the page
Recorded edits10to this page, all time

The whole hunk

from line 781, old and new numbered
/
lines
from line 781
781781 // Parse the JSON response from Claude. The SDK decodes each content block
782782 // into its concrete class, so find the TextBlock before reading the text.
783783 $textBlock = array_find($response->content, fn ($block) => $block instanceof \Anthropic\Messages\TextBlock)
784 ?? throw new RuntimeException('Expected a text block in the response.');
784 ?? throw new \RuntimeException('Expected a text block in the response.');
785785 $assessment = json_decode($textBlock->text, associative: true, flags: JSON_THROW_ON_ERROR);
786786 
787787 // Extract the violation status from the assessment
from line 1334
13341334 // Parse the JSON response from Claude. The SDK decodes each content block
13351335 // into its concrete class, so find the TextBlock before reading the text.
13361336 $textBlock = array_find($response->content, fn ($block) => $block instanceof \Anthropic\Messages\TextBlock)
1337 ?? throw new RuntimeException('Expected a text block in the response.');
1337 ?? throw new \RuntimeException('Expected a text block in the response.');
13381338 $assessment = json_decode($textBlock->text, associative: true, flags: JSON_THROW_ON_ERROR);
13391339 
13401340 // Extract the risk level, violated categories, and explanation from the assessment
from line 2074
20742074 // Parse the JSON response from Claude. The SDK decodes each content block
20752075 // into its concrete class, so find the TextBlock before reading the text.
20762076 $textBlock = array_find($response->content, fn ($block) => $block instanceof \Anthropic\Messages\TextBlock)
2077 ?? throw new RuntimeException('Expected a text block in the response.');
2077 ?? throw new \RuntimeException('Expected a text block in the response.');
20782078 $assessment = json_decode($textBlock->text, associative: true, flags: JSON_THROW_ON_ERROR);
20792079 
20802080 // Extract the violation status from the assessment
from line 2649
26492649 // Parse the JSON response from Claude. The SDK decodes each content block
26502650 // into its concrete class, so find the TextBlock before reading the text.
26512651 $textBlock = array_find($response->content, fn ($block) => $block instanceof \Anthropic\Messages\TextBlock)
2652 ?? throw new RuntimeException('Expected a text block in the response.');
2652 ?? throw new \RuntimeException('Expected a text block in the response.');
26532653 
26542654 return json_decode($textBlock->text, associative: true, flags: JSON_THROW_ON_ERROR);
26552655 };
Feedback