diff --git a/ai/ai-react-app/src/App.tsx b/ai/ai-react-app/src/App.tsx index 48052c9a6..c65680c1f 100644 --- a/ai/ai-react-app/src/App.tsx +++ b/ai/ai-react-app/src/App.tsx @@ -2,10 +2,10 @@ import { useEffect, useState } from "react"; import MainLayout from "./components/Layout/MainLayout"; // Defines the primary modes or views available in the application. -export type AppMode = "chat" | "imagenGen" | "live"; +export type AppMode = "chat" | "nanobanana" | "live"; function App() { - // State to manage which main view ('chat' or 'imagenGen') is currently active. + // State to manage which main view ('chat' or 'nanobanana') is currently active. const [activeMode, setActiveMode] = useState("chat"); useEffect(() => { diff --git a/ai/ai-react-app/src/components/Common/PromptInput.tsx b/ai/ai-react-app/src/components/Common/PromptInput.tsx index 93bfc9d6a..23da687a3 100644 --- a/ai/ai-react-app/src/components/Common/PromptInput.tsx +++ b/ai/ai-react-app/src/components/Common/PromptInput.tsx @@ -6,7 +6,6 @@ import { CountTokensResponse, Part, getGenerativeModel, - ImagenModelParams, } from "firebase/ai"; import { fileToGenerativePart } from "../../utils/fileUtils"; import { AppMode } from "../../App"; @@ -23,8 +22,8 @@ interface PromptInputProps { activeMode: AppMode; aiInstance: AI; currentParams?: ModelParams; - currentImagenParams?: ImagenModelParams; selectedFile: File | null; + selectedAspectRatio?: string; } const PromptInput: React.FC = ({ @@ -39,6 +38,7 @@ const PromptInput: React.FC = ({ aiInstance, currentParams, selectedFile, + selectedAspectRatio, }) => { const [tokenCount, setTokenCount] = useState( null, @@ -55,11 +55,15 @@ const PromptInput: React.FC = ({ setTokenCountError(null); const currentPromptText = prompt.trim(); + let textToCount = currentPromptText; + if (selectedAspectRatio) { + textToCount += `\nUse aspect ratio ${selectedAspectRatio}`; + } const parts: Part[] = []; // Add text part if present - if (currentPromptText) { - parts.push({ text: currentPromptText }); + if (textToCount) { + parts.push({ text: textToCount }); } // Add file part if present @@ -137,15 +141,22 @@ const PromptInput: React.FC = ({ {/* Main Input Area */}
-