From d59d77ad00f1c1ed28db9888f9625c5adb9b7563 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Thu, 11 Jun 2026 10:24:51 +0000 Subject: [PATCH] Fix default Gemini model and add 5 new features - Downgrade `gemini-2.5-flash` references to `gemini-1.5-flash` to ensure standard public model calls work. - Add "Copy Report" button to clipboard functionality. - Add "Download .md" report file functionality. - Add a "Clear" button to easily reset the prediction form. - Add a Prediction History feature using localStorage to save and reload recent queries. - Add "Preferred Backend Engine" to the prediction input form and prompt. Co-authored-by: JITSA007 <10954985+JITSA007@users.noreply.github.com> --- index.html | 179 ++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 149 insertions(+), 30 deletions(-) diff --git a/index.html b/index.html index f3babbd..c288682 100644 --- a/index.html +++ b/index.html @@ -128,11 +128,18 @@ // NEW STATE: Purpose of the AI const [purpose, setPurpose] = useState('General Chat & Assistant'); + const [backend, setBackend] = useState('Any'); const [loading, setLoading] = useState(false); const [result, setResult] = useState(''); const [error, setError] = useState(''); + // State for prediction history + const [history, setHistory] = useState(() => { + const saved = localStorage.getItem('llm_predictions_history'); + return saved ? JSON.parse(saved) : []; + }); + // Fetch available models from Google using the provided API Key const handleFetchModels = async () => { if (!customApiKey.trim()) { @@ -177,11 +184,11 @@ const fetchAIPrediction = async (promptText) => { const apiKey = customApiKey.trim() || ""; - // CRITICAL FIX: If a custom key is provided, default to a standard public model (gemini-2.5-flash) + // CRITICAL FIX: If a custom key is provided, default to a standard public model (gemini-1.5-flash) // If no key is provided, use the internal canvas preview model. - let modelName = "gemini-2.5-flash-preview-09-2025"; + let modelName = "gemini-1.5-flash"; if (apiKey) { - modelName = selectedModel || "gemini-2.5-flash"; + modelName = selectedModel || "gemini-1.5-flash"; } const url = `https://generativelanguage.googleapis.com/v1beta/models/${modelName}:generateContent?key=${apiKey}`; @@ -268,8 +275,9 @@ Model/Series: ${deviceInfo.model} Additional Known Specs: ${deviceInfo.extraSpecs || 'None provided.'} Primary Purpose for AI: ${purpose} + Preferred Backend Engine: ${backend} - Please generate the table of recommendations based on this setup and their intended purpose.`; + Please generate the table of recommendations based on this setup and their intended purpose. Tailor the "Best App to Run" to their preferred backend if specified.`; } else { prompt = `Analyze these computer specs for running Local LLMs: OS: ${specs.os} @@ -277,13 +285,27 @@ RAM: ${specs.ram} GPU: ${specs.gpu} Primary Purpose for AI: ${purpose} + Preferred Backend Engine: ${backend} - Please generate the table of recommendations based on this setup and their intended purpose.`; + Please generate the table of recommendations based on this setup and their intended purpose. Tailor the "Best App to Run" to their preferred backend if specified.`; } try { const aiResponse = await fetchAIPrediction(prompt); setResult(aiResponse); + + // Save to history + const newHistoryItem = { + id: Date.now(), + timestamp: new Date().toLocaleString(), + type: inputMode, + details: inputMode === 'device' ? `${deviceInfo.brand} ${deviceInfo.model}` : `${specs.cpu}, ${specs.gpu}`, + result: aiResponse + }; + const updatedHistory = [newHistoryItem, ...history].slice(0, 5); // Keep last 5 + setHistory(updatedHistory); + localStorage.setItem('llm_predictions_history', JSON.stringify(updatedHistory)); + } catch (err) { setError(err.message || "Oops! The AI prediction failed. Please try again."); console.error(err); @@ -508,19 +530,37 @@