mirror of
https://github.com/NCBM/plyngent.git
synced 2026-11-07 15:37:55 +08:00
lmproto: keep the thinking block's type on the wire
``omit_defaults`` dropped the block's defaulted discriminator, and a request that carried thinking was answered with 422 "thinking: missing field ``type``" — which is what the compat sent for any configured ``reasoning_effort``. The field has no default now, so it always encodes (both call sites pass it).
This commit is contained in:
@@ -67,9 +67,13 @@ class AnthropicThinkingConfig(Struct, omit_defaults=True):
|
||||
``budget_tokens`` is the reasoning budget the model may spend before it
|
||||
answers; the API requires it to be at least 1024 and smaller than
|
||||
``max_tokens`` (see ``agent.messages_bridge``, which keeps both valid).
|
||||
|
||||
``type`` carries no default: ``omit_defaults`` would drop a defaulted one,
|
||||
and the server reads the block as malformed without it — DeepSeek answers
|
||||
``thinking: missing field ``type``.
|
||||
"""
|
||||
|
||||
type: Literal["enabled", "disabled"] = "enabled"
|
||||
type: Literal["enabled", "disabled"]
|
||||
budget_tokens: int | Unset = UNSET
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user