| 1 |
<?php |
| 2 |
/** |
| 3 |
* Prompt to create a course |
| 4 |
*/ |
| 5 |
if ( ! isset( $params ) ) { |
| 6 |
return; |
| 7 |
} |
| 8 |
|
| 9 |
// Course Intent |
| 10 |
$topic = $params['topic'] ?? ''; |
| 11 |
$goal = $params['goals'] ?? ''; |
| 12 |
$course_objective = trim( $params['course_objective'] ?? '' ); |
| 13 |
|
| 14 |
// AI Settings |
| 15 |
$language = $params['language'] ?? 'English'; |
| 16 |
$audience = $params['audience'] ?? 'Students'; |
| 17 |
$tone = $params['tone'] ?? 'analytical'; |
| 18 |
$length = $params['length'] ?? 60; |
| 19 |
$outputs = $params['outputs'] ?? 1; |
| 20 |
|
| 21 |
return <<<XML |
| 22 |
<prompt> |
| 23 |
<course_context> |
| 24 |
<audience> |
| 25 |
The target audience is: $audience |
| 26 |
</audience> |
| 27 |
<content_parameters> |
| 28 |
<language>$language</language> |
| 29 |
<tone>$tone</tone> |
| 30 |
</content_parameters> |
| 31 |
</course_context> |
| 32 |
|
| 33 |
<task_instructions> |
| 34 |
You are an expert course title creator. |
| 35 |
Create a concise, compelling course title with the following details: |
| 36 |
- Topic: {$topic} |
| 37 |
- Goal: {$goal} |
| 38 |
|
| 39 |
<structure_requirements> |
| 40 |
- The title must not exceed {$length} characters. |
| 41 |
- Generate EXACTLY **{$outputs}** course title(s) in a JSON array. |
| 42 |
</structure_requirements> |
| 43 |
</task_instructions> |
| 44 |
|
| 45 |
<output_format> |
| 46 |
- You MUST respond valid JSON array object. |
| 47 |
- Do not include any introductory text, explanations, or markdown code fences like ```json. |
| 48 |
- The JSON structure must strictly follow this example: |
| 49 |
<json_example> |
| 50 |
{ |
| 51 |
"results": [ |
| 52 |
{ "item": "Compelling Course Title Here" }, |
| 53 |
{ "item": "Another Engaging Title" } |
| 54 |
] |
| 55 |
} |
| 56 |
</json_example> |
| 57 |
</output_format> |
| 58 |
</prompt> |
| 59 |
XML; |
| 60 |
|