omniai-anthropic 1.9.3 → 1.9.4
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/omniai/anthropic/client.rb +4 -0
- data/lib/omniai/anthropic/config.rb +7 -0
- data/lib/omniai/anthropic/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe02992338864e110012ee2d463d0922deb06d0e536b246546eae3b3cfd9d5aa
|
4
|
+
data.tar.gz: 3ad82e6af98e100ac3186120a5622c87184f759dc669bea4f26a99489b116411
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 180cea8404f6740edbd1c219e21089a40604e5cfdef051e0dfe1f6ba0b624f55bab73d69c8629e22a17e16b6e0008f32b6498694cedb525defd0bc70c6810ccf
|
7
|
+
data.tar.gz: c955b172f69deb6afd9d03d215e1ac1aa2d60407d8d8b214bbe381085c55af5659f64a82dab20aa95be4a3254c49abdabf87e2a90ca004d3a9598c32dec37ecc
|
@@ -25,12 +25,14 @@ module OmniAI
|
|
25
25
|
# @param api_key [String] optional - defaults to `OmniAI::Anthropic.config.api_key`
|
26
26
|
# @param host [String] optional - defaults to `OmniAI::Anthropic.config.host`
|
27
27
|
# @param version [String] optional - defaults to `OmniAI::Anthropic.config.version`
|
28
|
+
# @param beta [String] optional - defaults to `OmniAI::Anthropic.config.beta`
|
28
29
|
# @param logger [Logger] optional - defaults to `OmniAI::Anthropic.config.logger`
|
29
30
|
# @param timeout [Integer] optional - defaults to `OmniAI::Anthropic.config.timeout`
|
30
31
|
def initialize(
|
31
32
|
api_key: OmniAI::Anthropic.config.api_key,
|
32
33
|
host: OmniAI::Anthropic.config.host,
|
33
34
|
version: OmniAI::Anthropic.config.version,
|
35
|
+
beta: OmniAI::Anthropic.config.beta,
|
34
36
|
logger: OmniAI::Anthropic.config.logger,
|
35
37
|
timeout: OmniAI::Anthropic.config.timeout
|
36
38
|
)
|
@@ -40,6 +42,7 @@ module OmniAI
|
|
40
42
|
|
41
43
|
@host = host
|
42
44
|
@version = version
|
45
|
+
@beta = beta
|
43
46
|
end
|
44
47
|
|
45
48
|
# @return [HTTP::Client]
|
@@ -47,6 +50,7 @@ module OmniAI
|
|
47
50
|
@connection ||= super.headers({
|
48
51
|
'x-api-key': @api_key,
|
49
52
|
'anthropic-version': @version,
|
53
|
+
'anthropic-beta': @beta,
|
50
54
|
}.compact)
|
51
55
|
end
|
52
56
|
|
@@ -11,20 +11,27 @@ module OmniAI
|
|
11
11
|
# @return [String, nil] passed as `anthropic-version` if specified
|
12
12
|
attr_accessor :version
|
13
13
|
|
14
|
+
# @!attribute [rw] beta
|
15
|
+
# @return [String, nil] passed as `anthropic-beta` if specified
|
16
|
+
attr_accessor :beta
|
17
|
+
|
14
18
|
# @param api_key [String, nil] optional - defaults to `ENV['ANTHROPIC_API_KEY']`
|
15
19
|
# @param host [String, nil] optional - defaults to `ENV['ANTHROPIC_HOST'] w/ fallback to `DEFAULT_HOST`
|
16
20
|
# @param version [String, nil] optional - defaults to `ENV['ANTHROPIC_VERSION'] w/ fallback to `DEFAULT_VERSION`
|
21
|
+
# @param beta [String, nil] optional - defaults to `ENV['ANTHROPIC_BETA']`
|
17
22
|
# @param logger [Logger, nil] optional - defaults to
|
18
23
|
# @param timeout [Integer, Hash, nil] optional
|
19
24
|
def initialize(
|
20
25
|
api_key: ENV.fetch('ANTHROPIC_API_KEY', nil),
|
21
26
|
host: ENV.fetch('ANTHROPIC_HOST', DEFAULT_HOST),
|
22
27
|
version: ENV.fetch('ANTHROPIC_VERSION', DEFAULT_VERSION),
|
28
|
+
beta: ENV.fetch('ANTHROPIC_BETA', nil),
|
23
29
|
logger: nil,
|
24
30
|
timeout: nil
|
25
31
|
)
|
26
32
|
super(api_key:, host:, logger:, timeout:)
|
27
33
|
@version = version
|
34
|
+
@beta = beta
|
28
35
|
@chat_options[:max_tokens] = 4096
|
29
36
|
end
|
30
37
|
end
|