Apply suggestions from code review

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
This commit is contained in:
Roy Vivat 2026-03-23 16:43:30 -07:00 • committed by GitHub
parent 1bfe1dd956
commit 5b7e11eaec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 2 deletions

View file

@ -3014,7 +3014,13 @@ class ModelResponseIterator:
hasattr(choice, "finish_reason")
and choice.finish_reason == "stop"
and hasattr(choice, "delta")
and (choice.delta is None or not choice.delta.tool_calls)
and (
choice.delta is None
or (
not choice.delta.tool_calls
and choice.delta.content is None
)
)
):
choice.finish_reason = "tool_calls"

View file

@ -13,7 +13,6 @@ Ref: https://github.com/BerriAI/litellm/issues/24442
import pytest
import litellm
from litellm import ModelResponse
from litellm.llms.vertex_ai.gemini.vertex_and_google_ai_studio_gemini import (
VertexGeminiConfig,