retab 0.1.3 → 0.1.5
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.rb +6 -0
- data/lib/retab/classifications/classification_request.rb +7 -4
- data/lib/retab/{jobs/job_error.rb → classifications/primitive_error.rb} +1 -1
- data/lib/retab/classifications.rb +38 -1
- data/lib/retab/client.rb +12 -16
- data/lib/retab/edits/edit.rb +6 -0
- data/lib/retab/{workflow_artifacts → edits}/edit_config.rb +1 -1
- data/lib/retab/edits/edit_request.rb +7 -4
- data/lib/retab/edits.rb +38 -1
- 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.rb +6 -0
- data/lib/retab/extractions/extraction_request.rb +6 -3
- data/lib/retab/extractions/sources_response.rb +1 -1
- data/lib/retab/extractions.rb +38 -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/parses/parse.rb +6 -0
- data/lib/retab/parses/parse_request.rb +8 -5
- data/lib/retab/parses.rb +33 -1
- data/lib/retab/partitions/partition.rb +7 -1
- data/lib/retab/partitions/partition_request.rb +8 -5
- data/lib/retab/partitions.rb +38 -1
- 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.rb +6 -0
- data/lib/retab/splits/split_request.rb +7 -4
- data/lib/retab/splits/subdocument.rb +2 -2
- data/lib/retab/splits.rb +38 -1
- data/lib/retab/types/{job_status.rb → classification_status.rb} +3 -4
- data/lib/retab/types/classification_workflow_artifact_status.rb +9 -0
- data/lib/retab/types/{supported_endpoint.rb → classifications_status.rb} +1 -1
- data/lib/retab/types/{jobs_order.rb → edit_status.rb} +1 -1
- data/lib/retab/types/edit_workflow_artifact_status.rb +9 -0
- data/lib/retab/types/{jobs_status.rb → edits_status.rb} +1 -1
- data/lib/retab/types/{jobs_endpoint.rb → extraction_status.rb} +1 -1
- data/lib/retab/types/extraction_workflow_artifact_status.rb +9 -0
- data/lib/retab/types/extractions_status.rb +9 -0
- data/lib/retab/types/parse_status.rb +9 -0
- data/lib/retab/types/parse_workflow_artifact_status.rb +9 -0
- data/lib/retab/types/partition_status.rb +9 -0
- data/lib/retab/types/partition_workflow_artifact_status.rb +9 -0
- data/lib/retab/types/partitions_status.rb +9 -0
- data/lib/retab/types/split_status.rb +9 -0
- data/lib/retab/types/split_workflow_artifact_status.rb +9 -0
- data/lib/retab/types/splits_status.rb +9 -0
- 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 +7 -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 +7 -1
- data/lib/retab/workflow_artifacts/extraction_workflow_artifact.rb +7 -1
- data/lib/retab/workflow_artifacts/function_invocation.rb +4 -4
- data/lib/retab/workflow_artifacts/parse_workflow_artifact.rb +7 -1
- data/lib/retab/workflow_artifacts/partition_workflow_artifact.rb +8 -2
- data/lib/retab/workflow_artifacts/review_evaluation.rb +6 -6
- data/lib/retab/workflow_artifacts/split_workflow_artifact.rb +7 -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/{jobs/job_warning.rb → workflow_test_run_results/workflow_test_run_timing.rb} +1 -1
- 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/lib/retab.rb +0 -1
- data/rbi/retab/api_call_invocation.rbi +4 -4
- data/rbi/retab/classification.rbi +14 -2
- data/rbi/retab/classification_request.rbi +6 -0
- data/rbi/retab/classification_workflow_artifact.rbi +14 -2
- data/rbi/retab/classifications.rbi +14 -3
- data/rbi/retab/client.rbi +10 -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.rbi +14 -2
- data/rbi/retab/edit_request.rbi +6 -0
- data/rbi/retab/edit_workflow_artifact.rbi +16 -4
- data/rbi/retab/edits.rbi +14 -3
- 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.rbi +12 -0
- data/rbi/retab/extraction_request.rbi +6 -0
- data/rbi/retab/extraction_workflow_artifact.rbi +14 -2
- data/rbi/retab/extractions.rbi +14 -3
- 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/parse.rbi +12 -0
- data/rbi/retab/parse_request.rbi +6 -0
- data/rbi/retab/parse_workflow_artifact.rbi +12 -0
- data/rbi/retab/parses.rbi +12 -2
- data/rbi/retab/partition.rbi +12 -0
- data/rbi/retab/partition_request.rbi +6 -0
- data/rbi/retab/partition_workflow_artifact.rbi +14 -2
- data/rbi/retab/partitions.rbi +14 -3
- data/rbi/retab/{job_warning.rbi → primitive_error.rbi} +1 -1
- 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/split.rbi +14 -2
- data/rbi/retab/split_request.rbi +6 -0
- data/rbi/retab/split_workflow_artifact.rbi +14 -2
- data/rbi/retab/splits.rbi +14 -3
- 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 +45 -57
- data/lib/retab/jobs/create_job_request.rb +0 -28
- data/lib/retab/jobs/job.rb +0 -70
- data/lib/retab/jobs/job_response.rb +0 -25
- data/lib/retab/jobs.rb +0 -252
- data/lib/retab/types/create_job_request_endpoint.rb +0 -34
- data/lib/retab/types/generate_schema_request_reasoning_effort.rb +0 -17
- data/lib/retab/types/jobs_source.rb +0 -14
- 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/create_job_request.rbi +0 -36
- data/rbi/retab/email_trigger.rbi +0 -36
- data/rbi/retab/job.rbi +0 -120
- data/rbi/retab/job_error.rbi +0 -36
- data/rbi/retab/job_response.rbi +0 -30
- data/rbi/retab/jobs.rbi +0 -76
- 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: 892cc7d33cd77ee2992206da231970259f4f0cf3668c762671b114b78116d1ee
|
|
4
|
+
data.tar.gz: 17e6a78b1858ab551518b0b379b92b4d54980e25565ce0d567504b17c2f0294c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 653dc2782eee8ec927931b08da074dff4bceb322e7605a74ba14f2629cc6c9a8dca82c66de8748bc13e72a5cfc38c256b2b147844298b0c82000ccfa84c8d33e
|
|
7
|
+
data.tar.gz: 04d599b812516886ac4b0a2f3336af22d96418a40340da1412b45ed43e2b98733d2cbdbee41e35d70af30b7b4ea38df5c7651ef40ece0fba3a1a065b12d74237
|
|
@@ -13,6 +13,8 @@ module Retab
|
|
|
13
13
|
n_consensus: :n_consensus,
|
|
14
14
|
instructions: :instructions,
|
|
15
15
|
output: :output,
|
|
16
|
+
status: :status,
|
|
17
|
+
error: :error,
|
|
16
18
|
consensus: :consensus,
|
|
17
19
|
usage: :usage,
|
|
18
20
|
created_at: :created_at
|
|
@@ -26,6 +28,8 @@ module Retab
|
|
|
26
28
|
:n_consensus,
|
|
27
29
|
:instructions,
|
|
28
30
|
:output,
|
|
31
|
+
:status,
|
|
32
|
+
:error,
|
|
29
33
|
:consensus,
|
|
30
34
|
:usage,
|
|
31
35
|
:created_at
|
|
@@ -41,6 +45,8 @@ module Retab
|
|
|
41
45
|
@n_consensus = hash[:n_consensus]
|
|
42
46
|
@instructions = hash[:instructions]
|
|
43
47
|
@output = hash[:output] ? Retab::ClassificationDecision.new(hash[:output]) : nil
|
|
48
|
+
@status = hash[:status].nil? ? "pending" : hash[:status]
|
|
49
|
+
@error = hash[:error] ? Retab::PrimitiveError.new(hash[:error]) : nil
|
|
44
50
|
@consensus = hash[:consensus] ? Retab::ClassificationConsensus.new(hash[:consensus]) : nil
|
|
45
51
|
@usage = hash[:usage] ? Retab::RetabUsage.new(hash[:usage]) : nil
|
|
46
52
|
@created_at = hash[:created_at]
|
|
@@ -12,7 +12,8 @@ module Retab
|
|
|
12
12
|
first_n_pages: :first_n_pages,
|
|
13
13
|
instructions: :instructions,
|
|
14
14
|
n_consensus: :n_consensus,
|
|
15
|
-
bust_cache: :bust_cache
|
|
15
|
+
bust_cache: :bust_cache,
|
|
16
|
+
background: :background
|
|
16
17
|
}.freeze
|
|
17
18
|
|
|
18
19
|
attr_accessor(
|
|
@@ -22,7 +23,8 @@ module Retab
|
|
|
22
23
|
:first_n_pages,
|
|
23
24
|
:instructions,
|
|
24
25
|
:n_consensus,
|
|
25
|
-
:bust_cache
|
|
26
|
+
:bust_cache,
|
|
27
|
+
:background
|
|
26
28
|
)
|
|
27
29
|
|
|
28
30
|
def initialize(json)
|
|
@@ -30,11 +32,12 @@ module Retab
|
|
|
30
32
|
hash = self.class.normalize(json)
|
|
31
33
|
@document = hash[:document] ? Retab::MimeData.new(hash[:document]) : nil
|
|
32
34
|
@categories = (hash[:categories] || []).map { |item| item ? Retab::Category.new(item) : nil }
|
|
33
|
-
@model = hash[:model]
|
|
35
|
+
@model = hash[:model].nil? ? "retab-small" : hash[:model]
|
|
34
36
|
@first_n_pages = hash[:first_n_pages]
|
|
35
37
|
@instructions = hash[:instructions]
|
|
36
38
|
@n_consensus = hash[:n_consensus]
|
|
37
|
-
@bust_cache = hash[:bust_cache]
|
|
39
|
+
@bust_cache = hash[:bust_cache].nil? ? false : hash[:bust_cache]
|
|
40
|
+
@background = hash[:background].nil? ? false : hash[:background]
|
|
38
41
|
end
|
|
39
42
|
end
|
|
40
43
|
end
|
|
@@ -16,6 +16,7 @@ module Retab
|
|
|
16
16
|
# @param limit [Integer, nil]
|
|
17
17
|
# @param order [Retab::Types::ClassificationsOrder, nil]
|
|
18
18
|
# @param filename [String, nil]
|
|
19
|
+
# @param status [Retab::Types::ClassificationsStatus, nil]
|
|
19
20
|
# @param from_date [String, nil]
|
|
20
21
|
# @param to_date [String, nil]
|
|
21
22
|
# @param request_options [Hash] (see Retab::Types::RequestOptions)
|
|
@@ -26,6 +27,7 @@ module Retab
|
|
|
26
27
|
limit: 10,
|
|
27
28
|
order: "desc",
|
|
28
29
|
filename: nil,
|
|
30
|
+
status: nil,
|
|
29
31
|
from_date: nil,
|
|
30
32
|
to_date: nil,
|
|
31
33
|
request_options: {}
|
|
@@ -36,6 +38,7 @@ module Retab
|
|
|
36
38
|
"limit" => limit,
|
|
37
39
|
"order" => order,
|
|
38
40
|
"filename" => filename,
|
|
41
|
+
"status" => status,
|
|
39
42
|
"from_date" => from_date,
|
|
40
43
|
"to_date" => to_date
|
|
41
44
|
}.compact
|
|
@@ -53,6 +56,7 @@ module Retab
|
|
|
53
56
|
limit: limit,
|
|
54
57
|
order: order,
|
|
55
58
|
filename: filename,
|
|
59
|
+
status: status,
|
|
56
60
|
from_date: from_date,
|
|
57
61
|
to_date: to_date,
|
|
58
62
|
request_options: request_options
|
|
@@ -66,6 +70,7 @@ module Retab
|
|
|
66
70
|
limit: limit,
|
|
67
71
|
order: order,
|
|
68
72
|
filename: filename,
|
|
73
|
+
status: status,
|
|
69
74
|
from_date: from_date,
|
|
70
75
|
to_date: to_date
|
|
71
76
|
},
|
|
@@ -81,6 +86,7 @@ module Retab
|
|
|
81
86
|
# @param instructions [String, nil] Free-form instructions appended to the system prompt to steer the classification.
|
|
82
87
|
# @param n_consensus [Integer, nil] Number of classification runs to use for consensus voting. Uses deterministic single-pass when set to 1.
|
|
83
88
|
# @param bust_cache [Boolean, nil] If true, skip the LLM cache and force a fresh completion
|
|
89
|
+
# @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.
|
|
84
90
|
# @param request_options [Hash] (see Retab::Types::RequestOptions)
|
|
85
91
|
# @return [Retab::Classification]
|
|
86
92
|
def create(
|
|
@@ -91,6 +97,7 @@ module Retab
|
|
|
91
97
|
instructions: nil,
|
|
92
98
|
n_consensus: nil,
|
|
93
99
|
bust_cache: nil,
|
|
100
|
+
background: nil,
|
|
94
101
|
request_options: {}
|
|
95
102
|
)
|
|
96
103
|
document = Retab::MimeData.coerce(document) unless document.nil?
|
|
@@ -101,7 +108,8 @@ module Retab
|
|
|
101
108
|
"first_n_pages" => first_n_pages,
|
|
102
109
|
"instructions" => instructions,
|
|
103
110
|
"n_consensus" => n_consensus,
|
|
104
|
-
"bust_cache" => bust_cache
|
|
111
|
+
"bust_cache" => bust_cache,
|
|
112
|
+
"background" => background
|
|
105
113
|
}.compact
|
|
106
114
|
response = @client.request(
|
|
107
115
|
method: :post,
|
|
@@ -121,16 +129,22 @@ module Retab
|
|
|
121
129
|
|
|
122
130
|
# Get Classification
|
|
123
131
|
# @param classification_id [String]
|
|
132
|
+
# @param include_output [Boolean, nil] When false, returns a cheap status-only projection (no output), served from cache for in-flight background runs.
|
|
124
133
|
# @param request_options [Hash] (see Retab::Types::RequestOptions)
|
|
125
134
|
# @return [Retab::Classification]
|
|
126
135
|
def get(
|
|
127
136
|
classification_id:,
|
|
137
|
+
include_output: true,
|
|
128
138
|
request_options: {}
|
|
129
139
|
)
|
|
140
|
+
params = {
|
|
141
|
+
"include_output" => include_output
|
|
142
|
+
}.compact
|
|
130
143
|
response = @client.request(
|
|
131
144
|
method: :get,
|
|
132
145
|
path: "/v1/classifications/#{Retab::Util.encode_path(classification_id)}",
|
|
133
146
|
auth: true,
|
|
147
|
+
params: params,
|
|
134
148
|
request_options: request_options
|
|
135
149
|
)
|
|
136
150
|
result = Retab::Classification.new(response.body)
|
|
@@ -158,5 +172,28 @@ module Retab
|
|
|
158
172
|
)
|
|
159
173
|
nil
|
|
160
174
|
end
|
|
175
|
+
|
|
176
|
+
# Cancel Classification
|
|
177
|
+
# @param classification_id [String]
|
|
178
|
+
# @param request_options [Hash] (see Retab::Types::RequestOptions)
|
|
179
|
+
# @return [Retab::Classification]
|
|
180
|
+
def create_classification_cancel(
|
|
181
|
+
classification_id:,
|
|
182
|
+
request_options: {}
|
|
183
|
+
)
|
|
184
|
+
response = @client.request(
|
|
185
|
+
method: :post,
|
|
186
|
+
path: "/v1/classifications/#{Retab::Util.encode_path(classification_id)}/cancel",
|
|
187
|
+
auth: true,
|
|
188
|
+
request_options: request_options
|
|
189
|
+
)
|
|
190
|
+
result = Retab::Classification.new(response.body)
|
|
191
|
+
result.last_response = Retab::Types::ApiResponse.new(
|
|
192
|
+
http_status: response.code.to_i,
|
|
193
|
+
http_headers: response.each_header.to_h,
|
|
194
|
+
request_id: response["x-request-id"]
|
|
195
|
+
)
|
|
196
|
+
result
|
|
197
|
+
end
|
|
161
198
|
end
|
|
162
199
|
end
|
data/lib/retab/client.rb
CHANGED
|
@@ -5,16 +5,20 @@
|
|
|
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)
|
|
18
22
|
end
|
|
19
23
|
|
|
20
24
|
def parses
|
|
@@ -25,24 +29,16 @@ module Retab
|
|
|
25
29
|
@partitions ||= Retab::Partitions.new(self)
|
|
26
30
|
end
|
|
27
31
|
|
|
28
|
-
def
|
|
29
|
-
@
|
|
32
|
+
def schemas
|
|
33
|
+
@schemas ||= Retab::Schemas.new(self)
|
|
30
34
|
end
|
|
31
35
|
|
|
32
|
-
def
|
|
33
|
-
@
|
|
36
|
+
def splits
|
|
37
|
+
@splits ||= Retab::Splits.new(self)
|
|
34
38
|
end
|
|
35
39
|
|
|
36
40
|
def workflows
|
|
37
41
|
@workflows ||= Retab::Workflows.new(self)
|
|
38
42
|
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
43
|
end
|
|
48
44
|
end
|
data/lib/retab/edits/edit.rb
CHANGED
|
@@ -13,6 +13,8 @@ module Retab
|
|
|
13
13
|
config: :config,
|
|
14
14
|
template_id: :template_id,
|
|
15
15
|
output: :output,
|
|
16
|
+
status: :status,
|
|
17
|
+
error: :error,
|
|
16
18
|
filled_document_ref: :filled_document_ref,
|
|
17
19
|
usage: :usage,
|
|
18
20
|
created_at: :created_at
|
|
@@ -26,6 +28,8 @@ module Retab
|
|
|
26
28
|
:config,
|
|
27
29
|
:template_id,
|
|
28
30
|
:output,
|
|
31
|
+
:status,
|
|
32
|
+
:error,
|
|
29
33
|
:filled_document_ref,
|
|
30
34
|
:usage,
|
|
31
35
|
:created_at
|
|
@@ -41,6 +45,8 @@ module Retab
|
|
|
41
45
|
@config = hash[:config] ? Retab::EditConfig.new(hash[:config]) : nil
|
|
42
46
|
@template_id = hash[:template_id]
|
|
43
47
|
@output = hash[:output] ? Retab::EditResult.new(hash[:output]) : nil
|
|
48
|
+
@status = hash[:status].nil? ? "pending" : hash[:status]
|
|
49
|
+
@error = hash[:error] ? Retab::PrimitiveError.new(hash[:error]) : nil
|
|
44
50
|
@filled_document_ref = hash[:filled_document_ref] ? Retab::FileRef.new(hash[:filled_document_ref]) : nil
|
|
45
51
|
@usage = hash[:usage] ? Retab::RetabUsage.new(hash[:usage]) : nil
|
|
46
52
|
@created_at = hash[:created_at]
|
|
@@ -11,7 +11,8 @@ module Retab
|
|
|
11
11
|
template_id: :template_id,
|
|
12
12
|
model: :model,
|
|
13
13
|
config: :config,
|
|
14
|
-
bust_cache: :bust_cache
|
|
14
|
+
bust_cache: :bust_cache,
|
|
15
|
+
background: :background
|
|
15
16
|
}.freeze
|
|
16
17
|
|
|
17
18
|
attr_accessor(
|
|
@@ -20,7 +21,8 @@ module Retab
|
|
|
20
21
|
:template_id,
|
|
21
22
|
:model,
|
|
22
23
|
:config,
|
|
23
|
-
:bust_cache
|
|
24
|
+
:bust_cache,
|
|
25
|
+
:background
|
|
24
26
|
)
|
|
25
27
|
|
|
26
28
|
def initialize(json)
|
|
@@ -29,9 +31,10 @@ module Retab
|
|
|
29
31
|
@instructions = hash[:instructions]
|
|
30
32
|
@document = hash[:document] ? Retab::MimeData.new(hash[:document]) : nil
|
|
31
33
|
@template_id = hash[:template_id]
|
|
32
|
-
@model = hash[:model]
|
|
34
|
+
@model = hash[:model].nil? ? "retab-small" : hash[:model]
|
|
33
35
|
@config = hash[:config] ? Retab::EditConfig.new(hash[:config]) : nil
|
|
34
|
-
@bust_cache = hash[:bust_cache]
|
|
36
|
+
@bust_cache = hash[:bust_cache].nil? ? false : hash[:bust_cache]
|
|
37
|
+
@background = hash[:background].nil? ? false : hash[:background]
|
|
35
38
|
end
|
|
36
39
|
end
|
|
37
40
|
end
|
data/lib/retab/edits.rb
CHANGED
|
@@ -21,6 +21,7 @@ module Retab
|
|
|
21
21
|
# @param order [Retab::Types::EditsOrder, nil]
|
|
22
22
|
# @param filename [String, nil]
|
|
23
23
|
# @param template_id [String, nil]
|
|
24
|
+
# @param status [Retab::Types::EditsStatus, nil]
|
|
24
25
|
# @param from_date [String, nil]
|
|
25
26
|
# @param to_date [String, nil]
|
|
26
27
|
# @param request_options [Hash] (see Retab::Types::RequestOptions)
|
|
@@ -32,6 +33,7 @@ module Retab
|
|
|
32
33
|
order: "desc",
|
|
33
34
|
filename: nil,
|
|
34
35
|
template_id: nil,
|
|
36
|
+
status: nil,
|
|
35
37
|
from_date: nil,
|
|
36
38
|
to_date: nil,
|
|
37
39
|
request_options: {}
|
|
@@ -43,6 +45,7 @@ module Retab
|
|
|
43
45
|
"order" => order,
|
|
44
46
|
"filename" => filename,
|
|
45
47
|
"template_id" => template_id,
|
|
48
|
+
"status" => status,
|
|
46
49
|
"from_date" => from_date,
|
|
47
50
|
"to_date" => to_date
|
|
48
51
|
}.compact
|
|
@@ -61,6 +64,7 @@ module Retab
|
|
|
61
64
|
order: order,
|
|
62
65
|
filename: filename,
|
|
63
66
|
template_id: template_id,
|
|
67
|
+
status: status,
|
|
64
68
|
from_date: from_date,
|
|
65
69
|
to_date: to_date,
|
|
66
70
|
request_options: request_options
|
|
@@ -75,6 +79,7 @@ module Retab
|
|
|
75
79
|
order: order,
|
|
76
80
|
filename: filename,
|
|
77
81
|
template_id: template_id,
|
|
82
|
+
status: status,
|
|
78
83
|
from_date: from_date,
|
|
79
84
|
to_date: to_date
|
|
80
85
|
},
|
|
@@ -89,6 +94,7 @@ module Retab
|
|
|
89
94
|
# @param model [String, nil] The model to use for edit inference.
|
|
90
95
|
# @param config [Retab::EditConfig, nil] Edit configuration (rendering options).
|
|
91
96
|
# @param bust_cache [Boolean, nil] If true, skip the LLM cache and force a fresh completion.
|
|
97
|
+
# @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.
|
|
92
98
|
# @param request_options [Hash] (see Retab::Types::RequestOptions)
|
|
93
99
|
# @return [Retab::Edit]
|
|
94
100
|
def create(
|
|
@@ -98,6 +104,7 @@ module Retab
|
|
|
98
104
|
model: nil,
|
|
99
105
|
config: nil,
|
|
100
106
|
bust_cache: nil,
|
|
107
|
+
background: nil,
|
|
101
108
|
request_options: {}
|
|
102
109
|
)
|
|
103
110
|
document = Retab::MimeData.coerce(document) unless document.nil?
|
|
@@ -107,7 +114,8 @@ module Retab
|
|
|
107
114
|
"template_id" => template_id,
|
|
108
115
|
"model" => model,
|
|
109
116
|
"config" => config,
|
|
110
|
-
"bust_cache" => bust_cache
|
|
117
|
+
"bust_cache" => bust_cache,
|
|
118
|
+
"background" => background
|
|
111
119
|
}.compact
|
|
112
120
|
response = @client.request(
|
|
113
121
|
method: :post,
|
|
@@ -127,16 +135,22 @@ module Retab
|
|
|
127
135
|
|
|
128
136
|
# Get Edit
|
|
129
137
|
# @param edit_id [String]
|
|
138
|
+
# @param include_output [Boolean, nil] When false, returns a cheap status-only projection (no output), served from cache for in-flight background runs.
|
|
130
139
|
# @param request_options [Hash] (see Retab::Types::RequestOptions)
|
|
131
140
|
# @return [Retab::Edit]
|
|
132
141
|
def get(
|
|
133
142
|
edit_id:,
|
|
143
|
+
include_output: true,
|
|
134
144
|
request_options: {}
|
|
135
145
|
)
|
|
146
|
+
params = {
|
|
147
|
+
"include_output" => include_output
|
|
148
|
+
}.compact
|
|
136
149
|
response = @client.request(
|
|
137
150
|
method: :get,
|
|
138
151
|
path: "/v1/edits/#{Retab::Util.encode_path(edit_id)}",
|
|
139
152
|
auth: true,
|
|
153
|
+
params: params,
|
|
140
154
|
request_options: request_options
|
|
141
155
|
)
|
|
142
156
|
result = Retab::Edit.new(response.body)
|
|
@@ -164,5 +178,28 @@ module Retab
|
|
|
164
178
|
)
|
|
165
179
|
nil
|
|
166
180
|
end
|
|
181
|
+
|
|
182
|
+
# Cancel Edit
|
|
183
|
+
# @param edit_id [String]
|
|
184
|
+
# @param request_options [Hash] (see Retab::Types::RequestOptions)
|
|
185
|
+
# @return [Retab::Edit]
|
|
186
|
+
def create_edit_cancel(
|
|
187
|
+
edit_id:,
|
|
188
|
+
request_options: {}
|
|
189
|
+
)
|
|
190
|
+
response = @client.request(
|
|
191
|
+
method: :post,
|
|
192
|
+
path: "/v1/edits/#{Retab::Util.encode_path(edit_id)}/cancel",
|
|
193
|
+
auth: true,
|
|
194
|
+
request_options: request_options
|
|
195
|
+
)
|
|
196
|
+
result = Retab::Edit.new(response.body)
|
|
197
|
+
result.last_response = Retab::Types::ApiResponse.new(
|
|
198
|
+
http_status: response.code.to_i,
|
|
199
|
+
http_headers: response.each_header.to_h,
|
|
200
|
+
request_id: response["x-request-id"]
|
|
201
|
+
)
|
|
202
|
+
result
|
|
203
|
+
end
|
|
167
204
|
end
|
|
168
205
|
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,
|
|
@@ -14,6 +14,8 @@ module Retab
|
|
|
14
14
|
image_resolution_dpi: :image_resolution_dpi,
|
|
15
15
|
instructions: :instructions,
|
|
16
16
|
output: :output,
|
|
17
|
+
status: :status,
|
|
18
|
+
error: :error,
|
|
17
19
|
consensus: :consensus,
|
|
18
20
|
metadata: :metadata,
|
|
19
21
|
usage: :usage,
|
|
@@ -29,6 +31,8 @@ module Retab
|
|
|
29
31
|
:image_resolution_dpi,
|
|
30
32
|
:instructions,
|
|
31
33
|
:output,
|
|
34
|
+
:status,
|
|
35
|
+
:error,
|
|
32
36
|
:consensus,
|
|
33
37
|
:metadata,
|
|
34
38
|
:usage,
|
|
@@ -46,6 +50,8 @@ module Retab
|
|
|
46
50
|
@image_resolution_dpi = hash[:image_resolution_dpi]
|
|
47
51
|
@instructions = hash[:instructions]
|
|
48
52
|
@output = hash[:output] || {}
|
|
53
|
+
@status = hash[:status].nil? ? "pending" : hash[:status]
|
|
54
|
+
@error = hash[:error] ? Retab::PrimitiveError.new(hash[:error]) : nil
|
|
49
55
|
@consensus = hash[:consensus] ? Retab::ExtractionConsensus.new(hash[:consensus]) : nil
|
|
50
56
|
@metadata = hash[:metadata] || {}
|
|
51
57
|
@usage = hash[:usage] ? Retab::RetabUsage.new(hash[:usage]) : nil
|