setEndpoint("cms.tencentcloudapi.com"); $clientProfile = new ClientProfile(); $clientProfile->setHttpProfile($httpProfile); $this->client = new CmsClient($cred, "ap-guangzhou", $clientProfile); } public function text(string $text) { $req = new TextModerationRequest(); $req->fromJsonString(json_encode( ['Content' => base64_encode($text)] )); $resp = $this->client->TextModeration($req); dump($resp->toJsonString()); } public function image(string $url) { $req = new ImageModerationRequest(); $req->fromJsonString(json_encode([ 'FileUrl' => $url, ])); $resp = $this->client->ImageModeration($req); dump($resp->toJsonString()); } public function voice(string $url) { $req = new AudioModerationRequest(); $req->fromJsonString(json_encode([ 'FileUrl' => $url, ])); $resp = $this->client->AudioModeration($req); dump($resp->toJsonString()); } }