refactor: uniform Google LLM variant and parsing logic and make contant value consistent with Google GenAI SDK : 903e0729ce/google/genai/_automatic_function_calling_util.py (L96)

PiperOrigin-RevId: 765639681
This commit is contained in:
Xiang (Sean) Zhou
2025-05-31 13:11:44 -07:00
committed by Copybara-Service
parent 62d7bf58bb
commit 036f954a2a
6 changed files with 76 additions and 38 deletions

View File

@@ -17,22 +17,9 @@ from typing import List
from google.adk.tools import _automatic_function_calling_util
from google.adk.tools.agent_tool import ToolContext
from google.adk.tools.langchain_tool import LangchainTool
# TODO: crewai requires python 3.10 as minimum
# from crewai_tools import FileReadTool
from langchain_community.tools import ShellTool
from pydantic import BaseModel
import pytest
def test_unsupported_variant():
def simple_function(input_str: str) -> str:
return {'result': input_str}
with pytest.raises(ValueError):
_automatic_function_calling_util.build_function_declaration(
func=simple_function, variant='Unsupported'
)
def test_string_input():