omniai-anthropic 3.7.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: 20cd61e7e110c59273cb86062c34630d07d66b14a5da7be33cfb11f3a3f29514
4
- data.tar.gz: 44dfedfa87d0cb07ca36fc155efd5ddb8507eef146202a41e98be1c1bbd0010c
3
+ metadata.gz: 54ace6377f4ec569ce3e78de2d878c099707d9331e5cbb68635a766c71637b4e
4
+ data.tar.gz: 27868e87f01534c18a2e951d6eabeb82b6ec3100f2b36818e610c0c76ae5c782
5
5
  SHA512:
6
- metadata.gz: 815f8ed94a51cdbe222754218ab865a17227971e6d58d0c39aa6a87425919127af507871bd25263f355d22c5e46c5849c2bc34d6f3a955b6cebc6a06ce944c49
7
- data.tar.gz: c4303f54ed395240b18c054f1776ac680323c89ba609c9c0c8dba57f5ad0c641d71eaa34a4713d9d6cc3356fdda59d4f020a186bc7b0d6aca5ec66f9bf2fe34d
6
+ metadata.gz: ac834a7bb42e9af6529ae465ec9048c24ca2b3f1490b69df42dcca5b064ad67d7b704dd76e4c1b802aa11b7a7e9b2e9342043add43eed6d22592956c45a37eb7
7
+ data.tar.gz: '081062fa5a0e066ae77d05e4fea012253a92d172e55e360a58235de5ab335789629ceee7e95d6f9cd25256141ff7afdb8cdd3d3fcd31fc050ec91f950f6ef2cb'
@@ -47,6 +47,7 @@ module OmniAI
47
47
  CLAUDE_OPUS_4_6 = "claude-opus-4-6"
48
48
  CLAUDE_OPUS_4_7 = "claude-opus-4-7"
49
49
  CLAUDE_OPUS_5 = "claude-opus-5"
50
+ CLAUDE_OPUS_5_5 = "claude-opus-5-5"
50
51
  CLAUDE_SONNET_4_0 = "claude-sonnet-4-0"
51
52
  CLAUDE_SONNET_4_5 = "claude-sonnet-4-5"
52
53
  CLAUDE_SONNET_4_6 = "claude-sonnet-4-6"
@@ -54,12 +55,26 @@ module OmniAI
54
55
  CLAUDE_FABLE_5 = "claude-fable-5"
55
56
 
56
57
  CLAUDE_HAIKU = CLAUDE_HAIKU_4_5
57
- CLAUDE_OPUS = CLAUDE_OPUS_5
58
+ CLAUDE_OPUS = CLAUDE_OPUS_5_5
58
59
  CLAUDE_SONNET = CLAUDE_SONNET_5
59
60
  end
60
61
 
61
62
  DEFAULT_MODEL = Model::CLAUDE_SONNET
62
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
+
63
78
  # @return [Context]
64
79
  CONTEXT = Context.build do |context|
65
80
  context.serializers[:tool] = ToolSerializer.method(:serialize)
@@ -94,7 +109,8 @@ module OmniAI
94
109
  # @return [Hash]
95
110
  #
96
111
  # NOTE: Anthropic requires temperature=1 (default) when thinking is enabled,
97
- # 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.
98
114
  def payload
99
115
  OmniAI::Anthropic.config.chat_options
100
116
  .merge({
@@ -102,7 +118,7 @@ module OmniAI
102
118
  messages:,
103
119
  system:,
104
120
  stream: stream? || nil,
105
- temperature: thinking_config ? nil : @temperature,
121
+ temperature: thinking_config || TEMPERATURE_UNSUPPORTED_MODELS.include?(@model) ? nil : @temperature,
106
122
  tools: tools_payload,
107
123
  thinking: thinking_config,
108
124
  })
@@ -2,6 +2,6 @@
2
2
 
3
3
  module OmniAI
4
4
  module Anthropic
5
- VERSION = "3.7.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.7.0
4
+ version: 3.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Sylvestre