File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 1414
1515# Pydantic model conversion tests 
1616
17- from  typing  import  List 
1817from  typing  import  Optional 
1918from  unittest .mock  import  MagicMock 
2019
20+ import  pydantic 
21+ import  pytest 
22+ 
2123from  google .adk .agents .invocation_context  import  InvocationContext 
2224from  google .adk .sessions .session  import  Session 
2325from  google .adk .tools .function_tool  import  FunctionTool 
2426from  google .adk .tools .tool_context  import  ToolContext 
25- import  pydantic 
26- import  pytest 
2727
2828
2929class  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
296296def  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 :
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments