mirror of
https://github.com/nextcloud/server.git
synced 2026-04-05 00:56:16 -04:00
LLM OCP API: Simplify LanguageModelManager#canHandleTask
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
(cherry picked from commit 945522768e)
This commit is contained in:
parent
70e65ff7a3
commit
39bc710d17
1 changed files with 6 additions and 1 deletions
|
|
@ -127,7 +127,12 @@ class LanguageModelManager implements ILanguageModelManager {
|
|||
}
|
||||
|
||||
public function canHandleTask(ILanguageModelTask $task): bool {
|
||||
return count(array_filter($this->getAvailableTaskClasses(), fn ($class) => $task instanceof $class)) > 0;
|
||||
foreach ($this->getAvailableTaskClasses() as $class) {
|
||||
if ($task instanceof $class) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue