-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
266 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?php | ||
|
||
namespace App\Console\Commands\AI; | ||
|
||
use App\Jobs\ProcessTranscribe; | ||
use Exception; | ||
use Illuminate\Console\Command; | ||
|
||
class createTranscription extends Command | ||
{ | ||
/** | ||
* The name and signature of the console command. | ||
* | ||
* @var string | ||
*/ | ||
protected $signature = 'create:Transcription {s3_key} {upload_type}'; | ||
|
||
/** | ||
* The console command description. | ||
* | ||
* @var string | ||
*/ | ||
protected $description = 'Command description'; | ||
|
||
/** | ||
* Create a new command instance. | ||
* | ||
* @return void | ||
*/ | ||
public function __construct() | ||
{ | ||
parent::__construct(); | ||
} | ||
|
||
/** | ||
* Execute the console command. | ||
* | ||
* @return int | ||
*/ | ||
public function handle() | ||
{ | ||
//create:Transcription ee97f036e5d70ea252e4e46ff7811304.webm discussion_comment | ||
try { | ||
$s3_key = $this->argument('s3_key'); | ||
$upload_type = $this->argument('upload_type'); | ||
$job = new ProcessTranscribe($s3_key, $upload_type); | ||
$job->handle(); | ||
} catch (Exception $e) { | ||
echo $e->getMessage(); | ||
|
||
} | ||
return 0; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<?php | ||
|
||
namespace App\Console\Commands\AI; | ||
|
||
use App\DiscussionComment; | ||
use App\Exceptions\Handler; | ||
use Exception; | ||
use Illuminate\Console\Command; | ||
|
||
class fixMaxErrorIssue extends Command | ||
{ | ||
/** | ||
* The name and signature of the console command. | ||
* | ||
* @var string | ||
*/ | ||
protected $signature = 'fix:maxErrorIssue'; | ||
|
||
/** | ||
* The console command description. | ||
* | ||
* @var string | ||
*/ | ||
protected $description = 'Command description'; | ||
|
||
/** | ||
* Create a new command instance. | ||
* | ||
* @return void | ||
*/ | ||
public function __construct() | ||
{ | ||
parent::__construct(); | ||
} | ||
|
||
/** | ||
* @param DiscussionComment $discussionComment | ||
* @return int | ||
* @throws Exception | ||
*/ | ||
public function handle(DiscussionComment $discussionComment) | ||
{ | ||
$discussion_comments = $discussionComment->where('message', 'LIKE', '%Maximum content size%') | ||
->limit(5) | ||
->get(); | ||
foreach ($discussion_comments as $discussion_comment) { | ||
try { | ||
$this->call('create:Transcription', | ||
['s3_key' => $discussion_comment->file, | ||
'upload_type' => 'discussion_comment' | ||
]); | ||
} catch (Exception $e){ | ||
$h = new Handler(app()); | ||
$h->report($e); | ||
} | ||
} | ||
|
||
return 0; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
FROM laravelphp/vapor:php80 | ||
|
||
COPY . /var/task | ||
RUN apk --update add ffmpeg | ||
COPY . /var/task |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
FROM laravelphp/vapor:php80 | ||
|
||
RUN apk --update add ffmpeg | ||
COPY . /var/task |