| 1 |
<?php |
| 2 |
|
| 3 |
class Meow_MWAI_QueryImage extends Meow_MWAI_Query { |
| 4 |
|
| 5 |
public function __construct( $prompt = "", $model = "dall-e" ) { |
| 6 |
parent::__construct( $prompt ); |
| 7 |
$this->model = $model; |
| 8 |
$this->mode = "generation"; // could be generation, edit, variation |
| 9 |
} |
| 10 |
|
| 11 |
// Based on the params of the query, update the attributes |
| 12 |
public function injectParams( $params ) { |
| 13 |
if ( isset( $params['model'] ) ) { |
| 14 |
$this->setModel( $params['model'] ); |
| 15 |
} |
| 16 |
if ( isset( $params['apiKey'] ) ) { |
| 17 |
$this->setApiKey( $params['apiKey'] ); |
| 18 |
} |
| 19 |
if ( isset( $params['maxResults'] ) ) { |
| 20 |
$this->setMaxResults( $params['maxResults'] ); |
| 21 |
} |
| 22 |
if ( isset( $params['env'] ) ) { |
| 23 |
$this->setEnv( $params['env'] ); |
| 24 |
} |
| 25 |
if ( isset( $params['session'] ) ) { |
| 26 |
$this->setSession( $params['session'] ); |
| 27 |
} |
| 28 |
} |
| 29 |
|
| 30 |
} |
| 31 |
|