ai-dev-system / api /app /agents /frontend.py
42hgyn26hz-cpu
Initial commit
4f4aa9b
raw
history blame contribute delete
740 Bytes
import requests
from app.config import CODE_MODEL_URL
MODEL_NAME = "deepseek-ai/DeepSeek-Coder-V2-Instruct"
def frontend_agent(plan: str) -> str:
prompt = f"""
You are a senior frontend engineer.
Based on this backend plan:
{plan}
Generate:
- NextJS app structure
- API integration example
- Auth integration
- Clean folder structure
Return full production-ready frontend code.
"""
payload = {
"model": MODEL_NAME,
"messages": [{"role": "user", "content": prompt}],
"temperature": 0.3,
}
response = requests.post(CODE_MODEL_URL, json=payload, timeout=300)
response.raise_for_status()
return response.json()["choices"][0]["message"]["content"]