Auto commit: 2025-11-18T10:51:37.976Z

This commit is contained in:
Flatlogic Bot 2025-11-18 10:51:37 +00:00
parent 78612e6972
commit 6a8221f33b
2 changed files with 1 additions and 12 deletions

View File

@ -44,18 +44,7 @@ if ($_SESSION['question_index'] < count($questions)) {
foreach ($_SESSION['answers'] as $index => $answer) {
$formatted_answers[] = "Q: " . $questions[$index] . "\nA: " . $answer;
}
$prompt = <<<'EOD'
You are a burnout analysis expert. A user has completed a burnout survey. The user answered on a scale of 1-5 where 1 is 'Never' and 5 is 'Always'. Analyze the following survey answers and provide a detailed analysis.
Return the response as a JSON object. The JSON object must have the following keys: "scores", "analysis", "recommendations", and "nextSteps".
- "scores" should be an object with keys "Exhaustion", "Cynicism", and "Inefficacy", each with a numeric score from 0 to 5.
- "analysis" should be an object with keys "overallSummary", "exhaustionSummary", "cynicismSummary", and "inefficacySummary", each containing a string with the corresponding analysis.
- "recommendations" should be an array of objects, where each object has a "title" and a "description".
- "nextSteps" should be an array of strings.
Answers:
EOD;
$prompt = "You are a burnout analysis expert. A user has completed a burnout survey. The user answered on a scale of 1-5 where 1 is 'Never' and 5 is 'Always'. Analyze the following survey answers and provide a detailed analysis.\n\nReturn the response as a JSON object. The JSON object must have the following keys: \"scores\", \"analysis\", \"recommendations\", and \"nextSteps\".\n\n- The 'scores' key should contain an object with 'Exhaustion', 'Cynicism', and 'Inefficacy' as keys, each with a numeric score from 0 to 5.\n- The 'analysis' key should contain an object with 'overallSummary', 'exhaustionSummary', 'cynicismSummary', and 'inefficacySummary' as keys, each containing a string with the corresponding analysis.\n- The 'recommendations' key should contain an array of objects, where each object has a 'title' and a 'description'.\n- The 'nextSteps' key should contain an array of strings.\n\nAnswers:";
$prompt .= implode("\n\n", $formatted_answers);
$ai_response = LocalAIApi::createResponse([

Binary file not shown.

After

Width:  |  Height:  |  Size: 362 KiB