File tree Expand file tree Collapse file tree 1 file changed +26
-1
lines changed
Expand file tree Collapse file tree 1 file changed +26
-1
lines changed Original file line number Diff line number Diff line change 11"""Components for managing tasks within the A2A server."""
22
3+ import logging
4+
35from a2a .server .tasks .base_push_notification_sender import (
46 BasePushNotificationSender ,
57)
6- from a2a .server .tasks .database_task_store import DatabaseTaskStore
78from a2a .server .tasks .inmemory_push_notification_config_store import (
89 InMemoryPushNotificationConfigStore ,
910)
1819from a2a .server .tasks .task_updater import TaskUpdater
1920
2021
22+ logger = logging .getLogger (__name__ )
23+
24+ try :
25+ from a2a .server .tasks .database_task_store import (
26+ DatabaseTaskStore , # type: ignore
27+ )
28+ except ImportError as e :
29+ _original_error = e
30+ # If the database task store is not available, we can still use in-memory stores.
31+ logger .debug (
32+ 'DatabaseTaskStore not loaded. This is expected if database dependencies are not installed. Error: %s' ,
33+ e ,
34+ )
35+
36+ class DatabaseTaskStore : # type: ignore
37+ """Placeholder for DatabaseTaskStore when dependencies are not installed."""
38+
39+ def __init__ (self , * args , ** kwargs ):
40+ raise ImportError (
41+ 'To use DatabaseTaskStore, its dependencies must be installed. '
42+ 'You can install them with \' pip install "a2a-sdk[sql]"\' '
43+ ) from _original_error
44+
45+
2146__all__ = [
2247 'BasePushNotificationSender' ,
2348 'DatabaseTaskStore' ,
You can’t perform that action at this time.
0 commit comments