'Invalid input. session_id, persona, and history are required.']); exit; } $sessionId = $data['session_id']; $persona = $data['persona']; $history = $data['history']; // --- System Prompt & API Call (remains the same) --- $system_prompt = "You are a market research analyst. Your task is to analyze a conversation between an entrepreneur and a potential customer persona. The persona's details and the conversation are provided below.\n\n" . "**Persona Profile:**\n" . "- Name: {$persona['name']}\n" . "- Age: {$persona['age']}\n" . "- Occupation: {$persona['occupation']}\n" . "- Traits: {$persona['traits']}\n" . "- Concerns: {$persona['concerns']}\n" . "- Style: {$persona['style']}\n\n" . "**Your Analysis Should Include:**\n" . "1. **Key Takeaways:** A bulleted list of the most important points from the conversation.\n" . "2. **Persona's Sentiment:** A brief assessment (Positive, Negative, Neutral, Mixed) of the persona's overall feeling about the business idea, with a brief justification.\n" . "3. **Actionable Insights:** A bulleted list of concrete suggestions for the entrepreneur to improve their idea based on the persona's feedback.\n\n" . "Please format your response in simple HTML, using

for titles and