Skip to content
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
7 changes: 6 additions & 1 deletion veadk/memory/short_term_memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ async def create_session(
app_name: str,
user_id: str,
session_id: str,
state: dict | None = None,
) -> Session | None:
"""Create or retrieve a user session.

Expand All @@ -151,6 +152,10 @@ async def create_session(
app_name (str): The name of the application associated with the session.
user_id (str): The unique identifier of the user.
session_id (str): The unique identifier of the session to be created or retrieved.
state (dict | None):
The initial state of the session.
If a session with the given `session_id` already exists,
this argument is ignored and the existing session state is preserved.

Returns:
Session | None: The retrieved or newly created `Session` object, or `None` if the session creation failed.
Expand All @@ -175,7 +180,7 @@ async def create_session(
return session
else:
return await self._session_service.create_session(
app_name=app_name, user_id=user_id, session_id=session_id
app_name=app_name, user_id=user_id, session_id=session_id, state=state
)

async def generate_profile(
Expand Down
Loading