omniai-anthropic 1.9.3 → 1.9.4

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: 3b3723aa11fbf3b8def1f87dee64a9bc9a171e7d2e8e3292354c5476c24d4233
4
- data.tar.gz: 667d9b3ce3e9fb6cd4061372358b555def837325f3107404bf0a83fbd10a9af4
3
+ metadata.gz: fe02992338864e110012ee2d463d0922deb06d0e536b246546eae3b3cfd9d5aa
4
+ data.tar.gz: 3ad82e6af98e100ac3186120a5622c87184f759dc669bea4f26a99489b116411
5
5
  SHA512:
6
- metadata.gz: e448d21a9d4d615b2679015bd8ada729b23a407a1707d956baff61cb1fcc629e26cfaf7752b18f6dc52abed4b1a22cea884d95b2c423391be8e5ca5329b4ea5d
7
- data.tar.gz: c68070843dc6c36ffb8639873eee20d61382c44b035f41ca147ac458fecb58709a52f06d3bad476fb91d835315eeed47c8f7dfb0af10566ed5e65566f033690a
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module OmniAI
4
4
  module Anthropic
5
- VERSION = '1.9.3'
5
+ VERSION = '1.9.4'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniai-anthropic
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.3
4
+ version: 1.9.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Sylvestre