mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-05-10 15:12:12 +00:00
AcceptAllModels return CompletitionsModels as fallback
This commit is contained in:
parent
25ced0d660
commit
67cb6fb8a2
1 changed files with 2 additions and 1 deletions
|
|
@ -23,6 +23,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace App\Services\AI;
|
||||
|
||||
use Symfony\AI\Platform\Bridge\Generic\CompletionsModel;
|
||||
use Symfony\AI\Platform\Exception\ModelNotFoundException;
|
||||
use Symfony\AI\Platform\Model;
|
||||
use Symfony\AI\Platform\ModelCatalog\ModelCatalogInterface;
|
||||
|
|
@ -47,7 +48,7 @@ final readonly class AcceptAllModelsCatalog implements ModelCatalogInterface
|
|||
return $this->decorated->getModel($modelName);
|
||||
} catch (ModelNotFoundException $e) {
|
||||
//If the model is not found, return a generic model with the given name and no capabilities.
|
||||
return new Model($modelName, []);
|
||||
return new CompletionsModel($modelName, []);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue