Private
Public Access
1
0

Add --model flag completion

This commit is contained in:
2024-03-12 07:43:57 +00:00
parent f2c7d2bdd0
commit 7d56726c78
2 changed files with 13 additions and 0 deletions

View File

@@ -42,6 +42,16 @@ func NewContext() (*Context, error) {
return &Context{*config, s, hl}, nil
}
func (c *Context) GetModels() (models []string) {
for _, m := range *c.Config.Anthropic.Models {
models = append(models, m)
}
for _, m := range *c.Config.OpenAI.Models {
models = append(models, m)
}
return
}
func (c *Context) GetCompletionProvider(model string) (provider.ChatCompletionClient, error) {
for _, m := range *c.Config.Anthropic.Models {
if m == model {