From 2e3424ad5c6e54bce43b1a073bd950d767bebb2a Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Sun, 2 Nov 2025 19:42:55 +0000 Subject: [PATCH] v.2 --- api/analyze_chat.php | 104 +++++++++++ api/chat.php | 17 ++ api/generate_personas.php | 50 ++++- assets/css/custom.css | 110 +++++++++++ assets/js/main.js | 269 +++++++++++++++++++++++---- db/config.php | 56 +++++- db/migrations/001_initial_schema.sql | 45 +++++ index.php | 44 +++++ 8 files changed, 641 insertions(+), 54 deletions(-) create mode 100644 api/analyze_chat.php create mode 100644 api/chat.php create mode 100644 db/migrations/001_initial_schema.sql diff --git a/api/analyze_chat.php b/api/analyze_chat.php new file mode 100644 index 0000000..fd29f5b --- /dev/null +++ b/api/analyze_chat.php @@ -0,0 +1,104 @@ + '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