Compare commits

...

4 Commits

Author SHA1 Message Date
github-actions[bot]
b64178c292 Update version to v1.4.143 and commit 2025-02-26 08:53:09 +00:00
Eugen Eisler
f7d38fb51f Merge pull request #1264 from danielmiessler/feat/exolab
feat: implement support for exolab
2025-02-26 09:52:13 +01:00
Eugen Eisler
ea6c0b9025 Merge branch 'main' into feat/exolab 2025-02-26 09:50:53 +01:00
Eugen Eisler
d25be21939 feat: implement support for https://github.com/exo-explore/exo 2025-01-18 19:55:24 +01:00
5 changed files with 58 additions and 7 deletions

View File

@@ -3,6 +3,7 @@ package core
import (
"bytes"
"fmt"
"github.com/danielmiessler/fabric/plugins/ai/exolab"
"os"
"path/filepath"
"strconv"
@@ -55,7 +56,7 @@ func NewPluginRegistry(db *fsdb.Db) (ret *PluginRegistry, err error) {
gemini.NewClient(),
//gemini_openai.NewClient(),
anthropic.NewClient(), siliconcloud.NewClient(),
openrouter.NewClient(), lmstudio.NewClient(), mistral.NewClient(), deepseek.NewClient())
openrouter.NewClient(), lmstudio.NewClient(), mistral.NewClient(), deepseek.NewClient(), exolab.NewClient())
_ = ret.Configure()
return

View File

@@ -1 +1 @@
"1.4.142"
"1.4.143"

View File

@@ -0,0 +1,44 @@
package exolab
import (
"github.com/danielmiessler/fabric/plugins"
"github.com/danielmiessler/fabric/plugins/ai/openai"
"strings"
goopenai "github.com/sashabaranov/go-openai"
)
func NewClient() (ret *Client) {
ret = &Client{}
ret.Client = openai.NewClientCompatibleNoSetupQuestions("Exolab", ret.configure)
ret.ApiBaseURL = ret.AddSetupQuestion("API Base URL", true)
ret.ApiBaseURL.Value = "http://localhost:52415"
ret.ApiModels = ret.AddSetupQuestionCustom("models", true,
"Enter your deployed Exolab models (comma separated)")
return
}
type Client struct {
*openai.Client
ApiModels *plugins.SetupQuestion
apiModels []string
}
func (oi *Client) configure() (err error) {
oi.apiModels = strings.Split(oi.ApiModels.Value, ",")
config := goopenai.DefaultConfig("")
config.BaseURL = oi.ApiBaseURL.Value
oi.ApiClient = goopenai.NewClientWithConfig(config)
return
}
func (oi *Client) ListModels() (ret []string, err error) {
ret = oi.apiModels
return
}

View File

@@ -18,6 +18,16 @@ func NewClient() (ret *Client) {
}
func NewClientCompatible(vendorName string, defaultBaseUrl string, configureCustom func() error) (ret *Client) {
ret = NewClientCompatibleNoSetupQuestions(vendorName, configureCustom)
ret.ApiKey = ret.AddSetupQuestion("API Key", true)
ret.ApiBaseURL = ret.AddSetupQuestion("API Base URL", false)
ret.ApiBaseURL.Value = defaultBaseUrl
return
}
func NewClientCompatibleNoSetupQuestions(vendorName string, configureCustom func() error) (ret *Client) {
ret = &Client{}
if configureCustom == nil {
@@ -30,10 +40,6 @@ func NewClientCompatible(vendorName string, defaultBaseUrl string, configureCust
ConfigureCustom: configureCustom,
}
ret.ApiKey = ret.AddSetupQuestion("API Key", true)
ret.ApiBaseURL = ret.AddSetupQuestion("API Base URL", false)
ret.ApiBaseURL.Value = defaultBaseUrl
return
}

View File

@@ -1,3 +1,3 @@
package main
var version = "v1.4.142"
var version = "v1.4.143"