retab 0.1.14 → 0.1.15

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e3a1f03f127fc3767746e6a871be0ede4e85d3197bcd2ab4b0e379f0e43d4504
4
- data.tar.gz: ae8c1ca128e777790eeab415935800347ceaa2d66e8faf6e9ce108fd7d753ca4
3
+ metadata.gz: '09bef47099e8bd19d55bc02c29ca0b48fd860d6c5ca4bf72b40cbebae05a5d17'
4
+ data.tar.gz: 3f139b2c0a59cc5eec4120f5d2cdcce08d76245c52133a066df3461949ba7e26
5
5
  SHA512:
6
- metadata.gz: b07e0c01db15f12136d7ae5ec2f8f59c231d50d561baeecd0db533d561ac478d2452f196fbb41b37b9bce0d30addd8ebcd500d1c7ac7d1156629d4cf7ff8a46f
7
- data.tar.gz: 20827b74f9313a985671960653f48ea55fa46a07a3a3eb22af09fe3dd15569faa70666446ac4f4e3692d2b03dc7d4eddc7c8cb7fa21bc3144d053569e292a5bd
6
+ metadata.gz: 259e150d8f37f91b6330c1881b77e1aafc90c46a155214e8e3a87b817ceaea571db37b68fb1aeb6883fe5ce63fc6360d48e2d5ad223831b7ed5fedeb50876acd
7
+ data.tar.gz: c39b9e6efef0344e2265ac810643c1ba6e70767a86fa836849bae5318e9afa58de466b0b8894db18a3e9d90f8c171c8e1fc1f55c4fb19ac5931c0dedd2f46717
@@ -18,7 +18,7 @@ module Retab
18
18
  @api_host = api_host || base_url || DEFAULT_API_HOST
19
19
  @timeout = timeout || 60
20
20
  @max_retries = max_retries || 3
21
- @user_agent = user_agent || "retab-ruby/#{Retab::VERSION rescue "0.1.13"}"
21
+ @user_agent = user_agent || "retab-ruby/#{Retab::VERSION rescue "0.1.15"}"
22
22
  end
23
23
  end
24
24
  end
@@ -0,0 +1,83 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ require "json"
6
+
7
+ module Retab
8
+ class ExtractionSources
9
+ def initialize(client)
10
+ @client = client
11
+ end
12
+
13
+ # Get Extraction Sources
14
+ # @param extraction_id [String]
15
+ # @param mode [Retab::Types::ExtractionSourcesMode, nil] Opt into progressive sources for this mode. Omit to retain the legacy synchronous response.
16
+ # @param job_id [String, nil] Expected job identity returned by POST. A changed extraction returns 409.
17
+ # @param request_options [Hash] (see Retab::Types::RequestOptions)
18
+ # @return [Retab::SourcesResponse]
19
+ def get(
20
+ extraction_id:,
21
+ mode: nil,
22
+ job_id: nil,
23
+ request_options: {}
24
+ )
25
+ params = {
26
+ "mode" => mode,
27
+ "job_id" => job_id
28
+ }.compact
29
+ response = @client.request(
30
+ method: :get,
31
+ path: "/v1/extractions/#{Retab::Util.encode_path(extraction_id)}/sources",
32
+ auth: true,
33
+ params: params,
34
+ request_options: request_options
35
+ )
36
+ result = Retab::SourcesResponse.new(response.body)
37
+ result.last_response = Retab::Types::ApiResponse.new(
38
+ http_status: response.code.to_i,
39
+ http_headers: response.each_header.to_h,
40
+ request_id: response["x-request-id"]
41
+ )
42
+ result
43
+ end
44
+
45
+ # Create Extraction Sources
46
+ # @param extraction_id [String]
47
+ # @param background [Boolean, nil] Return immediately when true. Otherwise wait up to 20 seconds, then return 202 with Location while the same durable job continues.
48
+ # @param job_id [String, nil] Optional expected sources job identity. Returns 409 if the extraction changed.
49
+ # @param mode [Retab::Types::CreateSourcesRequestMode, nil]
50
+ # @param retry_ [Boolean, nil] Retry a terminal failed or incomplete computation. Concurrent requests join the current attempt; billing remains once per extraction.
51
+ # @param request_options [Hash] (see Retab::Types::RequestOptions)
52
+ # @return [Retab::SourcesResponse]
53
+ def create(
54
+ extraction_id:,
55
+ background: nil,
56
+ job_id: nil,
57
+ mode: nil,
58
+ retry_: nil,
59
+ request_options: {}
60
+ )
61
+ body = {
62
+ "background" => background,
63
+ "job_id" => job_id,
64
+ "mode" => mode,
65
+ "retry" => retry_
66
+ }.compact
67
+ response = @client.request(
68
+ method: :post,
69
+ path: "/v1/extractions/#{Retab::Util.encode_path(extraction_id)}/sources",
70
+ auth: true,
71
+ body: body,
72
+ request_options: request_options
73
+ )
74
+ result = Retab::SourcesResponse.new(response.body)
75
+ result.last_response = Retab::Types::ApiResponse.new(
76
+ http_status: response.code.to_i,
77
+ http_headers: response.each_header.to_h,
78
+ request_id: response["x-request-id"]
79
+ )
80
+ result
81
+ end
82
+ end
83
+ end
@@ -10,6 +10,10 @@ module Retab
10
10
  @client = client
11
11
  end
12
12
 
13
+ def sources
14
+ @sources ||= Retab::ExtractionSources.new(@client)
15
+ end
16
+
13
17
  # List Extractions
14
18
  # @param before [String, nil]
15
19
  # @param after [String, nil]
@@ -282,75 +286,5 @@ module Retab
282
286
  )
283
287
  result
284
288
  end
285
-
286
- # Get Extraction Sources
287
- # @param extraction_id [String]
288
- # @param mode [Retab::Types::ExtractionsMode, nil] Opt into progressive sources for this mode. Omit to retain the legacy synchronous response.
289
- # @param job_id [String, nil] Expected job identity returned by POST. A changed extraction returns 409.
290
- # @param request_options [Hash] (see Retab::Types::RequestOptions)
291
- # @return [Retab::SourcesResponse]
292
- def sources(
293
- extraction_id:,
294
- mode: nil,
295
- job_id: nil,
296
- request_options: {}
297
- )
298
- params = {
299
- "mode" => mode,
300
- "job_id" => job_id
301
- }.compact
302
- response = @client.request(
303
- method: :get,
304
- path: "/v1/extractions/#{Retab::Util.encode_path(extraction_id)}/sources",
305
- auth: true,
306
- params: params,
307
- request_options: request_options
308
- )
309
- result = Retab::SourcesResponse.new(response.body)
310
- result.last_response = Retab::Types::ApiResponse.new(
311
- http_status: response.code.to_i,
312
- http_headers: response.each_header.to_h,
313
- request_id: response["x-request-id"]
314
- )
315
- result
316
- end
317
-
318
- # Create Extraction Sources
319
- # @param extraction_id [String]
320
- # @param background [Boolean, nil] Return immediately when true. Otherwise wait up to 20 seconds, then return 202 with Location while the same durable job continues.
321
- # @param job_id [String, nil] Optional expected sources job identity. Returns 409 if the extraction changed.
322
- # @param mode [Retab::Types::CreateSourcesRequestMode, nil]
323
- # @param retry_ [Boolean, nil] Retry a terminal failed or incomplete computation. Concurrent requests join the current attempt; billing remains once per extraction.
324
- # @param request_options [Hash] (see Retab::Types::RequestOptions)
325
- # @return [Retab::SourcesResponse]
326
- def create_extraction_source(
327
- extraction_id:,
328
- background: nil,
329
- job_id: nil,
330
- mode: nil,
331
- retry_: nil,
332
- request_options: {}
333
- )
334
- body = {
335
- "background" => background,
336
- "job_id" => job_id,
337
- "mode" => mode,
338
- "retry" => retry_
339
- }.compact
340
- response = @client.request(
341
- method: :post,
342
- path: "/v1/extractions/#{Retab::Util.encode_path(extraction_id)}/sources",
343
- auth: true,
344
- body: body,
345
- request_options: request_options
346
- )
347
- result = Retab::SourcesResponse.new(response.body)
348
- result.last_response = Retab::Types::ApiResponse.new(
349
- http_status: response.code.to_i,
350
- http_headers: response.each_header.to_h,
351
- request_id: response["x-request-id"]
352
- )
353
- result
354
- end
355
289
  end
356
290
  end
@@ -4,6 +4,6 @@
4
4
 
5
5
  module Retab
6
6
  module Types
7
- ExtractionsMode = CreateSourcesRequestMode
7
+ ExtractionSourcesMode = CreateSourcesRequestMode
8
8
  end
9
9
  end
data/lib/retab/version.rb CHANGED
@@ -5,5 +5,5 @@
5
5
  # @oagen-ignore-file
6
6
 
7
7
  module Retab
8
- VERSION = "0.1.14"
8
+ VERSION = "0.1.15"
9
9
  end
data/lib/retab.rb CHANGED
@@ -17,6 +17,7 @@ loader.collapse("#{__dir__}/retab/edits")
17
17
  loader.collapse("#{__dir__}/retab/experiment_run_metrics")
18
18
  loader.collapse("#{__dir__}/retab/experiment_run_results")
19
19
  loader.collapse("#{__dir__}/retab/experiment_runs")
20
+ loader.collapse("#{__dir__}/retab/extraction_sources")
20
21
  loader.collapse("#{__dir__}/retab/extractions")
21
22
  loader.collapse("#{__dir__}/retab/files")
22
23
  loader.collapse("#{__dir__}/retab/parses")
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ # typed: strong
6
+
7
+ module Retab
8
+ class ExtractionSources
9
+ sig { params(client: Retab::BaseClient).void }
10
+ def initialize(client); end
11
+
12
+ sig do
13
+ params(
14
+ extraction_id: String,
15
+ mode: T.nilable(String),
16
+ job_id: T.nilable(String),
17
+ request_options: T::Hash[Symbol, T.untyped]
18
+ ).returns(Retab::SourcesResponse)
19
+ end
20
+ def get(extraction_id:, mode:, job_id:, request_options:); end
21
+
22
+ sig do
23
+ params(
24
+ extraction_id: String,
25
+ background: T.nilable(T::Boolean),
26
+ job_id: T.nilable(String),
27
+ mode: T.nilable(String),
28
+ retry_: T.nilable(T::Boolean),
29
+ request_options: T::Hash[Symbol, T.untyped]
30
+ ).returns(Retab::SourcesResponse)
31
+ end
32
+ def create(extraction_id:, background:, job_id:, mode:, retry_:, request_options:); end
33
+
34
+ end
35
+ end
@@ -9,6 +9,9 @@ module Retab
9
9
  sig { params(client: Retab::BaseClient).void }
10
10
  def initialize(client); end
11
11
 
12
+ sig { returns(Retab::ExtractionSources) }
13
+ def sources; end
14
+
12
15
  sig do
13
16
  params(
14
17
  before: T.nilable(String),
@@ -91,27 +94,5 @@ module Retab
91
94
  end
92
95
  def create_extraction_cancel(extraction_id:, request_options:); end
93
96
 
94
- sig do
95
- params(
96
- extraction_id: String,
97
- mode: T.nilable(String),
98
- job_id: T.nilable(String),
99
- request_options: T::Hash[Symbol, T.untyped]
100
- ).returns(Retab::SourcesResponse)
101
- end
102
- def sources(extraction_id:, mode:, job_id:, request_options:); end
103
-
104
- sig do
105
- params(
106
- extraction_id: String,
107
- background: T.nilable(T::Boolean),
108
- job_id: T.nilable(String),
109
- mode: T.nilable(String),
110
- retry_: T.nilable(T::Boolean),
111
- request_options: T::Hash[Symbol, T.untyped]
112
- ).returns(Retab::SourcesResponse)
113
- end
114
- def create_extraction_source(extraction_id:, background:, job_id:, mode:, retry_:, request_options:); end
115
-
116
97
  end
117
98
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: retab
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.14
4
+ version: 0.1.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Retab
@@ -115,18 +115,19 @@ files:
115
115
  - lib/retab/experiment_runs/pending_workflow_experiment_run.rb
116
116
  - lib/retab/experiment_runs/queued_workflow_experiment_run.rb
117
117
  - lib/retab/experiment_runs/running_workflow_experiment_run.rb
118
+ - lib/retab/extraction_sources.rb
119
+ - lib/retab/extraction_sources/create_sources_request.rb
120
+ - lib/retab/extraction_sources/evidence_anchor.rb
121
+ - lib/retab/extraction_sources/evidence_source.rb
122
+ - lib/retab/extraction_sources/source_field_evidence.rb
123
+ - lib/retab/extraction_sources/source_job.rb
124
+ - lib/retab/extraction_sources/source_job_error.rb
125
+ - lib/retab/extraction_sources/sources_response.rb
118
126
  - lib/retab/extractions.rb
119
- - lib/retab/extractions/create_sources_request.rb
120
- - lib/retab/extractions/evidence_anchor.rb
121
- - lib/retab/extractions/evidence_source.rb
122
127
  - lib/retab/extractions/extraction.rb
123
128
  - lib/retab/extractions/extraction_consensus.rb
124
129
  - lib/retab/extractions/extraction_request.rb
125
- - lib/retab/extractions/source_field_evidence.rb
126
- - lib/retab/extractions/source_job.rb
127
- - lib/retab/extractions/source_job_error.rb
128
130
  - lib/retab/extractions/source_options.rb
129
- - lib/retab/extractions/sources_response.rb
130
131
  - lib/retab/files.rb
131
132
  - lib/retab/files/complete_file_upload_request.rb
132
133
  - lib/retab/files/create_file_blueprint_request.rb
@@ -252,9 +253,9 @@ files:
252
253
  - lib/retab/types/experiment_runs_order.rb
253
254
  - lib/retab/types/experiment_schema_drift_status.rb
254
255
  - lib/retab/types/experiment_summary_metrics_response_block_type.rb
256
+ - lib/retab/types/extraction_sources_mode.rb
255
257
  - lib/retab/types/extraction_status.rb
256
258
  - lib/retab/types/extraction_workflow_artifact_status.rb
257
- - lib/retab/types/extractions_mode.rb
258
259
  - lib/retab/types/extractions_order.rb
259
260
  - lib/retab/types/extractions_status.rb
260
261
  - lib/retab/types/field_type.rb
@@ -673,6 +674,7 @@ files:
673
674
  - rbi/retab/extraction.rbi
674
675
  - rbi/retab/extraction_consensus.rbi
675
676
  - rbi/retab/extraction_request.rbi
677
+ - rbi/retab/extraction_sources.rbi
676
678
  - rbi/retab/extraction_workflow_artifact.rbi
677
679
  - rbi/retab/extractions.rbi
678
680
  - rbi/retab/file.rbi