Changeset 0.9.0 (#50)

This commit is contained in:
2026-02-23 01:57:28 +00:00
parent 15be26c516
commit 8264aa6016
94 changed files with 9812 additions and 8574 deletions

View File

@@ -1,6 +1,7 @@
package providers
import (
"git.gobha.me/xcaliber/chat-switchboard/capabilities"
"bufio"
"bytes"
"context"
@@ -190,25 +191,25 @@ func (p *OpenAIProvider) ListModels(ctx context.Context, cfg ProviderConfig) ([]
return nil, fmt.Errorf("decode models: %w", err)
}
models := make([]Model, 0, len(result.Data))
out := make([]Model, 0, len(result.Data))
for _, m := range result.Data {
// Try known table first, then heuristic
caps, found := LookupKnownModel(m.ID)
caps, found := capabilities.LookupKnownModel(m.ID)
if !found {
caps = InferCapabilities(m.ID)
caps = capabilities.InferCapabilities(m.ID)
}
// Use context_length from API if available and we don't have it
if m.ContextLength > 0 && caps.MaxContext == 0 {
caps.MaxContext = m.ContextLength
}
models = append(models, Model{
out = append(out, Model{
ID: m.ID,
OwnedBy: m.OwnedBy,
Capabilities: caps,
})
}
return models, nil
return out, nil
}
// ── HTTP Layer ──────────────────────────────