Skip to content

Commit b39f74b

Browse files
committed
Fix model capabilities for models with custom names.
1 parent 506b12e commit b39f74b

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## Unreleased
44

5+
- Fix model capabilities for models with custom names.
6+
57
## 0.70.1
68

79
- Fix prePrompt hook.

src/eca/models.clj

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,19 +77,21 @@
7777
(merge p
7878
(reduce
7979
(fn [m [model model-config]]
80-
(let [full-model (str provider "/" model)
80+
(let [real-model-name (or (:modelName model-config) model)
81+
full-real-model (str provider "/" real-model-name)
82+
full-model (str provider "/" model)
8183
model-capabilities (merge
82-
(or (get all-models full-model)
84+
(or (get all-models full-real-model)
8385
;; we guess the capabilities from
8486
;; the first model with same name
85-
(when-let [found-full-model (first (filter #(= (shared/normalize-model-name model)
87+
(when-let [found-full-model (first (filter #(= (shared/normalize-model-name real-model-name)
8688
(shared/normalize-model-name (second (string/split % #"/" 2))))
8789
(keys all-models)))]
8890
(get all-models found-full-model))
89-
{:model-name (or (:modelName model-config) model)
90-
:tools true
91+
{:tools true
9192
:reason? true
92-
:web-search true}))]
93+
:web-search true})
94+
{:model-name real-model-name})]
9395
(assoc m full-model model-capabilities)))
9496
{}
9597
(:models provider-config))))

0 commit comments

Comments
 (0)