Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ dependencies = [
# go/keep-sorted end
"orjson>=3.11.3",
]

dynamic = ["version"]

[project.urls]
Expand All @@ -45,6 +46,11 @@ test = [
"pytest>=8.4.2",
"pytest-asyncio>=1.2.0",
]
sqlalchemy = [
# Required for DatabaseMemoryService; aiosqlite enables SQLite async
"sqlalchemy[asyncio]>=2.0.0",
"aiosqlite>=0.19.0",
]


[tool.pyink]
Expand Down Expand Up @@ -74,6 +80,8 @@ build-backend = "flit_core.buildapi"
dev = [
"pytest>=8.4.2",
"pytest-asyncio>=1.2.0",
"sqlalchemy[asyncio]>=2.0.0",
"aiosqlite>=0.19.0",
]


Expand Down
15 changes: 12 additions & 3 deletions src/google/adk_community/memory/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,20 @@

"""Community memory services for ADK."""

try:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Correct handling of optional dependencies. This allows users who don't need the SQL backend to use the package without installing SQLAlchemy.

from .database_memory_service import DatabaseMemoryService
from .memory_search_backend import KeywordSearchBackend
from .memory_search_backend import MemorySearchBackend
except ImportError:
pass

from .open_memory_service import OpenMemoryService
from .open_memory_service import OpenMemoryServiceConfig

__all__ = [
"OpenMemoryService",
"OpenMemoryServiceConfig",
'DatabaseMemoryService',
'KeywordSearchBackend',
'MemorySearchBackend',
'OpenMemoryService',
'OpenMemoryServiceConfig',
]

Loading