foobara-anthropic-api 0.0.11 → 1.0.1

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: 100d058f153d064ff269add3266553a015cbd49dc65fb19fe56ca2b51c0c12e2
4
- data.tar.gz: e915d5871114ea3274babbe516c979f615756434dc6447923f1b6db94f7f29b9
3
+ metadata.gz: 31dbabde045e3fba65b784d621e015238a68ba0e2fac1b11fa116790af8fe7a4
4
+ data.tar.gz: 8bc717a103e506dd46c6e3b1488e6a288dfc595f3915df2a3bbe882b57249f21
5
5
  SHA512:
6
- metadata.gz: 79bb2307a2e8a2599495a2e6b70f7082eb0cfbc25f7bb63369cb0ff4d0f934a1f760d691703e46a313e0fe9d9bd2a5d94d5f6fe0db1b41ded2bab61ae16492fe
7
- data.tar.gz: 9ff209426bb551fd9e844a876720d086d2ec96dc2566b71b346a889064cf1fe3bf183eb99b7310facd858b9e71f9231672f7208fb68f83cac3c6dddbcf67a34a
6
+ metadata.gz: adfa510edd141f56f8a92184fc395fc33e2c40bd1eec91dcd8e1aa9de464744c95aee175cf8cea23e31d3bd3b419e289000c33ceee9b01e5c0a0b1d1cb155866
7
+ data.tar.gz: faefc72c13e128d0659fd3662b52067a0bc98289633285b0e4532eda9e53c091da89361c0ce6817d1bcaf768d3f011d501a8df37f284ef87f013c448ce77f651
@@ -36,6 +36,27 @@ module Foobara
36
36
  def anthropic_version
37
37
  inputs[:anthropic_version] || ENV.fetch("ANTHROPIC_VERSION", "2023-06-01")
38
38
  end
39
+
40
+ def issue_http_request(failures = 0)
41
+ super()
42
+
43
+ return if failures > 6
44
+
45
+ case response.code
46
+ when "429"
47
+ # TODO: figure out how to test this code path
48
+ # :nocov:
49
+ sleep 2 ** failures
50
+ issue_http_request(failures + 1)
51
+ # :nocov:
52
+ when "529"
53
+ # :nocov:
54
+ failures += 1
55
+ sleep failures
56
+ issue_http_request(failures)
57
+ # :nocov:
58
+ end
59
+ end
39
60
  end
40
61
  end
41
62
  end
@@ -16,6 +16,10 @@ module Foobara
16
16
  def api_token
17
17
  BaseCommand.api_token
18
18
  end
19
+
20
+ def default_llm_model
21
+ :"claude-3-7-sonnet-20250219"
22
+ end
19
23
  end
20
24
  end
21
25
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foobara-anthropic-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Georgi