fix: Explictly throw execption when custom id is set for vertex ai session service.

PiperOrigin-RevId: 757815469
This commit is contained in:
Shangjie Chen
2025-05-12 10:18:48 -07:00
committed by Copybara-Service
parent 4c4cfb74ae
commit 70a6bfae90
2 changed files with 18 additions and 0 deletions

View File

@@ -57,6 +57,12 @@ class VertexAiSessionService(BaseSessionService):
state: Optional[dict[str, Any]] = None,
session_id: Optional[str] = None,
) -> Session:
if session_id:
raise ValueError(
'User-provided Session id is not supported for'
' VertexAISessionService.'
)
reasoning_engine_id = _parse_reasoning_engine_id(app_name)
session_json_dict = {'user_id': user_id}