Skip to content

Commit 0d1240e

Browse files
vertex-sdk-botcopybara-github
authored andcommitted
fix: Adding google internal import rule for vertex service to adk app
PiperOrigin-RevId: 817237115
1 parent ffe9cde commit 0d1240e

File tree

2 files changed

+18
-4
lines changed
  • vertexai
    • agent_engines/templates
    • preview/reasoning_engines/templates

2 files changed

+18
-4
lines changed

vertexai/agent_engines/templates/adk.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -560,8 +560,15 @@ def set_up(self):
560560
agent_engine_id=os.environ.get("GOOGLE_CLOUD_AGENT_ENGINE_ID"),
561561
)
562562
except ImportError:
563-
# TODO(ysian): Handle this via _g3 import for google3.
564-
pass
563+
from google.adk.sessions.vertex_ai_session_service_g3 import (
564+
VertexAiSessionService,
565+
)
566+
567+
self._tmpl_attrs["session_service"] = VertexAiSessionService(
568+
project=project,
569+
location=location,
570+
agent_engine_id=os.environ.get("GOOGLE_CLOUD_AGENT_ENGINE_ID"),
571+
)
565572

566573
else:
567574
self._tmpl_attrs["session_service"] = InMemorySessionService()

vertexai/preview/reasoning_engines/templates/adk.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -541,8 +541,15 @@ def set_up(self):
541541
location=location,
542542
)
543543
except ImportError:
544-
# TODO(deanchen): Handle this via _g3 import for google3.
545-
pass
544+
from google.adk.sessions.vertex_ai_session_service_g3 import (
545+
VertexAiSessionService,
546+
)
547+
548+
self._tmpl_attrs["session_service"] = VertexAiSessionService(
549+
project=project,
550+
location=location,
551+
agent_engine_id=os.environ.get("GOOGLE_CLOUD_AGENT_ENGINE_ID"),
552+
)
546553

547554
else:
548555
self._tmpl_attrs["session_service"] = InMemorySessionService()

0 commit comments

Comments
 (0)