Skip to content
Open
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ sdc-agents = [
"sdc-agents>=4.3.3; python_version >= '3.11'",
]
spraay = ["web3>=6.0.0"]
typesense = ["typesense>=0.20.0"]


[tool.pyink]
Expand Down
10 changes: 9 additions & 1 deletion src/google/adk_community/sessions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,12 @@

from .redis_session_service import RedisSessionService

__all__ = ["RedisSessionService"]
__all__ = ["RedisSessionService", "TypesenseSessionService"]


def __getattr__(name: str):
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice use of lazy imports with __getattr__ to keep the typesense dependency optional!

if name == "TypesenseSessionService":
from .typesense_session_service import TypesenseSessionService

return TypesenseSessionService
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
Loading
Loading