Spaces:
Running
Running
Download test-intent.js from Luca448/APP-Backend: direct link, hf CLI and curl.
- Browser
- Download file 865 Bytes
-
https://huggingface.co/spaces/Luca448/APP-Backend/resolve/main/test-intent.js
- Command line
-
hf download hf://spaces/Luca448/APP-Backend/test-intent.js
-
curl -L -o test-intent.js https://huggingface.co/spaces/Luca448/APP-Backend/resolve/main/test-intent.js
865 Bytes
| import { gemini } from './src/ai/gemini.js'; | |
| import { db } from './src/db/database.js'; | |
| async function test() { | |
| const apiKey = db.getSetting('gemini_api_key'); | |
| const prompt = 'Erkläre mir das physikalische Prinzip des Flaschenzugs. Bitte zeige mir anhand einer Skizze, wie sich die Zugkraft halbiert.'; | |
| const imageIntentPrompt = `Der Nutzer fragt: "${prompt}".\nErfordert diese Frage zwingend ein generiertes Bild zur visuellen Erklärung oder wurde explizit ein Bild angefragt (z.B. Arbeitsblätter, Diagramme, Szenen, Skizzen)?\nWenn ja, antworte NUR mit dem passenden englischen Midjourney/Flux Bild-Prompt (max 30 Wörter). Wenn nein, antworte NUR mit NEIN.`; | |
| try { | |
| const res = await gemini.generateContent(imageIntentPrompt, 'gemini-3.5-flash', apiKey); | |
| console.log('Result:', res); | |
| } catch(e) { console.error('Error:', e); } | |
| } | |
| test(); | |