export const generateReelScript = async (topic: string) => {
const prompt = Generate a short 15-second Instagram reel script and 5 viral hashtags for the topic: "${topic}". Make the script engaging and desi style.
;
const res = await fetch("https://api.openai.com/v1/chat/completions", {
method: "POST",
headers: {
"Authorization": Bearer ${Deno.env.get("OPENAI_API_KEY")}
,
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "gpt-4",
messages: [{ role: "user", content: prompt }],
temperature: 0.7,
}),
});
const data = await res.json(); return data.choices[0].message.content; };
// Example test run generateReelScript("Shiv Bhakti").then(console.log); 🎥 Script: "Jab tak gale mein dam hai, tab tak Bholenath ka naam hai! Har har Mahadev! 🚩"
🔖 Hashtags: #MahadevReel #DesiBhakti #ShivPremi #ReelMitra #BhaktiViral