Skip to content

Commit 76fa997

Browse files
committed
refactor: not to use typing.List
1 parent 451b317 commit 76fa997

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tests/unittests/tools/test_function_tool_pydantic.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@
1414

1515
# Pydantic model conversion tests
1616

17-
from typing import List
1817
from typing import Optional
1918
from unittest.mock import MagicMock
2019

20+
import pydantic
21+
import pytest
22+
2123
from google.adk.agents.invocation_context import InvocationContext
2224
from google.adk.sessions.session import Session
2325
from google.adk.tools.function_tool import FunctionTool
2426
from google.adk.tools.tool_context import ToolContext
25-
import pydantic
26-
import pytest
2727

2828

2929
class UserModel(pydantic.BaseModel):
@@ -283,7 +283,7 @@ async def test_run_async_with_optional_pydantic_models():
283283
assert result["preferences_type"] == "PreferencesModel"
284284

285285

286-
def function_with_list_of_pydantic_models(users: List[UserModel]) -> dict:
286+
def function_with_list_of_pydantic_models(users: list[UserModel]) -> dict:
287287
"""Function that takes a list of Pydantic models."""
288288
return {
289289
"count": len(users),
@@ -294,7 +294,7 @@ def function_with_list_of_pydantic_models(users: List[UserModel]) -> dict:
294294

295295

296296
def function_with_optional_list_of_pydantic_models(
297-
users: Optional[List[UserModel]] = None,
297+
users: Optional[list[UserModel]] = None,
298298
) -> dict:
299299
"""Function that takes an optional list of Pydantic models."""
300300
if users is None:

0 commit comments

Comments
 (0)