Use @ as the separator between model and provider
Also put the provider after the model (e.g. `gpt-4o@openai`, `openai/gpt-4o@openrouter`. The aim here was to reduce clashing and confusion with existing model naming conventions.
This commit is contained in:
parent
dfe43179c0
commit
85a2abbbf3
@ -66,7 +66,7 @@ func (c *Context) GetModels() (models []string) {
|
||||
for _, p := range c.Config.Providers {
|
||||
for _, m := range *p.Models {
|
||||
modelCounts[m]++
|
||||
models = append(models, *p.Name+"/"+m)
|
||||
models = append(models, fmt.Sprintf("%s@%s", m, *p.Name))
|
||||
}
|
||||
}
|
||||
|
||||
@ -80,12 +80,12 @@ func (c *Context) GetModels() (models []string) {
|
||||
}
|
||||
|
||||
func (c *Context) GetModelProvider(model string) (string, api.ChatCompletionClient, error) {
|
||||
parts := strings.Split(model, "/")
|
||||
parts := strings.Split(model, "@")
|
||||
|
||||
var provider string
|
||||
if len(parts) > 1 {
|
||||
provider = parts[0]
|
||||
model = parts[1]
|
||||
model = parts[0]
|
||||
provider = parts[1]
|
||||
}
|
||||
|
||||
for _, p := range c.Config.Providers {
|
||||
|
Loading…
Reference in New Issue
Block a user