Repository navigation
Expand file tree
/
Copy pathAnalyzeImageField.php
More file actions
27 lines (24 loc) · 1.93 KB
/
Copy pathAnalyzeImageField.php
File metadata and controls
27 lines (24 loc) · 1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
declare(strict_types=1);
namespace GetStream\GeneratedModels;
class AnalyzeImageField extends BaseModel
{
public function __construct(
public ?string $id = null, // Echo of `content_ids[label]` when supplied on the request; omitted otherwise.
public ?string $action = null, // Per-image action: keep | flag | remove.
public ?float $confidence = null, // Highest confidence (0–1) across detected classifications + sub-classifications. Convenience aggregate over the nested values in `classifications`.
/** @var array<Classification>|null */
#[ArrayOf(Classification::class)]
public ?array $classifications = null, // Hierarchical list of L1 (parent) classifications. Each entry: `name`, `confidence` (0–1), and nested `subclassifications` (L2 leaves with their own confidence). Resolved against the app's effective taxonomy (custom taxonomy when configured, otherwise the standard Bodyguard catalogue).
/** @var array<Classification>|null */
#[ArrayOf(Classification::class)]
public ?array $ocrClassifications = null, // Flat list of Bodyguard OCR text-moderation labels on the image's extracted text (e.g. VULGARITY, PII). Each entry: `name` + `severity`. Populated when BG's OCR pipeline returned non-empty results for this image.
public ?string $error = null, // Set when moderation couldn't be determined for this image — action is absent.
/** @var array<DetectedURLResponse>|null */
#[ArrayOf(DetectedURLResponse::class)]
public ?array $detectedUrls = null, // URLs found in the image, as `{url, source}` objects: `source` is `qr` (decoded from a QR code) or `ocr` (in text visible in the image). Independent of the action; omitted when none were found.
) {
}
// BaseModel automatically handles jsonSerialize(), toArray(), and fromJson() using constructor types!
// Use #[JsonKey('user_id')] to override field names if needed.
}