modules
3 years ago
admin.php
3 years ago
ai.php
3 years ago
answer.php
3 years ago
api.php
3 years ago
core.php
3 years ago
init.php
3 years ago
openai.php
3 years ago
query.php
3 years ago
queryembed.php
3 years ago
queryimage.php
3 years ago
querytext.php
3 years ago
querytranscribe.php
3 years ago
rest.php
3 years ago
security.php
3 years ago
queryimage.php
31 lines
| 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 |