omniai-anthropic 3.8.0 → 3.9.0

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: 1689783da704c9474e0c87a65b63a11589918a1c85d2cdbb3c936bb367903cf9
4
- data.tar.gz: 581b32358a1c0464e7f3550fe0d0caac455955703b98dde80f1fb755e4f8d10d
3
+ metadata.gz: 51669edf069f8f6e36ee785035c535721e3ee67c36c3620297f56ac81f41827c
4
+ data.tar.gz: 605d8e0e44e5b3c6ffe0746240d8265577eceb525e49982b1ddf807773ce3538
5
5
  SHA512:
6
- metadata.gz: a89aa7e9b61dd98d9b893ea147da74f35fec059fdc05a9ebecaf80651496f62aabfbc3d43ede744527bf5e811a26caa9dc928e6c25ec433b1faeef734063fffe
7
- data.tar.gz: 81ff3b93a6f55df6848cc86f65984f1083e29fc9c8ddd03661c04126df3ace29df62837238cea61d69011bb1037ad1c1a83bc832750acbf680e98f28ce60aad2
6
+ metadata.gz: e1191e0dc2452e687ee4155b411ef4f1dd898fd66ca24887a7b1539efe6b6e8e9174b938c8145228400f24df77e6515bcdb1f65573e0543917b798b1f4ae1487
7
+ data.tar.gz: 249d249dcf655d636a41b44e418c339f5d6e102fc6292d15b72306de5f23b00a31b3ebcd5b88193620a7ec020496db41d4708efa18709fa61891c13d5f76737d
@@ -52,6 +52,7 @@ module OmniAI
52
52
  CLAUDE_SONNET_4_5 = "claude-sonnet-4-5"
53
53
  CLAUDE_SONNET_4_6 = "claude-sonnet-4-6"
54
54
  CLAUDE_SONNET_5 = "claude-sonnet-5"
55
+ CLAUDE_SONNET_5_5 = "claude-sonnet-5-5"
55
56
  CLAUDE_FABLE_5 = "claude-fable-5"
56
57
 
57
58
  CLAUDE_HAIKU = CLAUDE_HAIKU_4_5
@@ -61,6 +62,21 @@ module OmniAI
61
62
 
62
63
  DEFAULT_MODEL = Model::CLAUDE_SONNET
63
64
 
65
+ # Models that reject `temperature` with a 400 ("`temperature` is deprecated for this model"), even with
66
+ # thinking omitted. Every entry below was verified live against the API (Sonnet 5.5 on 2026-09-28, the rest on
67
+ # 2026-09-26). Opus 4.8 rejects it too but has no constant yet.
68
+ #
69
+ # Models absent from this list pass `temperature` through unchanged. That is deliberate: an unlisted
70
+ # model that rejects it surfaces a loud API error the caller can act on, whereas over-applying the guard
71
+ # would silently discard a caller's temperature.
72
+ TEMPERATURE_UNSUPPORTED_MODELS = [
73
+ Model::CLAUDE_OPUS_4_7,
74
+ Model::CLAUDE_OPUS_5,
75
+ Model::CLAUDE_OPUS_5_5,
76
+ Model::CLAUDE_SONNET_5,
77
+ Model::CLAUDE_SONNET_5_5,
78
+ ].freeze
79
+
64
80
  # @return [Context]
65
81
  CONTEXT = Context.build do |context|
66
82
  context.serializers[:tool] = ToolSerializer.method(:serialize)
@@ -95,7 +111,8 @@ module OmniAI
95
111
  # @return [Hash]
96
112
  #
97
113
  # NOTE: Anthropic requires temperature=1 (default) when thinking is enabled,
98
- # so temperature is omitted from the payload when thinking_config is present.
114
+ # so temperature is omitted from the payload when thinking_config is present
115
+ # or the model is in TEMPERATURE_UNSUPPORTED_MODELS.
99
116
  def payload
100
117
  OmniAI::Anthropic.config.chat_options
101
118
  .merge({
@@ -103,7 +120,7 @@ module OmniAI
103
120
  messages:,
104
121
  system:,
105
122
  stream: stream? || nil,
106
- temperature: thinking_config ? nil : @temperature,
123
+ temperature: thinking_config || TEMPERATURE_UNSUPPORTED_MODELS.include?(@model) ? nil : @temperature,
107
124
  tools: tools_payload,
108
125
  thinking: thinking_config,
109
126
  })
@@ -2,6 +2,6 @@
2
2
 
3
3
  module OmniAI
4
4
  module Anthropic
5
- VERSION = "3.8.0"
5
+ VERSION = "3.9.0"
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: 3.8.0
4
+ version: 3.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Sylvestre