diff --git a/network-poc/static/index.html b/network-poc/static/index.html index 2ccbd71..039f5a1 100644 --- a/network-poc/static/index.html +++ b/network-poc/static/index.html @@ -2025,9 +2025,10 @@ filename.py: what this file contains Rules: - Max 4 files -- Only .py, .txt, .json, .html files +- Only .py, .toml, .json, .html files - No directories, no paths, just filenames - List dependencies first, then main app (e.g. models.py before main.py) +- Use pyproject.toml for dependencies (not requirements.txt) Project: ${task}`; const plan = await kpnRun(agentPrompts.manager.model, managerPrompt); @@ -2055,7 +2056,7 @@ Project: ${task}`; // Fallback: manageri ei tuottanut tiedostolistaa, käytetään koko vastausta ohjeena termLog(' Ei tiedostojakoa — generoidaan yhtenä kokonaisuutena'); termLog(`\n[2] Koodari — toteutus`); - const code = await kpnRun(agentPrompts.coder.model, `Project: ${task}\nFiles: ${plan}\n\nWrite all the code for this project. Use the exact libraries mentioned in the project description.`); + const code = await kpnRun(agentPrompts.coder.model, `Project: ${task}\nFiles: ${plan}\n\nWrite all the code for this project. Use the exact libraries mentioned in the project description. Use pyproject.toml for dependencies (not requirements.txt).`); if (code) { termLog(`\n━━━ Pipeline valmis ━━━`); } @@ -2080,8 +2081,24 @@ Project: ${task}`; ).join('\n\n') + '\n\n'; } + // Erityisohjeet pyproject.toml / requirements.txt -tiedostoille + let extraInstructions = ''; + if (file.name === 'pyproject.toml') { + extraInstructions = `\nUse this exact format: +[project] +name = "projectname" +version = "0.1.0" +requires-python = ">=3.11" +dependencies = ["fastapi", "uvicorn"] + +[project.scripts] +start = "uvicorn main:app --reload"`; + } else if (file.name === 'requirements.txt') { + extraInstructions = '\nList one dependency per line. No version pins unless necessary.'; + } + const coderPrompt = `${context}Project: ${task} -Write ONLY the file "${file.name}"${file.desc ? ': ' + file.desc : ''}. +Write ONLY the file "${file.name}"${file.desc ? ': ' + file.desc : ''}.${extraInstructions} Use the exact libraries mentioned in the project description. Write correct, working code.`; const code = await kpnRun(agentPrompts.coder.model, coderPrompt); if (!code) {