Files
DeepTutor/tests/services
Junjie Zhou bf269ec112 fix(llm): route Anthropic temperature via extra_body for SDK 1.x compat
anthropic-sdk-python >= 1.0 (released 2026-08-20) removed `temperature`
from the explicit signature of `AsyncMessages.create()` and
`AsyncMessages.stream()`. Any LLM call through the Anthropic binding —
including the real Anthropic API and any Anthropic-compatible gateway
(e.g. MiniMax, AWS Bedrock Claude) — now raises:

    AsyncMessages.create() got an unexpected keyword argument 'temperature'

The Anthropic API itself still accepts `temperature` as a top-level
request field; the SDK simply forces callers to tunnel it through
`extra_body` instead of accepting it as a first-class kwarg. This patch
moves both `temperature` assignments in `AnthropicProvider._build_kwargs`
from the top-level kwargs to `extra_body`, so the wire payload is
unchanged and SDK 1.x stops rejecting the call.

Tests in test_anthropic_provider_fixes.py are updated to assert against
`extra_body['temperature']` instead of top-level `temperature`, plus a
new `test_temperature_is_routed_via_extra_body` covers the new
behaviour end-to-end.
2026-08-28 01:32:25 +08:00
..
2026-07-31 00:25:48 +08:00
2026-06-11 20:03:34 +08:00
2026-08-25 02:24:35 +08:00
2026-06-18 00:22:48 +08:00
2026-08-25 02:24:35 +08:00
2026-06-17 10:50:44 +08:00
2026-08-19 17:34:52 +08:00
2026-06-11 20:03:34 +08:00
2026-03-15 00:04:34 +08:00
2026-04-23 19:29:16 +08:00
2026-08-25 02:24:35 +08:00