GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: Migrate vertex_ai_session_service to use Agent Engine SDK · googleapis/python-aiplatform@03772e2

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • vertexai
    • agent_engines/templates
      • adk.py
    • preview/reasoning_engines/templates
      • adk.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎vertexai/agent_engines/templates/adk.py‎

Copy file name to clipboardExpand all lines: vertexai/agent_engines/templates/adk.py
+13-8Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -537,15 +537,20 @@ def set_up(self):
537537
if session_service_builder:
538538
self._tmpl_attrs["session_service"] = session_service_builder()
539539
elif "GOOGLE_CLOUD_AGENT_ENGINE_ID" in os.environ:
540-
from google.adk.sessions.vertex_ai_session_service import (
541-
VertexAiSessionService,
542-
)
540+
try:
541+
from google.adk.sessions.vertex_ai_session_service import (
542+
VertexAiSessionService,
543+
)
544+
545+
self._tmpl_attrs["session_service"] = VertexAiSessionService(
546+
project=project,
547+
location=location,
548+
agent_engine_id=os.environ.get("GOOGLE_CLOUD_AGENT_ENGINE_ID"),
549+
)
550+
except ImportError:
551+
# TODO(ysian): Handle this via _g3 import for google3.
552+
pass
543553

544-
self._tmpl_attrs["session_service"] = VertexAiSessionService(
545-
project=project,
546-
location=location,
547-
agent_engine_id=os.environ.get("GOOGLE_CLOUD_AGENT_ENGINE_ID"),
548-
)
549554
else:
550555
self._tmpl_attrs["session_service"] = InMemorySessionService()
551556

Collapse file

‎vertexai/preview/reasoning_engines/templates/adk.py‎

Copy file name to clipboardExpand all lines: vertexai/preview/reasoning_engines/templates/adk.py
+19-14Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -512,21 +512,26 @@ def set_up(self):
512512
if session_service_builder:
513513
self._tmpl_attrs["session_service"] = session_service_builder()
514514
elif "GOOGLE_CLOUD_AGENT_ENGINE_ID" in os.environ:
515-
from google.adk.sessions.vertex_ai_session_service import (
516-
VertexAiSessionService,
517-
)
518-
519-
if is_version_sufficient("1.5.0"):
520-
self._tmpl_attrs["session_service"] = VertexAiSessionService(
521-
project=project,
522-
location=location,
523-
agent_engine_id=os.environ.get("GOOGLE_CLOUD_AGENT_ENGINE_ID"),
524-
)
525-
else:
526-
self._tmpl_attrs["session_service"] = VertexAiSessionService(
527-
project=project,
528-
location=location,
515+
try:
516+
from google.adk.sessions.vertex_ai_session_service import (
517+
VertexAiSessionService,
529518
)
519+
520+
if is_version_sufficient("1.5.0"):
521+
self._tmpl_attrs["session_service"] = VertexAiSessionService(
522+
project=project,
523+
location=location,
524+
agent_engine_id=os.environ.get("GOOGLE_CLOUD_AGENT_ENGINE_ID"),
525+
)
526+
else:
527+
self._tmpl_attrs["session_service"] = VertexAiSessionService(
528+
project=project,
529+
location=location,
530+
)
531+
except ImportError:
532+
# TODO(deanchen): Handle this via _g3 import for google3.
533+
pass
534+
530535
else:
531536
self._tmpl_attrs["session_service"] = InMemorySessionService()
532537

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.