@@ -308,7 +308,7 @@ def _resolve_schema(schemas: set[type], schema_name: str, omit_flag: str | None
308308 if not should_omit :
309309 all_annotations [field_name ] = field_type
310310
311- return TypedDict (schema_name , all_annotations ) # type: ignore[operator]
311+ return cast ( "type" , TypedDict (schema_name , all_annotations ) ) # type: ignore[operator]
312312
313313
314314def _extract_metadata (type_ : type ) -> list :
@@ -347,7 +347,7 @@ def _get_can_jump_to(middleware: AgentMiddleware[Any, Any], hook_name: str) -> l
347347 and sync_method is not base_sync_method
348348 and hasattr (sync_method , "__can_jump_to__" )
349349 ):
350- return sync_method .__can_jump_to__
350+ return cast ( "list[JumpTo]" , sync_method .__can_jump_to__ )
351351
352352 # Try async method - only if it's overridden from base class
353353 async_method = getattr (middleware .__class__ , f"a{ hook_name } " , None )
@@ -356,7 +356,7 @@ def _get_can_jump_to(middleware: AgentMiddleware[Any, Any], hook_name: str) -> l
356356 and async_method is not base_async_method
357357 and hasattr (async_method , "__can_jump_to__" )
358358 ):
359- return async_method .__can_jump_to__
359+ return cast ( "list[JumpTo]" , async_method .__can_jump_to__ )
360360
361361 return []
362362
0 commit comments