export async function generateFriendlyReply(inputText: string): Promise { const API_KEY = "your-api-key"; const API_ENDPOINT = "https://api.openai.com/v1/engines/davinci-codex/completions"; const headers = { "Content-Type": "application/json", Authorization: `Bearer ${API_KEY}`, }; const prompt = `Translate the following aggressive reply to a friendly one: "${inputText}"`; const response = await fetch(API_ENDPOINT, { method: "POST", headers: headers, body: JSON.stringify({ prompt: prompt, max_tokens: 50, n: 1, stop: null, temperature: 0.5, }), }); const data = await response.json(); return data.choices[0].text.trim(); }