Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Agency #169

Merged
merged 6 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

woop woop

<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
Loading