diff options
| author | Grail Finder <wohilas@gmail.com> | 2026-03-02 11:25:20 +0300 |
|---|---|---|
| committer | Grail Finder <wohilas@gmail.com> | 2026-03-02 11:25:20 +0300 |
| commit | 4f6000a43ad2ee019a799c5b5154af9f853e2b83 (patch) | |
| tree | c0a74081e043aeb1e479c8540789050be468c4d9 /models | |
| parent | 9ba46b40cc7fb058ff506ff554ba19e7337448d9 (diff) | |
Enha: check if model has vision before giving it vision tools
Diffstat (limited to 'models')
| -rw-r--r-- | models/models.go | 14 | ||||
| -rw-r--r-- | models/openrouter.go | 13 |
2 files changed, 27 insertions, 0 deletions
diff --git a/models/models.go b/models/models.go index 973eb3d..97d0272 100644 --- a/models/models.go +++ b/models/models.go @@ -608,6 +608,20 @@ func (lcp *LCPModels) ListModels() []string { return resp } +func (lcp *LCPModels) HasVision(modelID string) bool { + for _, m := range lcp.Data { + if m.ID == modelID { + args := m.Status.Args + for i := 0; i < len(args)-1; i++ { + if args[i] == "--mmproj" { + return true + } + } + } + } + return false +} + type ResponseStats struct { Tokens int Duration float64 diff --git a/models/openrouter.go b/models/openrouter.go index 62709a1..2dd49cc 100644 --- a/models/openrouter.go +++ b/models/openrouter.go @@ -172,3 +172,16 @@ func (orm *ORModels) ListModels(free bool) []string { } return resp } + +func (orm *ORModels) HasVision(modelID string) bool { + for i := range orm.Data { + if orm.Data[i].ID == modelID { + for _, mod := range orm.Data[i].Architecture.InputModalities { + if mod == "image" { + return true + } + } + } + } + return false +} |
