Skip to content

Commit 3a267fc

Browse files
committed
improved dx
1 parent 30fbcc8 commit 3a267fc

3 files changed

Lines changed: 16 additions & 2 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "chuk-sessions"
7-
version = "0.5"
7+
version = "0.5.1"
88
description = "CHUK Sessions provides a comprehensive, async-first session management system with automatic expiration, and support for both in-memory and Redis storage backends. Perfect for web applications, MCP servers, API gateways, and microservices that need reliable, scalable session handling."
99
readme = "README.md"
1010
requires-python = ">=3.11"

src/chuk_sessions/session_manager.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,23 @@ async def validate_session(self, session_id: str) -> bool:
144144
return False
145145

146146
async def get_session_info(self, session_id: str) -> Optional[dict[str, Any]]:
147+
"""
148+
Get session information as a dict.
149+
150+
For typed access, use get_session_metadata() instead.
151+
"""
147152
metadata = await self._get_session_metadata(session_id)
148153
return metadata.to_dict() if metadata else None
149154

155+
async def get_session_metadata(self, session_id: str) -> Optional[SessionMetadata]:
156+
"""
157+
Get session information as typed SessionMetadata.
158+
159+
This returns the Pydantic model directly for better type safety.
160+
For backwards compatibility, use get_session_info() which returns dict.
161+
"""
162+
return await self._get_session_metadata(session_id)
163+
150164
async def update_session_metadata(
151165
self,
152166
session_id: str,

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)