retab 0.1.11 → 0.1.12
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 +4 -4
- data/lib/retab/client.rb +4 -0
- data/lib/retab/consensus/create_consensus_request.rb +28 -0
- data/lib/retab/consensus/reconciliation_alignment.rb +30 -0
- data/lib/retab/consensus/reconciliation_field.rb +34 -0
- data/lib/retab/consensus/reconciliation_path_alignment.rb +25 -0
- data/lib/retab/consensus/reconciliation_result.rb +31 -0
- data/lib/retab/consensus.rb +46 -0
- data/lib/retab/experiment_run_metrics/experiment_summary_metrics_response.rb +6 -0
- data/lib/retab/extractions/extraction_request.rb +3 -3
- data/lib/retab/extractions.rb +6 -6
- data/lib/retab/usage/usage_primitive_triggered_by.rb +3 -0
- data/lib/retab/usage/usage_run_record.rb +3 -0
- data/lib/retab/usage/v_1_usage_usage_run_triggered_by.rb +28 -0
- data/lib/retab/usage.rb +3 -3
- data/lib/retab/version.rb +1 -1
- data/lib/retab.rb +1 -0
- data/rbi/retab/client.rbi +3 -0
- data/rbi/retab/consensus.rbi +23 -0
- data/rbi/retab/create_consensus_request.rbi +36 -0
- data/rbi/retab/experiment_summary_metrics_response.rbi +12 -0
- data/rbi/retab/extraction_request.rbi +4 -4
- data/rbi/retab/extractions.rbi +4 -4
- data/rbi/retab/reconciliation_alignment.rbi +36 -0
- data/rbi/retab/reconciliation_field.rbi +48 -0
- data/rbi/retab/reconciliation_path_alignment.rbi +30 -0
- data/rbi/retab/reconciliation_result.rbi +42 -0
- data/rbi/retab/usage_primitive_triggered_by.rbi +6 -0
- data/rbi/retab/usage_run_record.rbi +6 -0
- data/rbi/retab/v_1_usage_usage_run_triggered_by.rbi +36 -0
- metadata +15 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 42b59c6b5a798c010207cd26417fffd501f4fcfab09c0c26c72e4b8a913774d4
|
|
4
|
+
data.tar.gz: c72d4edba45cb7a74dc0d730d9d5eb9bea9070119e7dfee6fa79825c55ca87ea
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 11f68093fdd2b39eccde81b522e0d876af633a41d81ffe4b987b7b43575c3ee0c311f64b89955610068bafe261268a10907c80a0c219b31cc2ee45507fc7e00f
|
|
7
|
+
data.tar.gz: 6d6a30db0bbd8a0a23c232535299850755cd46baf4fd2fa953441435d1e36d989972d41faa8228573705179645f94fec6e40c4b8733ecf38e92eaaa49a104d86
|
data/lib/retab/client.rb
CHANGED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# This file is auto-generated by oagen. Do not edit.
|
|
4
|
+
|
|
5
|
+
module Retab
|
|
6
|
+
class CreateConsensusRequest < Retab::Types::BaseModel
|
|
7
|
+
|
|
8
|
+
HASH_ATTRS = {
|
|
9
|
+
include_alignment: :include_alignment,
|
|
10
|
+
inputs: :inputs,
|
|
11
|
+
json_schema: :json_schema
|
|
12
|
+
}.freeze
|
|
13
|
+
|
|
14
|
+
attr_accessor(
|
|
15
|
+
:include_alignment,
|
|
16
|
+
:inputs,
|
|
17
|
+
:json_schema
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
def initialize(json)
|
|
21
|
+
super()
|
|
22
|
+
hash = self.class.normalize(json)
|
|
23
|
+
@include_alignment = hash[:include_alignment]
|
|
24
|
+
@inputs = (hash[:inputs] || []).map { |item| item || {} }
|
|
25
|
+
@json_schema = hash[:json_schema] || {}
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# This file is auto-generated by oagen. Do not edit.
|
|
4
|
+
|
|
5
|
+
module Retab
|
|
6
|
+
class ReconciliationAlignment < Retab::Types::BaseModel
|
|
7
|
+
|
|
8
|
+
HASH_ATTRS = {
|
|
9
|
+
aligned_inputs: :aligned_inputs,
|
|
10
|
+
path_alignments: :path_alignments,
|
|
11
|
+
reference_index: :reference_index
|
|
12
|
+
}.freeze
|
|
13
|
+
|
|
14
|
+
attr_accessor(
|
|
15
|
+
:aligned_inputs,
|
|
16
|
+
:path_alignments,
|
|
17
|
+
:reference_index
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
def initialize(json)
|
|
21
|
+
super()
|
|
22
|
+
hash = self.class.normalize(json)
|
|
23
|
+
@aligned_inputs = (hash[:aligned_inputs] || []).map { |item| item || {} }
|
|
24
|
+
@path_alignments = (hash[:path_alignments] || []).map { |item|
|
|
25
|
+
item ? Retab::ReconciliationPathAlignment.new(item) : nil
|
|
26
|
+
}
|
|
27
|
+
@reference_index = hash[:reference_index]
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# This file is auto-generated by oagen. Do not edit.
|
|
4
|
+
|
|
5
|
+
module Retab
|
|
6
|
+
class ReconciliationField < Retab::Types::BaseModel
|
|
7
|
+
|
|
8
|
+
HASH_ATTRS = {
|
|
9
|
+
likelihood: :likelihood,
|
|
10
|
+
path: :path,
|
|
11
|
+
supporting_input_count: :supporting_input_count,
|
|
12
|
+
total_input_count: :total_input_count,
|
|
13
|
+
value: :value
|
|
14
|
+
}.freeze
|
|
15
|
+
|
|
16
|
+
attr_accessor(
|
|
17
|
+
:likelihood,
|
|
18
|
+
:path,
|
|
19
|
+
:supporting_input_count,
|
|
20
|
+
:total_input_count,
|
|
21
|
+
:value
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
def initialize(json)
|
|
25
|
+
super()
|
|
26
|
+
hash = self.class.normalize(json)
|
|
27
|
+
@likelihood = hash[:likelihood]
|
|
28
|
+
@path = hash[:path]
|
|
29
|
+
@supporting_input_count = hash[:supporting_input_count]
|
|
30
|
+
@total_input_count = hash[:total_input_count]
|
|
31
|
+
@value = hash[:value]
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# This file is auto-generated by oagen. Do not edit.
|
|
4
|
+
|
|
5
|
+
module Retab
|
|
6
|
+
class ReconciliationPathAlignment < Retab::Types::BaseModel
|
|
7
|
+
|
|
8
|
+
HASH_ATTRS = {
|
|
9
|
+
canonical_path: :canonical_path,
|
|
10
|
+
source_paths: :source_paths
|
|
11
|
+
}.freeze
|
|
12
|
+
|
|
13
|
+
attr_accessor(
|
|
14
|
+
:canonical_path,
|
|
15
|
+
:source_paths
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
def initialize(json)
|
|
19
|
+
super()
|
|
20
|
+
hash = self.class.normalize(json)
|
|
21
|
+
@canonical_path = hash[:canonical_path]
|
|
22
|
+
@source_paths = (hash[:source_paths] || [])
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# This file is auto-generated by oagen. Do not edit.
|
|
4
|
+
|
|
5
|
+
module Retab
|
|
6
|
+
class ReconciliationResult < Retab::Types::BaseModel
|
|
7
|
+
|
|
8
|
+
HASH_ATTRS = {
|
|
9
|
+
alignment: :alignment,
|
|
10
|
+
consensus: :consensus,
|
|
11
|
+
fields: :fields,
|
|
12
|
+
likelihoods: :likelihoods
|
|
13
|
+
}.freeze
|
|
14
|
+
|
|
15
|
+
attr_accessor(
|
|
16
|
+
:alignment,
|
|
17
|
+
:consensus,
|
|
18
|
+
:fields,
|
|
19
|
+
:likelihoods
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
def initialize(json)
|
|
23
|
+
super()
|
|
24
|
+
hash = self.class.normalize(json)
|
|
25
|
+
@alignment = hash[:alignment] ? Retab::ReconciliationAlignment.new(hash[:alignment]) : nil
|
|
26
|
+
@consensus = hash[:consensus] || {}
|
|
27
|
+
@fields = (hash[:fields] || []).map { |item| item ? Retab::ReconciliationField.new(item) : nil }
|
|
28
|
+
@likelihoods = hash[:likelihoods] || {}
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
@@ -0,0 +1,46 @@
|
|
|
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 Consensus
|
|
9
|
+
def initialize(client)
|
|
10
|
+
@client = client
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
# Create Consensus
|
|
14
|
+
# @param include_alignment [Boolean, nil]
|
|
15
|
+
# @param inputs [Array<Hash{String => Object}>, nil]
|
|
16
|
+
# @param json_schema [Hash{String => Object}, nil]
|
|
17
|
+
# @param request_options [Hash] (see Retab::Types::RequestOptions)
|
|
18
|
+
# @return [Retab::ReconciliationResult]
|
|
19
|
+
def create(
|
|
20
|
+
inputs:,
|
|
21
|
+
include_alignment: nil,
|
|
22
|
+
json_schema: nil,
|
|
23
|
+
request_options: {}
|
|
24
|
+
)
|
|
25
|
+
body = {
|
|
26
|
+
"include_alignment" => include_alignment,
|
|
27
|
+
"inputs" => inputs,
|
|
28
|
+
"json_schema" => json_schema
|
|
29
|
+
}.compact
|
|
30
|
+
response = @client.request(
|
|
31
|
+
method: :post,
|
|
32
|
+
path: "/v1/consensus",
|
|
33
|
+
auth: true,
|
|
34
|
+
body: body,
|
|
35
|
+
request_options: request_options
|
|
36
|
+
)
|
|
37
|
+
result = Retab::ReconciliationResult.new(response.body)
|
|
38
|
+
result.last_response = Retab::Types::ApiResponse.new(
|
|
39
|
+
http_status: response.code.to_i,
|
|
40
|
+
http_headers: response.each_header.to_h,
|
|
41
|
+
request_id: response["x-request-id"]
|
|
42
|
+
)
|
|
43
|
+
result
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
@@ -15,6 +15,8 @@ module Retab
|
|
|
15
15
|
score: :score,
|
|
16
16
|
prior_score: :prior_score,
|
|
17
17
|
documents: :documents,
|
|
18
|
+
scored_document_count: :scored_document_count,
|
|
19
|
+
total_document_count: :total_document_count,
|
|
18
20
|
aggregate: :aggregate,
|
|
19
21
|
prior_run_id: :prior_run_id
|
|
20
22
|
}.freeze
|
|
@@ -29,6 +31,8 @@ module Retab
|
|
|
29
31
|
:score,
|
|
30
32
|
:prior_score,
|
|
31
33
|
:documents,
|
|
34
|
+
:scored_document_count,
|
|
35
|
+
:total_document_count,
|
|
32
36
|
:aggregate,
|
|
33
37
|
:prior_run_id
|
|
34
38
|
)
|
|
@@ -47,6 +51,8 @@ module Retab
|
|
|
47
51
|
@documents = (hash[:documents] || []).map { |item|
|
|
48
52
|
item ? Retab::ExperimentSummaryMetricDocument.new(item) : nil
|
|
49
53
|
}
|
|
54
|
+
@scored_document_count = hash[:scored_document_count]
|
|
55
|
+
@total_document_count = hash[:total_document_count]
|
|
50
56
|
@aggregate = hash[:aggregate] ? Retab::ExperimentExtractSummaryAggregate.new(hash[:aggregate]) : nil
|
|
51
57
|
@prior_run_id = hash[:prior_run_id]
|
|
52
58
|
end
|
|
@@ -16,7 +16,7 @@ module Retab
|
|
|
16
16
|
bust_cache: :bust_cache,
|
|
17
17
|
stream: :stream,
|
|
18
18
|
background: :background,
|
|
19
|
-
|
|
19
|
+
deep_extraction: :deep_extraction
|
|
20
20
|
}.freeze
|
|
21
21
|
|
|
22
22
|
attr_accessor(
|
|
@@ -30,7 +30,7 @@ module Retab
|
|
|
30
30
|
:bust_cache,
|
|
31
31
|
:stream,
|
|
32
32
|
:background,
|
|
33
|
-
:
|
|
33
|
+
:deep_extraction
|
|
34
34
|
)
|
|
35
35
|
|
|
36
36
|
def initialize(json)
|
|
@@ -46,7 +46,7 @@ module Retab
|
|
|
46
46
|
@bust_cache = hash[:bust_cache].nil? ? false : hash[:bust_cache]
|
|
47
47
|
@stream = hash[:stream].nil? ? false : hash[:stream]
|
|
48
48
|
@background = hash[:background].nil? ? false : hash[:background]
|
|
49
|
-
@
|
|
49
|
+
@deep_extraction = hash[:deep_extraction].nil? ? false : hash[:deep_extraction]
|
|
50
50
|
end
|
|
51
51
|
end
|
|
52
52
|
end
|
data/lib/retab/extractions.rb
CHANGED
|
@@ -109,7 +109,7 @@ module Retab
|
|
|
109
109
|
# @param bust_cache [Boolean, nil] If true, skip the LLM cache and force a fresh completion
|
|
110
110
|
# @param stream [Boolean, nil]
|
|
111
111
|
# @param background [Boolean, nil] If true, run asynchronously: returns immediately with status 'queued' and an empty output. Poll GET /v1/<primitive>/{id} until status is terminal. Mutually exclusive with stream.
|
|
112
|
-
# @param
|
|
112
|
+
# @param deep_extraction [Boolean, nil] Optimizes for accuracy over latency in documents with very large arrays.
|
|
113
113
|
# @param request_options [Hash] (see Retab::Types::RequestOptions)
|
|
114
114
|
# @return [Retab::Extraction]
|
|
115
115
|
def create(
|
|
@@ -123,7 +123,7 @@ module Retab
|
|
|
123
123
|
bust_cache: nil,
|
|
124
124
|
stream: nil,
|
|
125
125
|
background: nil,
|
|
126
|
-
|
|
126
|
+
deep_extraction: nil,
|
|
127
127
|
request_options: {}
|
|
128
128
|
)
|
|
129
129
|
document = Retab::MimeData.coerce(document, client: @client) unless document.nil?
|
|
@@ -138,7 +138,7 @@ module Retab
|
|
|
138
138
|
"bust_cache" => bust_cache,
|
|
139
139
|
"stream" => stream,
|
|
140
140
|
"background" => background,
|
|
141
|
-
"
|
|
141
|
+
"deep_extraction" => deep_extraction
|
|
142
142
|
}.compact
|
|
143
143
|
response = @client.request(
|
|
144
144
|
method: :post,
|
|
@@ -167,7 +167,7 @@ module Retab
|
|
|
167
167
|
# @param bust_cache [Boolean, nil] If true, skip the LLM cache and force a fresh completion
|
|
168
168
|
# @param stream [Boolean, nil]
|
|
169
169
|
# @param background [Boolean, nil] If true, run asynchronously: returns immediately with status 'queued' and an empty output. Poll GET /v1/<primitive>/{id} until status is terminal. Mutually exclusive with stream.
|
|
170
|
-
# @param
|
|
170
|
+
# @param deep_extraction [Boolean, nil] Optimizes for accuracy over latency in documents with very large arrays.
|
|
171
171
|
# @param request_options [Hash] (see Retab::Types::RequestOptions)
|
|
172
172
|
# @return [void]
|
|
173
173
|
def create_stream(
|
|
@@ -181,7 +181,7 @@ module Retab
|
|
|
181
181
|
bust_cache: nil,
|
|
182
182
|
stream: nil,
|
|
183
183
|
background: nil,
|
|
184
|
-
|
|
184
|
+
deep_extraction: nil,
|
|
185
185
|
request_options: {}
|
|
186
186
|
)
|
|
187
187
|
document = Retab::MimeData.coerce(document, client: @client) unless document.nil?
|
|
@@ -196,7 +196,7 @@ module Retab
|
|
|
196
196
|
"bust_cache" => bust_cache,
|
|
197
197
|
"stream" => stream,
|
|
198
198
|
"background" => background,
|
|
199
|
-
"
|
|
199
|
+
"deep_extraction" => deep_extraction
|
|
200
200
|
}.compact
|
|
201
201
|
@client.request(
|
|
202
202
|
method: :post,
|
|
@@ -11,6 +11,7 @@ module Retab
|
|
|
11
11
|
auth_method: :auth_method,
|
|
12
12
|
key_name: :key_name,
|
|
13
13
|
key_prefix: :key_prefix,
|
|
14
|
+
user_email: :user_email,
|
|
14
15
|
user_id: :user_id
|
|
15
16
|
}.freeze
|
|
16
17
|
|
|
@@ -20,6 +21,7 @@ module Retab
|
|
|
20
21
|
:auth_method,
|
|
21
22
|
:key_name,
|
|
22
23
|
:key_prefix,
|
|
24
|
+
:user_email,
|
|
23
25
|
:user_id
|
|
24
26
|
)
|
|
25
27
|
|
|
@@ -31,6 +33,7 @@ module Retab
|
|
|
31
33
|
@auth_method = hash[:auth_method]
|
|
32
34
|
@key_name = hash[:key_name]
|
|
33
35
|
@key_prefix = hash[:key_prefix]
|
|
36
|
+
@user_email = hash[:user_email]
|
|
34
37
|
@user_id = hash[:user_id]
|
|
35
38
|
end
|
|
36
39
|
end
|
|
@@ -17,6 +17,7 @@ module Retab
|
|
|
17
17
|
started_at: :started_at,
|
|
18
18
|
status: :status,
|
|
19
19
|
trigger_type: :trigger_type,
|
|
20
|
+
triggered_by: :triggered_by,
|
|
20
21
|
workflow_id: :workflow_id
|
|
21
22
|
}.freeze
|
|
22
23
|
|
|
@@ -32,6 +33,7 @@ module Retab
|
|
|
32
33
|
:started_at,
|
|
33
34
|
:status,
|
|
34
35
|
:trigger_type,
|
|
36
|
+
:triggered_by,
|
|
35
37
|
:workflow_id
|
|
36
38
|
)
|
|
37
39
|
|
|
@@ -49,6 +51,7 @@ module Retab
|
|
|
49
51
|
@started_at = hash[:started_at]
|
|
50
52
|
@status = hash[:status]
|
|
51
53
|
@trigger_type = hash[:trigger_type]
|
|
54
|
+
@triggered_by = hash[:triggered_by] ? Retab::V1UsageUsageRunTriggeredBy.new(hash[:triggered_by]) : nil
|
|
52
55
|
@workflow_id = hash[:workflow_id]
|
|
53
56
|
end
|
|
54
57
|
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# This file is auto-generated by oagen. Do not edit.
|
|
4
|
+
|
|
5
|
+
module Retab
|
|
6
|
+
class V1UsageUsageRunTriggeredBy < Retab::Types::BaseModel
|
|
7
|
+
|
|
8
|
+
HASH_ATTRS = {
|
|
9
|
+
api_key_id: :api_key_id,
|
|
10
|
+
user_email: :user_email,
|
|
11
|
+
user_id: :user_id
|
|
12
|
+
}.freeze
|
|
13
|
+
|
|
14
|
+
attr_accessor(
|
|
15
|
+
:api_key_id,
|
|
16
|
+
:user_email,
|
|
17
|
+
:user_id
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
def initialize(json)
|
|
21
|
+
super()
|
|
22
|
+
hash = self.class.normalize(json)
|
|
23
|
+
@api_key_id = hash[:api_key_id]
|
|
24
|
+
@user_email = hash[:user_email]
|
|
25
|
+
@user_id = hash[:user_id]
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
data/lib/retab/usage.rb
CHANGED
|
@@ -16,7 +16,7 @@ module Retab
|
|
|
16
16
|
# @param before [String, nil] Return blocks before this cursor (opaque token from a prior page's list_metadata).
|
|
17
17
|
# @param after [String, nil] Return blocks after this cursor (opaque token from a prior page's list_metadata).
|
|
18
18
|
# @param workflow_id [String, nil] Filter to a single workflow id.
|
|
19
|
-
# @param block_type [String, nil] Filter by block type
|
|
19
|
+
# @param block_type [String, nil] Filter by block type: extract, classify, split, parse, edit, or partition. These are the primitive-kind names recorded on the execution, which differ from the workflow block type enum (a classifier block records classify). An unknown value is rejected with 422.
|
|
20
20
|
# @param from_date [String, nil] Inclusive activity lower bound (YYYY-MM-DD, UTC).
|
|
21
21
|
# @param to_date [String, nil] Inclusive activity upper bound (YYYY-MM-DD, UTC).
|
|
22
22
|
# @param request_options [Hash] (see Retab::Types::RequestOptions)
|
|
@@ -91,8 +91,8 @@ module Retab
|
|
|
91
91
|
# @param user_id [String, nil] Filter to executions triggered by a single user id (the user_id returned under triggered_by).
|
|
92
92
|
# @param run_id [String, nil] Filter to a single workflow run id (origin run).
|
|
93
93
|
# @param block_id [String, nil] Filter to a single workflow block id (origin block).
|
|
94
|
-
# @param operation [String, nil] Filter by operation
|
|
95
|
-
# @param status [String, nil] Filter by execution lifecycle status.
|
|
94
|
+
# @param operation [String, nil] Filter by operation: extraction, classify, split, parse, edit, partition, or schema_generation. The stored-kind aliases extract and classification are also accepted. An unknown value is rejected with 422.
|
|
95
|
+
# @param status [String, nil] Filter by execution lifecycle status: created, running, completed, failed, or canceled. Note the single-l spelling: a primitive execution is canceled, whereas a workflow run's status is cancelled. An unknown value is rejected with 422.
|
|
96
96
|
# @param metadata [String, nil] Filter by metadata equality: a JSON object of string key/value pairs (e.g. {"tenant":"acme"}). Pairs AND together.
|
|
97
97
|
# @param from_date [String, nil] Inclusive created_at lower bound (YYYY-MM-DD, UTC).
|
|
98
98
|
# @param to_date [String, nil] Inclusive created_at upper bound (YYYY-MM-DD, UTC).
|
data/lib/retab/version.rb
CHANGED
data/lib/retab.rb
CHANGED
|
@@ -11,6 +11,7 @@ loader = Zeitwerk::Loader.for_gem
|
|
|
11
11
|
require_relative "retab/inflections"
|
|
12
12
|
loader.inflector.inflect(RETAB_INFLECTIONS)
|
|
13
13
|
loader.collapse("#{__dir__}/retab/classifications")
|
|
14
|
+
loader.collapse("#{__dir__}/retab/consensus")
|
|
14
15
|
loader.collapse("#{__dir__}/retab/edit_templates")
|
|
15
16
|
loader.collapse("#{__dir__}/retab/edits")
|
|
16
17
|
loader.collapse("#{__dir__}/retab/experiment_run_metrics")
|
data/rbi/retab/client.rbi
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
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 Consensus
|
|
9
|
+
sig { params(client: Retab::BaseClient).void }
|
|
10
|
+
def initialize(client); end
|
|
11
|
+
|
|
12
|
+
sig do
|
|
13
|
+
params(
|
|
14
|
+
inputs: T.nilable(T::Array[T::Hash[String, T.untyped]]),
|
|
15
|
+
include_alignment: T.nilable(T::Boolean),
|
|
16
|
+
json_schema: T.nilable(T::Hash[String, T.untyped]),
|
|
17
|
+
request_options: T::Hash[Symbol, T.untyped]
|
|
18
|
+
).returns(Retab::ReconciliationResult)
|
|
19
|
+
end
|
|
20
|
+
def create(inputs:, include_alignment:, json_schema:, request_options:); end
|
|
21
|
+
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
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 CreateConsensusRequest
|
|
9
|
+
sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void }
|
|
10
|
+
def initialize(json); end
|
|
11
|
+
|
|
12
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
13
|
+
def include_alignment; end
|
|
14
|
+
|
|
15
|
+
sig { params(value: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) }
|
|
16
|
+
def include_alignment=(value); end
|
|
17
|
+
|
|
18
|
+
sig { returns(T.nilable(T::Array[T::Hash[String, T.untyped]])) }
|
|
19
|
+
def inputs; end
|
|
20
|
+
|
|
21
|
+
sig { params(value: T.nilable(T::Array[T::Hash[String, T.untyped]])).returns(T.nilable(T::Array[T::Hash[String, T.untyped]])) }
|
|
22
|
+
def inputs=(value); end
|
|
23
|
+
|
|
24
|
+
sig { returns(T.nilable(T::Hash[String, T.untyped])) }
|
|
25
|
+
def json_schema; end
|
|
26
|
+
|
|
27
|
+
sig { params(value: T.nilable(T::Hash[String, T.untyped])).returns(T.nilable(T::Hash[String, T.untyped])) }
|
|
28
|
+
def json_schema=(value); end
|
|
29
|
+
|
|
30
|
+
sig { returns(T::Hash[Symbol, T.untyped]) }
|
|
31
|
+
def to_h; end
|
|
32
|
+
|
|
33
|
+
sig { params(args: T.untyped).returns(String) }
|
|
34
|
+
def to_json(*args); end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -63,6 +63,18 @@ module Retab
|
|
|
63
63
|
sig { params(value: T.nilable(T::Array[Retab::ExperimentSummaryMetricDocument])).returns(T.nilable(T::Array[Retab::ExperimentSummaryMetricDocument])) }
|
|
64
64
|
def documents=(value); end
|
|
65
65
|
|
|
66
|
+
sig { returns(T.nilable(Integer)) }
|
|
67
|
+
def scored_document_count; end
|
|
68
|
+
|
|
69
|
+
sig { params(value: T.nilable(Integer)).returns(T.nilable(Integer)) }
|
|
70
|
+
def scored_document_count=(value); end
|
|
71
|
+
|
|
72
|
+
sig { returns(T.nilable(Integer)) }
|
|
73
|
+
def total_document_count; end
|
|
74
|
+
|
|
75
|
+
sig { params(value: T.nilable(Integer)).returns(T.nilable(Integer)) }
|
|
76
|
+
def total_document_count=(value); end
|
|
77
|
+
|
|
66
78
|
sig { returns(T.nilable(T.any(Retab::ExperimentExtractSummaryAggregate, Retab::ExperimentConfusionSummaryAggregate))) }
|
|
67
79
|
def aggregate; end
|
|
68
80
|
|
|
@@ -69,11 +69,11 @@ module Retab
|
|
|
69
69
|
sig { params(value: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) }
|
|
70
70
|
def background=(value); end
|
|
71
71
|
|
|
72
|
-
sig { returns(T.nilable(T::
|
|
73
|
-
def
|
|
72
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
73
|
+
def deep_extraction; end
|
|
74
74
|
|
|
75
|
-
sig { params(value: T.nilable(T::
|
|
76
|
-
def
|
|
75
|
+
sig { params(value: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) }
|
|
76
|
+
def deep_extraction=(value); end
|
|
77
77
|
|
|
78
78
|
sig { returns(T::Hash[Symbol, T.untyped]) }
|
|
79
79
|
def to_h; end
|
data/rbi/retab/extractions.rbi
CHANGED
|
@@ -40,11 +40,11 @@ module Retab
|
|
|
40
40
|
bust_cache: T.nilable(T::Boolean),
|
|
41
41
|
stream: T.nilable(T::Boolean),
|
|
42
42
|
background: T.nilable(T::Boolean),
|
|
43
|
-
|
|
43
|
+
deep_extraction: T.nilable(T::Boolean),
|
|
44
44
|
request_options: T::Hash[Symbol, T.untyped]
|
|
45
45
|
).returns(Retab::Extraction)
|
|
46
46
|
end
|
|
47
|
-
def create(document:, json_schema:, model:, instructions:, n_consensus:, metadata:, additional_messages:, bust_cache:, stream:, background:,
|
|
47
|
+
def create(document:, json_schema:, model:, instructions:, n_consensus:, metadata:, additional_messages:, bust_cache:, stream:, background:, deep_extraction:, request_options:); end
|
|
48
48
|
|
|
49
49
|
sig do
|
|
50
50
|
params(
|
|
@@ -58,11 +58,11 @@ module Retab
|
|
|
58
58
|
bust_cache: T.nilable(T::Boolean),
|
|
59
59
|
stream: T.nilable(T::Boolean),
|
|
60
60
|
background: T.nilable(T::Boolean),
|
|
61
|
-
|
|
61
|
+
deep_extraction: T.nilable(T::Boolean),
|
|
62
62
|
request_options: T::Hash[Symbol, T.untyped]
|
|
63
63
|
).returns(NilClass)
|
|
64
64
|
end
|
|
65
|
-
def create_stream(document:, json_schema:, model:, instructions:, n_consensus:, metadata:, additional_messages:, bust_cache:, stream:, background:,
|
|
65
|
+
def create_stream(document:, json_schema:, model:, instructions:, n_consensus:, metadata:, additional_messages:, bust_cache:, stream:, background:, deep_extraction:, request_options:); end
|
|
66
66
|
|
|
67
67
|
sig do
|
|
68
68
|
params(
|
|
@@ -0,0 +1,36 @@
|
|
|
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 ReconciliationAlignment
|
|
9
|
+
sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void }
|
|
10
|
+
def initialize(json); end
|
|
11
|
+
|
|
12
|
+
sig { returns(T.nilable(T::Array[T::Hash[String, T.untyped]])) }
|
|
13
|
+
def aligned_inputs; end
|
|
14
|
+
|
|
15
|
+
sig { params(value: T.nilable(T::Array[T::Hash[String, T.untyped]])).returns(T.nilable(T::Array[T::Hash[String, T.untyped]])) }
|
|
16
|
+
def aligned_inputs=(value); end
|
|
17
|
+
|
|
18
|
+
sig { returns(T.nilable(T::Array[Retab::ReconciliationPathAlignment])) }
|
|
19
|
+
def path_alignments; end
|
|
20
|
+
|
|
21
|
+
sig { params(value: T.nilable(T::Array[Retab::ReconciliationPathAlignment])).returns(T.nilable(T::Array[Retab::ReconciliationPathAlignment])) }
|
|
22
|
+
def path_alignments=(value); end
|
|
23
|
+
|
|
24
|
+
sig { returns(Integer) }
|
|
25
|
+
def reference_index; end
|
|
26
|
+
|
|
27
|
+
sig { params(value: Integer).returns(Integer) }
|
|
28
|
+
def reference_index=(value); end
|
|
29
|
+
|
|
30
|
+
sig { returns(T::Hash[Symbol, T.untyped]) }
|
|
31
|
+
def to_h; end
|
|
32
|
+
|
|
33
|
+
sig { params(args: T.untyped).returns(String) }
|
|
34
|
+
def to_json(*args); end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -0,0 +1,48 @@
|
|
|
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 ReconciliationField
|
|
9
|
+
sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void }
|
|
10
|
+
def initialize(json); end
|
|
11
|
+
|
|
12
|
+
sig { returns(Float) }
|
|
13
|
+
def likelihood; end
|
|
14
|
+
|
|
15
|
+
sig { params(value: Float).returns(Float) }
|
|
16
|
+
def likelihood=(value); end
|
|
17
|
+
|
|
18
|
+
sig { returns(String) }
|
|
19
|
+
def path; end
|
|
20
|
+
|
|
21
|
+
sig { params(value: String).returns(String) }
|
|
22
|
+
def path=(value); end
|
|
23
|
+
|
|
24
|
+
sig { returns(Integer) }
|
|
25
|
+
def supporting_input_count; end
|
|
26
|
+
|
|
27
|
+
sig { params(value: Integer).returns(Integer) }
|
|
28
|
+
def supporting_input_count=(value); end
|
|
29
|
+
|
|
30
|
+
sig { returns(Integer) }
|
|
31
|
+
def total_input_count; end
|
|
32
|
+
|
|
33
|
+
sig { params(value: Integer).returns(Integer) }
|
|
34
|
+
def total_input_count=(value); end
|
|
35
|
+
|
|
36
|
+
sig { returns(T.untyped) }
|
|
37
|
+
def value; end
|
|
38
|
+
|
|
39
|
+
sig { params(value: T.untyped).returns(T.untyped) }
|
|
40
|
+
def value=(value); end
|
|
41
|
+
|
|
42
|
+
sig { returns(T::Hash[Symbol, T.untyped]) }
|
|
43
|
+
def to_h; end
|
|
44
|
+
|
|
45
|
+
sig { params(args: T.untyped).returns(String) }
|
|
46
|
+
def to_json(*args); end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
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 ReconciliationPathAlignment
|
|
9
|
+
sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void }
|
|
10
|
+
def initialize(json); end
|
|
11
|
+
|
|
12
|
+
sig { returns(String) }
|
|
13
|
+
def canonical_path; end
|
|
14
|
+
|
|
15
|
+
sig { params(value: String).returns(String) }
|
|
16
|
+
def canonical_path=(value); end
|
|
17
|
+
|
|
18
|
+
sig { returns(T.nilable(T::Array[T.nilable(String)])) }
|
|
19
|
+
def source_paths; end
|
|
20
|
+
|
|
21
|
+
sig { params(value: T.nilable(T::Array[T.nilable(String)])).returns(T.nilable(T::Array[T.nilable(String)])) }
|
|
22
|
+
def source_paths=(value); end
|
|
23
|
+
|
|
24
|
+
sig { returns(T::Hash[Symbol, T.untyped]) }
|
|
25
|
+
def to_h; end
|
|
26
|
+
|
|
27
|
+
sig { params(args: T.untyped).returns(String) }
|
|
28
|
+
def to_json(*args); end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -0,0 +1,42 @@
|
|
|
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 ReconciliationResult
|
|
9
|
+
sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void }
|
|
10
|
+
def initialize(json); end
|
|
11
|
+
|
|
12
|
+
sig { returns(Retab::ReconciliationAlignment) }
|
|
13
|
+
def alignment; end
|
|
14
|
+
|
|
15
|
+
sig { params(value: Retab::ReconciliationAlignment).returns(Retab::ReconciliationAlignment) }
|
|
16
|
+
def alignment=(value); end
|
|
17
|
+
|
|
18
|
+
sig { returns(T::Hash[String, T.untyped]) }
|
|
19
|
+
def consensus; end
|
|
20
|
+
|
|
21
|
+
sig { params(value: T::Hash[String, T.untyped]).returns(T::Hash[String, T.untyped]) }
|
|
22
|
+
def consensus=(value); end
|
|
23
|
+
|
|
24
|
+
sig { returns(T.nilable(T::Array[Retab::ReconciliationField])) }
|
|
25
|
+
def fields; end
|
|
26
|
+
|
|
27
|
+
sig { params(value: T.nilable(T::Array[Retab::ReconciliationField])).returns(T.nilable(T::Array[Retab::ReconciliationField])) }
|
|
28
|
+
def fields=(value); end
|
|
29
|
+
|
|
30
|
+
sig { returns(T::Hash[String, Float]) }
|
|
31
|
+
def likelihoods; end
|
|
32
|
+
|
|
33
|
+
sig { params(value: T::Hash[String, Float]).returns(T::Hash[String, Float]) }
|
|
34
|
+
def likelihoods=(value); end
|
|
35
|
+
|
|
36
|
+
sig { returns(T::Hash[Symbol, T.untyped]) }
|
|
37
|
+
def to_h; end
|
|
38
|
+
|
|
39
|
+
sig { params(args: T.untyped).returns(String) }
|
|
40
|
+
def to_json(*args); end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -39,6 +39,12 @@ module Retab
|
|
|
39
39
|
sig { params(value: T.nilable(String)).returns(T.nilable(String)) }
|
|
40
40
|
def key_prefix=(value); end
|
|
41
41
|
|
|
42
|
+
sig { returns(T.nilable(String)) }
|
|
43
|
+
def user_email; end
|
|
44
|
+
|
|
45
|
+
sig { params(value: T.nilable(String)).returns(T.nilable(String)) }
|
|
46
|
+
def user_email=(value); end
|
|
47
|
+
|
|
42
48
|
sig { returns(T.nilable(String)) }
|
|
43
49
|
def user_id; end
|
|
44
50
|
|
|
@@ -75,6 +75,12 @@ module Retab
|
|
|
75
75
|
sig { params(value: String).returns(String) }
|
|
76
76
|
def trigger_type=(value); end
|
|
77
77
|
|
|
78
|
+
sig { returns(T.nilable(Retab::V1UsageUsageRunTriggeredBy)) }
|
|
79
|
+
def triggered_by; end
|
|
80
|
+
|
|
81
|
+
sig { params(value: T.nilable(Retab::V1UsageUsageRunTriggeredBy)).returns(T.nilable(Retab::V1UsageUsageRunTriggeredBy)) }
|
|
82
|
+
def triggered_by=(value); end
|
|
83
|
+
|
|
78
84
|
sig { returns(String) }
|
|
79
85
|
def workflow_id; end
|
|
80
86
|
|
|
@@ -0,0 +1,36 @@
|
|
|
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 V1UsageUsageRunTriggeredBy
|
|
9
|
+
sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void }
|
|
10
|
+
def initialize(json); end
|
|
11
|
+
|
|
12
|
+
sig { returns(T.nilable(String)) }
|
|
13
|
+
def api_key_id; end
|
|
14
|
+
|
|
15
|
+
sig { params(value: T.nilable(String)).returns(T.nilable(String)) }
|
|
16
|
+
def api_key_id=(value); end
|
|
17
|
+
|
|
18
|
+
sig { returns(T.nilable(String)) }
|
|
19
|
+
def user_email; end
|
|
20
|
+
|
|
21
|
+
sig { params(value: T.nilable(String)).returns(T.nilable(String)) }
|
|
22
|
+
def user_email=(value); end
|
|
23
|
+
|
|
24
|
+
sig { returns(T.nilable(String)) }
|
|
25
|
+
def user_id; end
|
|
26
|
+
|
|
27
|
+
sig { params(value: T.nilable(String)).returns(T.nilable(String)) }
|
|
28
|
+
def user_id=(value); end
|
|
29
|
+
|
|
30
|
+
sig { returns(T::Hash[Symbol, T.untyped]) }
|
|
31
|
+
def to_h; end
|
|
32
|
+
|
|
33
|
+
sig { params(args: T.untyped).returns(String) }
|
|
34
|
+
def to_json(*args); end
|
|
35
|
+
end
|
|
36
|
+
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.
|
|
4
|
+
version: 0.1.12
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Retab
|
|
@@ -57,6 +57,12 @@ files:
|
|
|
57
57
|
- lib/retab/classifications/retab_usage.rb
|
|
58
58
|
- lib/retab/client.rb
|
|
59
59
|
- lib/retab/configuration.rb
|
|
60
|
+
- lib/retab/consensus.rb
|
|
61
|
+
- lib/retab/consensus/create_consensus_request.rb
|
|
62
|
+
- lib/retab/consensus/reconciliation_alignment.rb
|
|
63
|
+
- lib/retab/consensus/reconciliation_field.rb
|
|
64
|
+
- lib/retab/consensus/reconciliation_path_alignment.rb
|
|
65
|
+
- lib/retab/consensus/reconciliation_result.rb
|
|
60
66
|
- lib/retab/edit_templates.rb
|
|
61
67
|
- lib/retab/edit_templates/create_edit_template_request.rb
|
|
62
68
|
- lib/retab/edit_templates/edit_template.rb
|
|
@@ -319,6 +325,7 @@ files:
|
|
|
319
325
|
- lib/retab/usage/usage_primitive_record.rb
|
|
320
326
|
- lib/retab/usage/usage_primitive_triggered_by.rb
|
|
321
327
|
- lib/retab/usage/usage_run_record.rb
|
|
328
|
+
- lib/retab/usage/v_1_usage_usage_run_triggered_by.rb
|
|
322
329
|
- lib/retab/util.rb
|
|
323
330
|
- lib/retab/version.rb
|
|
324
331
|
- lib/retab/workflow_artifacts.rb
|
|
@@ -563,9 +570,11 @@ files:
|
|
|
563
570
|
- rbi/retab/condition_evaluation_result.rbi
|
|
564
571
|
- rbi/retab/condition_evaluation_sub_condition.rbi
|
|
565
572
|
- rbi/retab/conditional_evaluation.rbi
|
|
573
|
+
- rbi/retab/consensus.rbi
|
|
566
574
|
- rbi/retab/contain_condition.rbi
|
|
567
575
|
- rbi/retab/container_context_data.rbi
|
|
568
576
|
- rbi/retab/create_block_execution_request.rbi
|
|
577
|
+
- rbi/retab/create_consensus_request.rbi
|
|
569
578
|
- rbi/retab/create_edit_template_request.rbi
|
|
570
579
|
- rbi/retab/create_experiment_request.rbi
|
|
571
580
|
- rbi/retab/create_experiment_run_request.rbi
|
|
@@ -696,6 +705,10 @@ files:
|
|
|
696
705
|
- rbi/retab/queued_workflow_eval_run.rbi
|
|
697
706
|
- rbi/retab/queued_workflow_experiment_result.rbi
|
|
698
707
|
- rbi/retab/queued_workflow_experiment_run.rbi
|
|
708
|
+
- rbi/retab/reconciliation_alignment.rbi
|
|
709
|
+
- rbi/retab/reconciliation_field.rbi
|
|
710
|
+
- rbi/retab/reconciliation_path_alignment.rbi
|
|
711
|
+
- rbi/retab/reconciliation_result.rbi
|
|
699
712
|
- rbi/retab/reconstruct_document_ref.rbi
|
|
700
713
|
- rbi/retab/reconstruct_enriched_row.rbi
|
|
701
714
|
- rbi/retab/reconstruct_enriched_table.rbi
|
|
@@ -775,6 +788,7 @@ files:
|
|
|
775
788
|
- rbi/retab/usage_primitive_record.rbi
|
|
776
789
|
- rbi/retab/usage_primitive_triggered_by.rbi
|
|
777
790
|
- rbi/retab/usage_run_record.rbi
|
|
791
|
+
- rbi/retab/v_1_usage_usage_run_triggered_by.rbi
|
|
778
792
|
- rbi/retab/validate_workflow_block_config_request.rbi
|
|
779
793
|
- rbi/retab/validate_workflow_block_config_response.rbi
|
|
780
794
|
- rbi/retab/validation_error.rbi
|