Skip to content

Commit 6b28ffa

Browse files
committed
Update DeepSeekProvider to comply with DeepSeek v3.2 requirements for sending thinking parts
1 parent 8be5360 commit 6b28ffa

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pydantic_ai_slim/pydantic_ai/providers/deepseek.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,8 @@ def model_profile(self, model_name: str) -> ModelProfile | None:
4747
return OpenAIModelProfile(
4848
json_schema_transformer=OpenAIJsonSchemaTransformer,
4949
openai_chat_custom_reasoning_field='reasoning_content',
50-
# DeepSeek recommends against sending back unchanged reasoning parts in requests.
51-
# The following is for compatibility with existing behavior. May want to change later.
52-
openai_chat_send_back_thinking_parts='thinking_tags',
50+
# Starting from DeepSeek v3.2, DeepSeek requires sending thinking parts for optimal agentic performance.
51+
openai_chat_send_back_thinking_parts='custom_field',
5352
).update(profile)
5453

5554
@overload

0 commit comments

Comments
 (0)