Skip to content

Commit 862a34b

Browse files
committed
ensure that global is defined for vertexai backends
1 parent 22d31c5 commit 862a34b

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

ai/ai-react-app/src/components/Layout/MainLayout.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ const MainLayout: React.FC<MainLayoutProps> = ({
6262
try {
6363
const backendInstance =
6464
activeBackendType === BackendType.VERTEX_AI
65-
? new VertexAIBackend()
65+
? activeMode === "nanobanana"
66+
? new VertexAIBackend("global")
67+
: new VertexAIBackend()
6668
: new GoogleAIBackend();
6769
const aiInstance = getAI(getApp(), { backend: backendInstance });
6870
setActiveAI(aiInstance);
@@ -77,7 +79,7 @@ const MainLayout: React.FC<MainLayoutProps> = ({
7779
);
7880
setActiveAI(null);
7981
}
80-
}, [activeBackendType]);
82+
}, [activeBackendType, activeMode]);
8183

8284
useEffect(() => {
8385
setUsageMetadata(null);

0 commit comments

Comments
 (0)