@@ -128,9 +128,14 @@ async def on_message_send(
128128 if task :
129129 task = task_manager .update_with_message (params .message , task )
130130 if self .should_add_push_info (params ):
131- assert isinstance (self ._push_notifier , PushNotifier ) # For typechecker
132- assert isinstance (params .configuration , MessageSendConfiguration ) # For typechecker
133- assert isinstance (params .configuration .pushNotificationConfig , PushNotificationConfig ) # For typechecker
131+ assert isinstance (self ._push_notifier , PushNotifier )
132+ assert isinstance (
133+ params .configuration , MessageSendConfiguration
134+ )
135+ assert isinstance (
136+ params .configuration .pushNotificationConfig ,
137+ PushNotificationConfig ,
138+ )
134139 await self ._push_notifier .set_info (
135140 task .id , params .configuration .pushNotificationConfig
136141 )
@@ -193,9 +198,14 @@ async def on_message_send_stream(
193198 task = task_manager .update_with_message (params .message , task )
194199
195200 if self .should_add_push_info (params ):
196- assert isinstance (self ._push_notifier , PushNotifier ) # For typechecker
197- assert isinstance (params .configuration , MessageSendConfiguration ) # For typechecker
198- assert isinstance (params .configuration .pushNotificationConfig , PushNotificationConfig ) # For typechecker
201+ assert isinstance (self ._push_notifier , PushNotifier )
202+ assert isinstance (
203+ params .configuration , MessageSendConfiguration
204+ )
205+ assert isinstance (
206+ params .configuration .pushNotificationConfig ,
207+ PushNotificationConfig ,
208+ )
199209 await self ._push_notifier .set_info (
200210 task .id , params .configuration .pushNotificationConfig
201211 )
@@ -324,11 +334,8 @@ async def on_resubscribe_to_task(
324334 yield event
325335
326336 def should_add_push_info (self , params : MessageSendParams ) -> bool :
327- if (
337+ return bool (
328338 self ._push_notifier
329339 and params .configuration
330340 and params .configuration .pushNotificationConfig
331- ):
332- return True
333- else :
334- return False
341+ )
0 commit comments