mindee 4.12.0 → 4.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -0
  3. data/.rubocop.yml +1 -1
  4. data/CHANGELOG.md +13 -0
  5. data/docs/code_samples/v2_classification.txt +30 -0
  6. data/docs/code_samples/v2_crop.txt +30 -0
  7. data/docs/code_samples/{default_v2.txt → v2_extraction.txt} +7 -5
  8. data/docs/code_samples/v2_extraction_webhook.txt +45 -0
  9. data/docs/code_samples/v2_ocr.txt +30 -0
  10. data/docs/code_samples/v2_split.txt +30 -0
  11. data/lib/mindee/client_v2.rb +69 -17
  12. data/lib/mindee/errors/mindee_http_error_v2.rb +2 -2
  13. data/lib/mindee/geometry/point.rb +5 -0
  14. data/lib/mindee/geometry/polygon.rb +5 -0
  15. data/lib/mindee/http/mindee_api_v2.rb +62 -12
  16. data/lib/mindee/input/base_parameters.rb +146 -0
  17. data/lib/mindee/input/inference_parameters.rb +48 -91
  18. data/lib/mindee/input/local_response.rb +5 -4
  19. data/lib/mindee/parsing/v2/field/field_location.rb +1 -1
  20. data/lib/mindee/parsing/v2/inference.rb +8 -21
  21. data/lib/mindee/parsing/v2/inference_response.rb +5 -2
  22. data/lib/mindee/v2/parsing/base_inference.rb +44 -0
  23. data/lib/mindee/v2/parsing/base_response.rb +13 -0
  24. data/lib/mindee/v2/product/base_product.rb +27 -0
  25. data/lib/mindee/v2/product/classification/classification.rb +19 -0
  26. data/lib/mindee/v2/product/classification/classification_classifier.rb +25 -0
  27. data/lib/mindee/v2/product/classification/classification_inference.rb +34 -0
  28. data/lib/mindee/v2/product/classification/classification_response.rb +32 -0
  29. data/lib/mindee/v2/product/classification/classification_result.rb +27 -0
  30. data/lib/mindee/v2/product/classification/params/classification_parameters.rb +46 -0
  31. data/lib/mindee/v2/product/crop/crop.rb +19 -0
  32. data/lib/mindee/v2/product/crop/crop_inference.rb +34 -0
  33. data/lib/mindee/v2/product/crop/crop_item.rb +29 -0
  34. data/lib/mindee/v2/product/crop/crop_response.rb +32 -0
  35. data/lib/mindee/v2/product/crop/crop_result.rb +34 -0
  36. data/lib/mindee/v2/product/crop/params/crop_parameters.rb +46 -0
  37. data/lib/mindee/v2/product/extraction/extraction.rb +19 -0
  38. data/lib/mindee/v2/product/extraction/extraction_inference.rb +25 -0
  39. data/lib/mindee/v2/product/extraction/extraction_response.rb +23 -0
  40. data/lib/mindee/v2/product/extraction/extraction_result.rb +15 -0
  41. data/lib/mindee/v2/product/extraction/params/extraction_parameters.rb +18 -0
  42. data/lib/mindee/v2/product/ocr/ocr.rb +19 -0
  43. data/lib/mindee/v2/product/ocr/ocr_inference.rb +34 -0
  44. data/lib/mindee/v2/product/ocr/ocr_page.rb +33 -0
  45. data/lib/mindee/v2/product/ocr/ocr_response.rb +32 -0
  46. data/lib/mindee/v2/product/ocr/ocr_result.rb +34 -0
  47. data/lib/mindee/v2/product/ocr/ocr_word.rb +29 -0
  48. data/lib/mindee/v2/product/ocr/params/ocr_parameters.rb +46 -0
  49. data/lib/mindee/v2/product/split/params/split_parameters.rb +46 -0
  50. data/lib/mindee/v2/product/split/split.rb +19 -0
  51. data/lib/mindee/v2/product/split/split_inference.rb +34 -0
  52. data/lib/mindee/v2/product/split/split_range.rb +30 -0
  53. data/lib/mindee/v2/product/split/split_response.rb +32 -0
  54. data/lib/mindee/v2/product/split/split_result.rb +34 -0
  55. data/lib/mindee/v2/product.rb +7 -0
  56. data/lib/mindee/v2.rb +4 -0
  57. data/lib/mindee/version.rb +1 -1
  58. data/lib/mindee.rb +7 -0
  59. data/sig/mindee/client_v2.rbs +11 -7
  60. data/sig/mindee/errors/mindee_http_error_v2.rbs +1 -1
  61. data/sig/mindee/geometry/point.rbs +2 -0
  62. data/sig/mindee/geometry/polygon.rbs +2 -0
  63. data/sig/mindee/http/mindee_api_v2.rbs +20 -4
  64. data/sig/mindee/input/base_parameters.rbs +35 -0
  65. data/sig/mindee/input/inference_parameters.rbs +4 -12
  66. data/sig/mindee/input/local_response.rbs +2 -2
  67. data/sig/mindee/parsing/v2/inference.rbs +4 -5
  68. data/sig/mindee/parsing/v2/inference_response.rbs +11 -2
  69. data/sig/mindee/v2/parsing/base_inference.rbs +18 -0
  70. data/sig/mindee/v2/parsing/base_response.rbs +11 -0
  71. data/sig/mindee/v2/product/base_product.rbs +19 -0
  72. data/sig/mindee/v2/product/classification/classification.rbs +10 -0
  73. data/sig/mindee/v2/product/classification/classification_classifier.rbs +15 -0
  74. data/sig/mindee/v2/product/classification/classification_inference.rbs +15 -0
  75. data/sig/mindee/v2/product/classification/classification_response.rbs +23 -0
  76. data/sig/mindee/v2/product/classification/classification_result.rbs +15 -0
  77. data/sig/mindee/v2/product/classification/params/classification_parameters/classification_parameters.rbs +23 -0
  78. data/sig/mindee/v2/product/crop/crop.rbs +10 -0
  79. data/sig/mindee/v2/product/crop/crop_inference.rbs +14 -0
  80. data/sig/mindee/v2/product/crop/crop_item.rbs +15 -0
  81. data/sig/mindee/v2/product/crop/crop_response.rbs +23 -0
  82. data/sig/mindee/v2/product/crop/crop_result.rbs +14 -0
  83. data/sig/mindee/v2/product/crop/params/crop_parameters/crop_parameters.rbs +23 -0
  84. data/sig/mindee/v2/product/extraction/extraction.rbs +12 -0
  85. data/sig/mindee/v2/product/extraction/extraction_inference.rbs +14 -0
  86. data/sig/mindee/v2/product/extraction/extraction_response.rbs +18 -0
  87. data/sig/mindee/v2/product/extraction/extraction_result.rbs +10 -0
  88. data/sig/mindee/v2/product/extraction/params/extraction_parameters.rbs +12 -0
  89. data/sig/mindee/v2/product/ocr/ocr.rbs +10 -0
  90. data/sig/mindee/v2/product/ocr/ocr_inference.rbs +14 -0
  91. data/sig/mindee/v2/product/ocr/ocr_page.rbs +15 -0
  92. data/sig/mindee/v2/product/ocr/ocr_response.rbs +23 -0
  93. data/sig/mindee/v2/product/ocr/ocr_result.rbs +14 -0
  94. data/sig/mindee/v2/product/ocr/ocr_word.rbs +15 -0
  95. data/sig/mindee/v2/product/ocr/params/ocr_parameters/ocr_parameters.rbs +24 -0
  96. data/sig/mindee/v2/product/split/params/split_parameters/split_parameters.rbs +23 -0
  97. data/sig/mindee/v2/product/split/split.rbs +10 -0
  98. data/sig/mindee/v2/product/split/split_inference.rbs +14 -0
  99. data/sig/mindee/v2/product/split/split_range.rbs +15 -0
  100. data/sig/mindee/v2/product/split/split_response.rbs +23 -0
  101. data/sig/mindee/v2/product/split/split_result.rbs +14 -0
  102. metadata +78 -3
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'split_result'
4
+
5
+ module Mindee
6
+ module V2
7
+ module Product
8
+ module Split
9
+ # Split inference result.
10
+ class SplitInference < Mindee::V2::Parsing::BaseInference
11
+ # @return [SplitResult] Result of a split inference.
12
+ attr_reader :result
13
+
14
+ # @param server_response [Hash] Hash representation of the JSON returned by the service.
15
+ def initialize(server_response)
16
+ super
17
+
18
+ @result = SplitResult.new(server_response['result'])
19
+ end
20
+
21
+ # String representation.
22
+ # @return [String]
23
+ def to_s
24
+ [
25
+ super,
26
+ @result.to_s,
27
+ '',
28
+ ].join("\n")
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mindee
4
+ module V2
5
+ module Product
6
+ module Split
7
+ # Split inference result.
8
+ class SplitRange
9
+ # @return [Array<Integer>] 0-based page indexes, where the first integer indicates the start page and the
10
+ # second integer indicates the end page.
11
+ attr_reader :page_range
12
+ # @return [String] The document type, as identified on given classification values.
13
+ attr_reader :document_type
14
+
15
+ # @param server_response [Hash] Hash representation of the JSON returned by the service.
16
+ def initialize(server_response)
17
+ @page_range = server_response['page_range']
18
+ @document_type = server_response['document_type']
19
+ end
20
+
21
+ # String representation.
22
+ # @return [String]
23
+ def to_s
24
+ "* :Page Range: #{@page_range}\n :Document Type: #{@document_type}"
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../../parsing/base_response'
4
+ require_relative 'params/split_parameters'
5
+ require_relative 'split_inference'
6
+
7
+ module Mindee
8
+ module V2
9
+ module Product
10
+ module Split
11
+ # HTTP response wrapper that embeds a V2 Inference.
12
+ class SplitResponse < Mindee::V2::Parsing::BaseResponse
13
+ # @return [SplitInference] Parsed inference payload.
14
+ attr_reader :inference
15
+
16
+ # @param server_response [Hash] Hash parsed from the API JSON response.
17
+ def initialize(server_response)
18
+ super
19
+
20
+ @inference = SplitInference.new(server_response['inference'])
21
+ end
22
+
23
+ # String representation.
24
+ # @return [String]
25
+ def to_s
26
+ @inference.to_s
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'split_range'
4
+
5
+ module Mindee
6
+ module V2
7
+ module Product
8
+ module Split
9
+ # Result of a split utility inference.
10
+ class SplitResult
11
+ # @return [Array<SplitRange>] List of results of splitped document regions.
12
+ attr_reader :splits
13
+
14
+ # @param server_response [Hash] Hash representation of the JSON returned by the service.
15
+ def initialize(server_response)
16
+ @splits = if server_response.key?('splits')
17
+ server_response['splits'].map do |split|
18
+ SplitRange.new(split)
19
+ end
20
+ end
21
+ end
22
+
23
+ # String representation.
24
+ # @return [String]
25
+ def to_s
26
+ splits_str = @splits.join("\n")
27
+
28
+ "Splits\n======\n#{splits_str}"
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'product/classification/classification'
4
+ require_relative 'product/crop/crop'
5
+ require_relative 'product/extraction/extraction'
6
+ require_relative 'product/ocr/ocr'
7
+ require_relative 'product/split/split'
data/lib/mindee/v2.rb ADDED
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'parsing'
4
+ require_relative 'product'
@@ -3,7 +3,7 @@
3
3
  # Mindee
4
4
  module Mindee
5
5
  # Current version.
6
- VERSION = '4.12.0'
6
+ VERSION = '4.13.0'
7
7
 
8
8
  # Finds and return the current platform.
9
9
  # @return [Symbol, Hash[String | Symbol, Regexp], Nil?]
data/lib/mindee.rb CHANGED
@@ -84,6 +84,13 @@ module Mindee
84
84
  module US
85
85
  end
86
86
  end
87
+
88
+ # V2-specific module.
89
+ module V2
90
+ # Product-specific module.
91
+ module Product
92
+ end
93
+ end
87
94
  end
88
95
 
89
96
  # Shorthand to call the logger from anywhere.
@@ -3,15 +3,19 @@
3
3
  OTS_OWNER: String
4
4
  module Mindee
5
5
  class ClientV2
6
- attr_reader mindee_api: HTTP::MindeeApiV2
6
+ private attr_reader mindee_api: HTTP::MindeeApiV2
7
7
 
8
8
  def logger: () -> Logger
9
9
  def initialize: (?api_key: String) -> void
10
- def get_inference: (String) -> Parsing::V2::InferenceResponse
11
- def get_job: (String) -> Parsing::V2::JobResponse
12
- def enqueue_inference: (Input::Source::LocalInputSource | Input::Source::URLInputSource, Hash[String | Symbol, untyped] | Input::InferenceParameters) -> Parsing::V2::JobResponse
13
- def enqueue_and_get_inference: (Input::Source::LocalInputSource | Input::Source::URLInputSource, Hash[String | Symbol, untyped] | Input::InferenceParameters) -> Parsing::V2::InferenceResponse
14
- def validate_async_params: (Integer | Float, Integer | Float, Integer) -> void
15
- def normalize_inference_parameters: (Hash[String | Symbol, untyped] | Input::InferenceParameters) -> Input::InferenceParameters
10
+ def get_inference: (String inference_id) -> Parsing::V2::InferenceResponse
11
+ def get_result: [T] (HTTP::_ProductClass[T] product, String resource) -> T
12
+ def get_result_url: [T] (HTTP::_ResponseFactory[T] response_class, String inference_id) -> T
13
+ def get_job: (String job_id) -> Parsing::V2::JobResponse
14
+ def enqueue_inference: (Input::Source::LocalInputSource | Input::Source::URLInputSource, Hash[String | Symbol, untyped] | Input::InferenceParameters params, ?disable_redundant_warnings: bool) -> Parsing::V2::JobResponse
15
+ def enqueue: [T] (HTTP::_ProductClass[T] product, Input::Source::LocalInputSource | Input::Source::URLInputSource, Hash[String | Symbol, untyped] | Input::BaseParameters params) -> Parsing::V2::JobResponse
16
+ def enqueue_and_get_result: [T] (HTTP::_ProductClass[T] product, Input::Source::LocalInputSource | Input::Source::URLInputSource, Hash[String | Symbol, untyped] | Input::BaseParameters params) -> T
17
+ def enqueue_and_get_inference: (Input::Source::LocalInputSource | Input::Source::URLInputSource, Hash[String | Symbol, untyped] | Input::InferenceParameters params, ?disable_redundant_warnings: bool) -> Parsing::V2::InferenceResponse
18
+ def validate_async_params: (Integer | Float, Integer | Float, Integer) -> void
19
+ def normalize_parameters: (singleton(Input::BaseParameters) param_class, Hash[String | Symbol, untyped] | Input::BaseParameters params) -> Input::BaseParameters
16
20
  end
17
21
  end
@@ -9,7 +9,7 @@ module Mindee
9
9
  attr_reader title: String
10
10
  attr_reader errors: Array[Parsing::V2::ErrorItem]
11
11
 
12
- def initialize: (Hash[String, untyped] | Parsing::V2::ErrorResponse) -> void
12
+ def initialize: (Hash[String, untyped] | Mindee::Parsing::V2::ErrorResponse) -> void
13
13
  end
14
14
  end
15
15
  end
@@ -7,6 +7,8 @@ module Mindee
7
7
 
8
8
  def initialize: (Float, Float) -> void
9
9
  def []: (Integer) -> Float
10
+
11
+ def to_s: -> String
10
12
  end
11
13
  end
12
14
  end
@@ -5,6 +5,8 @@ module Mindee
5
5
  def initialize: (Array[::Mindee::Geometry::Point | Array[Float]]) -> void
6
6
  def centroid: -> Point
7
7
  def point_in_y?: (Point) -> bool
8
+
9
+ def to_s: -> String
8
10
  end
9
11
  end
10
12
  end
@@ -1,21 +1,37 @@
1
- # lib/mindee/http/mindee_api_v2.rb
1
+ # lib/mindee/http/mindee_api_v2.rbs
2
2
  module Mindee
3
3
  module HTTP
4
+ interface _ResponseFactory[T]
5
+ def new: (Hash[String | Symbol, untyped]) -> T
6
+ end
7
+
8
+ interface _ProductClass[T]
9
+ def slug: () -> String
10
+ def response_type: () -> _ResponseFactory[T]
11
+ def params_type: () -> singleton(Input::BaseParameters)
12
+ end
13
+
4
14
  class MindeeApiV2
5
15
  attr_reader settings: ApiSettingsV2
6
16
 
7
17
  def initialize: (?api_key: String?) -> void
8
- def req_post_inference_enqueue: (Input::Source::LocalInputSource | Input::Source::URLInputSource, Input::InferenceParameters) -> Parsing::V2::JobResponse
18
+
19
+ def req_get_result: [T] (_ProductClass[T] product, String resource) -> T
20
+
21
+ def req_post_enqueue: (Input::Source::LocalInputSource | Input::Source::URLInputSource, Input::BaseParameters) -> Parsing::V2::JobResponse
9
22
  def req_get_inference: (String) -> Parsing::V2::InferenceResponse
10
23
  def req_get_job: (String) -> Parsing::V2::JobResponse
11
24
  def process_response: (Net::HTTPResponse?) -> Hash[String | Symbol, untyped]
12
25
  def poll: (String) -> Net::HTTPResponse
13
26
  def inference_job_req_get: (String) -> Net::HTTPResponse
14
27
  def inference_result_req_get: (String) -> Net::HTTPResponse
15
- def enqueue: (Input::Source::LocalInputSource | Input::Source::URLInputSource, Input::InferenceParameters) -> Net::HTTPResponse?
28
+ def result_req_get: [T] (String, _ProductClass[T] product) -> Net::HTTPResponse
29
+ def enqueue: (Input::Source::LocalInputSource | Input::Source::URLInputSource, Input::BaseParameters) -> Net::HTTPResponse?
16
30
 
17
31
  private
18
-
32
+ def req_get_job_url: (String) -> Parsing::V2::JobResponse
33
+ def req_get_result_url: [T] (_ResponseFactory[T] result_class, String url) -> T
34
+ def uri?: (String) -> bool
19
35
  def enqueue_form_options: (Array[untyped], Input::InferenceParameters) -> Array[untyped]
20
36
  end
21
37
  end
@@ -0,0 +1,35 @@
1
+ # lib/mindee/input/base_parameters.rb
2
+
3
+ module Mindee
4
+ module Input
5
+ class BaseParameters
6
+ attr_reader self.slug: String
7
+
8
+ def self.from_hash: (params: Hash[String | Symbol, untyped]) -> instance
9
+ def self.load_from_hash: (params: Hash[String | Symbol, untyped]) -> Hash[String | Symbol, untyped]
10
+
11
+ def slug: -> String
12
+
13
+ attr_reader model_id: String
14
+ attr_reader file_alias: String?
15
+ attr_reader webhook_ids: Array[String]?
16
+ attr_reader polling_options: PollingOptions
17
+ attr_reader close_file: bool
18
+
19
+ def initialize: (
20
+ String,
21
+ ?file_alias: String?,
22
+ ?webhook_ids: Array[String]?,
23
+ ?polling_options: Hash[Symbol | String, untyped] | PollingOptions?,
24
+ ?close_file: bool?
25
+ ) -> void
26
+
27
+ def append_form_data: (Array[Array[untyped]]) -> Array[Array[untyped]]
28
+ def validate_async_params: () -> void
29
+
30
+ private
31
+
32
+ def get_clean_polling_options: (Hash[String | Symbol, untyped] | PollingOptions?) -> PollingOptions
33
+ end
34
+ end
35
+ end
@@ -1,17 +1,14 @@
1
1
  # lib/mindee/input/inference_parameters.rb
2
2
  module Mindee
3
3
  module Input
4
- class InferenceParameters
5
- attr_reader close_file: bool
4
+ class InferenceParameters < BaseParameters
5
+ def self.slug: -> String
6
+
6
7
  attr_reader confidence: bool?
7
- attr_reader file_alias: String?
8
- attr_reader model_id: String
9
- attr_reader polling_options: PollingOptions
10
8
  attr_reader polygon: bool?
11
9
  attr_reader rag: bool?
12
10
  attr_reader raw_text: bool?
13
11
  attr_reader text_context: String?
14
- attr_reader webhook_ids: Array[String]?
15
12
  attr_reader data_schema: DataSchema?
16
13
 
17
14
  def initialize: (
@@ -29,12 +26,7 @@ module Mindee
29
26
  ) -> void
30
27
 
31
28
  def self.from_hash: (params: Hash[String | Symbol, untyped]) -> InferenceParameters
32
-
33
- def validate_async_params: -> void
34
-
35
- private
36
-
37
- def get_clean_polling_options: (Hash[String | Symbol, untyped] | PollingOptions?) -> PollingOptions
29
+ def append_form_data: (Array[Array[untyped]]) -> Array[Array[untyped]]
38
30
  end
39
31
  end
40
32
  end
@@ -2,13 +2,13 @@
2
2
  module Mindee
3
3
  module Input
4
4
  class LocalResponse
5
- def file: -> StringIO
5
+ attr_reader file: StringIO
6
6
  def initialize: (File | IO | StringIO | String | Pathname | Tempfile) -> void
7
7
  def as_hash: -> Hash[String | Symbol, untyped]
8
8
  def self.process_secret_key: (String) -> String
9
9
  def get_hmac_signature: (String) -> String
10
10
  def valid_hmac_signature?: (String, String) -> bool
11
- def deserialize_response: (singleton(Parsing::V2::CommonResponse))-> (Parsing::V2::JobResponse | Parsing::V2::InferenceResponse)
11
+ def deserialize_response: (singleton(Parsing::V2::CommonResponse))-> (Parsing::V2::JobResponse | Mindee::Parsing::V2::InferenceResponse)
12
12
  end
13
13
  end
14
14
  end
@@ -2,12 +2,11 @@
2
2
  module Mindee
3
3
  module Parsing
4
4
  module V2
5
- class Inference
5
+ class Inference < Mindee::V2::Parsing::BaseInference
6
+ attr_reader self.params_type: singleton(Input::InferenceParameters)
7
+ attr_reader self.response_type: singleton(InferenceResponse)
8
+ attr_reader self.slug: String
6
9
 
7
- attr_reader id: String
8
- attr_reader job: InferenceJob
9
- attr_reader model: InferenceModel
10
- attr_reader file: InferenceFile
11
10
  attr_reader active_options: InferenceActiveOptions
12
11
  attr_reader result: InferenceResult
13
12
 
@@ -2,10 +2,19 @@
2
2
  module Mindee
3
3
  module Parsing
4
4
  module V2
5
- class InferenceResponse < CommonResponse
6
- attr_reader inference: V2::Inference
5
+ class InferenceResponse < Mindee::V2::Parsing::BaseResponse[Mindee::Parsing::V2::Inference]
6
+
7
+ self.@slug: String
8
+ self.@_params_type: singleton(Input::BaseParameters)
9
+
10
+ attr_reader inference: Mindee::Parsing::V2::Inference
7
11
  def initialize: (Hash[String | Symbol, untyped]) -> void
12
+
13
+ def _params_type: -> singleton(Input::InferenceParameters)
14
+
8
15
  def to_s: -> String
16
+ def self._params_type: () -> singleton(Input::InferenceParameters)
17
+ def self.slug: () -> String
9
18
  end
10
19
  end
11
20
  end
@@ -0,0 +1,18 @@
1
+ # lib/mindee/v2/parsing/base_inference.rb
2
+
3
+ module Mindee
4
+ module V2
5
+ module Parsing
6
+ class BaseInference
7
+ attr_reader job: Mindee::Parsing::V2::InferenceJob
8
+ attr_reader file: Mindee::Parsing::V2::InferenceFile
9
+ attr_reader id: String
10
+ attr_reader model: Mindee::Parsing::V2::InferenceModel
11
+
12
+ def initialize: (Hash[String | Symbol, untyped]) -> void
13
+
14
+ def to_s: -> String
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,11 @@
1
+ # lib/mindee/v2/parsing/base_response.rb
2
+
3
+ module Mindee
4
+ module V2
5
+ module Parsing
6
+ class BaseResponse[T] < Mindee::Parsing::V2::CommonResponse
7
+ attr_reader inference: T
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,19 @@
1
+ module Mindee
2
+ module V2
3
+ module Product
4
+ class BaseProduct
5
+ self.@slug: String
6
+ self.@params_type: singleton(Input::BaseParameters)
7
+ self.@response_type: singleton(Parsing::BaseResponse)
8
+
9
+ def self._params_type: () -> singleton(Input::BaseParameters)
10
+
11
+ attr_reader self.slug: String
12
+ attr_reader self.params_type: singleton(Input::BaseParameters)
13
+ attr_reader self.response_type: singleton(Parsing::BaseResponse)
14
+
15
+ def initialize: -> void
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,10 @@
1
+ module Mindee
2
+ module V2
3
+ module Product
4
+ module Classification
5
+ class Classification < BaseProduct
6
+ end
7
+ end
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,15 @@
1
+ # lib/mindee/v2/product/classification/classification_classifier.rb
2
+
3
+ module Mindee
4
+ module V2
5
+ module Product
6
+ module Classification
7
+ class ClassificationClassifier
8
+ attr_reader document_type: String
9
+
10
+ def initialize: (Hash[String | Symbol, untyped]) -> void
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,15 @@
1
+ module Mindee
2
+ module V2
3
+ module Product
4
+ module Classification
5
+ class ClassificationInference
6
+ attr_reader result: ClassificationResult
7
+
8
+ def initialize: (Hash[String | Symbol, untyped]) -> void
9
+
10
+ def to_s: -> String
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,23 @@
1
+ # lib/mindee/v2/product/classification/classification_response.rb
2
+
3
+ module Mindee
4
+ module V2
5
+ module Product
6
+ module Classification
7
+ class ClassificationResponse
8
+ self.@slug: String
9
+ self.@_params_type: singleton(Params::ClassificationParameters)
10
+
11
+ attr_reader inference: Mindee::V2::Product::Classification::ClassificationInference
12
+ def initialize: (Hash[String | Symbol, untyped]) -> void
13
+
14
+ def _params_type: -> singleton(Params::ClassificationParameters)
15
+
16
+ def to_s: -> String
17
+ def self._params_type: () -> singleton(Params::ClassificationParameters)
18
+ def self.slug: () -> String
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,15 @@
1
+ module Mindee
2
+ module V2
3
+ module Product
4
+ module Classification
5
+ class ClassificationResult
6
+ attr_reader classification: ClassificationClassifier
7
+
8
+ def initialize: (Hash[String | Symbol, untyped]) -> void
9
+
10
+ def to_s: -> String
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,23 @@
1
+ module Mindee
2
+ module V2
3
+ module Product
4
+ module Classification
5
+ module Params
6
+ class ClassificationParameters
7
+ def self.slug: -> String
8
+
9
+ def self.from_hash: (params: Hash[String | Symbol, untyped]) -> ClassificationParameters
10
+
11
+ def initialize: (
12
+ String,
13
+ ?file_alias: String?,
14
+ ?webhook_ids: Array[String]?,
15
+ ?polling_options: Hash[Symbol | String, untyped] | Input::PollingOptions?,
16
+ ?close_file: bool?
17
+ ) -> void
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,10 @@
1
+ module Mindee
2
+ module V2
3
+ module Product
4
+ module Crop
5
+ class Crop < BaseProduct
6
+ end
7
+ end
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,14 @@
1
+ module Mindee
2
+ module V2
3
+ module Product
4
+ module Crop
5
+ class CropInference
6
+ attr_reader result: CropResult
7
+
8
+ def initialize: (Hash[String | Symbol, untyped]) -> void
9
+ def to_s: -> String
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,15 @@
1
+ module Mindee
2
+ module V2
3
+ module Product
4
+ module Crop
5
+ class CropItem
6
+ attr_reader object_type: String
7
+ attr_reader location: Mindee::Parsing::V2::Field::FieldLocation
8
+
9
+ def initialize: (Hash[String | Symbol, untyped]) -> void
10
+ def to_s: -> String
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,23 @@
1
+ # lib/mindee/v2/product/crop/crop_response.rb
2
+
3
+ module Mindee
4
+ module V2
5
+ module Product
6
+ module Crop
7
+ class CropResponse
8
+ self.@slug: String
9
+ self.@_params_type: singleton(Params::CropParameters)
10
+
11
+ attr_reader inference: Mindee::V2::Product::Crop::CropInference
12
+ def initialize: (Hash[String | Symbol, untyped]) -> void
13
+
14
+ def _params_type: -> singleton(Params::CropParameters)
15
+
16
+ def to_s: -> String
17
+ def self._params_type: () -> singleton(Params::CropParameters)
18
+ def self.slug: () -> String
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,14 @@
1
+ module Mindee
2
+ module V2
3
+ module Product
4
+ module Crop
5
+ class CropResult
6
+ attr_reader crops: Array[CropItem]
7
+
8
+ def initialize: (Hash[String | Symbol, untyped]) -> void
9
+ def to_s: -> String
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end