Merge pull request #908 from nep-0/main

Add SiliconCloud support
This commit is contained in:
Eugen Eisler 2024-09-13 11:32:58 +02:00 committed by GitHub
commit 48076450d7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 17 additions and 1 deletions

View File

@ -17,6 +17,7 @@ import (
"github.com/danielmiessler/fabric/vendors/groc" "github.com/danielmiessler/fabric/vendors/groc"
"github.com/danielmiessler/fabric/vendors/ollama" "github.com/danielmiessler/fabric/vendors/ollama"
"github.com/danielmiessler/fabric/vendors/openai" "github.com/danielmiessler/fabric/vendors/openai"
"github.com/danielmiessler/fabric/vendors/siliconcloud"
"github.com/danielmiessler/fabric/youtube" "github.com/danielmiessler/fabric/youtube"
"github.com/pkg/errors" "github.com/pkg/errors"
) )
@ -59,7 +60,7 @@ func NewFabricBase(db *db.Db) (ret *Fabric) {
"Enter the index the name of your default model") "Enter the index the name of your default model")
ret.VendorsAll.AddVendors(openai.NewClient(), azure.NewClient(), ollama.NewClient(), groc.NewClient(), ret.VendorsAll.AddVendors(openai.NewClient(), azure.NewClient(), ollama.NewClient(), groc.NewClient(),
gemini.NewClient(), anthropic.NewClient()) gemini.NewClient(), anthropic.NewClient(), siliconcloud.NewClient())
return return
} }

15
vendors/siliconcloud/siliconcloud.go vendored Normal file
View File

@ -0,0 +1,15 @@
package siliconcloud
import (
"github.com/danielmiessler/fabric/vendors/openai"
)
func NewClient() (ret *Client) {
ret = &Client{}
ret.Client = openai.NewClientCompatible("SiliconCloud", "https://api.siliconflow.cn/v1", nil)
return
}
type Client struct {
*openai.Client
}