omniai-anthropic 3.8.0 → 3.8.1

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