diff --git a/lib/Settings/Admin.php b/lib/Settings/Admin.php index 419f27d9..6aae60b0 100644 --- a/lib/Settings/Admin.php +++ b/lib/Settings/Admin.php @@ -9,8 +9,16 @@ use OCA\Github\Service\SecretService; use OCP\AppFramework\Http\TemplateResponse; use OCP\AppFramework\Services\IInitialState; +use OCP\Files\File; +use OCP\Files\IRootFolder; use OCP\IConfig; use OCP\Settings\ISettings; +use OCP\SpeechToText\ISpeechToTextManager; +use OCP\TaskProcessing\IManager; +use OCP\TaskProcessing\Task; +use OCP\TaskProcessing\TaskTypes\TextToText; +use OCP\TextProcessing\FreePromptTaskType; +use OCP\TextProcessing\IManager as TextProcessingIManager; class Admin implements ISettings { @@ -18,6 +26,10 @@ public function __construct( private SecretService $secretService, private IConfig $config, private IInitialState $initialStateService, + private IManager $taskprocessingManager, + private TextProcessingIManager $textProcessingManager, + private ISpeechToTextManager $speechToTextManager, + private IRootFolder $root, ) { } @@ -34,6 +46,20 @@ public function getForm(): TemplateResponse { $allowDefaultTokenToAnonymous = $this->config->getAppValue(Application::APP_ID, 'allow_default_link_token_to_anonymous', '0') === '1'; $allowDefaultTokenToGuests = $this->config->getAppValue(Application::APP_ID, 'allow_default_link_token_to_guests', '0') === '1'; +// $task = new Task(TextToText::ID, ['input' => 'count to 4 reverse'], Application::APP_ID, 'admin'); +// $task = $this->taskprocessingManager->runTask($task); +// $clientID = $task->getOutput()['output']; + +// $textProTask = new \OCP\TextProcessing\Task(FreePromptTaskType::class, 'count to 5 random', Application::APP_ID, 'admin'); +// $output = $this->textProcessingManager->runTask($textProTask); +// $clientID = $output; + +// $adminFolder = $this->root->getUserFolder('admin'); +// $file = $adminFolder->getFirstNodeById(766); +// if ($file !== null && $file instanceof File) { +// $clientID = $this->speechToTextManager->transcribeFile($file, 'admin', 'integration_github'); +// } + $adminConfig = [ 'client_id' => $clientID, 'client_secret' => $clientSecret === '' ? '' : 'dummyClientSecret', diff --git a/src/components/AdminSettings.vue b/src/components/AdminSettings.vue index d8fa4d63..10e93440 100644 --- a/src/components/AdminSettings.vue +++ b/src/components/AdminSettings.vue @@ -8,6 +8,10 @@ {{ t('integration_github', 'GitHub integration') }} + +