riveter-sdk 1.1.0 → 1.3.0
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/riveter/errors.rb +1 -1
- data/lib/riveter/models.rb +13 -18
- data/lib/riveter/resources.rb +2 -2
- data/lib/riveter/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e8721e5ad86b3062573198f7cbf1d4a792ba7c2422f43cdfb7e7d5de9a2e94ba
|
|
4
|
+
data.tar.gz: fbc023276fc58c6c7c2876556e76b35227cfdc8ea37774fc135b26022a64fc6e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 624978fd150a8a2c0a249796865c2c4635ea155352acc4b6416797006e84b6017aa046982b082039ee0edaf5acba16b088daa42c80513f1b100c57793a318b76
|
|
7
|
+
data.tar.gz: c4d27560a932ed5480451255a68d9eb0b1d1f61a782d38e6d2e8d479ed4164bcf6fc386b2abf6e4ae2f4eba070f99062c328a82ec3439cf6fe4de80203c419ca
|
data/lib/riveter/errors.rb
CHANGED
|
@@ -43,7 +43,7 @@ module Riveter
|
|
|
43
43
|
end
|
|
44
44
|
|
|
45
45
|
# Builds an APIError from either the clean { "error" => {...} } envelope
|
|
46
|
-
# or the
|
|
46
|
+
# or the { "request_status" => "error" } shape (401s).
|
|
47
47
|
def self.from_response(status, body)
|
|
48
48
|
if body.is_a?(Hash)
|
|
49
49
|
error = body["error"]
|
data/lib/riveter/models.rb
CHANGED
|
@@ -57,14 +57,13 @@ module Riveter
|
|
|
57
57
|
# Endpoint-specific kickoff extras (dataset_id, credits_charged, ...) are
|
|
58
58
|
# plain fields; #output is nil until the run finishes. An `estimate_cost: true`
|
|
59
59
|
# kickoff returns this shape with #estimate_cost set, no #id, and the priced
|
|
60
|
-
# #credit_detail.
|
|
61
|
-
# kickoff took a legacy mode.
|
|
60
|
+
# #credit_detail.
|
|
62
61
|
class Run < Model
|
|
63
62
|
field :id, :type, :status, :credits_used, :estimate_cost, :app_url, :result_url,
|
|
64
63
|
:started_at, :finished_at, :error, :stopped_reason, :enrichment_id, :enrichment_name,
|
|
65
64
|
:dataset_id, :extraction_id, :monitor_id, :webhook_url, :output,
|
|
66
65
|
:max_items, :configured_dataset_id, :credits_charged, :variables,
|
|
67
|
-
:validation_warning, :tier
|
|
66
|
+
:validation_warning, :tier
|
|
68
67
|
model_field :progress, RunProgress
|
|
69
68
|
model_field :credit_detail, CreditDetail
|
|
70
69
|
|
|
@@ -87,21 +86,18 @@ module Riveter
|
|
|
87
86
|
field :counts
|
|
88
87
|
end
|
|
89
88
|
|
|
90
|
-
# Compact list-endpoint shape. Column configuration is on Enrichments#get.
|
|
91
|
-
# #app_url, and #dataset_id (the dataset copy to fill instead) are set on legacy
|
|
92
|
-
# enrichments only.
|
|
89
|
+
# Compact list-endpoint shape. Column configuration is on Enrichments#get.
|
|
93
90
|
class EnrichmentSummary < Model
|
|
94
|
-
field :id, :name, :
|
|
91
|
+
field :id, :name, :column_count, :input_columns,
|
|
95
92
|
:output_columns, :column_names_truncated, :created_at, :updated_at
|
|
96
93
|
end
|
|
97
94
|
|
|
98
95
|
# An enrichment: #prompt, #input_columns, #output as an array of column hashes ("name" /
|
|
99
96
|
# "prompt" / "output_schema" / "tool"), #tools, the budget fields, and #version.
|
|
100
|
-
# #dataset_id / #app_url are set on Enrichments#create.
|
|
101
|
-
# its older shape (the legacy API docs, kept in #raw) with #legacy set.
|
|
97
|
+
# #dataset_id / #app_url are set on Enrichments#create.
|
|
102
98
|
class Enrichment < Model
|
|
103
99
|
field :id, :name, :prompt, :input_columns, :output, :tools, :budget_credits_per_row,
|
|
104
|
-
:budget_locked, :version, :created_at, :updated_at, :app_url, :dataset_id
|
|
100
|
+
:budget_locked, :version, :created_at, :updated_at, :app_url, :dataset_id
|
|
105
101
|
end
|
|
106
102
|
|
|
107
103
|
# One cell. #state is pending / running / ok / not_found / failed / manual / stale;
|
|
@@ -228,8 +224,9 @@ module Riveter
|
|
|
228
224
|
end
|
|
229
225
|
end
|
|
230
226
|
|
|
227
|
+
# #error is nil unless #status is "discovery_failed"; then it is a Hash with "type" and "message".
|
|
231
228
|
class Extraction < Model
|
|
232
|
-
field :id, :name, :status, :app_url, :starting_url, :goal_description,
|
|
229
|
+
field :id, :name, :status, :error, :app_url, :starting_url, :goal_description,
|
|
233
230
|
:output_record_json_schema, :required_keys, :locked,
|
|
234
231
|
:validation_passing, :discovered_at, :run_credits_required,
|
|
235
232
|
:credits_charged, :estimate_cost
|
|
@@ -237,19 +234,17 @@ module Riveter
|
|
|
237
234
|
end
|
|
238
235
|
|
|
239
236
|
# A monitor fills #dataset_id's #columns (every output column when nil) again on a
|
|
240
|
-
# schedule.
|
|
241
|
-
# #
|
|
242
|
-
# `estimate_cost: true` create returns this shape with #estimate_cost set, no #id, and
|
|
243
|
-
# the priced #credit_detail for one tick.
|
|
237
|
+
# schedule. An `estimate_cost: true` create returns this shape with #estimate_cost set,
|
|
238
|
+
# no #id, and the priced #credit_detail for one tick.
|
|
244
239
|
class Monitor < Model
|
|
245
240
|
field :id, :name, :enabled, :cadence, :minute, :hour, :day_of_week,
|
|
246
241
|
:day_of_month, :timezone, :webhook_url, :alert_rule, :output_format,
|
|
247
242
|
:next_run_at, :schedule_summary, :dataset_id, :dataset_name, :columns,
|
|
248
|
-
:enrichment_id, :
|
|
243
|
+
:enrichment_id, :created_at, :estimate_cost
|
|
249
244
|
model_field :credit_detail, CreditDetail
|
|
250
245
|
end
|
|
251
246
|
|
|
252
|
-
# Synchronous scrape result (
|
|
247
|
+
# Synchronous scrape result (request_status format, per the spec).
|
|
253
248
|
class ScrapeResult < Model
|
|
254
249
|
field :request_status, :text, :url, :base_url_for_links, :status_code,
|
|
255
250
|
:possibly_blocked, :credit_used, :riveter_app_link, :estimate_cost
|
|
@@ -269,7 +264,7 @@ module Riveter
|
|
|
269
264
|
field :name, :last_used_at, :created_by
|
|
270
265
|
end
|
|
271
266
|
|
|
272
|
-
# Account info (
|
|
267
|
+
# Account info (request_status format, per the spec).
|
|
273
268
|
class AccountInfo < Model
|
|
274
269
|
field :request_status, :message
|
|
275
270
|
model_field :account, Account
|
data/lib/riveter/resources.rb
CHANGED
|
@@ -58,8 +58,8 @@ module Riveter
|
|
|
58
58
|
@client = client
|
|
59
59
|
end
|
|
60
60
|
|
|
61
|
-
# Paginated compact list of enrichments: names,
|
|
62
|
-
#
|
|
61
|
+
# Paginated compact list of enrichments: names, column names and counts.
|
|
62
|
+
# Params: name:, page:, per_page:. (operationId: listEnrichments)
|
|
63
63
|
def list(**params)
|
|
64
64
|
fetch_page = ->(page) { @client.request(:get, "/enrichments", query: params.merge(page: page)) }
|
|
65
65
|
EnrichmentsPage.new(fetch_page.call(params[:page] || 1), fetch_page)
|
data/lib/riveter/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: riveter-sdk
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Riveter
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-11-17 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: Client for the Riveter API — enrich data, build datasets, scrape pages,
|
|
14
14
|
and run web searches. https://docs.riveterhq.com
|