|
33 | 33 | InvalidParamsError, |
34 | 34 | ListTaskPushNotificationConfigParams, |
35 | 35 | Message, |
36 | | - MessageSendConfiguration, |
37 | 36 | MessageSendParams, |
38 | | - PushNotificationConfig, |
39 | 37 | Task, |
40 | 38 | TaskIdParams, |
41 | 39 | TaskNotFoundError, |
@@ -217,13 +215,11 @@ async def _setup_message_execution( |
217 | 215 | # dictating the task ID at this layer is useful for tracking running |
218 | 216 | # agents. |
219 | 217 |
|
220 | | - if self.should_add_push_info(params): |
221 | | - assert self._push_config_store is not None |
222 | | - assert isinstance(params.configuration, MessageSendConfiguration) |
223 | | - assert isinstance( |
224 | | - params.configuration.pushNotificationConfig, |
225 | | - PushNotificationConfig, |
226 | | - ) |
| 218 | + if ( |
| 219 | + self._push_config_store |
| 220 | + and params.configuration |
| 221 | + and params.configuration.pushNotificationConfig |
| 222 | + ): |
227 | 223 | await self._push_config_store.set_info( |
228 | 224 | task_id, params.configuration.pushNotificationConfig |
229 | 225 | ) |
@@ -499,11 +495,3 @@ async def on_delete_task_push_notification_config( |
499 | 495 | await self._push_config_store.delete_info( |
500 | 496 | params.id, params.pushNotificationConfigId |
501 | 497 | ) |
502 | | - |
503 | | - def should_add_push_info(self, params: MessageSendParams) -> bool: |
504 | | - """Determines if push notification info should be set for a task.""" |
505 | | - return bool( |
506 | | - self._push_config_store |
507 | | - and params.configuration |
508 | | - and params.configuration.pushNotificationConfig |
509 | | - ) |
0 commit comments