mirror of
https://github.com/danielmiessler/fabric
synced 2024-11-08 07:11:06 +00:00
Merge pull request #910 from rudi-bruchez/openrouter
Add Openrouter Vendor support
This commit is contained in:
commit
37401fcfb4
@ -17,7 +17,8 @@ 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/vendors/openrouter"
|
||||||
|
"github.com/danielmiessler/fabric/vendors/siliconcloud"
|
||||||
"github.com/danielmiessler/fabric/youtube"
|
"github.com/danielmiessler/fabric/youtube"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
)
|
)
|
||||||
@ -60,7 +61,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(), siliconcloud.NewClient())
|
gemini.NewClient(), anthropic.NewClient(), siliconcloud.NewClient(), openrouter.NewClient())
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -3,8 +3,9 @@ package core
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/danielmiessler/fabric/vendors"
|
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
|
"github.com/danielmiessler/fabric/vendors"
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewVendorsManager() *VendorsManager {
|
func NewVendorsManager() *VendorsManager {
|
||||||
|
16
vendors/openrouter/openrouter.go
vendored
Normal file
16
vendors/openrouter/openrouter.go
vendored
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
package openrouter
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/danielmiessler/fabric/vendors/openai"
|
||||||
|
)
|
||||||
|
|
||||||
|
func NewClient() (ret *Client) {
|
||||||
|
ret = &Client{}
|
||||||
|
ret.Client = openai.NewClientCompatible("OpenRouter", "https://openrouter.ai/api/v1", nil)
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
type Client struct {
|
||||||
|
*openai.Client
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user