bitfab 0.62.1 → 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: cc1948acb817b6dd96f4640660c592d8e9445992793a74ab5f42d7ae4e83d4aa
4
- data.tar.gz: cfe56ae2c624d01c9bef3cbc583e83cf841cf4c50c99087e9138f9dbb00b0049
3
+ metadata.gz: e9c9645b803f604245b2f2f2bbd14117590321d81234a8f423c1cd28a3e44a87
4
+ data.tar.gz: a2171ba8262decea1b34c57bcb67cb4d678aab2b10fa42f9f3ba7ca889c2a5b0
5
5
  SHA512:
6
- metadata.gz: eb3efe0fa5f4cf0b5487345630ff9f2ce31ae5ed9e0a9a33d5648f91e63b23af959e54fa8d4a7dbd20c757e2eeea2de07704df34b14626c006df447d7bb4c3b9
7
- data.tar.gz: 261f27ee2d6e223aa74b94c8ed9664b9bc179e4399128ce8258f1158def61b29433d792735860095c87a0c01e76b6959a915d7110d84386ff63214f49563eb07
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bitfab
4
- VERSION = "0.62.1"
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.1
4
+ version: 0.62.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Harvest Team