retab 0.1.3 → 0.1.4
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/classifications/category.rb +1 -1
- data/lib/retab/classifications/classification_request.rb +2 -2
- data/lib/retab/client.rb +16 -16
- data/lib/retab/{workflow_artifacts → edits}/edit_config.rb +1 -1
- data/lib/retab/edits/edit_request.rb +2 -2
- data/lib/retab/experiment_run_metrics/experiment_by_document_metrics_response.rb +2 -2
- data/lib/retab/experiment_run_metrics/experiment_by_target_metrics_response.rb +2 -2
- data/lib/retab/experiment_run_metrics/experiment_metrics_missing_error.rb +2 -2
- data/lib/retab/experiment_run_metrics/experiment_metrics_stale_error.rb +2 -2
- data/lib/retab/experiment_run_metrics/experiment_summary_metrics_response.rb +2 -2
- data/lib/retab/experiment_run_metrics/experiment_votes_metrics_response.rb +2 -2
- data/lib/retab/experiment_run_results/error_workflow_experiment_result.rb +2 -2
- data/lib/retab/experiment_run_results/experiment_result.rb +2 -5
- data/lib/retab/experiment_runs/experiment_run.rb +6 -3
- data/lib/retab/experiment_runs.rb +0 -10
- data/lib/retab/extractions/extraction_request.rb +3 -3
- data/lib/retab/extractions/sources_response.rb +1 -1
- data/lib/retab/extractions.rb +1 -1
- data/lib/retab/files/create_upload_response.rb +1 -1
- data/lib/retab/files/file.rb +1 -1
- data/lib/retab/files.rb +65 -65
- data/lib/retab/jobs/job.rb +3 -3
- data/lib/retab/parses/parse_request.rb +3 -3
- data/lib/retab/partitions/partition.rb +1 -1
- data/lib/retab/partitions/partition_request.rb +3 -3
- data/lib/retab/schemas/generate_schema_request.rb +2 -5
- data/lib/retab/schemas/partial_schema.rb +2 -2
- data/lib/retab/schemas.rb +0 -3
- data/lib/retab/splits/split_request.rb +2 -2
- data/lib/retab/splits/subdocument.rb +2 -2
- data/lib/retab/types/trigger_info_type.rb +18 -0
- data/lib/retab/types/{workflow_export_payload_request_trigger_types.rb → workflow_export_payload_request_trigger_type.rb} +1 -1
- data/lib/retab/types/workflow_runs_trigger_type.rb +1 -1
- data/lib/retab/workflow_artifacts/api_call_invocation.rb +4 -4
- data/lib/retab/workflow_artifacts/classification_workflow_artifact.rb +1 -1
- data/lib/retab/workflow_artifacts/condition_evaluation_details.rb +6 -6
- data/lib/retab/workflow_artifacts/condition_evaluation_per_item.rb +1 -1
- data/lib/retab/workflow_artifacts/condition_evaluation_result.rb +7 -7
- data/lib/retab/workflow_artifacts/condition_evaluation_sub_condition.rb +6 -6
- data/lib/retab/workflow_artifacts/conditional_evaluation.rb +4 -4
- data/lib/retab/workflow_artifacts/edit_workflow_artifact.rb +1 -1
- data/lib/retab/workflow_artifacts/extraction_workflow_artifact.rb +1 -1
- data/lib/retab/workflow_artifacts/function_invocation.rb +4 -4
- data/lib/retab/workflow_artifacts/parse_workflow_artifact.rb +1 -1
- data/lib/retab/workflow_artifacts/partition_workflow_artifact.rb +2 -2
- data/lib/retab/workflow_artifacts/review_evaluation.rb +6 -6
- data/lib/retab/workflow_artifacts/split_workflow_artifact.rb +1 -1
- data/lib/retab/workflow_artifacts/while_loop_termination.rb +4 -4
- data/lib/retab/workflow_artifacts.rb +22 -22
- data/lib/retab/workflow_block_executions/completed_block_execution_lifecycle.rb +1 -1
- data/lib/retab/workflow_block_executions/create_block_execution_request.rb +1 -1
- data/lib/retab/workflow_block_executions/error_block_execution_lifecycle.rb +1 -1
- data/lib/retab/workflow_block_executions/skipped_block_execution_lifecycle.rb +1 -1
- data/lib/retab/workflow_block_executions/stored_block_execution.rb +3 -3
- data/lib/retab/workflow_block_executions.rb +1 -1
- data/lib/retab/workflow_blocks/workflow_block.rb +1 -1
- data/lib/retab/workflow_blocks/workflow_block_create_request.rb +1 -1
- data/lib/retab/workflow_blocks.rb +7 -7
- data/lib/retab/workflow_edges.rb +3 -3
- data/lib/retab/workflow_experiments/experiment_document_capture_request.rb +3 -3
- data/lib/retab/workflow_experiments/experiment_document_provenance.rb +3 -3
- data/lib/retab/{workflow_test_run_results → workflow_experiments}/file_handle_input.rb +1 -1
- data/lib/retab/{workflow_test_run_results → workflow_experiments}/json_handle_input.rb +1 -1
- data/lib/retab/workflow_experiments/workflow_experiment.rb +3 -3
- data/lib/retab/workflow_reviews/review.rb +3 -3
- data/lib/retab/workflow_reviews/review_all_of.rb +1 -1
- data/lib/retab/workflow_reviews/review_always.rb +1 -1
- data/lib/retab/workflow_reviews/review_any_of.rb +1 -1
- data/lib/retab/workflow_reviews/review_any_required_field_null.rb +1 -1
- data/lib/retab/workflow_reviews/review_any_split_pages_lt.rb +1 -1
- data/lib/retab/workflow_reviews/review_boundary_confidence_lt.rb +1 -1
- data/lib/retab/workflow_reviews/review_branch_in.rb +1 -1
- data/lib/retab/workflow_reviews/review_category_in.rb +1 -1
- data/lib/retab/workflow_reviews/review_confidence_lt.rb +1 -1
- data/lib/retab/workflow_reviews/review_decision.rb +3 -3
- data/lib/retab/workflow_reviews/review_field_confidence_lt.rb +1 -1
- data/lib/retab/workflow_reviews/review_json_condition.rb +1 -1
- data/lib/retab/workflow_reviews/review_split_count_neq.rb +1 -1
- data/lib/retab/workflow_reviews/review_top_margin_lt.rb +1 -1
- data/lib/retab/workflow_reviews/review_validation_failed.rb +1 -1
- data/lib/retab/workflow_reviews/submit_decision_response.rb +2 -2
- data/lib/retab/workflow_runs/awaiting_review_run.rb +1 -1
- data/lib/retab/workflow_runs/cancel_workflow_response.rb +2 -2
- data/lib/retab/workflow_runs/cancelled_terminal.rb +1 -1
- data/lib/retab/workflow_runs/create_workflow_run_request.rb +1 -1
- data/lib/retab/workflow_runs/error_terminal.rb +1 -1
- data/lib/retab/workflow_runs/pending_run.rb +1 -1
- data/lib/retab/workflow_runs/run_timing.rb +2 -11
- data/lib/retab/workflow_runs/running_run.rb +1 -1
- data/lib/retab/workflow_runs/{manual_trigger.rb → trigger_info.rb} +3 -8
- data/lib/retab/workflow_runs/workflow_export_payload_request.rb +7 -7
- data/lib/retab/workflow_runs/workflow_run.rb +7 -21
- data/lib/retab/workflow_runs.rb +6 -16
- data/lib/retab/workflow_spec/declarative_apply_response.rb +2 -2
- data/lib/retab/workflow_spec/declarative_plan_field_change.rb +2 -2
- data/lib/retab/workflow_spec/declarative_plan_response.rb +2 -2
- data/lib/retab/workflow_spec/declarative_plan_summary.rb +1 -1
- data/lib/retab/workflow_spec.rb +10 -10
- data/lib/retab/workflow_steps/awaiting_review_step_lifecycle.rb +1 -1
- data/lib/retab/workflow_steps/cancelled_step_lifecycle.rb +1 -1
- data/lib/retab/workflow_steps/container_context_data.rb +1 -1
- data/lib/retab/workflow_steps/error_step_lifecycle.rb +1 -1
- data/lib/retab/workflow_steps/queued_step_lifecycle.rb +1 -1
- data/lib/retab/workflow_steps.rb +5 -10
- data/lib/retab/workflow_test_run_results/verdict_summary.rb +3 -3
- data/lib/retab/workflow_test_run_results/workflow_test_result.rb +4 -4
- data/lib/retab/workflow_test_run_results/workflow_test_run_timing.rb +7 -0
- data/lib/retab/workflow_test_runs/workflow_test_run.rb +7 -21
- data/lib/retab/workflow_test_runs.rb +1 -11
- data/lib/retab/workflow_tests/all_items_match_condition.rb +1 -1
- data/lib/retab/workflow_tests/any_item_matches_condition.rb +1 -1
- data/lib/retab/workflow_tests/array_contains_condition.rb +1 -1
- data/lib/retab/workflow_tests/assertion_schema_dep.rb +1 -1
- data/lib/retab/workflow_tests/between_condition.rb +2 -2
- data/lib/retab/workflow_tests/contain_condition.rb +1 -1
- data/lib/retab/workflow_tests/ends_with_condition.rb +1 -1
- data/lib/retab/workflow_tests/equal_condition.rb +1 -1
- data/lib/retab/workflow_tests/exist_condition.rb +1 -1
- data/lib/retab/workflow_tests/json_schema_valid_condition.rb +1 -1
- data/lib/retab/workflow_tests/length_compare_condition.rb +1 -1
- data/lib/retab/workflow_tests/llm_judged_as_condition.rb +1 -1
- data/lib/retab/workflow_tests/llm_not_judged_as_condition.rb +1 -1
- data/lib/retab/{workflow_test_run_results → workflow_tests}/manual_workflow_test_source.rb +1 -1
- data/lib/retab/workflow_tests/matche_regex_condition.rb +1 -1
- data/lib/retab/workflow_tests/not_contains_condition.rb +1 -1
- data/lib/retab/workflow_tests/not_equals_condition.rb +1 -1
- data/lib/retab/workflow_tests/not_exists_condition.rb +1 -1
- data/lib/retab/workflow_tests/number_compare_condition.rb +1 -1
- data/lib/retab/workflow_tests/object_contains_condition.rb +1 -1
- data/lib/retab/{workflow_test_run_results → workflow_tests}/run_step_workflow_test_source.rb +1 -1
- data/lib/retab/workflow_tests/similarity_gte_condition.rb +2 -2
- data/lib/retab/workflow_tests/split_iou_condition.rb +1 -1
- data/lib/retab/workflow_tests/start_with_condition.rb +1 -1
- data/lib/retab/workflow_tests/workflow_test.rb +2 -2
- data/lib/retab/{workflow_test_runs → workflow_tests}/workflow_test_block_target.rb +1 -1
- data/lib/retab/workflows/create_workflow_request.rb +2 -2
- data/lib/retab/workflows/publish_workflow_request.rb +1 -1
- data/lib/retab/workflows/workflow.rb +2 -2
- data/lib/retab/workflows/workflow_published.rb +1 -1
- data/lib/retab/workflows.rb +23 -0
- data/rbi/retab/api_call_invocation.rbi +4 -4
- data/rbi/retab/client.rbi +13 -13
- data/rbi/retab/condition_evaluation_details.rbi +2 -2
- data/rbi/retab/condition_evaluation_result.rbi +2 -2
- data/rbi/retab/condition_evaluation_sub_condition.rbi +2 -2
- data/rbi/retab/conditional_evaluation.rbi +4 -4
- data/rbi/retab/edit_workflow_artifact.rbi +2 -2
- data/rbi/retab/experiment_document_capture_request.rbi +2 -2
- data/rbi/retab/experiment_document_provenance.rbi +2 -2
- data/rbi/retab/experiment_result.rbi +0 -6
- data/rbi/retab/experiment_run.rbi +10 -4
- data/rbi/retab/experiment_runs.rbi +1 -3
- data/rbi/retab/extraction_workflow_artifact.rbi +2 -2
- data/rbi/retab/files.rbi +17 -17
- data/rbi/retab/function_invocation.rbi +4 -4
- data/rbi/retab/generate_schema_request.rbi +0 -6
- data/rbi/retab/job.rbi +2 -2
- data/rbi/retab/partition_workflow_artifact.rbi +2 -2
- data/rbi/retab/review.rbi +2 -2
- data/rbi/retab/review_decision.rbi +4 -4
- data/rbi/retab/review_evaluation.rbi +2 -2
- data/rbi/retab/run_timing.rbi +0 -18
- data/rbi/retab/schemas.rbi +1 -2
- data/rbi/retab/stored_block_execution.rbi +2 -2
- data/rbi/retab/{schedule_trigger.rbi → trigger_info.rbi} +3 -9
- data/rbi/retab/verdict_summary.rbi +2 -2
- data/rbi/retab/while_loop_termination.rbi +2 -2
- data/rbi/retab/workflow_artifacts.rbi +8 -8
- data/rbi/retab/workflow_export_payload_request.rbi +4 -4
- data/rbi/retab/workflow_run.rbi +12 -6
- data/rbi/retab/workflow_runs.rbi +3 -5
- data/rbi/retab/workflow_spec.rbi +4 -4
- data/rbi/retab/workflow_steps.rbi +1 -2
- data/rbi/retab/workflow_test_result.rbi +2 -2
- data/rbi/retab/workflow_test_run.rbi +12 -6
- data/rbi/retab/workflow_test_run_timing.rbi +2 -2
- data/rbi/retab/workflow_test_runs.rbi +1 -3
- data/rbi/retab/workflows.rbi +8 -0
- metadata +26 -38
- data/lib/retab/types/generate_schema_request_reasoning_effort.rb +0 -17
- data/lib/retab/workflow_runs/api_trigger.rb +0 -25
- data/lib/retab/workflow_runs/email_trigger.rb +0 -28
- data/lib/retab/workflow_runs/restart_trigger.rb +0 -25
- data/lib/retab/workflow_runs/schedule_trigger.rb +0 -25
- data/lib/retab/workflow_runs/webhook_trigger.rb +0 -25
- data/lib/retab/workflow_runs/workflow_snapshot_ref.rb +0 -25
- data/lib/retab/workflow_test_runs/workflow_test_run_timing.rb +0 -31
- data/rbi/retab/api_trigger.rbi +0 -30
- data/rbi/retab/email_trigger.rbi +0 -36
- data/rbi/retab/manual_trigger.rbi +0 -30
- data/rbi/retab/restart_trigger.rbi +0 -30
- data/rbi/retab/webhook_trigger.rbi +0 -30
- data/rbi/retab/workflow_snapshot_ref.rbi +0 -30
- /data/lib/retab/{extractions → classifications}/file_ref.rb +0 -0
- /data/lib/retab/{extractions → classifications}/retab_usage.rb +0 -0
- /data/lib/retab/{workflow_artifacts → edits}/b_box.rb +0 -0
- /data/lib/retab/{workflow_artifacts → edits}/edit_result.rb +0 -0
- /data/lib/retab/{workflow_artifacts → edits}/form_field.rb +0 -0
- /data/lib/retab/{workflow_runs → workflow_artifacts}/error_details.rb +0 -0
- /data/lib/retab/{workflow_steps → workflow_block_executions}/step_artifact_ref.rb +0 -0
- /data/lib/retab/{workflow_test_run_results → workflow_experiments}/materialized_document.rb +0 -0
- /data/lib/retab/{workflow_test_runs → workflow_test_run_results}/cancelled_workflow_test_run.rb +0 -0
- /data/lib/retab/{workflow_test_runs → workflow_test_run_results}/completed_workflow_test_run.rb +0 -0
- /data/lib/retab/{workflow_test_runs → workflow_test_run_results}/error_workflow_test_run.rb +0 -0
- /data/lib/retab/{workflow_test_runs → workflow_test_run_results}/pending_workflow_test_run.rb +0 -0
- /data/lib/retab/{workflow_test_runs → workflow_test_run_results}/queued_workflow_test_run.rb +0 -0
- /data/lib/retab/{workflow_test_runs → workflow_test_run_results}/running_workflow_test_run.rb +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 633ca3b09e7ca247d1f5a3c41d9ea37f0e649ce2f2b536c2b01adcdd01edc1c9
|
|
4
|
+
data.tar.gz: 54e2f7b0cda211c064919753b96047635ac6d394a352e9392a683d5db14ce69c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bd49432f3c96e45650ca9d8874ffb67655b1cbbc2fc4327851a39a4ab2d80a5ea3782e031090593fbfc55c0fdecc10de79dc0020a3ef71d6523d654aab4ec4ce
|
|
7
|
+
data.tar.gz: c4771af16fa81bf4c1922a4093e2822c725badf6af4ce2b768331113c0a9c954943df5f16e80aa5247533645aed75dae05e55c310d3bbbda560600684b4a9b10
|
|
@@ -30,11 +30,11 @@ module Retab
|
|
|
30
30
|
hash = self.class.normalize(json)
|
|
31
31
|
@document = hash[:document] ? Retab::MimeData.new(hash[:document]) : nil
|
|
32
32
|
@categories = (hash[:categories] || []).map { |item| item ? Retab::Category.new(item) : nil }
|
|
33
|
-
@model = hash[:model]
|
|
33
|
+
@model = hash[:model].nil? ? "retab-small" : hash[:model]
|
|
34
34
|
@first_n_pages = hash[:first_n_pages]
|
|
35
35
|
@instructions = hash[:instructions]
|
|
36
36
|
@n_consensus = hash[:n_consensus]
|
|
37
|
-
@bust_cache = hash[:bust_cache]
|
|
37
|
+
@bust_cache = hash[:bust_cache].nil? ? false : hash[:bust_cache]
|
|
38
38
|
end
|
|
39
39
|
end
|
|
40
40
|
end
|
data/lib/retab/client.rb
CHANGED
|
@@ -5,16 +5,24 @@
|
|
|
5
5
|
module Retab
|
|
6
6
|
class Client < BaseClient
|
|
7
7
|
|
|
8
|
-
def
|
|
9
|
-
@
|
|
8
|
+
def classifications
|
|
9
|
+
@classifications ||= Retab::Classifications.new(self)
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def edits
|
|
13
|
+
@edits ||= Retab::Edits.new(self)
|
|
10
14
|
end
|
|
11
15
|
|
|
12
16
|
def extractions
|
|
13
17
|
@extractions ||= Retab::Extractions.new(self)
|
|
14
18
|
end
|
|
15
19
|
|
|
16
|
-
def
|
|
17
|
-
@
|
|
20
|
+
def files
|
|
21
|
+
@files ||= Retab::Files.new(self)
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def jobs
|
|
25
|
+
@jobs ||= Retab::Jobs.new(self)
|
|
18
26
|
end
|
|
19
27
|
|
|
20
28
|
def parses
|
|
@@ -25,24 +33,16 @@ module Retab
|
|
|
25
33
|
@partitions ||= Retab::Partitions.new(self)
|
|
26
34
|
end
|
|
27
35
|
|
|
28
|
-
def
|
|
29
|
-
@
|
|
36
|
+
def schemas
|
|
37
|
+
@schemas ||= Retab::Schemas.new(self)
|
|
30
38
|
end
|
|
31
39
|
|
|
32
|
-
def
|
|
33
|
-
@
|
|
40
|
+
def splits
|
|
41
|
+
@splits ||= Retab::Splits.new(self)
|
|
34
42
|
end
|
|
35
43
|
|
|
36
44
|
def workflows
|
|
37
45
|
@workflows ||= Retab::Workflows.new(self)
|
|
38
46
|
end
|
|
39
|
-
|
|
40
|
-
def edits
|
|
41
|
-
@edits ||= Retab::Edits.new(self)
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
def jobs
|
|
45
|
-
@jobs ||= Retab::Jobs.new(self)
|
|
46
|
-
end
|
|
47
47
|
end
|
|
48
48
|
end
|
|
@@ -29,9 +29,9 @@ module Retab
|
|
|
29
29
|
@instructions = hash[:instructions]
|
|
30
30
|
@document = hash[:document] ? Retab::MimeData.new(hash[:document]) : nil
|
|
31
31
|
@template_id = hash[:template_id]
|
|
32
|
-
@model = hash[:model]
|
|
32
|
+
@model = hash[:model].nil? ? "retab-small" : hash[:model]
|
|
33
33
|
@config = hash[:config] ? Retab::EditConfig.new(hash[:config]) : nil
|
|
34
|
-
@bust_cache = hash[:bust_cache]
|
|
34
|
+
@bust_cache = hash[:bust_cache].nil? ? false : hash[:bust_cache]
|
|
35
35
|
end
|
|
36
36
|
end
|
|
37
37
|
end
|
|
@@ -31,8 +31,8 @@ module Retab
|
|
|
31
31
|
super()
|
|
32
32
|
hash = self.class.normalize(json)
|
|
33
33
|
@run_id = hash[:run_id]
|
|
34
|
-
@kind = hash[:kind]
|
|
35
|
-
@view = hash[:view]
|
|
34
|
+
@kind = hash[:kind].nil? ? "by_document" : hash[:kind]
|
|
35
|
+
@view = hash[:view].nil? ? "by_document" : hash[:view]
|
|
36
36
|
@document = hash[:document] ? Retab::ExperimentMetricDocumentRef.new(hash[:document]) : nil
|
|
37
37
|
@score = hash[:score]
|
|
38
38
|
@prior_score = hash[:prior_score]
|
|
@@ -31,8 +31,8 @@ module Retab
|
|
|
31
31
|
super()
|
|
32
32
|
hash = self.class.normalize(json)
|
|
33
33
|
@run_id = hash[:run_id]
|
|
34
|
-
@kind = hash[:kind]
|
|
35
|
-
@view = hash[:view]
|
|
34
|
+
@kind = hash[:kind].nil? ? "by_target" : hash[:kind]
|
|
35
|
+
@view = hash[:view].nil? ? "by_target" : hash[:view]
|
|
36
36
|
@target = hash[:target]
|
|
37
37
|
@score = hash[:score]
|
|
38
38
|
@prior_score = hash[:prior_score]
|
|
@@ -22,8 +22,8 @@ module Retab
|
|
|
22
22
|
def initialize(json)
|
|
23
23
|
super()
|
|
24
24
|
hash = self.class.normalize(json)
|
|
25
|
-
@kind = hash[:kind]
|
|
26
|
-
@error = hash[:error]
|
|
25
|
+
@kind = hash[:kind].nil? ? "no_metrics" : hash[:kind]
|
|
26
|
+
@error = hash[:error].nil? ? "no_metrics" : hash[:error]
|
|
27
27
|
@experiment_id = hash[:experiment_id]
|
|
28
28
|
@message = hash[:message]
|
|
29
29
|
end
|
|
@@ -28,8 +28,8 @@ module Retab
|
|
|
28
28
|
def initialize(json)
|
|
29
29
|
super()
|
|
30
30
|
hash = self.class.normalize(json)
|
|
31
|
-
@kind = hash[:kind]
|
|
32
|
-
@error = hash[:error]
|
|
31
|
+
@kind = hash[:kind].nil? ? "stale_metrics" : hash[:kind]
|
|
32
|
+
@error = hash[:error].nil? ? "stale_metrics" : hash[:error]
|
|
33
33
|
@experiment_id = hash[:experiment_id]
|
|
34
34
|
@stale_reasons = (hash[:stale_reasons] || [])
|
|
35
35
|
@last_run = hash[:last_run] ? Retab::MetricsStaleErrorLastRun.new(hash[:last_run]) : nil
|
|
@@ -38,8 +38,8 @@ module Retab
|
|
|
38
38
|
hash = self.class.normalize(json)
|
|
39
39
|
@experiment_id = hash[:experiment_id]
|
|
40
40
|
@run_id = hash[:run_id]
|
|
41
|
-
@kind = hash[:kind]
|
|
42
|
-
@view = hash[:view]
|
|
41
|
+
@kind = hash[:kind].nil? ? "summary" : hash[:kind]
|
|
42
|
+
@view = hash[:view].nil? ? "summary" : hash[:view]
|
|
43
43
|
@definition_fingerprint = hash[:definition_fingerprint]
|
|
44
44
|
@block_type = hash[:block_type]
|
|
45
45
|
@score = hash[:score]
|
|
@@ -31,8 +31,8 @@ module Retab
|
|
|
31
31
|
super()
|
|
32
32
|
hash = self.class.normalize(json)
|
|
33
33
|
@run_id = hash[:run_id]
|
|
34
|
-
@kind = hash[:kind]
|
|
35
|
-
@view = hash[:view]
|
|
34
|
+
@kind = hash[:kind].nil? ? "votes" : hash[:kind]
|
|
35
|
+
@view = hash[:view].nil? ? "votes" : hash[:view]
|
|
36
36
|
@document = hash[:document] ? Retab::ExperimentVotesMetricDocument.new(hash[:document]) : nil
|
|
37
37
|
@target = hash[:target]
|
|
38
38
|
@score = hash[:score]
|
|
@@ -20,8 +20,8 @@ module Retab
|
|
|
20
20
|
def initialize(json)
|
|
21
21
|
super()
|
|
22
22
|
hash = self.class.normalize(json)
|
|
23
|
-
@status = hash[:status]
|
|
24
|
-
@message = hash[:message]
|
|
23
|
+
@status = hash[:status].nil? ? "error" : hash[:status]
|
|
24
|
+
@message = hash[:message].nil? ? "(no message)" : hash[:message]
|
|
25
25
|
@details = hash[:details] ? Retab::ErrorDetails.new(hash[:details]) : nil
|
|
26
26
|
end
|
|
27
27
|
end
|
|
@@ -15,8 +15,7 @@ module Retab
|
|
|
15
15
|
block_type: :block_type,
|
|
16
16
|
handle_inputs: :handle_inputs,
|
|
17
17
|
artifact: :artifact,
|
|
18
|
-
attempt: :attempt
|
|
19
|
-
is_placeholder: :is_placeholder
|
|
18
|
+
attempt: :attempt
|
|
20
19
|
}.freeze
|
|
21
20
|
|
|
22
21
|
attr_accessor(
|
|
@@ -29,8 +28,7 @@ module Retab
|
|
|
29
28
|
:block_type,
|
|
30
29
|
:handle_inputs,
|
|
31
30
|
:artifact,
|
|
32
|
-
:attempt
|
|
33
|
-
:is_placeholder
|
|
31
|
+
:attempt
|
|
34
32
|
)
|
|
35
33
|
|
|
36
34
|
def initialize(json)
|
|
@@ -63,7 +61,6 @@ module Retab
|
|
|
63
61
|
@handle_inputs = hash[:handle_inputs] || {}
|
|
64
62
|
@artifact = hash[:artifact] ? Retab::StepArtifactRef.new(hash[:artifact]) : nil
|
|
65
63
|
@attempt = hash[:attempt]
|
|
66
|
-
@is_placeholder = hash[:is_placeholder]
|
|
67
64
|
end
|
|
68
65
|
end
|
|
69
66
|
end
|
|
@@ -7,7 +7,8 @@ module Retab
|
|
|
7
7
|
|
|
8
8
|
HASH_ATTRS = {
|
|
9
9
|
id: :id,
|
|
10
|
-
|
|
10
|
+
workflow_id: :workflow_id,
|
|
11
|
+
workflow_version_id: :workflow_version_id,
|
|
11
12
|
trigger: :trigger,
|
|
12
13
|
experiment_id: :experiment_id,
|
|
13
14
|
block_id: :block_id,
|
|
@@ -27,7 +28,8 @@ module Retab
|
|
|
27
28
|
|
|
28
29
|
attr_accessor(
|
|
29
30
|
:id,
|
|
30
|
-
:
|
|
31
|
+
:workflow_id,
|
|
32
|
+
:workflow_version_id,
|
|
31
33
|
:trigger,
|
|
32
34
|
:experiment_id,
|
|
33
35
|
:block_id,
|
|
@@ -49,7 +51,8 @@ module Retab
|
|
|
49
51
|
super()
|
|
50
52
|
hash = self.class.normalize(json)
|
|
51
53
|
@id = hash[:id]
|
|
52
|
-
@
|
|
54
|
+
@workflow_id = hash[:workflow_id]
|
|
55
|
+
@workflow_version_id = hash[:workflow_version_id]
|
|
53
56
|
@trigger = hash[:trigger] ? Retab::ExperimentRunTrigger.new(hash[:trigger]) : nil
|
|
54
57
|
@experiment_id = hash[:experiment_id]
|
|
55
58
|
@block_id = hash[:block_id]
|
|
@@ -15,10 +15,8 @@ module Retab
|
|
|
15
15
|
# @param experiment_id [String, nil]
|
|
16
16
|
# @param block_id [String, nil]
|
|
17
17
|
# @param status [Retab::Types::WorkflowExperimentsStatus, nil]
|
|
18
|
-
# @param statuses [String, nil]
|
|
19
18
|
# @param exclude_status [Retab::Types::WorkflowExperimentsExcludeStatus, nil]
|
|
20
19
|
# @param trigger_type [String, nil]
|
|
21
|
-
# @param trigger_types [String, nil]
|
|
22
20
|
# @param from_date [String, nil]
|
|
23
21
|
# @param to_date [String, nil]
|
|
24
22
|
# @param sort_by [String, nil]
|
|
@@ -33,10 +31,8 @@ module Retab
|
|
|
33
31
|
experiment_id: nil,
|
|
34
32
|
block_id: nil,
|
|
35
33
|
status: nil,
|
|
36
|
-
statuses: nil,
|
|
37
34
|
exclude_status: nil,
|
|
38
35
|
trigger_type: nil,
|
|
39
|
-
trigger_types: nil,
|
|
40
36
|
from_date: nil,
|
|
41
37
|
to_date: nil,
|
|
42
38
|
sort_by: "created_at",
|
|
@@ -51,10 +47,8 @@ module Retab
|
|
|
51
47
|
"experiment_id" => experiment_id,
|
|
52
48
|
"block_id" => block_id,
|
|
53
49
|
"status" => status,
|
|
54
|
-
"statuses" => statuses,
|
|
55
50
|
"exclude_status" => exclude_status,
|
|
56
51
|
"trigger_type" => trigger_type,
|
|
57
|
-
"trigger_types" => trigger_types,
|
|
58
52
|
"from_date" => from_date,
|
|
59
53
|
"to_date" => to_date,
|
|
60
54
|
"sort_by" => sort_by,
|
|
@@ -76,10 +70,8 @@ module Retab
|
|
|
76
70
|
experiment_id: experiment_id,
|
|
77
71
|
block_id: block_id,
|
|
78
72
|
status: status,
|
|
79
|
-
statuses: statuses,
|
|
80
73
|
exclude_status: exclude_status,
|
|
81
74
|
trigger_type: trigger_type,
|
|
82
|
-
trigger_types: trigger_types,
|
|
83
75
|
from_date: from_date,
|
|
84
76
|
to_date: to_date,
|
|
85
77
|
sort_by: sort_by,
|
|
@@ -98,10 +90,8 @@ module Retab
|
|
|
98
90
|
experiment_id: experiment_id,
|
|
99
91
|
block_id: block_id,
|
|
100
92
|
status: status,
|
|
101
|
-
statuses: statuses,
|
|
102
93
|
exclude_status: exclude_status,
|
|
103
94
|
trigger_type: trigger_type,
|
|
104
|
-
trigger_types: trigger_types,
|
|
105
95
|
from_date: from_date,
|
|
106
96
|
to_date: to_date,
|
|
107
97
|
sort_by: sort_by,
|
|
@@ -38,14 +38,14 @@ module Retab
|
|
|
38
38
|
hash = self.class.normalize(json)
|
|
39
39
|
@document = hash[:document] ? Retab::MimeData.new(hash[:document]) : nil
|
|
40
40
|
@json_schema = hash[:json_schema] || {}
|
|
41
|
-
@model = hash[:model]
|
|
41
|
+
@model = hash[:model].nil? ? "retab-small" : hash[:model]
|
|
42
42
|
@image_resolution_dpi = hash[:image_resolution_dpi]
|
|
43
43
|
@instructions = hash[:instructions]
|
|
44
44
|
@n_consensus = hash[:n_consensus]
|
|
45
45
|
@metadata = hash[:metadata] || {}
|
|
46
46
|
@additional_messages = (hash[:additional_messages] || []).map { |item| item || {} }
|
|
47
|
-
@bust_cache = hash[:bust_cache]
|
|
48
|
-
@stream = hash[:stream]
|
|
47
|
+
@bust_cache = hash[:bust_cache].nil? ? false : hash[:bust_cache]
|
|
48
|
+
@stream = hash[:stream].nil? ? false : hash[:stream]
|
|
49
49
|
@chunking_keys = hash[:chunking_keys] || {}
|
|
50
50
|
end
|
|
51
51
|
end
|
|
@@ -26,7 +26,7 @@ module Retab
|
|
|
26
26
|
def initialize(json)
|
|
27
27
|
super()
|
|
28
28
|
hash = self.class.normalize(json)
|
|
29
|
-
@object = hash[:object]
|
|
29
|
+
@object = hash[:object].nil? ? "extraction.sources" : hash[:object]
|
|
30
30
|
@extraction_id = hash[:extraction_id]
|
|
31
31
|
@document_type = hash[:document_type]
|
|
32
32
|
@file = hash[:file] ? Retab::FileRef.new(hash[:file]) : nil
|
data/lib/retab/extractions.rb
CHANGED
|
@@ -17,7 +17,7 @@ module Retab
|
|
|
17
17
|
# @param order [Retab::Types::ExtractionsOrder, nil]
|
|
18
18
|
# @param filename [String, nil]
|
|
19
19
|
# @param filename_regex [String, nil] Deprecated alias for prefix filename filtering. Regex patterns are rejected.
|
|
20
|
-
# @param filename_contains [String, nil] Plain
|
|
20
|
+
# @param filename_contains [String, nil] Plain-text search over the filename.
|
|
21
21
|
# @param document_type [Array<String>, nil] Filter by document type. Can be repeated. Accepted values: bmp, csv, doc, docm, docx, dotm, dotx, eml, gif, heic, heif, htm, html, jpeg, jpg, json, md, mhtml, msg, odp, ods, odt, ots, ott, pdf, png, ppt, pptx, rtf, svg, tif, tiff, tsv, txt, webp, xlam, xls, xlsb, xlsm, xlsx, xltm, xltx, xml, yaml, yml.
|
|
22
22
|
# @param from_date [String, nil]
|
|
23
23
|
# @param to_date [String, nil]
|
|
@@ -28,7 +28,7 @@ module Retab
|
|
|
28
28
|
hash = self.class.normalize(json)
|
|
29
29
|
@file_id = hash[:fileId]
|
|
30
30
|
@upload_url = hash[:uploadUrl]
|
|
31
|
-
@upload_method = hash[:uploadMethod]
|
|
31
|
+
@upload_method = hash[:uploadMethod].nil? ? "PUT" : hash[:uploadMethod]
|
|
32
32
|
@upload_headers = hash[:uploadHeaders] || {}
|
|
33
33
|
@mime_data = hash[:mimeData] ? Retab::MimeData.new(hash[:mimeData]) : nil
|
|
34
34
|
@expires_at = hash[:expiresAt]
|
data/lib/retab/files/file.rb
CHANGED
data/lib/retab/files.rb
CHANGED
|
@@ -10,71 +10,6 @@ module Retab
|
|
|
10
10
|
@client = client
|
|
11
11
|
end
|
|
12
12
|
|
|
13
|
-
# Upload File
|
|
14
|
-
# @param filename [String] Filename to store
|
|
15
|
-
# @param content_type [String, nil] MIME type the client will upload
|
|
16
|
-
# @param size_bytes [Integer] Expected upload size in bytes
|
|
17
|
-
# @param sha_256 [String, nil] Optional SHA-256 checksum
|
|
18
|
-
# @param request_options [Hash] (see Retab::Types::RequestOptions)
|
|
19
|
-
# @return [Retab::CreateUploadResponse]
|
|
20
|
-
def create_upload(
|
|
21
|
-
filename:,
|
|
22
|
-
size_bytes:,
|
|
23
|
-
content_type: nil,
|
|
24
|
-
sha_256: nil,
|
|
25
|
-
request_options: {}
|
|
26
|
-
)
|
|
27
|
-
body = {
|
|
28
|
-
"filename" => filename,
|
|
29
|
-
"content_type" => content_type,
|
|
30
|
-
"size_bytes" => size_bytes,
|
|
31
|
-
"sha256" => sha_256
|
|
32
|
-
}.compact
|
|
33
|
-
response = @client.request(
|
|
34
|
-
method: :post,
|
|
35
|
-
path: "/v1/files/upload",
|
|
36
|
-
auth: true,
|
|
37
|
-
body: body,
|
|
38
|
-
request_options: request_options
|
|
39
|
-
)
|
|
40
|
-
result = Retab::CreateUploadResponse.new(response.body)
|
|
41
|
-
result.last_response = Retab::Types::ApiResponse.new(
|
|
42
|
-
http_status: response.code.to_i,
|
|
43
|
-
http_headers: response.each_header.to_h,
|
|
44
|
-
request_id: response["x-request-id"]
|
|
45
|
-
)
|
|
46
|
-
result
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
# Complete Upload File
|
|
50
|
-
# @param file_id [String]
|
|
51
|
-
# @param sha_256 [String, nil] Optional SHA-256 checksum
|
|
52
|
-
# @param request_options [Hash] (see Retab::Types::RequestOptions)
|
|
53
|
-
# @return [Retab::MimeData]
|
|
54
|
-
def complete_upload(
|
|
55
|
-
file_id:,
|
|
56
|
-
sha_256: nil,
|
|
57
|
-
request_options: {}
|
|
58
|
-
)
|
|
59
|
-
body = {
|
|
60
|
-
"sha256" => sha_256
|
|
61
|
-
}.compact
|
|
62
|
-
response = @client.request(
|
|
63
|
-
method: :post,
|
|
64
|
-
path: "/v1/files/upload/#{Retab::Util.encode_path(file_id)}/complete",
|
|
65
|
-
auth: true,
|
|
66
|
-
body: body,
|
|
67
|
-
request_options: request_options
|
|
68
|
-
)
|
|
69
|
-
result = Retab::MimeData.new(response.body)
|
|
70
|
-
result.last_response = Retab::Types::ApiResponse.new(
|
|
71
|
-
http_status: response.code.to_i,
|
|
72
|
-
http_headers: response.each_header.to_h,
|
|
73
|
-
request_id: response["x-request-id"]
|
|
74
|
-
)
|
|
75
|
-
result
|
|
76
|
-
end
|
|
77
|
-
|
|
78
13
|
# List Files
|
|
79
14
|
# @param before [String, nil]
|
|
80
15
|
# @param after [String, nil]
|
|
@@ -153,6 +88,71 @@ module Retab
|
|
|
153
88
|
)
|
|
154
89
|
end
|
|
155
90
|
|
|
91
|
+
# Upload File
|
|
92
|
+
# @param filename [String] Filename to store
|
|
93
|
+
# @param content_type [String, nil] MIME type the client will upload
|
|
94
|
+
# @param size_bytes [Integer] Expected upload size in bytes
|
|
95
|
+
# @param sha_256 [String, nil] Optional SHA-256 checksum
|
|
96
|
+
# @param request_options [Hash] (see Retab::Types::RequestOptions)
|
|
97
|
+
# @return [Retab::CreateUploadResponse]
|
|
98
|
+
def create_upload(
|
|
99
|
+
filename:,
|
|
100
|
+
size_bytes:,
|
|
101
|
+
content_type: nil,
|
|
102
|
+
sha_256: nil,
|
|
103
|
+
request_options: {}
|
|
104
|
+
)
|
|
105
|
+
body = {
|
|
106
|
+
"filename" => filename,
|
|
107
|
+
"content_type" => content_type,
|
|
108
|
+
"size_bytes" => size_bytes,
|
|
109
|
+
"sha256" => sha_256
|
|
110
|
+
}.compact
|
|
111
|
+
response = @client.request(
|
|
112
|
+
method: :post,
|
|
113
|
+
path: "/v1/files/upload",
|
|
114
|
+
auth: true,
|
|
115
|
+
body: body,
|
|
116
|
+
request_options: request_options
|
|
117
|
+
)
|
|
118
|
+
result = Retab::CreateUploadResponse.new(response.body)
|
|
119
|
+
result.last_response = Retab::Types::ApiResponse.new(
|
|
120
|
+
http_status: response.code.to_i,
|
|
121
|
+
http_headers: response.each_header.to_h,
|
|
122
|
+
request_id: response["x-request-id"]
|
|
123
|
+
)
|
|
124
|
+
result
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
# Complete Upload File
|
|
128
|
+
# @param file_id [String]
|
|
129
|
+
# @param sha_256 [String, nil] Optional SHA-256 checksum
|
|
130
|
+
# @param request_options [Hash] (see Retab::Types::RequestOptions)
|
|
131
|
+
# @return [Retab::MimeData]
|
|
132
|
+
def complete_upload(
|
|
133
|
+
file_id:,
|
|
134
|
+
sha_256: nil,
|
|
135
|
+
request_options: {}
|
|
136
|
+
)
|
|
137
|
+
body = {
|
|
138
|
+
"sha256" => sha_256
|
|
139
|
+
}.compact
|
|
140
|
+
response = @client.request(
|
|
141
|
+
method: :post,
|
|
142
|
+
path: "/v1/files/upload/#{Retab::Util.encode_path(file_id)}/complete",
|
|
143
|
+
auth: true,
|
|
144
|
+
body: body,
|
|
145
|
+
request_options: request_options
|
|
146
|
+
)
|
|
147
|
+
result = Retab::MimeData.new(response.body)
|
|
148
|
+
result.last_response = Retab::Types::ApiResponse.new(
|
|
149
|
+
http_status: response.code.to_i,
|
|
150
|
+
http_headers: response.each_header.to_h,
|
|
151
|
+
request_id: response["x-request-id"]
|
|
152
|
+
)
|
|
153
|
+
result
|
|
154
|
+
end
|
|
155
|
+
|
|
156
156
|
# Get File
|
|
157
157
|
# @param file_id [String]
|
|
158
158
|
# @param request_options [Hash] (see Retab::Types::RequestOptions)
|
data/lib/retab/jobs/job.rb
CHANGED
|
@@ -49,8 +49,8 @@ module Retab
|
|
|
49
49
|
super()
|
|
50
50
|
hash = self.class.normalize(json)
|
|
51
51
|
@id = hash[:id]
|
|
52
|
-
@object = hash[:object]
|
|
53
|
-
@status = hash[:status]
|
|
52
|
+
@object = hash[:object].nil? ? "job" : hash[:object]
|
|
53
|
+
@status = hash[:status].nil? ? "validating" : hash[:status]
|
|
54
54
|
@endpoint = hash[:endpoint]
|
|
55
55
|
@error = hash[:error] ? Retab::JobError.new(hash[:error]) : nil
|
|
56
56
|
@warnings = (hash[:warnings] || []).map { |item| item ? Retab::JobWarning.new(item) : nil }
|
|
@@ -59,7 +59,7 @@ module Retab
|
|
|
59
59
|
@completed_at = hash[:completed_at]
|
|
60
60
|
@expires_at = hash[:expires_at]
|
|
61
61
|
@metadata = hash[:metadata] || {}
|
|
62
|
-
@cancelled = hash[:cancelled]
|
|
62
|
+
@cancelled = hash[:cancelled].nil? ? false : hash[:cancelled]
|
|
63
63
|
@attempt_count = hash[:attempt_count]
|
|
64
64
|
@last_attempt_at = hash[:last_attempt_at]
|
|
65
65
|
@last_failure_code = hash[:last_failure_code]
|
|
@@ -27,11 +27,11 @@ module Retab
|
|
|
27
27
|
super()
|
|
28
28
|
hash = self.class.normalize(json)
|
|
29
29
|
@document = hash[:document] ? Retab::MimeData.new(hash[:document]) : nil
|
|
30
|
-
@model = hash[:model]
|
|
31
|
-
@table_parsing_format = hash[:table_parsing_format]
|
|
30
|
+
@model = hash[:model].nil? ? "retab-small" : hash[:model]
|
|
31
|
+
@table_parsing_format = hash[:table_parsing_format].nil? ? "html" : hash[:table_parsing_format]
|
|
32
32
|
@image_resolution_dpi = hash[:image_resolution_dpi]
|
|
33
33
|
@instructions = hash[:instructions]
|
|
34
|
-
@bust_cache = hash[:bust_cache]
|
|
34
|
+
@bust_cache = hash[:bust_cache].nil? ? false : hash[:bust_cache]
|
|
35
35
|
end
|
|
36
36
|
end
|
|
37
37
|
end
|
|
@@ -42,7 +42,7 @@ module Retab
|
|
|
42
42
|
@key = hash[:key]
|
|
43
43
|
@instructions = hash[:instructions]
|
|
44
44
|
@n_consensus = hash[:n_consensus]
|
|
45
|
-
@allow_overlap = hash[:allow_overlap]
|
|
45
|
+
@allow_overlap = hash[:allow_overlap].nil? ? true : hash[:allow_overlap]
|
|
46
46
|
@output = (hash[:output] || []).map { |item| item ? Retab::PartitionChunk.new(item) : nil }
|
|
47
47
|
@consensus = hash[:consensus] ? Retab::PartitionConsensus.new(hash[:consensus]) : nil
|
|
48
48
|
@usage = hash[:usage] ? Retab::RetabUsage.new(hash[:usage]) : nil
|
|
@@ -31,10 +31,10 @@ module Retab
|
|
|
31
31
|
@document = hash[:document] ? Retab::MimeData.new(hash[:document]) : nil
|
|
32
32
|
@key = hash[:key]
|
|
33
33
|
@instructions = hash[:instructions]
|
|
34
|
-
@model = hash[:model]
|
|
34
|
+
@model = hash[:model].nil? ? "retab-small" : hash[:model]
|
|
35
35
|
@n_consensus = hash[:n_consensus]
|
|
36
|
-
@allow_overlap = hash[:allow_overlap]
|
|
37
|
-
@bust_cache = hash[:bust_cache]
|
|
36
|
+
@allow_overlap = hash[:allow_overlap].nil? ? true : hash[:allow_overlap]
|
|
37
|
+
@bust_cache = hash[:bust_cache].nil? ? false : hash[:bust_cache]
|
|
38
38
|
end
|
|
39
39
|
end
|
|
40
40
|
end
|
|
@@ -8,7 +8,6 @@ module Retab
|
|
|
8
8
|
HASH_ATTRS = {
|
|
9
9
|
documents: :documents,
|
|
10
10
|
model: :model,
|
|
11
|
-
reasoning_effort: :reasoning_effort,
|
|
12
11
|
instructions: :instructions,
|
|
13
12
|
image_resolution_dpi: :image_resolution_dpi,
|
|
14
13
|
stream: :stream
|
|
@@ -17,7 +16,6 @@ module Retab
|
|
|
17
16
|
attr_accessor(
|
|
18
17
|
:documents,
|
|
19
18
|
:model,
|
|
20
|
-
:reasoning_effort,
|
|
21
19
|
:instructions,
|
|
22
20
|
:image_resolution_dpi,
|
|
23
21
|
:stream
|
|
@@ -27,11 +25,10 @@ module Retab
|
|
|
27
25
|
super()
|
|
28
26
|
hash = self.class.normalize(json)
|
|
29
27
|
@documents = (hash[:documents] || []).map { |item| item ? Retab::MimeData.new(item) : nil }
|
|
30
|
-
@model = hash[:model]
|
|
31
|
-
@reasoning_effort = hash[:reasoning_effort]
|
|
28
|
+
@model = hash[:model].nil? ? "retab-small" : hash[:model]
|
|
32
29
|
@instructions = hash[:instructions]
|
|
33
30
|
@image_resolution_dpi = hash[:image_resolution_dpi]
|
|
34
|
-
@stream = hash[:stream]
|
|
31
|
+
@stream = hash[:stream].nil? ? false : hash[:stream]
|
|
35
32
|
end
|
|
36
33
|
end
|
|
37
34
|
end
|
|
@@ -22,10 +22,10 @@ module Retab
|
|
|
22
22
|
def initialize(json)
|
|
23
23
|
super()
|
|
24
24
|
hash = self.class.normalize(json)
|
|
25
|
-
@object = hash[:object]
|
|
25
|
+
@object = hash[:object].nil? ? "schema" : hash[:object]
|
|
26
26
|
@created_at = hash[:created_at]
|
|
27
27
|
@json_schema = hash[:json_schema] || {}
|
|
28
|
-
@strict = hash[:strict]
|
|
28
|
+
@strict = hash[:strict].nil? ? true : hash[:strict]
|
|
29
29
|
end
|
|
30
30
|
end
|
|
31
31
|
end
|
data/lib/retab/schemas.rb
CHANGED
|
@@ -13,7 +13,6 @@ module Retab
|
|
|
13
13
|
# Generate Schema From Examples
|
|
14
14
|
# @param documents [Array<Retab::MimeData, Pathname, IO, String, Hash>]
|
|
15
15
|
# @param model [String, nil]
|
|
16
|
-
# @param reasoning_effort [Retab::Types::GenerateSchemaRequestReasoningEffort, nil]
|
|
17
16
|
# @param instructions [String, nil]
|
|
18
17
|
# @param image_resolution_dpi [Integer, nil] Resolution of the image sent to the LLM
|
|
19
18
|
# @param stream [Boolean, nil]
|
|
@@ -22,7 +21,6 @@ module Retab
|
|
|
22
21
|
def generate(
|
|
23
22
|
documents:,
|
|
24
23
|
model: nil,
|
|
25
|
-
reasoning_effort: nil,
|
|
26
24
|
instructions: nil,
|
|
27
25
|
image_resolution_dpi: nil,
|
|
28
26
|
stream: nil,
|
|
@@ -32,7 +30,6 @@ module Retab
|
|
|
32
30
|
body = {
|
|
33
31
|
"documents" => documents,
|
|
34
32
|
"model" => model,
|
|
35
|
-
"reasoning_effort" => reasoning_effort,
|
|
36
33
|
"instructions" => instructions,
|
|
37
34
|
"image_resolution_dpi" => image_resolution_dpi,
|
|
38
35
|
"stream" => stream
|
|
@@ -28,10 +28,10 @@ module Retab
|
|
|
28
28
|
hash = self.class.normalize(json)
|
|
29
29
|
@document = hash[:document] ? Retab::MimeData.new(hash[:document]) : nil
|
|
30
30
|
@subdocuments = (hash[:subdocuments] || []).map { |item| item ? Retab::Subdocument.new(item) : nil }
|
|
31
|
-
@model = hash[:model]
|
|
31
|
+
@model = hash[:model].nil? ? "retab-small" : hash[:model]
|
|
32
32
|
@instructions = hash[:instructions]
|
|
33
33
|
@n_consensus = hash[:n_consensus]
|
|
34
|
-
@bust_cache = hash[:bust_cache]
|
|
34
|
+
@bust_cache = hash[:bust_cache].nil? ? false : hash[:bust_cache]
|
|
35
35
|
end
|
|
36
36
|
end
|
|
37
37
|
end
|