omniai-anthropic 1.9.3 → 1.9.5
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a87fd0a4205d9cfe57877da0c8fdf7df5cafe32b277828b5a3d3f784a4f30c0c
|
4
|
+
data.tar.gz: 2bc347f7ca3a524646c11c8eea23171eee8689d57e64b68a42ed1cd552f1e268
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f6e2b83dcdf422bff4eaccddd3cc08651494dc8903e81370556609992f4cd030f16b2991e00ee8e5662e87c5a0dcd912674e7fc63f24ee85420d5f4675731c8
|
7
|
+
data.tar.gz: 19148605bf8ca1c22442505dcc8e4c624fb150486e0e2be1fa4407127b556c2e9eb4bbbb31340459dbdeb87bb58475f1f3f2c29e5404880e466e8d776c8e9371
|
@@ -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
|