Skip to content

Build and run agents you can see, understand and trust.

[HOTFIX] Fix the error of the `enable_thinking` argument in `DashScopeChatModel` class (#796)

YuYanbe7ffa4203e8
diff --git a/src/agentscope/model/_dashscope_model.py b/src/agentscope/model/_dashscope_model.py
index 89c05bdc8..e697fa6d1 100644
--- a/src/agentscope/model/_dashscope_model.py
+++ b/src/agentscope/model/_dashscope_model.py
@@ -176,7 +176,10 @@ class DashScopeChatModel(ChatModelBase):
self._validate_tool_choice(tool_choice, tools)
kwargs["tool_choice"] = self._format_tool_choice(tool_choice)
- if self.enable_thinking and "enable_thinking" not in kwargs:
+ if (
+ self.enable_thinking is not None
+ and "enable_thinking" not in kwargs
+ ):
kwargs["enable_thinking"] = self.enable_thinking
if structured_model: