Class: Mindee::Parsing::V2::InferenceActiveOptions

Inherits:
Object
  • Object
show all
Defined in:
lib/mindee/parsing/v2/inference_active_options.rb

Overview

Options which were activated during the inference.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(server_response) ⇒ InferenceActiveOptions

Returns a new instance of InferenceActiveOptions.

Parameters:

  • server_response (Hash)

    Raw JSON parsed into a Hash.



18
19
20
21
22
23
# File 'lib/mindee/parsing/v2/inference_active_options.rb', line 18

def initialize(server_response)
  @raw_text = server_response['raw_text']
  @polygon = server_response['polygon']
  @confidence = server_response['confidence']
  @rag = server_response['rag']
end

Instance Attribute Details

#confidenceBoolean (readonly)

Returns Whether the confidence feature was activated.

Returns:

  • (Boolean)

    Whether the confidence feature was activated.



13
14
15
# File 'lib/mindee/parsing/v2/inference_active_options.rb', line 13

def confidence
  @confidence
end

#polygonBoolean (readonly)

Returns Whether the polygon feature was activated.

Returns:

  • (Boolean)

    Whether the polygon feature was activated.



11
12
13
# File 'lib/mindee/parsing/v2/inference_active_options.rb', line 11

def polygon
  @polygon
end

#ragBoolean (readonly)

Returns Whether the Retrieval-Augmented Generation feature was activated.

Returns:

  • (Boolean)

    Whether the Retrieval-Augmented Generation feature was activated.



15
16
17
# File 'lib/mindee/parsing/v2/inference_active_options.rb', line 15

def rag
  @rag
end

#raw_textBoolean (readonly)

Returns Whether the Raw Text feature was activated.

Returns:

  • (Boolean)

    Whether the Raw Text feature was activated.



9
10
11
# File 'lib/mindee/parsing/v2/inference_active_options.rb', line 9

def raw_text
  @raw_text
end

Instance Method Details

#to_sString

String representation.

Returns:

  • (String)


27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/mindee/parsing/v2/inference_active_options.rb', line 27

def to_s
  parts = [
    'Active Options',
    '==============',
    ":Raw Text: #{@raw_text ? 'True' : 'False'}",
    ":Polygon: #{@polygon ? 'True' : 'False'}",
    ":Confidence: #{@confidence ? 'True' : 'False'}",
    ":RAG: #{@rag ? 'True' : 'False'}",
    '',
  ]
  parts.join("\n")
end