Class: GetStream::Generated::Models::AnalyzeImageField
- Defined in:
- lib/getstream_ruby/generated/models/analyze_image_field.rb
Instance Attribute Summary collapse
-
#action ⇒ String
Per-image action: keep | flag | remove.
-
#classifications ⇒ Array<Classification>
Hierarchical list of L1 (parent) classifications.
-
#confidence ⇒ Float
Highest confidence (0–1) across detected classifications + sub-classifications.
-
#detected_urls ⇒ Array<DetectedURLResponse>
URLs found in the image, as
{url, source}objects:sourceisqr(decoded from a QR code) orocr(in text visible in the image). -
#error ⇒ String
Set when moderation couldn't be determined for this image — action is absent.
-
#id ⇒ String
Echo of
content_ids[label]when supplied on the request; omitted otherwise. -
#ocr_classifications ⇒ Array<Classification>
Flat list of Bodyguard OCR text-moderation labels on the image's extracted text (e.g. VULGARITY, PII).
Class Method Summary collapse
-
.json_field_mappings ⇒ Object
Override field mappings for JSON serialization.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ AnalyzeImageField
constructor
Initialize with attributes.
Methods inherited from BaseModel
#==, #inspect, omit_empty_fields, #to_h, #to_json
Constructor Details
#initialize(attributes = {}) ⇒ AnalyzeImageField
Initialize with attributes
35 36 37 38 39 40 41 42 43 44 |
# File 'lib/getstream_ruby/generated/models/analyze_image_field.rb', line 35 def initialize(attributes = {}) super(attributes) @action = attributes.fetch(:action) { attributes.fetch('action', nil) } @confidence = attributes.fetch(:confidence) { attributes.fetch('confidence', nil) } @error = attributes.fetch(:error) { attributes.fetch('error', nil) } @id = attributes.fetch(:id) { attributes.fetch('id', nil) } @classifications = attributes.fetch(:classifications) { attributes.fetch('classifications', nil) } @detected_urls = attributes.fetch(:detected_urls) { attributes.fetch('detected_urls', nil) } @ocr_classifications = attributes.fetch(:ocr_classifications) { attributes.fetch('ocr_classifications', nil) } end |
Instance Attribute Details
#action ⇒ String
Returns Per-image action: keep | flag | remove.
14 15 16 |
# File 'lib/getstream_ruby/generated/models/analyze_image_field.rb', line 14 def action @action end |
#classifications ⇒ Array<Classification>
Returns 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).
26 27 28 |
# File 'lib/getstream_ruby/generated/models/analyze_image_field.rb', line 26 def classifications @classifications end |
#confidence ⇒ Float
Returns Highest confidence (0–1) across detected classifications + sub-classifications. Convenience aggregate over the nested values in classifications.
17 18 19 |
# File 'lib/getstream_ruby/generated/models/analyze_image_field.rb', line 17 def confidence @confidence end |
#detected_urls ⇒ Array<DetectedURLResponse>
Returns 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.
29 30 31 |
# File 'lib/getstream_ruby/generated/models/analyze_image_field.rb', line 29 def detected_urls @detected_urls end |
#error ⇒ String
Returns Set when moderation couldn't be determined for this image — action is absent.
20 21 22 |
# File 'lib/getstream_ruby/generated/models/analyze_image_field.rb', line 20 def error @error end |
#id ⇒ String
Returns Echo of content_ids[label] when supplied on the request; omitted otherwise.
23 24 25 |
# File 'lib/getstream_ruby/generated/models/analyze_image_field.rb', line 23 def id @id end |
#ocr_classifications ⇒ Array<Classification>
Returns 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.
32 33 34 |
# File 'lib/getstream_ruby/generated/models/analyze_image_field.rb', line 32 def ocr_classifications @ocr_classifications end |
Class Method Details
.json_field_mappings ⇒ Object
Override field mappings for JSON serialization
47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/getstream_ruby/generated/models/analyze_image_field.rb', line 47 def self.json_field_mappings { action: 'action', confidence: 'confidence', error: 'error', id: 'id', classifications: 'classifications', detected_urls: 'detected_urls', ocr_classifications: 'ocr_classifications' } end |