assistant.php
2 years ago
base.php
2 years ago
embed.php
2 years ago
feedback.php
2 years ago
function.php
2 years ago
image.php
2 years ago
parameter.php
2 years ago
text.php
2 years ago
transcribe.php
2 years ago
transcribe.php
26 lines
| 1 | <?php |
| 2 | |
| 3 | class Meow_MWAI_Query_Transcribe extends Meow_MWAI_Query_Base { |
| 4 | public string $url = ""; |
| 5 | |
| 6 | public function __construct( $message = '', $model = 'whisper-1' ) { |
| 7 | parent::__construct( $message ); |
| 8 | $this->set_model( $model ); |
| 9 | $this->mode = 'transcription'; |
| 10 | } |
| 11 | |
| 12 | public function set_url( $url ) { |
| 13 | $this->url = $url; |
| 14 | } |
| 15 | |
| 16 | // Based on the params of the query, update the attributes |
| 17 | public function inject_params( array $params ): void |
| 18 | { |
| 19 | parent::inject_params( $params ); |
| 20 | $params = $this->convert_keys( $params ); |
| 21 | |
| 22 | if ( !empty( $params['url'] ) ) { |
| 23 | $this->set_url( $params['url'] ); |
| 24 | } |
| 25 | } |
| 26 | } |