Skip to content

feat: Add session_service_db_kwargs to get_fast_api_app #1800

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
5 changes: 4 additions & 1 deletion src/google/adk/cli/fast_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ def get_fast_api_app(
*,
agents_dir: str,
session_service_uri: Optional[str] = None,
session_service_db_kwargs: Optional[dict[str, Any]] = None,
Copy link
Author

@miko-garrido miko-garrido Jul 12, 2025

Choose a reason for hiding this comment

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

The session_service_db_kwargs are here @seanzhou1023

Dev can pass kwargs as argument via the get_fast_api_app function

Copy link
Author

Choose a reason for hiding this comment

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

Hey @seanzhou1023 @hangfei - the arguments are passed here

artifact_service_uri: Optional[str] = None,
memory_service_uri: Optional[str] = None,
eval_storage_uri: Optional[str] = None,
Expand Down Expand Up @@ -344,7 +345,9 @@ async def internal_lifespan(app: FastAPI):
agent_engine_id=agent_engine_id,
)
else:
session_service = DatabaseSessionService(db_url=session_service_uri)
session_service = DatabaseSessionService(
db_url=session_service_uri, **(session_service_db_kwargs or {})
)
else:
session_service = InMemorySessionService()

Expand Down