fix empty models

This commit is contained in:
Sakurasan
2025-04-22 02:52:56 +08:00
parent 8d34f8d6fe
commit 9c604460b1
5 changed files with 7 additions and 6 deletions

View File

@@ -234,7 +234,6 @@ func (p *Proxy) Do(llmusage *llm.TokenUsage) error {
func (p *Proxy) SelectApiKey(model string) error {
akpikeys, err := p.apiKeyDao.FindApiKeysBySupportModel(p.db, model)
fmt.Println(len(akpikeys), err)
if err != nil || len(akpikeys) == 0 {
if strings.HasPrefix(model, "gpt") || strings.HasPrefix(model, "o1") || strings.HasPrefix(model, "o3") || strings.HasPrefix(model, "o4") {
keys, err := p.apiKeyDao.FindKeys(map[string]any{"active = ?": true, "apitype = ?": "openai"})