File tree Expand file tree Collapse file tree 2 files changed +24
-16
lines changed
preview/reasoning_engines/templates Expand file tree Collapse file tree 2 files changed +24
-16
lines changed Original file line number Diff line number Diff line change @@ -555,15 +555,19 @@ def set_up(self):
555555 elif "GOOGLE_CLOUD_AGENT_ENGINE_ID" in os .environ and is_version_sufficient (
556556 "1.5.0"
557557 ):
558- from google .adk .memory .vertex_ai_memory_bank_service import (
559- VertexAiMemoryBankService ,
560- )
558+ try :
559+ from google .adk .memory .vertex_ai_memory_bank_service import (
560+ VertexAiMemoryBankService ,
561+ )
561562
562- self ._tmpl_attrs ["memory_service" ] = VertexAiMemoryBankService (
563- project = project ,
564- location = location ,
565- agent_engine_id = os .environ .get ("GOOGLE_CLOUD_AGENT_ENGINE_ID" ),
566- )
563+ self ._tmpl_attrs ["memory_service" ] = VertexAiMemoryBankService (
564+ project = project ,
565+ location = location ,
566+ agent_engine_id = os .environ .get ("GOOGLE_CLOUD_AGENT_ENGINE_ID" ),
567+ )
568+ except ImportError :
569+ # TODO(ysian): Handle this via _g3 import for google3.
570+ pass
567571 else :
568572 self ._tmpl_attrs ["memory_service" ] = InMemoryMemoryService ()
569573
Original file line number Diff line number Diff line change @@ -536,15 +536,19 @@ def set_up(self):
536536 elif "GOOGLE_CLOUD_AGENT_ENGINE_ID" in os .environ and is_version_sufficient (
537537 "1.5.0"
538538 ):
539- from google .adk .memory .vertex_ai_memory_bank_service import (
540- VertexAiMemoryBankService ,
541- )
539+ try :
540+ from google .adk .memory .vertex_ai_memory_bank_service import (
541+ VertexAiMemoryBankService ,
542+ )
542543
543- self ._tmpl_attrs ["memory_service" ] = VertexAiMemoryBankService (
544- project = project ,
545- location = location ,
546- agent_engine_id = os .environ .get ("GOOGLE_CLOUD_AGENT_ENGINE_ID" ),
547- )
544+ self ._tmpl_attrs ["memory_service" ] = VertexAiMemoryBankService (
545+ project = project ,
546+ location = location ,
547+ agent_engine_id = os .environ .get ("GOOGLE_CLOUD_AGENT_ENGINE_ID" ),
548+ )
549+ except ImportError :
550+ # TODO(ysian): Handle this via _g3 import for google3.
551+ pass
548552 else :
549553 self ._tmpl_attrs ["memory_service" ] = InMemoryMemoryService ()
550554
You can’t perform that action at this time.
0 commit comments