generateModeration()、createModeration()
例
主なパラメーター
model(必須):モデレーションモデルのID(例:openai/omni-moderation-latest)。input(必須):コンテンツ項目(テキストまたはimage_url)。- 任意:
categories/severityフィルター(対応する場合)とuserタグ。
Documentation Index
Fetch the complete documentation index at: /docs/llms.txt
Use this file to discover all available pages before exploring further.
PHP SDKで/moderationsを呼び出します。
generateModeration()、createModeration()
<?php
require 'vendor/autoload.php';
use Phaseo\Sdk\Phaseo;
$apiKey = getenv('PHASEO_API_KEY');
$client = new Phaseo(apiKey: $apiKey);
$response = $client->createModeration([
'model' => 'openai/omni-moderation-latest',
'input' => 'Text to classify'
]);
echo $response['results'][0]['flagged'] ? 'Flagged' : 'Not flagged';
model(必須):モデレーションモデルのID(例:openai/omni-moderation-latest)。input(必須):コンテンツ項目(テキストまたはimage_url)。categories/severityフィルター(対応する場合)とuserタグ。