Skip to content

Commit

Permalink
Bug(SK): Fixed bug where isContentFlagged was erroring due to wrong a…
Browse files Browse the repository at this point in the history
…rray reference
  • Loading branch information
PapaRascal2020 committed Sep 21, 2024
1 parent 809de83 commit 0276ecd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Utilities/GptUtilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ public function isContentFlagged (
{
$response = $this->sidekick->moderate()->text(model: $model, content: $content);

if(!isset($response['response']['categories'])) return false;
if(!isset($response['results']['categories'])) return false;

foreach($response['response']['categories'] as $category => $bool) {
foreach($response['results']['categories'] as $category => $bool) {
if (!in_array($category, $exclusions) && $bool) return true;
}

Expand Down

0 comments on commit 0276ecd

Please sign in to comment.