Skip to content

Commit f1fc8ba

Browse files
committed
Add missing ModelCatalogInterface and implement getCapabilities method
The rebase removed some files that were needed for the model catalog functionality. This commit restores the missing interface and updates the abstract class to implement all required methods.
1 parent 958c146 commit f1fc8ba

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

src/platform/src/AbstractModelCatalog.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,18 @@ public function getModel(string $modelName): Model
5858
return $model;
5959
}
6060

61+
/**
62+
* @return list<Capability>
63+
*/
64+
public function getCapabilities(string $modelName): array
65+
{
66+
if (!isset($this->models[$modelName])) {
67+
return [];
68+
}
69+
70+
return $this->models[$modelName]['capabilities'];
71+
}
72+
6173
/**
6274
* @return array<string, array{class: string, capabilities: list<Capability>}>
6375
*/
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\AI\Platform;
13+
14+
/**
15+
* @author Oskar Stark <[email protected]>
16+
*/
17+
interface ModelCatalogInterface
18+
{
19+
public function getModel(string $modelName): Model;
20+
21+
/**
22+
* @return list<Capability>
23+
*/
24+
public function getCapabilities(string $modelName): array;
25+
26+
/**
27+
* @return array<string, array{class: string, capabilities: list<Capability>}>
28+
*/
29+
public function getModels(): array;
30+
}

0 commit comments

Comments
 (0)