bitfab 0.62.0 → 0.62.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4a04ce4c6087bca4125aeb03947b00facce1f8b1f8da0ab35973c110ef1f40ae
4
- data.tar.gz: c66fec4e4390bbdfa35f1a12a010bc070400309b874c2531f48930729754712f
3
+ metadata.gz: e9c9645b803f604245b2f2f2bbd14117590321d81234a8f423c1cd28a3e44a87
4
+ data.tar.gz: a2171ba8262decea1b34c57bcb67cb4d678aab2b10fa42f9f3ba7ca889c2a5b0
5
5
  SHA512:
6
- metadata.gz: 5c0d3bf2b9f187c8e0ec6e9ce99cf28b81cf992377e4621e9636d77cd79a027a15f857e3572ba0bf8ebf5a4912cbd4fd8da8cd652ab1d2ad5f77e43073ba8c6e
7
- data.tar.gz: 64eef7e076828f8ab95c4b53f0f2c95061b142819d8e705ac59417a6b2df95da6ed6f4e5100627881e8de8582f769a6cf557e99b9a3ad3185eeb2e1e9f247ece
6
+ metadata.gz: de9ac521536899df9364387a8ad984328b952463bf79a440156156d8478aaf58331d9b4feec5f08b56f9bda8518eb6833a654301a3b9d9600dfd7fd6d20ffb49
7
+ data.tar.gz: 928e7013f798a18e730225d97e13ea2a6752d5e76c0a880b5df860fdfa7b016d8f44382026b926b0759c656c10b634d28abba5c4d8bc448aa3f3b85a26d539a4
@@ -4,6 +4,8 @@ require "uri"
4
4
 
5
5
  module Bitfab
6
6
  class Graders
7
+ GRADER_LABELS_PATH = "/api/sdk/graderLabels"
8
+
7
9
  def initialize(http_client)
8
10
  @http_client = http_client
9
11
  end
@@ -17,7 +19,19 @@ module Bitfab
17
19
  params["traceIds"] = trace_ids.join(",") unless trace_ids.nil? || trace_ids.empty?
18
20
  params["graderId"] = grader_id unless grader_id.nil?
19
21
  params["limit"] = limit unless limit.nil?
20
- @http_client.get("/api/sdk/graderLabels?#{URI.encode_www_form(params)}")["labels"]
22
+ @http_client.get("#{GRADER_LABELS_PATH}?#{URI.encode_www_form(params)}")["labels"]
23
+ end
24
+
25
+ def save_label(grader_id:, trace_id:, label:, reason: nil, failure_diagnostic: nil, confidence: nil)
26
+ update = {"graderId" => grader_id, "traceId" => trace_id, "label" => label}
27
+ update["reason"] = reason unless reason.nil?
28
+ update["failureDiagnostic"] = failure_diagnostic unless failure_diagnostic.nil?
29
+ update["confidence"] = confidence unless confidence.nil?
30
+ save_label_all([update]).first
31
+ end
32
+
33
+ def save_label_all(labels)
34
+ @http_client.request(GRADER_LABELS_PATH, {"labels" => labels})["labels"]
21
35
  end
22
36
  end
23
37
  end
@@ -186,7 +186,7 @@ module Bitfab
186
186
  options[:limit] = bound || 10
187
187
  end
188
188
 
189
- %i[name notes max_concurrency experiment_group_id dataset_ids grader_ids mock attempts only_with_assertions dry_run].each do |key|
189
+ %i[name notes max_concurrency experiment_group_id dataset_ids grader_ids mock attempts only_with_assertions judge_assertions dry_run].each do |key|
190
190
  options[key] = args[key] unless args[key].nil?
191
191
  end
192
192
 
@@ -303,6 +303,8 @@ module Bitfab
303
303
  options.on("--grader-ids IDS") { |value| args[:grader_ids] = comma_separated("--grader-ids", value) }
304
304
  options.on("--attempts N", Integer) { |value| args[:attempts] = positive_integer("--attempts", value) }
305
305
  options.on("--only-with-assertions") { args[:only_with_assertions] = true }
306
+ options.on("--judge-assertions",
307
+ "Judge each replay's approved assertions as it finishes (costs model calls)") { args[:judge_assertions] = true }
306
308
  options.on("--dry-run") { args[:dry_run] = true }
307
309
  options.on("--primitive TYPE", %w[async process]) { |value| args[:primitive] = value }
308
310
  options.on("--[no-]memory-throttle") { |value| args[:memory_throttle] = value }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bitfab
4
- VERSION = "0.62.0"
4
+ VERSION = "0.62.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bitfab
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.62.0
4
+ version: 0.62.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Harvest Team