Spaces:
Build error
Build error
| export default function handler(req, res) { | |
| if (req.method === 'POST') { | |
| const { message, language } = req.body | |
| // In a real app, this would call your AI model | |
| const response = language === 'fa' | |
| ? `پاسخ به: "${message}"\n\nمن یک مدل هوش مصنوعی هستم که میتوانم در برنامهنویسی به شما کمک کنم. لطفاً سوال دقیقتری بپرسید.` | |
| : `Response to: "${message}"\n\nI'm an AI model that can help with programming. Please ask a more specific question.` | |
| res.status(200).json({ response }) | |
| } else { | |
| res.setHeader('Allow', ['POST']) | |
| res.status(405).end(`Method ${req.method} Not Allowed`) | |
| } | |
| } |