foobara-anthropic-api 1.0.5 → 1.0.6
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/src/foobara/ai/anthropic_api/base_command.rb +4 -4
- data/src/foobara/ai/anthropic_api/create_message.rb +5 -7
- data/src/foobara/ai/anthropic_api/get_page_of_models.rb +5 -1
- data/src/foobara/ai/anthropic_api/types/message_result/usage.rb +11 -0
- data/src/foobara/ai/anthropic_api/types/message_result.rb +5 -0
- data/src/foobara/ai/anthropic_api/types/model.rb +6 -0
- 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: 2e1de39baf03e0b402cf920da0ad61f1d00072b3d732805526763d68557d4ed4
|
|
4
|
+
data.tar.gz: 531499f4a14808a66d4faf6db42b6a6aff624ccab3904b455121525305c1806d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dd3d98e7a450ef8e34db7b9eac489038c3a7d5327719bb250bafc6c5d95d80de452e2cbd13846236dfd1ffab97ffbb99735a9ab9198a7abdd2959710f391e17b
|
|
7
|
+
data.tar.gz: ec7e9c6f7491044c861eaf319a26a8053fd2dc4f4746259c6916cfff97beb9aeef6974fba21ef9a97275ca32e80a325f92d223adc59422b990ed0a474f601aa8
|
|
@@ -47,16 +47,16 @@ module Foobara
|
|
|
47
47
|
case response.code
|
|
48
48
|
when "429"
|
|
49
49
|
# TODO: figure out how to test this code path
|
|
50
|
-
# :
|
|
50
|
+
# simplecov:disable
|
|
51
51
|
sleep 2 ** failures
|
|
52
52
|
issue_http_request(failures + 1)
|
|
53
|
-
# :
|
|
53
|
+
# simplecov:enable
|
|
54
54
|
when "529"
|
|
55
|
-
# :
|
|
55
|
+
# simplecov:disable
|
|
56
56
|
failures += 1
|
|
57
57
|
sleep failures
|
|
58
58
|
issue_http_request(failures)
|
|
59
|
-
# :
|
|
59
|
+
# simplecov:enable
|
|
60
60
|
end
|
|
61
61
|
end
|
|
62
62
|
end
|
|
@@ -12,7 +12,6 @@ module Foobara
|
|
|
12
12
|
max_tokens :integer, default: 1024
|
|
13
13
|
model :model_enum, default: AnthropicApi.default_llm_model
|
|
14
14
|
messages [Types::Message]
|
|
15
|
-
temperature :float
|
|
16
15
|
end
|
|
17
16
|
|
|
18
17
|
result Types::MessageResult
|
|
@@ -20,11 +19,6 @@ module Foobara
|
|
|
20
19
|
def build_request_body
|
|
21
20
|
body = { model:, max_tokens:, messages: }
|
|
22
21
|
|
|
23
|
-
temp = inputs[:temperature]
|
|
24
|
-
if temp
|
|
25
|
-
body[:temperature] = temp
|
|
26
|
-
end
|
|
27
|
-
|
|
28
22
|
sys = inputs[:system]
|
|
29
23
|
if sys
|
|
30
24
|
body[:system] = sys
|
|
@@ -34,7 +28,11 @@ module Foobara
|
|
|
34
28
|
end
|
|
35
29
|
|
|
36
30
|
def build_result
|
|
37
|
-
Types::MessageResult.new(
|
|
31
|
+
Types::MessageResult.new(
|
|
32
|
+
response_body,
|
|
33
|
+
# Set this to false to discover new attributes
|
|
34
|
+
ignore_unexpected_attributes: true
|
|
35
|
+
)
|
|
38
36
|
end
|
|
39
37
|
end
|
|
40
38
|
end
|
|
@@ -25,7 +25,11 @@ module Foobara
|
|
|
25
25
|
end
|
|
26
26
|
|
|
27
27
|
def build_result
|
|
28
|
-
Types::PageOfModels.new(
|
|
28
|
+
Types::PageOfModels.new(
|
|
29
|
+
response_body,
|
|
30
|
+
# Set this to false to discover new attributes
|
|
31
|
+
ignore_unexpected_attributes: true
|
|
32
|
+
)
|
|
29
33
|
end
|
|
30
34
|
end
|
|
31
35
|
end
|
|
@@ -7,6 +7,17 @@ module Foobara
|
|
|
7
7
|
attributes do
|
|
8
8
|
input_tokens :integer, :required
|
|
9
9
|
output_tokens :integer, :required
|
|
10
|
+
|
|
11
|
+
# TODO: no clue if this can actually be null
|
|
12
|
+
cache_creation_input_tokens :integer, :allow_nil
|
|
13
|
+
# TODO: no clue if this can actually be null
|
|
14
|
+
cache_read_input_tokens :integer, :allow_nil
|
|
15
|
+
# TODO: type this
|
|
16
|
+
cache_creation :duckture, :allow_nil
|
|
17
|
+
# TODO: appears to be some kind of enum. No clue if it can be null
|
|
18
|
+
service_tier :string, :allow_nil
|
|
19
|
+
# TODO: appears to be some kind of enum. No clue if it can be null
|
|
20
|
+
inference_geo :string, :allow_nil
|
|
10
21
|
end
|
|
11
22
|
end
|
|
12
23
|
end
|
|
@@ -15,6 +15,11 @@ module Foobara
|
|
|
15
15
|
stop_sequence :string, :allow_nil
|
|
16
16
|
type :string, :required, one_of: ["message"]
|
|
17
17
|
usage Usage
|
|
18
|
+
|
|
19
|
+
# TODO: type this, no clue what it is (but it can definitely be null)
|
|
20
|
+
stop_details :duck
|
|
21
|
+
# TODO: type this, no clue what it is (but it can definitely be null)
|
|
22
|
+
container :duck
|
|
18
23
|
end
|
|
19
24
|
end
|
|
20
25
|
end
|
|
@@ -8,6 +8,12 @@ module Foobara
|
|
|
8
8
|
display_name :string, :required
|
|
9
9
|
type :string, :required
|
|
10
10
|
created_at :datetime, :required
|
|
11
|
+
# TODO: unclear if this can be null
|
|
12
|
+
max_input_tokens :integer, :allow_nil
|
|
13
|
+
# TODO: unclear if this can be null
|
|
14
|
+
max_tokens :integer, :allow_nil
|
|
15
|
+
# TODO: properly type this
|
|
16
|
+
capabilities :duckture, :allow_nil
|
|
11
17
|
end
|
|
12
18
|
end
|
|
13
19
|
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: 1.0.
|
|
4
|
+
version: 1.0.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Miles Georgi
|
|
@@ -100,7 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
100
100
|
- !ruby/object:Gem::Version
|
|
101
101
|
version: '0'
|
|
102
102
|
requirements: []
|
|
103
|
-
rubygems_version:
|
|
103
|
+
rubygems_version: 4.0.20
|
|
104
104
|
specification_version: 4
|
|
105
105
|
summary: No description. Add one.
|
|
106
106
|
test_files: []
|