retab 0.1.8 → 0.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (208) hide show
  1. checksums.yaml +4 -4
  2. data/lib/retab/base_client.rb +1 -5
  3. data/lib/retab/classifications/file_ref.rb +1 -22
  4. data/lib/retab/classifications.rb +1 -1
  5. data/lib/retab/edit_templates.rb +1 -1
  6. data/lib/retab/edits.rb +1 -1
  7. data/lib/retab/experiment_run_metrics/experiment_metrics_stale_error.rb +3 -3
  8. data/lib/retab/experiment_run_metrics/experiment_summary_metrics_response.rb +3 -3
  9. data/lib/retab/experiment_run_metrics/metrics_stale_error_last_run.rb +3 -3
  10. data/lib/retab/experiment_run_results/error_workflow_experiment_result.rb +1 -22
  11. data/lib/retab/experiment_run_results/pending_workflow_experiment_result.rb +1 -1
  12. data/lib/retab/experiment_run_results/queued_workflow_experiment_result.rb +1 -1
  13. data/lib/retab/experiment_run_results/running_workflow_experiment_result.rb +1 -1
  14. data/lib/retab/experiment_runs/create_experiment_run_request.rb +5 -2
  15. data/lib/retab/experiment_runs/error_workflow_experiment_run.rb +1 -1
  16. data/lib/retab/experiment_runs/experiment_run.rb +3 -3
  17. data/lib/retab/experiment_runs/pending_workflow_experiment_run.rb +1 -1
  18. data/lib/retab/experiment_runs/queued_workflow_experiment_run.rb +1 -1
  19. data/lib/retab/experiment_runs/running_workflow_experiment_run.rb +1 -1
  20. data/lib/retab/experiment_runs.rb +4 -1
  21. data/lib/retab/extractions/extraction.rb +0 -3
  22. data/lib/retab/extractions/extraction_request.rb +0 -3
  23. data/lib/retab/extractions.rb +53 -4
  24. data/lib/retab/files/create_file_blueprint_request.rb +3 -3
  25. data/lib/retab/files/file_blueprint.rb +5 -5
  26. data/lib/retab/files.rb +3 -3
  27. data/lib/retab/mime.rb +77 -6
  28. data/lib/retab/parses/parse.rb +0 -3
  29. data/lib/retab/parses/parse_request.rb +0 -3
  30. data/lib/retab/parses.rb +1 -4
  31. data/lib/retab/partitions.rb +1 -1
  32. data/lib/retab/schemas/generate_schema_request.rb +0 -3
  33. data/lib/retab/schemas.rb +1 -4
  34. data/lib/retab/splits.rb +1 -1
  35. data/lib/retab/types/{workflow_test_run_results_order.rb → eval_run_freshness_reasons.rb} +1 -1
  36. data/lib/retab/types/eval_run_freshness_status.rb +9 -0
  37. data/lib/retab/types/eval_run_trigger_type.rb +18 -0
  38. data/lib/retab/types/{latest_block_test_run_summary_outcome.rb → latest_block_eval_run_summary_outcome.rb} +1 -1
  39. data/lib/retab/types/{latest_block_test_run_summary_status.rb → latest_block_eval_run_summary_status.rb} +1 -1
  40. data/lib/retab/types/trigger_info_type.rb +1 -10
  41. data/lib/retab/types/{workflow_test_runs_order.rb → workflow_eval_result_verdict.rb} +1 -1
  42. data/lib/retab/types/workflow_eval_run_results_order.rb +9 -0
  43. data/lib/retab/types/{workflow_test_result_verdict.rb → workflow_eval_runs_order.rb} +1 -1
  44. data/lib/retab/types/workflow_eval_schema_drift.rb +9 -0
  45. data/lib/retab/types/{workflow_tests_order.rb → workflow_evals_order.rb} +1 -1
  46. data/lib/retab/types/workflow_experiment_freshness_state.rb +9 -0
  47. data/lib/retab/types/workflow_experiment_run_plan_mode.rb +15 -0
  48. data/lib/retab/types/workflow_experiments_exclude_status.rb +1 -1
  49. data/lib/retab/types/workflow_experiments_status.rb +1 -1
  50. data/lib/retab/version.rb +1 -1
  51. data/lib/retab/workflow_artifacts/extraction_workflow_artifact.rb +0 -3
  52. data/lib/retab/workflow_artifacts/parse_workflow_artifact.rb +0 -3
  53. data/lib/retab/workflow_artifacts/workflow_artifact.rb +5 -2
  54. data/lib/retab/{workflow_experiments/file_handle_input.rb → workflow_block_executions/block_exec_file_handle_input.rb} +6 -6
  55. data/lib/retab/workflow_block_executions/block_exec_file_ref.rb +28 -0
  56. data/lib/retab/{workflow_experiments/json_handle_input.rb → workflow_block_executions/block_exec_json_handle_input.rb} +6 -6
  57. data/lib/retab/workflow_block_executions/cancelled_block_execution_lifecycle.rb +25 -0
  58. data/lib/retab/workflow_block_executions/pending_block_execution_lifecycle.rb +20 -0
  59. data/lib/retab/workflow_block_executions/queued_block_execution_lifecycle.rb +20 -0
  60. data/lib/retab/workflow_block_executions/running_block_execution_lifecycle.rb +20 -0
  61. data/lib/retab/workflow_block_executions/stored_block_execution.rb +29 -0
  62. data/lib/retab/workflow_edges.rb +6 -0
  63. data/lib/retab/{workflow_test_run_results/cancelled_workflow_test_run.rb → workflow_eval_run_results/cancelled_workflow_eval_run.rb} +1 -1
  64. data/lib/retab/{workflow_test_run_results/completed_workflow_test_run.rb → workflow_eval_run_results/completed_workflow_eval_run.rb} +1 -1
  65. data/lib/retab/workflow_eval_run_results/error_workflow_eval_run.rb +28 -0
  66. data/lib/retab/{workflow_test_run_results/queued_workflow_test_run.rb → workflow_eval_run_results/file_handle_input.rb} +1 -1
  67. data/lib/retab/{workflow_test_run_results/workflow_test_run_timing.rb → workflow_eval_run_results/json_handle_input.rb} +1 -1
  68. data/lib/retab/workflow_eval_run_results/pending_workflow_eval_run.rb +7 -0
  69. data/lib/retab/{workflow_test_run_results/error_workflow_test_run.rb → workflow_eval_run_results/queued_workflow_eval_run.rb} +1 -1
  70. data/lib/retab/{workflow_test_run_results/pending_workflow_test_run.rb → workflow_eval_run_results/result_file_ref.rb} +1 -1
  71. data/lib/retab/workflow_eval_run_results/running_workflow_eval_run.rb +7 -0
  72. data/lib/retab/{workflow_test_run_results/workflow_test_result.rb → workflow_eval_run_results/workflow_eval_result.rb} +32 -41
  73. data/lib/retab/workflow_eval_run_results/workflow_eval_run_timing.rb +7 -0
  74. data/lib/retab/{workflow_test_run_results.rb → workflow_eval_run_results.rb} +10 -10
  75. data/lib/retab/{workflow_test_runs/block_test_batch_execution_counts.rb → workflow_eval_runs/block_eval_batch_execution_counts.rb} +3 -3
  76. data/lib/retab/{workflow_test_runs/block_test_lifecycle_counts.rb → workflow_eval_runs/block_eval_lifecycle_counts.rb} +1 -1
  77. data/lib/retab/{workflow_test_runs/block_test_outcome_counts.rb → workflow_eval_runs/block_eval_outcome_counts.rb} +1 -1
  78. data/lib/retab/{workflow_test_runs/create_workflow_test_run_request.rb → workflow_eval_runs/create_workflow_eval_run_request.rb} +4 -4
  79. data/lib/retab/{workflow_tests/workflow_test_block_target.rb → workflow_eval_runs/eval_run_block_target.rb} +1 -1
  80. data/lib/retab/workflow_eval_runs/eval_run_freshness.rb +34 -0
  81. data/lib/retab/{workflow_test_runs/workflow_test_run_workflow_scope.rb → workflow_eval_runs/eval_run_trigger.rb} +1 -1
  82. data/lib/retab/{workflow_test_runs/workflow_test_run.rb → workflow_eval_runs/workflow_eval_run.rb} +18 -18
  83. data/lib/retab/{workflow_test_runs/workflow_test_run_block_scope.rb → workflow_eval_runs/workflow_eval_run_block_scope.rb} +1 -1
  84. data/lib/retab/{workflow_test_runs/workflow_test_run_single_scope.rb → workflow_eval_runs/workflow_eval_run_single_scope.rb} +4 -4
  85. data/lib/retab/workflow_eval_runs/workflow_eval_run_workflow_scope.rb +20 -0
  86. data/lib/retab/{workflow_test_runs.rb → workflow_eval_runs.rb} +24 -24
  87. data/lib/retab/{workflow_tests/create_workflow_test_request.rb → workflow_evals/create_workflow_eval_request.rb} +4 -4
  88. data/lib/retab/workflow_evals/eval_file_handle_input.rb +7 -0
  89. data/lib/retab/workflow_evals/eval_json_handle_input.rb +7 -0
  90. data/lib/retab/{workflow_test_run_results/running_workflow_test_run.rb → workflow_evals/eval_public_file_ref.rb} +1 -1
  91. data/lib/retab/{workflow_tests/latest_block_test_run_summary.rb → workflow_evals/latest_block_eval_run_summary.rb} +4 -4
  92. data/lib/retab/{workflow_tests/manual_workflow_test_source.rb → workflow_evals/manual_workflow_eval_source.rb} +1 -1
  93. data/lib/retab/{workflow_tests/run_step_workflow_test_source.rb → workflow_evals/run_step_workflow_eval_source.rb} +1 -1
  94. data/lib/retab/{workflow_tests/update_workflow_test_request.rb → workflow_evals/update_workflow_eval_request.rb} +3 -3
  95. data/lib/retab/{workflow_tests/workflow_test.rb → workflow_evals/workflow_eval.rb} +7 -7
  96. data/lib/retab/workflow_evals/workflow_eval_block_target.rb +7 -0
  97. data/lib/retab/{workflow_tests.rb → workflow_evals.rb} +31 -31
  98. data/lib/retab/workflow_experiments/workflow_experiment.rb +12 -0
  99. data/lib/retab/workflow_runs/pending_run.rb +1 -14
  100. data/lib/retab/workflow_runs/running_run.rb +1 -14
  101. data/lib/retab/workflow_runs.rb +1 -1
  102. data/lib/retab/workflow_steps/pending_step_lifecycle.rb +1 -1
  103. data/lib/retab/workflow_steps/queued_step_lifecycle.rb +1 -14
  104. data/lib/retab/workflow_steps/running_step_lifecycle.rb +1 -1
  105. data/lib/retab/workflows.rb +2 -2
  106. data/lib/retab.rb +3 -3
  107. data/rbi/retab/{block_test_batch_execution_counts.rbi → block_eval_batch_execution_counts.rbi} +5 -5
  108. data/rbi/retab/{block_test_lifecycle_counts.rbi → block_eval_lifecycle_counts.rbi} +1 -1
  109. data/rbi/retab/{block_test_outcome_counts.rbi → block_eval_outcome_counts.rbi} +1 -1
  110. data/rbi/retab/block_exec_file_handle_input.rbi +30 -0
  111. data/rbi/retab/block_exec_file_ref.rbi +36 -0
  112. data/rbi/retab/block_exec_json_handle_input.rbi +30 -0
  113. data/rbi/retab/cancelled_block_execution_lifecycle.rbi +30 -0
  114. data/rbi/retab/{cancelled_workflow_test_run.rbi → cancelled_workflow_eval_run.rbi} +1 -1
  115. data/rbi/retab/classification_request.rbi +2 -2
  116. data/rbi/retab/{completed_workflow_test_run.rbi → completed_workflow_eval_run.rbi} +1 -1
  117. data/rbi/retab/create_experiment_run_request.rbi +6 -0
  118. data/rbi/retab/create_file_blueprint_request.rbi +4 -4
  119. data/rbi/retab/{create_workflow_test_request.rbi → create_workflow_eval_request.rbi} +5 -5
  120. data/rbi/retab/{create_workflow_test_run_request.rbi → create_workflow_eval_run_request.rbi} +3 -3
  121. data/rbi/retab/create_workflow_run_request.rbi +2 -2
  122. data/rbi/retab/edit_request.rbi +2 -2
  123. data/rbi/retab/{error_workflow_test_run.rbi → error_workflow_eval_run.rbi} +1 -1
  124. data/rbi/retab/eval_file_handle_input.rbi +30 -0
  125. data/rbi/retab/eval_json_handle_input.rbi +30 -0
  126. data/rbi/retab/eval_public_file_ref.rbi +36 -0
  127. data/rbi/retab/{workflow_test_block_target.rbi → eval_run_block_target.rbi} +1 -1
  128. data/rbi/retab/eval_run_freshness.rbi +48 -0
  129. data/rbi/retab/{workflow_test_run_workflow_scope.rbi → eval_run_trigger.rbi} +1 -1
  130. data/rbi/retab/experiment_metrics_stale_error.rbi +2 -2
  131. data/rbi/retab/experiment_run.rbi +2 -2
  132. data/rbi/retab/experiment_runs.rbi +2 -1
  133. data/rbi/retab/experiment_summary_metrics_response.rbi +2 -2
  134. data/rbi/retab/extraction.rbi +0 -6
  135. data/rbi/retab/extraction_request.rbi +2 -8
  136. data/rbi/retab/extraction_workflow_artifact.rbi +0 -6
  137. data/rbi/retab/extractions.rbi +19 -2
  138. data/rbi/retab/file_blueprint.rbi +6 -6
  139. data/rbi/retab/file_handle_input.rbi +2 -2
  140. data/rbi/retab/files.rbi +2 -2
  141. data/rbi/retab/generate_schema_request.rbi +0 -6
  142. data/rbi/retab/{latest_block_test_run_summary.rbi → latest_block_eval_run_summary.rbi} +3 -3
  143. data/rbi/retab/{manual_workflow_test_source.rbi → manual_workflow_eval_source.rbi} +3 -3
  144. data/rbi/retab/metrics_stale_error_last_run.rbi +2 -2
  145. data/rbi/retab/parse.rbi +0 -6
  146. data/rbi/retab/parse_request.rbi +2 -8
  147. data/rbi/retab/parse_workflow_artifact.rbi +0 -6
  148. data/rbi/retab/parses.rbi +1 -2
  149. data/rbi/retab/partition_request.rbi +2 -2
  150. data/rbi/retab/pending_block_execution_lifecycle.rbi +24 -0
  151. data/rbi/retab/{pending_workflow_test_run.rbi → pending_workflow_eval_run.rbi} +1 -1
  152. data/rbi/retab/queued_block_execution_lifecycle.rbi +24 -0
  153. data/rbi/retab/{queued_workflow_test_run.rbi → queued_workflow_eval_run.rbi} +1 -1
  154. data/rbi/retab/result_file_ref.rbi +36 -0
  155. data/rbi/retab/{run_step_workflow_test_source.rbi → run_step_workflow_eval_source.rbi} +1 -1
  156. data/rbi/retab/running_block_execution_lifecycle.rbi +24 -0
  157. data/rbi/retab/{running_workflow_test_run.rbi → running_workflow_eval_run.rbi} +1 -1
  158. data/rbi/retab/schemas.rbi +1 -2
  159. data/rbi/retab/split_request.rbi +2 -2
  160. data/rbi/retab/stored_block_execution.rbi +48 -6
  161. data/rbi/retab/{update_workflow_test_request.rbi → update_workflow_eval_request.rbi} +3 -3
  162. data/rbi/retab/workflow_artifact.rbi +6 -0
  163. data/rbi/retab/workflow_edges.rbi +2 -1
  164. data/rbi/retab/{workflow_test.rbi → workflow_eval.rbi} +11 -11
  165. data/rbi/retab/workflow_eval_block_target.rbi +30 -0
  166. data/rbi/retab/{workflow_test_result.rbi → workflow_eval_result.rbi} +35 -35
  167. data/rbi/retab/workflow_eval_run.rbi +84 -0
  168. data/rbi/retab/{workflow_test_run_block_scope.rbi → workflow_eval_run_block_scope.rbi} +1 -1
  169. data/rbi/retab/{workflow_test_run_results.rbi → workflow_eval_run_results.rbi} +3 -3
  170. data/rbi/retab/{workflow_test_run_single_scope.rbi → workflow_eval_run_single_scope.rbi} +3 -3
  171. data/rbi/retab/{workflow_test_run_timing.rbi → workflow_eval_run_timing.rbi} +1 -1
  172. data/rbi/retab/workflow_eval_run_workflow_scope.rbi +24 -0
  173. data/rbi/retab/{workflow_test_runs.rbi → workflow_eval_runs.rbi} +8 -8
  174. data/rbi/retab/{workflow_tests.rbi → workflow_evals.rbi} +16 -16
  175. data/rbi/retab/workflow_experiment.rbi +24 -0
  176. data/rbi/retab/workflows.rbi +2 -2
  177. metadata +125 -92
  178. data/lib/retab/types/workflow_test_schema_drift.rb +0 -9
  179. data/rbi/retab/workflow_test_run.rbi +0 -84
  180. /data/lib/retab/{workflow_test_run_results → workflow_eval_run_results}/assertion_failure.rb +0 -0
  181. /data/lib/retab/{workflow_test_run_results → workflow_eval_run_results}/assertion_result.rb +0 -0
  182. /data/lib/retab/{workflow_test_run_results → workflow_eval_run_results}/verdict_summary.rb +0 -0
  183. /data/lib/retab/{workflow_tests → workflow_evals}/all_items_match_condition.rb +0 -0
  184. /data/lib/retab/{workflow_tests → workflow_evals}/any_item_matches_condition.rb +0 -0
  185. /data/lib/retab/{workflow_tests → workflow_evals}/array_contains_condition.rb +0 -0
  186. /data/lib/retab/{workflow_experiments → workflow_evals}/artifact_drift.rb +0 -0
  187. /data/lib/retab/{workflow_experiments → workflow_evals}/artifact_freshness.rb +0 -0
  188. /data/lib/retab/{workflow_tests → workflow_evals}/assertion_schema_dep.rb +0 -0
  189. /data/lib/retab/{workflow_tests → workflow_evals}/assertion_spec.rb +0 -0
  190. /data/lib/retab/{workflow_tests → workflow_evals}/between_condition.rb +0 -0
  191. /data/lib/retab/{workflow_tests → workflow_evals}/contain_condition.rb +0 -0
  192. /data/lib/retab/{workflow_tests → workflow_evals}/ends_with_condition.rb +0 -0
  193. /data/lib/retab/{workflow_tests → workflow_evals}/equal_condition.rb +0 -0
  194. /data/lib/retab/{workflow_tests → workflow_evals}/exist_condition.rb +0 -0
  195. /data/lib/retab/{workflow_tests → workflow_evals}/json_schema_valid_condition.rb +0 -0
  196. /data/lib/retab/{workflow_tests → workflow_evals}/length_compare_condition.rb +0 -0
  197. /data/lib/retab/{workflow_tests → workflow_evals}/llm_judged_as_condition.rb +0 -0
  198. /data/lib/retab/{workflow_tests → workflow_evals}/llm_not_judged_as_condition.rb +0 -0
  199. /data/lib/retab/{workflow_tests → workflow_evals}/matche_regex_condition.rb +0 -0
  200. /data/lib/retab/{workflow_tests → workflow_evals}/not_contains_condition.rb +0 -0
  201. /data/lib/retab/{workflow_tests → workflow_evals}/not_equals_condition.rb +0 -0
  202. /data/lib/retab/{workflow_tests → workflow_evals}/not_exists_condition.rb +0 -0
  203. /data/lib/retab/{workflow_tests → workflow_evals}/number_compare_condition.rb +0 -0
  204. /data/lib/retab/{workflow_tests → workflow_evals}/object_contains_condition.rb +0 -0
  205. /data/lib/retab/{workflow_tests → workflow_evals}/output_target.rb +0 -0
  206. /data/lib/retab/{workflow_tests → workflow_evals}/similarity_gte_condition.rb +0 -0
  207. /data/lib/retab/{workflow_tests → workflow_evals}/split_iou_condition.rb +0 -0
  208. /data/lib/retab/{workflow_tests → workflow_evals}/start_with_condition.rb +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9d9fd0fbbfdf5fc2c58b483cc5d2fd0981d97d5f41f68d77f1c333944a2fc6dd
4
- data.tar.gz: b6984aca8ca57f563be3d839707c5846dcac45bbdfc03cf9888173a69df88383
3
+ metadata.gz: 6d8f00bc26ed73aa5d559ff12a8903bc8e0902d16aa47ee5bacdc174face30ad
4
+ data.tar.gz: c152d02486ec700e26c0a59c1ff51e07f15567516bfd06e19899ce1619771e30
5
5
  SHA512:
6
- metadata.gz: 9ac7596123c9d5073186740e0bb2e542f50d88c538cc478691fb28882f6d87a98477fd533eaf2c26b133c5efc18f9eeae536b844316d3a7aef30618dcfb22dec
7
- data.tar.gz: 40dae270f0ea4862db0bddd44fe79fc9f737c99c64d72f206e6ba9c85eabc067573a49f68f46b8dcbf727a3ef37c8b7fce27da802c74841848d9e7b5f4ab8ac9
6
+ metadata.gz: b89d753a806f26903c1f1bd3c005a80f92d8b7d940eba048d6f78de16e5241a27a628505eb2c320144dc1eed41579eefd750488007a345ced2368d4e24dec5fa
7
+ data.tar.gz: 4472ad621a070d8e80e703f3f4f4740d212ff7481966ce3094cb082361f74c648a8f0712bd43a1c34997d91ed8205c5146149b614252b4b607124ab33dba6054
@@ -72,11 +72,7 @@ module Retab
72
72
  req["User-Agent"] = @configuration.user_agent
73
73
  if auth
74
74
  key = (request_options[:api_key] || request_options["api_key"] || api_key)
75
- # Retab's API expects the raw key in `Api-Key` (not `Authorization: Bearer ...`).
76
- # Confirmed against the Python SDK's `client.py` and the server response on
77
- # /v1/files: "Provide a valid Bearer token, API Key, ..." — the API Key path
78
- # is the `Api-Key` header.
79
- req["Api-Key"] = key if key
75
+ req["Authorization"] = "Bearer #{key}" if key
80
76
  end
81
77
 
82
78
  if (idem = request_options[:idempotency_key] || request_options["idempotency_key"])
@@ -3,26 +3,5 @@
3
3
  # This file is auto-generated by oagen. Do not edit.
4
4
 
5
5
  module Retab
6
- class FileRef < Retab::Types::BaseModel
7
-
8
- HASH_ATTRS = {
9
- id: :id,
10
- filename: :filename,
11
- mime_type: :mime_type
12
- }.freeze
13
-
14
- attr_accessor(
15
- :id,
16
- :filename,
17
- :mime_type
18
- )
19
-
20
- def initialize(json)
21
- super()
22
- hash = self.class.normalize(json)
23
- @id = hash[:id]
24
- @filename = hash[:filename]
25
- @mime_type = hash[:mime_type]
26
- end
27
- end
6
+ FileRef = BlockExecFileRef
28
7
  end
@@ -100,7 +100,7 @@ module Retab
100
100
  background: nil,
101
101
  request_options: {}
102
102
  )
103
- document = Retab::MimeData.coerce(document) unless document.nil?
103
+ document = Retab::MimeData.coerce(document, client: @client) unless document.nil?
104
104
  body = {
105
105
  "document" => document,
106
106
  "categories" => categories,
@@ -74,7 +74,7 @@ module Retab
74
74
  form_fields:,
75
75
  request_options: {}
76
76
  )
77
- document = Retab::MimeData.coerce(document) unless document.nil?
77
+ document = Retab::MimeData.coerce(document, client: @client) unless document.nil?
78
78
  body = {
79
79
  "name" => name,
80
80
  "document" => document,
data/lib/retab/edits.rb CHANGED
@@ -107,7 +107,7 @@ module Retab
107
107
  background: nil,
108
108
  request_options: {}
109
109
  )
110
- document = Retab::MimeData.coerce(document) unless document.nil?
110
+ document = Retab::MimeData.coerce(document, client: @client) unless document.nil?
111
111
  body = {
112
112
  "instructions" => instructions,
113
113
  "document" => document,
@@ -11,7 +11,7 @@ module Retab
11
11
  experiment_id: :experiment_id,
12
12
  stale_reasons: :stale_reasons,
13
13
  last_run: :last_run,
14
- current_config_fingerprint: :current_config_fingerprint,
14
+ current_block_execution_fingerprint: :current_block_execution_fingerprint,
15
15
  message: :message
16
16
  }.freeze
17
17
 
@@ -21,7 +21,7 @@ module Retab
21
21
  :experiment_id,
22
22
  :stale_reasons,
23
23
  :last_run,
24
- :current_config_fingerprint,
24
+ :current_block_execution_fingerprint,
25
25
  :message
26
26
  )
27
27
 
@@ -33,7 +33,7 @@ module Retab
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
36
- @current_config_fingerprint = hash[:current_config_fingerprint]
36
+ @current_block_execution_fingerprint = hash[:current_block_execution_fingerprint]
37
37
  @message = hash[:message]
38
38
  end
39
39
  end
@@ -10,7 +10,7 @@ module Retab
10
10
  run_id: :run_id,
11
11
  kind: :kind,
12
12
  view: :view,
13
- definition_fingerprint: :definition_fingerprint,
13
+ block_execution_fingerprint: :block_execution_fingerprint,
14
14
  block_type: :block_type,
15
15
  score: :score,
16
16
  prior_score: :prior_score,
@@ -24,7 +24,7 @@ module Retab
24
24
  :run_id,
25
25
  :kind,
26
26
  :view,
27
- :definition_fingerprint,
27
+ :block_execution_fingerprint,
28
28
  :block_type,
29
29
  :score,
30
30
  :prior_score,
@@ -40,7 +40,7 @@ module Retab
40
40
  @run_id = hash[:run_id]
41
41
  @kind = hash[:kind].nil? ? "summary" : hash[:kind]
42
42
  @view = hash[:view].nil? ? "summary" : hash[:view]
43
- @definition_fingerprint = hash[:definition_fingerprint]
43
+ @block_execution_fingerprint = hash[:block_execution_fingerprint]
44
44
  @block_type = hash[:block_type]
45
45
  @score = hash[:score]
46
46
  @prior_score = hash[:prior_score]
@@ -7,14 +7,14 @@ module Retab
7
7
 
8
8
  HASH_ATTRS = {
9
9
  run_id: :run_id,
10
- definition_fingerprint: :definition_fingerprint,
10
+ block_execution_fingerprint: :block_execution_fingerprint,
11
11
  score: :score,
12
12
  created_at: :created_at
13
13
  }.freeze
14
14
 
15
15
  attr_accessor(
16
16
  :run_id,
17
- :definition_fingerprint,
17
+ :block_execution_fingerprint,
18
18
  :score,
19
19
  :created_at
20
20
  )
@@ -23,7 +23,7 @@ module Retab
23
23
  super()
24
24
  hash = self.class.normalize(json)
25
25
  @run_id = hash[:run_id]
26
- @definition_fingerprint = hash[:definition_fingerprint]
26
+ @block_execution_fingerprint = hash[:block_execution_fingerprint]
27
27
  @score = hash[:score]
28
28
  @created_at = hash[:created_at]
29
29
  end
@@ -3,26 +3,5 @@
3
3
  # This file is auto-generated by oagen. Do not edit.
4
4
 
5
5
  module Retab
6
- class ErrorWorkflowExperimentResult < Retab::Types::BaseModel
7
-
8
- HASH_ATTRS = {
9
- status: :status,
10
- message: :message,
11
- details: :details
12
- }.freeze
13
-
14
- attr_accessor(
15
- :status,
16
- :message,
17
- :details
18
- )
19
-
20
- def initialize(json)
21
- super()
22
- hash = self.class.normalize(json)
23
- @status = hash[:status].nil? ? "error" : hash[:status]
24
- @message = hash[:message].nil? ? "(no message)" : hash[:message]
25
- @details = hash[:details] ? Retab::ErrorDetails.new(hash[:details]) : nil
26
- end
27
- end
6
+ ErrorWorkflowExperimentResult = ErrorWorkflowEvalRun
28
7
  end
@@ -3,5 +3,5 @@
3
3
  # This file is auto-generated by oagen. Do not edit.
4
4
 
5
5
  module Retab
6
- PendingWorkflowExperimentResult = PendingRun
6
+ PendingWorkflowExperimentResult = PendingBlockExecutionLifecycle
7
7
  end
@@ -3,5 +3,5 @@
3
3
  # This file is auto-generated by oagen. Do not edit.
4
4
 
5
5
  module Retab
6
- QueuedWorkflowExperimentResult = QueuedStepLifecycle
6
+ QueuedWorkflowExperimentResult = QueuedBlockExecutionLifecycle
7
7
  end
@@ -3,5 +3,5 @@
3
3
  # This file is auto-generated by oagen. Do not edit.
4
4
 
5
5
  module Retab
6
- RunningWorkflowExperimentResult = RunningRun
6
+ RunningWorkflowExperimentResult = RunningBlockExecutionLifecycle
7
7
  end
@@ -7,12 +7,14 @@ module Retab
7
7
 
8
8
  HASH_ATTRS = {
9
9
  experiment_id: :experiment_id,
10
- workflow_id: :workflow_id
10
+ workflow_id: :workflow_id,
11
+ plan_token: :plan_token
11
12
  }.freeze
12
13
 
13
14
  attr_accessor(
14
15
  :experiment_id,
15
- :workflow_id
16
+ :workflow_id,
17
+ :plan_token
16
18
  )
17
19
 
18
20
  def initialize(json)
@@ -20,6 +22,7 @@ module Retab
20
22
  hash = self.class.normalize(json)
21
23
  @experiment_id = hash[:experiment_id]
22
24
  @workflow_id = hash[:workflow_id]
25
+ @plan_token = hash[:plan_token]
23
26
  end
24
27
  end
25
28
  end
@@ -3,5 +3,5 @@
3
3
  # This file is auto-generated by oagen. Do not edit.
4
4
 
5
5
  module Retab
6
- ErrorWorkflowExperimentRun = ErrorWorkflowExperimentResult
6
+ ErrorWorkflowExperimentRun = ErrorWorkflowEvalRun
7
7
  end
@@ -20,7 +20,7 @@ module Retab
20
20
  block_version_id: :block_version_id,
21
21
  metrics_validity_fingerprint: :metrics_validity_fingerprint,
22
22
  metrics_validity_fingerprint_version: :metrics_validity_fingerprint_version,
23
- definition_fingerprint: :definition_fingerprint,
23
+ block_execution_fingerprint: :block_execution_fingerprint,
24
24
  documents_fingerprint: :documents_fingerprint,
25
25
  score: :score,
26
26
  total_document_count: :total_document_count,
@@ -44,7 +44,7 @@ module Retab
44
44
  :block_version_id,
45
45
  :metrics_validity_fingerprint,
46
46
  :metrics_validity_fingerprint_version,
47
- :definition_fingerprint,
47
+ :block_execution_fingerprint,
48
48
  :documents_fingerprint,
49
49
  :score,
50
50
  :total_document_count,
@@ -87,7 +87,7 @@ module Retab
87
87
  @block_version_id = hash[:block_version_id]
88
88
  @metrics_validity_fingerprint = hash[:metrics_validity_fingerprint]
89
89
  @metrics_validity_fingerprint_version = hash[:metrics_validity_fingerprint_version]
90
- @definition_fingerprint = hash[:definition_fingerprint]
90
+ @block_execution_fingerprint = hash[:block_execution_fingerprint]
91
91
  @documents_fingerprint = hash[:documents_fingerprint]
92
92
  @score = hash[:score]
93
93
  @total_document_count = hash[:total_document_count]
@@ -3,5 +3,5 @@
3
3
  # This file is auto-generated by oagen. Do not edit.
4
4
 
5
5
  module Retab
6
- PendingWorkflowExperimentRun = PendingRun
6
+ PendingWorkflowExperimentRun = PendingBlockExecutionLifecycle
7
7
  end
@@ -3,5 +3,5 @@
3
3
  # This file is auto-generated by oagen. Do not edit.
4
4
 
5
5
  module Retab
6
- QueuedWorkflowExperimentRun = QueuedStepLifecycle
6
+ QueuedWorkflowExperimentRun = QueuedBlockExecutionLifecycle
7
7
  end
@@ -3,5 +3,5 @@
3
3
  # This file is auto-generated by oagen. Do not edit.
4
4
 
5
5
  module Retab
6
- RunningWorkflowExperimentRun = RunningRun
6
+ RunningWorkflowExperimentRun = RunningBlockExecutionLifecycle
7
7
  end
@@ -106,16 +106,19 @@ module Retab
106
106
  # Create Experiment Run Flat
107
107
  # @param experiment_id [String] The experiment to create a run for.
108
108
  # @param workflow_id [String, nil] Optional. When omitted, the workflow is derived from the experiment record. When supplied, must match the experiment's workflow_id (404 otherwise).
109
+ # @param plan_token [String, nil] Optional short-lived token returned by the run-plan preview. When supplied, run creation rejects if the current plan no longer matches the preview.
109
110
  # @param request_options [Hash] (see Retab::Types::RequestOptions)
110
111
  # @return [Retab::ExperimentRun]
111
112
  def create(
112
113
  experiment_id:,
113
114
  workflow_id: nil,
115
+ plan_token: nil,
114
116
  request_options: {}
115
117
  )
116
118
  body = {
117
119
  "experiment_id" => experiment_id,
118
- "workflow_id" => workflow_id
120
+ "workflow_id" => workflow_id,
121
+ "plan_token" => plan_token
119
122
  }.compact
120
123
  response = @client.request(
121
124
  method: :post,
@@ -11,7 +11,6 @@ module Retab
11
11
  model: :model,
12
12
  json_schema: :json_schema,
13
13
  n_consensus: :n_consensus,
14
- image_resolution_dpi: :image_resolution_dpi,
15
14
  instructions: :instructions,
16
15
  output: :output,
17
16
  status: :status,
@@ -28,7 +27,6 @@ module Retab
28
27
  :model,
29
28
  :json_schema,
30
29
  :n_consensus,
31
- :image_resolution_dpi,
32
30
  :instructions,
33
31
  :output,
34
32
  :status,
@@ -47,7 +45,6 @@ module Retab
47
45
  @model = hash[:model]
48
46
  @json_schema = hash[:json_schema] || {}
49
47
  @n_consensus = hash[:n_consensus]
50
- @image_resolution_dpi = hash[:image_resolution_dpi]
51
48
  @instructions = hash[:instructions]
52
49
  @output = hash[:output] || {}
53
50
  @status = hash[:status].nil? ? "pending" : hash[:status]
@@ -9,7 +9,6 @@ module Retab
9
9
  document: :document,
10
10
  json_schema: :json_schema,
11
11
  model: :model,
12
- image_resolution_dpi: :image_resolution_dpi,
13
12
  instructions: :instructions,
14
13
  n_consensus: :n_consensus,
15
14
  metadata: :metadata,
@@ -24,7 +23,6 @@ module Retab
24
23
  :document,
25
24
  :json_schema,
26
25
  :model,
27
- :image_resolution_dpi,
28
26
  :instructions,
29
27
  :n_consensus,
30
28
  :metadata,
@@ -41,7 +39,6 @@ module Retab
41
39
  @document = hash[:document] ? Retab::MimeData.new(hash[:document]) : nil
42
40
  @json_schema = hash[:json_schema] || {}
43
41
  @model = hash[:model].nil? ? "retab-small" : hash[:model]
44
- @image_resolution_dpi = hash[:image_resolution_dpi]
45
42
  @instructions = hash[:instructions]
46
43
  @n_consensus = hash[:n_consensus]
47
44
  @metadata = hash[:metadata] || {}
@@ -102,7 +102,6 @@ module Retab
102
102
  # @param document [Retab::MimeData, Pathname, IO, String, Hash]
103
103
  # @param json_schema [Hash{String => Object}] JSON schema describing the structured output
104
104
  # @param model [String, nil] The model to use for the extraction
105
- # @param image_resolution_dpi [Integer, nil] Resolution of the image sent to the LLM
106
105
  # @param instructions [String, nil] Free-form instructions appended to the system prompt to steer the extraction.
107
106
  # @param n_consensus [Integer, nil] Number of consensus extraction runs to perform. Uses deterministic single-pass when set to 1.
108
107
  # @param metadata [Hash{String => String}, nil] User-defined metadata to associate with this extraction
@@ -117,7 +116,6 @@ module Retab
117
116
  document:,
118
117
  json_schema:,
119
118
  model: nil,
120
- image_resolution_dpi: nil,
121
119
  instructions: nil,
122
120
  n_consensus: nil,
123
121
  metadata: nil,
@@ -128,12 +126,11 @@ module Retab
128
126
  chunking_keys: nil,
129
127
  request_options: {}
130
128
  )
131
- document = Retab::MimeData.coerce(document) unless document.nil?
129
+ document = Retab::MimeData.coerce(document, client: @client) unless document.nil?
132
130
  body = {
133
131
  "document" => document,
134
132
  "json_schema" => json_schema,
135
133
  "model" => model,
136
- "image_resolution_dpi" => image_resolution_dpi,
137
134
  "instructions" => instructions,
138
135
  "n_consensus" => n_consensus,
139
136
  "metadata" => metadata,
@@ -159,6 +156,58 @@ module Retab
159
156
  result
160
157
  end
161
158
 
159
+ # Create Extraction Stream
160
+ # @param document [Retab::MimeData, Pathname, IO, String, Hash]
161
+ # @param json_schema [Hash{String => Object}] JSON schema describing the structured output
162
+ # @param model [String, nil] The model to use for the extraction
163
+ # @param instructions [String, nil] Free-form instructions appended to the system prompt to steer the extraction.
164
+ # @param n_consensus [Integer, nil] Number of consensus extraction runs to perform. Uses deterministic single-pass when set to 1.
165
+ # @param metadata [Hash{String => String}, nil] User-defined metadata to associate with this extraction
166
+ # @param additional_messages [Array<Hash{String => Object}>, nil] Additional chat messages forwarded to the extraction model.
167
+ # @param bust_cache [Boolean, nil] If true, skip the LLM cache and force a fresh completion
168
+ # @param stream [Boolean, nil]
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 chunking_keys [Hash{String => String}, nil]
171
+ # @param request_options [Hash] (see Retab::Types::RequestOptions)
172
+ # @return [void]
173
+ def create_stream(
174
+ document:,
175
+ json_schema:,
176
+ model: nil,
177
+ instructions: nil,
178
+ n_consensus: nil,
179
+ metadata: nil,
180
+ additional_messages: nil,
181
+ bust_cache: nil,
182
+ stream: nil,
183
+ background: nil,
184
+ chunking_keys: nil,
185
+ request_options: {}
186
+ )
187
+ document = Retab::MimeData.coerce(document, client: @client) unless document.nil?
188
+ body = {
189
+ "document" => document,
190
+ "json_schema" => json_schema,
191
+ "model" => model,
192
+ "instructions" => instructions,
193
+ "n_consensus" => n_consensus,
194
+ "metadata" => metadata,
195
+ "additional_messages" => additional_messages,
196
+ "bust_cache" => bust_cache,
197
+ "stream" => stream,
198
+ "background" => background,
199
+ "chunking_keys" => chunking_keys
200
+ }.compact
201
+ @client.request(
202
+ method: :post,
203
+ path: "/v1/extractions/stream",
204
+ auth: true,
205
+ body: body,
206
+ request_options: request_options
207
+ )
208
+ nil
209
+ end
210
+
162
211
  # Get Extraction
163
212
  # @param extraction_id [String]
164
213
  # @param include_output [Boolean, nil] When false, returns a cheap status-only projection (no output), served from cache for in-flight background runs.
@@ -7,15 +7,15 @@ module Retab
7
7
 
8
8
  HASH_ATTRS = {
9
9
  file_id: :file_id,
10
- mode: :mode,
11
10
  intent: :intent,
11
+ mode: :mode,
12
12
  background: :background
13
13
  }.freeze
14
14
 
15
15
  attr_accessor(
16
16
  :file_id,
17
- :mode,
18
17
  :intent,
18
+ :mode,
19
19
  :background
20
20
  )
21
21
 
@@ -23,8 +23,8 @@ module Retab
23
23
  super()
24
24
  hash = self.class.normalize(json)
25
25
  @file_id = hash[:file_id]
26
- @mode = hash[:mode]
27
26
  @intent = hash[:intent]
27
+ @mode = hash[:mode]
28
28
  @background = hash[:background].nil? ? false : hash[:background]
29
29
  end
30
30
  end
@@ -9,28 +9,28 @@ module Retab
9
9
  object: :object,
10
10
  id: :id,
11
11
  file: :file,
12
- mode: :mode,
13
12
  intent: :intent,
14
13
  output: :output,
15
14
  status: :status,
16
15
  error: :error,
17
16
  created_at: :created_at,
18
17
  started_at: :started_at,
19
- completed_at: :completed_at
18
+ completed_at: :completed_at,
19
+ mode: :mode
20
20
  }.freeze
21
21
 
22
22
  attr_accessor(
23
23
  :object,
24
24
  :id,
25
25
  :file,
26
- :mode,
27
26
  :intent,
28
27
  :output,
29
28
  :status,
30
29
  :error,
31
30
  :created_at,
32
31
  :started_at,
33
- :completed_at
32
+ :completed_at,
33
+ :mode
34
34
  )
35
35
 
36
36
  def initialize(json)
@@ -39,7 +39,6 @@ module Retab
39
39
  @object = hash[:object].nil? ? "file.blueprint" : hash[:object]
40
40
  @id = hash[:id]
41
41
  @file = hash[:file] ? Retab::FileRef.new(hash[:file]) : nil
42
- @mode = hash[:mode]
43
42
  @intent = hash[:intent]
44
43
  @output = hash[:output] || {}
45
44
  @status = hash[:status].nil? ? "pending" : hash[:status]
@@ -47,6 +46,7 @@ module Retab
47
46
  @created_at = hash[:created_at]
48
47
  @started_at = hash[:started_at]
49
48
  @completed_at = hash[:completed_at]
49
+ @mode = hash[:mode]
50
50
  end
51
51
  end
52
52
  end
data/lib/retab/files.rb CHANGED
@@ -90,22 +90,22 @@ module Retab
90
90
 
91
91
  # Create File Blueprint
92
92
  # @param file_id [String] File id to analyze.
93
- # @param mode [Retab::Types::CreateFileBlueprintRequestMode, nil] Optional analysis depth override. Omit to let Retab choose.
94
93
  # @param intent [String, nil] Optional user intent used to guide the blueprint analysis.
94
+ # @param mode [Retab::Types::CreateFileBlueprintRequestMode, nil] Legacy compatibility field. Blueprint analysis always runs a single pass.
95
95
  # @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.
96
96
  # @param request_options [Hash] (see Retab::Types::RequestOptions)
97
97
  # @return [Retab::FileBlueprint]
98
98
  def create_blueprint(
99
99
  file_id:,
100
- mode: nil,
101
100
  intent: nil,
101
+ mode: nil,
102
102
  background: nil,
103
103
  request_options: {}
104
104
  )
105
105
  body = {
106
106
  "file_id" => file_id,
107
- "mode" => mode,
108
107
  "intent" => intent,
108
+ "mode" => mode,
109
109
  "background" => background
110
110
  }.compact
111
111
  response = @client.request(