feat: support initial state when creating session in short term memory#545
feat: support initial state when creating session in short term memory#545mrcaidev wants to merge 2 commits intovolcengine:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
为 ShortTermMemory.create_session 增加可选的初始 state 参数,用于在创建会话时将状态透传到底层 session_service,以支持在会话创建阶段注入会话元数据/上下文。
Changes:
- 为
ShortTermMemory.create_session新增state: dict | None = None参数 - 更新
create_sessiondocstring,补充state参数说明 - 创建新 session 时将
state透传给底层session_service.create_session(...)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
There was a problem hiding this comment.
Pull request overview
This PR extends ShortTermMemory.create_session() to accept an optional initial state and forwards it to the underlying ADK session_service, enabling callers to inject session metadata at session-creation time (e.g., sandbox metadata binding).
Changes:
- Add optional
stateparameter toShortTermMemory.create_session(...). - Update docstring to clarify
statesemantics (applied only on new session creation; ignored if the session already exists). - Forward
stateto the underlyingBaseSessionService.create_session(...)call.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
ShortTermMemory的create_session接口支持传入可选的state参数,直接透传给底层的session_service。该参数可以用于在创建会话时,就注入会话状态。例如,在创建会话之前,创建一个沙箱,并将其元数据绑定到会话状态中。