Skip to content

Commit

Permalink
Merge pull request #169 from nextcloud/enh/noid/agency
Browse files Browse the repository at this point in the history
Agency
  • Loading branch information
julien-nc authored Jan 7, 2025
2 parents 18fd49e + 1142a63 commit 916244f
Show file tree
Hide file tree
Showing 34 changed files with 835 additions and 241 deletions.
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Known providers:
More details on how to set this up in the [admin docs](https://docs.nextcloud.com/server/latest/admin_manual/ai/index.html)
]]> </description>
<version>2.1.1</version>
<version>2.2.0</version>
<licence>agpl</licence>
<author>Julien Veyssier</author>
<namespace>Assistant</namespace>
Expand Down
268 changes: 161 additions & 107 deletions composer.lock

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions lib/Controller/AssistantApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function notifyWhenReady(int $ocpTaskId): DataResponse {
*
* Get all available task types that the assistant can handle.
*
* @return DataResponse<Http::STATUS_OK, array{types: array<AssistantTaskProcessingTaskType>}, array{}>
* @return DataResponse<Http::STATUS_OK, array{types: list<AssistantTaskProcessingTaskType>}, array{}>
*
* 200: Available task types returned
*/
Expand All @@ -94,7 +94,7 @@ public function getAvailableTaskTypes(): DataResponse {
* Get a list of assistant tasks for the current user.
*
* @param string|null $taskTypeId Task type id. If null, tasks of all task types will be retrieved
* @return DataResponse<Http::STATUS_OK, array{tasks: array<AssistantTaskProcessingTask>}, array{}>|DataResponse<Http::STATUS_NOT_FOUND, '', array{}>
* @return DataResponse<Http::STATUS_OK, array{tasks: list<AssistantTaskProcessingTask>}, array{}>|DataResponse<Http::STATUS_NOT_FOUND, '', array{}>
*
* 200: User tasks returned
* 404: No tasks found
Expand Down Expand Up @@ -139,7 +139,7 @@ public function parseTextFromFile(?string $filePath = null, ?int $fileId = null)

try {
$text = $this->assistantService->parseTextFromFile($this->userId, $filePath, $fileId);
} catch (\Exception | \Throwable $e) {
} catch (\Exception|\Throwable $e) {
return new DataResponse($e->getMessage(), Http::STATUS_BAD_REQUEST);
}
return new DataResponse([
Expand Down Expand Up @@ -280,7 +280,7 @@ public function getOutputFilePreview(int $ocpTaskId, int $fileId): RedirectRespo
} elseif ($preview['type'] === 'icon') {
return new RedirectResponse($preview['icon']);
}
} catch (Exception | Throwable $e) {
} catch (Exception|Throwable $e) {
$this->logger->error('getImage error', ['exception' => $e]);
return new DataResponse('', Http::STATUS_NOT_FOUND);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Controller/AssistantController.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function getAssistantTaskResultPage(int $taskId): TemplateResponse {
$this->initialStateService->provideInitialState('task', $task->jsonSerialize());
return new TemplateResponse(Application::APP_ID, 'assistantPage');
}
} catch (Exception | \Throwable $e) {
} catch (Exception|\Throwable $e) {
}
}
return new TemplateResponse('', '403', [], TemplateResponse::RENDER_AS_ERROR, Http::STATUS_FORBIDDEN);
Expand Down
Loading

0 comments on commit 916244f

Please sign in to comment.