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 +4 -4
- data/lib/omniai/anthropic/chat.rb +17 -2
- data/lib/omniai/anthropic/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 54ace6377f4ec569ce3e78de2d878c099707d9331e5cbb68635a766c71637b4e
|
|
4
|
+
data.tar.gz: 27868e87f01534c18a2e951d6eabeb82b6ec3100f2b36818e610c0c76ae5c782
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
})
|