assist-feedback.php
1 year ago
assistant.php
1 year ago
base.php
1 year ago
dropped-file.php
1 year ago
edit-image.php
1 year ago
embed.php
1 year ago
feedback.php
1 year ago
function.php
1 year ago
image.php
1 year ago
parameter.php
1 year ago
text.php
1 year ago
transcribe.php
1 year ago
transcribe.php
37 lines
| 1 | <?php |
| 2 | |
| 3 | class Meow_MWAI_Query_Transcribe extends Meow_MWAI_Query_Base { |
| 4 | public string $url = ''; |
| 5 | |
| 6 | // Core Content |
| 7 | public ?Meow_MWAI_Query_DroppedFile $attachedFile = null; |
| 8 | |
| 9 | public function __construct( $message = '', $model = 'whisper-1' ) { |
| 10 | parent::__construct( $message ); |
| 11 | $this->set_model( $model ); |
| 12 | $this->feature = 'transcription'; |
| 13 | } |
| 14 | |
| 15 | public function set_url( $url ) { |
| 16 | $this->url = $url; |
| 17 | } |
| 18 | |
| 19 | // Based on the params of the query, update the attributes |
| 20 | public function inject_params( array $params ): void { |
| 21 | parent::inject_params( $params ); |
| 22 | $params = $this->convert_keys( $params ); |
| 23 | |
| 24 | if ( !empty( $params['url'] ) ) { |
| 25 | $this->set_url( $params['url'] ); |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | #region File Handling |
| 30 | |
| 31 | public function set_file( Meow_MWAI_Query_DroppedFile $file ): void { |
| 32 | $this->attachedFile = $file; |
| 33 | } |
| 34 | |
| 35 | #endregion |
| 36 | } |
| 37 |