| 1 |
<?php |
| 2 |
/** |
| 3 |
* Prompt to create a course |
| 4 |
*/ |
| 5 |
if ( ! isset( $params ) ) { |
| 6 |
return; |
| 7 |
} |
| 8 |
|
| 9 |
$model_type = LP_Settings::get_option( 'open_ai_image_model_type', 'gpt-image-1' ); |
| 10 |
|
| 11 |
// Course Intent |
| 12 |
$title = wp_trim_words( $params['post-title'] ?? '', 100 ); |
| 13 |
$language = $params['language'] ?? 'English'; |
| 14 |
$quality = $params['quality'] ?? 'auto'; |
| 15 |
//$size = $params['size'] ?? '256x256'; |
| 16 |
//$outputs = $params['outputs'] ?? 1; |
| 17 |
$style = $params['style'] ?? 'Impressionism'; |
| 18 |
$goal = wp_trim_words( $params['goal'] ?? '', 850 ); |
| 19 |
|
| 20 |
$main_subject = ! empty( $goal ) ? "The main subject of the image must be: $goal." : ''; |
| 21 |
$title = ! empty( $title ) ? "The image should be inspired by the course title: $title." : ''; |
| 22 |
|
| 23 |
/** |
| 24 |
*A text description of the desired image(s). |
| 25 |
* The maximum length is 32000 characters for gpt-image-1, |
| 26 |
* 1000 characters for dall-e-2 |
| 27 |
* and 4000 characters for dall-e-3. |
| 28 |
*/ |
| 29 |
|
| 30 |
return <<<PROMPT |
| 31 |
Create a feature image for an online course. With the following details: |
| 32 |
$main_subject |
| 33 |
$title |
| 34 |
|
| 35 |
The desired artistic style is: $style. |
| 36 |
PROMPT; |
| 37 |
|