Skip to content

feat: support initial state when creating session in short term memory#545

Open
mrcaidev wants to merge 2 commits intovolcengine:mainfrom
mrcaidev:feat/short-term-memory-create-session-initial-state
Open

feat: support initial state when creating session in short term memory#545
mrcaidev wants to merge 2 commits intovolcengine:mainfrom
mrcaidev:feat/short-term-memory-create-session-initial-state

Conversation

@mrcaidev
Copy link

ShortTermMemorycreate_session 接口支持传入可选的 state 参数,直接透传给底层的 session_service

该参数可以用于在创建会话时,就注入会话状态。例如,在创建会话之前,创建一个沙箱,并将其元数据绑定到会话状态中。

Copilot AI review requested due to automatic review settings March 17, 2026 10:12
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

ShortTermMemory.create_session 增加可选的初始 state 参数,用于在创建会话时将状态透传到底层 session_service,以支持在会话创建阶段注入会话元数据/上下文。

Changes:

  • ShortTermMemory.create_session 新增 state: dict | None = None 参数
  • 更新 create_session docstring,补充 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.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 state parameter to ShortTermMemory.create_session(...).
  • Update docstring to clarify state semantics (applied only on new session creation; ignored if the session already exists).
  • Forward state to the underlying BaseSessionService.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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants