| 1 |
<?php // phpcs:ignore |
| 2 |
|
| 3 |
namespace OPTN\Includes\Dto; |
| 4 |
|
| 5 |
/** |
| 6 |
* Model Input DTO |
| 7 |
*/ |
| 8 |
class ModelInput { |
| 9 |
|
| 10 |
/** |
| 11 |
* User prompt |
| 12 |
* |
| 13 |
* @var string |
| 14 |
*/ |
| 15 |
public $user_prompt; |
| 16 |
|
| 17 |
/** |
| 18 |
* Developer Prompt |
| 19 |
* |
| 20 |
* @var string |
| 21 |
*/ |
| 22 |
public $instruction; |
| 23 |
|
| 24 |
/** |
| 25 |
* Images |
| 26 |
* |
| 27 |
* @var array |
| 28 |
*/ |
| 29 |
public $images; |
| 30 |
|
| 31 |
/** |
| 32 |
* Task |
| 33 |
* |
| 34 |
* @var string |
| 35 |
*/ |
| 36 |
public $task; |
| 37 |
|
| 38 |
/** |
| 39 |
* Constructor |
| 40 |
* |
| 41 |
* @param string $user_prompt user prompt. |
| 42 |
* @param array $args args. |
| 43 |
*/ |
| 44 |
public function __construct( $user_prompt, $args ) { |
| 45 |
$this->user_prompt = $user_prompt; |
| 46 |
|
| 47 |
$parsed_args = wp_parse_args( |
| 48 |
$args, |
| 49 |
array( |
| 50 |
'instruction' => '', |
| 51 |
'images' => array(), |
| 52 |
'task' => 'generate', |
| 53 |
) |
| 54 |
); |
| 55 |
|
| 56 |
$this->instruction = $parsed_args['instruction']; |
| 57 |
$this->task = $parsed_args['task']; |
| 58 |
$this->images = $parsed_args['images']; |
| 59 |
} |
| 60 |
} |
| 61 |
|