riveter-sdk 1.1.0 → 1.2.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 +11 -17
- 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: 5287a59260bd3fbf2f4069af7bcc49ec2c8cb9015d55e36db170c50c62ca5fa9
|
|
4
|
+
data.tar.gz: 50ecfae1ff05b163f8479d9c63aabad0a18e31f001fd2a7fb4656901dc471f00
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2bd4722b2d5c49a06390a520ca1b7f0319923390debe5a3301496cd58f6257de10aff9e28254175a52c9745b9a9038915a27bc6acaa354137641fc3b61b3c414
|
|
7
|
+
data.tar.gz: ad7644661ae6d842485962aa4db8006936f26db528243ebebcdc721440f2cf879c4a05734a78924b3cf4b75d335e70ab2a36409f32a65c4d64b5af73426c81f3
|
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;
|
|
@@ -237,19 +233,17 @@ module Riveter
|
|
|
237
233
|
end
|
|
238
234
|
|
|
239
235
|
# 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.
|
|
236
|
+
# schedule. An `estimate_cost: true` create returns this shape with #estimate_cost set,
|
|
237
|
+
# no #id, and the priced #credit_detail for one tick.
|
|
244
238
|
class Monitor < Model
|
|
245
239
|
field :id, :name, :enabled, :cadence, :minute, :hour, :day_of_week,
|
|
246
240
|
:day_of_month, :timezone, :webhook_url, :alert_rule, :output_format,
|
|
247
241
|
:next_run_at, :schedule_summary, :dataset_id, :dataset_name, :columns,
|
|
248
|
-
:enrichment_id, :
|
|
242
|
+
:enrichment_id, :created_at, :estimate_cost
|
|
249
243
|
model_field :credit_detail, CreditDetail
|
|
250
244
|
end
|
|
251
245
|
|
|
252
|
-
# Synchronous scrape result (
|
|
246
|
+
# Synchronous scrape result (request_status format, per the spec).
|
|
253
247
|
class ScrapeResult < Model
|
|
254
248
|
field :request_status, :text, :url, :base_url_for_links, :status_code,
|
|
255
249
|
:possibly_blocked, :credit_used, :riveter_app_link, :estimate_cost
|
|
@@ -269,7 +263,7 @@ module Riveter
|
|
|
269
263
|
field :name, :last_used_at, :created_by
|
|
270
264
|
end
|
|
271
265
|
|
|
272
|
-
# Account info (
|
|
266
|
+
# Account info (request_status format, per the spec).
|
|
273
267
|
class AccountInfo < Model
|
|
274
268
|
field :request_status, :message
|
|
275
269
|
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.2.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-12 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
|