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 +4 -4
- data/lib/omniai/anthropic/chat.rb +19 -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: 51669edf069f8f6e36ee785035c535721e3ee67c36c3620297f56ac81f41827c
|
|
4
|
+
data.tar.gz: 605d8e0e44e5b3c6ffe0746240d8265577eceb525e49982b1ddf807773ce3538
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
})
|