Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions astrbot/core/provider/sources/gemini_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,15 @@ async def _prepare_query_config(
else:
thinking_config.thinking_level = level

# If any tools (native or custom function declarations) are active for this request,
# we must disable thinking because Gemini API does not support them simultaneously.
if tool_list and thinking_config:
if getattr(thinking_config, "thinking_budget", None) != 0:
logger.warning(
"[Gemini] Thinking config is automatically disabled because tools are active for this request."
)
thinking_config = None

return types.GenerateContentConfig(
system_instruction=system_instruction,
temperature=temperature,
Expand Down
Loading