Skip to content

Commit cbeacca

Browse files
Fix native mode detection
1 parent c4ea784 commit cbeacca

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

pipelines/google/google_gemini.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1461,7 +1461,8 @@ def _configure_generation(
14611461
types.Tool(google_search=types.GoogleSearch())
14621462
)
14631463

1464-
if __tools__ is not None and __metadata__.get("function_calling") == "native":
1464+
params = __metadata__.get("params", {})
1465+
if __tools__ is not None and params.get("function_calling") == "native":
14651466
for name, tool_def in __tools__.items():
14661467
tool = self._create_tool(tool_def)
14671468
self.log.debug(
@@ -1923,10 +1924,11 @@ async def pipe(
19231924
# For image generation models, gather ALL images from the last user turn
19241925
if supports_image_generation:
19251926
try:
1926-
contents, system_instruction = (
1927-
await self._build_image_generation_contents(
1928-
messages, __event_emitter__
1929-
)
1927+
(
1928+
contents,
1929+
system_instruction,
1930+
) = await self._build_image_generation_contents(
1931+
messages, __event_emitter__
19301932
)
19311933
# For image generation, system_instruction is integrated into the prompt
19321934
# so it will be None here (this is expected and correct)

0 commit comments

Comments
 (0)