Skip to content

Commit d20dc6f

Browse files
author
LehaoLin
committed
style(provider): simplify tool call presence check
1 parent 160fffe commit d20dc6f

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

astrbot/core/provider/provider.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -199,11 +199,7 @@ def flush_pending_if_valid() -> None:
199199
pending_tools.append(message)
200200
continue
201201

202-
if (
203-
role == "assistant"
204-
and message.get("tool_calls") is not None
205-
and len(message.get("tool_calls")) > 0
206-
):
202+
if role == "assistant" and message.get("tool_calls"):
207203
flush_pending_if_valid()
208204
pending_assistant = message
209205
continue

0 commit comments

Comments
 (0)