fix(gemini-live-vertex): disable NON_BLOCKING tools

GeminiLiveVertexLLMService overrides _supports_non_blocking_tools to
return False — Vertex AI's Gemini Live endpoint doesn't yet accept the
NON_BLOCKING behavior field on function declarations or the scheduling
field on FunctionResponse, and sending either breaks tool calling.

Effect: function declarations sent to Vertex no longer carry
NON_BLOCKING; FunctionResponses no longer carry scheduling: WHEN_IDLE.
Users registering a function with cancel_on_interruption=False against
Vertex get the same one-time logger.error + push_error the base class
surfaces on Gemini 3.x.
This commit is contained in:
Paul Kompfner
2026-05-08 16:54:15 -04:00
parent e21180b962
commit 5509377344

View File

@@ -238,6 +238,20 @@ class GeminiLiveVertexLLMService(GeminiLiveLLMService):
"When using Vertex AI, the recommended approach is to use Google Cloud Storage for file handling. The Gemini File API is not directly supported in this context." "When using Vertex AI, the recommended approach is to use Google Cloud Storage for file handling. The Gemini File API is not directly supported in this context."
) )
@property
def _supports_non_blocking_tools(self) -> bool:
"""Vertex AI's Gemini Live endpoint does not yet support NON_BLOCKING tool calls.
Override the base ``GeminiLiveLLMService`` getter to disable the
NON_BLOCKING ``behavior`` field on function declarations and the
``scheduling`` field on FunctionResponse for Vertex sessions —
sending either appears to break tool calling against Vertex.
Users hitting this on a function registered with
``cancel_on_interruption=False`` will see the same one-time
warning the base class surfaces for unsupported models.
"""
return False
@staticmethod @staticmethod
def _get_credentials( def _get_credentials(
credentials: str | None, credentials_path: str | None credentials: str | None, credentials_path: str | None