fix bugs
This commit is contained in:
@@ -187,7 +187,7 @@ func (p *Proxy) SelectApiKey(model string) error {
|
||||
|
||||
if err != nil || len(akpikeys) == 0 {
|
||||
if strings.HasPrefix(model, "gpt") || strings.HasPrefix(model, "o1") || strings.HasPrefix(model, "o3") {
|
||||
keys, err := p.apiKeyDao.FindKeys(map[string]any{"type = ?": "openai"})
|
||||
keys, err := p.apiKeyDao.FindKeys(map[string]any{"apitype = ?": "openai"})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -195,7 +195,7 @@ func (p *Proxy) SelectApiKey(model string) error {
|
||||
}
|
||||
|
||||
if strings.HasPrefix(model, "gemini") {
|
||||
keys, err := p.apiKeyDao.FindKeys(map[string]any{"type = ?": "gemini"})
|
||||
keys, err := p.apiKeyDao.FindKeys(map[string]any{"apitype = ?": "gemini"})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -203,7 +203,7 @@ func (p *Proxy) SelectApiKey(model string) error {
|
||||
}
|
||||
|
||||
if strings.HasPrefix(model, "claude") {
|
||||
keys, err := p.apiKeyDao.FindKeys(map[string]any{"type = ?": "claude"})
|
||||
keys, err := p.apiKeyDao.FindKeys(map[string]any{"apitype = ?": "claude"})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -227,7 +227,7 @@ func (p *Proxy) SelectApiKey(model string) error {
|
||||
|
||||
func (p *Proxy) updateSupportModel() {
|
||||
|
||||
keys, err := p.apiKeyDao.FindKeys(map[string]interface{}{"type in ?": "openai,azure,claude"})
|
||||
keys, err := p.apiKeyDao.FindKeys(map[string]interface{}{"apitype in ?": "openai,azure,claude"})
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user