Skip to content

Commit 1fce0f4

Browse files
committed
bug #1008 [Platform] OllamaApiCatalog capability resolution fix (Guikingone)
This PR was merged into the main branch. Discussion ---------- [Platform] `OllamaApiCatalog` capability resolution fix | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | Docs? | no | Issues | -- | License | MIT Fix a wrong usage of `Capability`, the `OllamaClient` is using `INPUT_MESSAGES` when the `OllamaApiCatalog` is resolving an `INPUT_TEXT` capability. Commits ------- d901b0f fix(platform): OllamaApiCatalog improved
2 parents 9fc6e02 + d901b0f commit 1fce0f4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/platform/src/Bridge/Ollama/OllamaApiCatalog.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function getModel(string $modelName): Ollama
4444
$capabilities = array_map(
4545
static fn (string $capability): Capability => match ($capability) {
4646
'embedding' => Capability::EMBEDDINGS,
47-
'completion' => Capability::INPUT_TEXT,
47+
'completion' => Capability::INPUT_MESSAGES,
4848
'tools' => Capability::TOOL_CALLING,
4949
'thinking' => Capability::THINKING,
5050
'vision' => Capability::INPUT_IMAGE,

src/platform/tests/Bridge/Ollama/OllamaApiCatalogTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function testModelCatalogCanReturnModelFromApi()
3434

3535
$this->assertSame('foo', $model->getName());
3636
$this->assertSame([
37-
Capability::INPUT_TEXT,
37+
Capability::INPUT_MESSAGES,
3838
], $model->getCapabilities());
3939
$this->assertSame(1, $httpClient->getRequestsCount());
4040
}
@@ -66,7 +66,7 @@ public function testModelCatalogCanReturnModelsFromApi()
6666
$this->assertSame(Ollama::class, $model['class']);
6767
$this->assertCount(1, $model['capabilities']);
6868
$this->assertSame([
69-
Capability::INPUT_TEXT,
69+
Capability::INPUT_MESSAGES,
7070
], $model['capabilities']);
7171
$this->assertSame(2, $httpClient->getRequestsCount());
7272
}

0 commit comments

Comments
 (0)