Compare commits

...

5 Commits

Author SHA1 Message Date
github-actions[bot]
2155ff9fc0 Update version to v1.4.58 and commit 2024-10-11 20:30:50 +00:00
Eugen Eisler
d33175e5b6 chore: we don't need tp configure DryRun vendor 2024-10-11 23:28:56 +03:00
Eugen Eisler
6dbd24e541 fix: Close #1040. Configure vendors separately that were not configured yet 2024-10-11 23:25:33 +03:00
github-actions[bot]
d1c527c421 Update version to v1.4.57 and commit 2024-10-11 19:27:41 +00:00
Eugen Eisler
c0bd61ba49 docs: Close #1035, provide better example for pattern variables 2024-10-11 22:27:20 +03:00
6 changed files with 19 additions and 19 deletions

View File

@@ -213,7 +213,7 @@ Usage:
Application Options:
-p, --pattern= Choose a pattern from the available patterns
-v, --variable= Values for pattern variables, e.g. -v=$name:John -v=$age:30
-v, --variable= Values for pattern variables, e.g. -v=#role:expert -v=#points:30"
-C, --context= Choose a context from the available contexts
--session= Choose a session from the available sessions
-S, --setup Run setup for all reconfigurable parts of fabric

View File

@@ -264,8 +264,6 @@ func Setup(db *db.Db, skipUpdatePatterns bool) (ret *core.Fabric, err error) {
func SetupVendor(db *db.Db, vendorName string) (ret *core.Fabric, err error) {
ret = core.NewFabricForSetup(db)
if err = ret.SetupVendor(vendorName); err != nil {
return
}
err = ret.SetupVendor(vendorName)
return
}

View File

@@ -15,7 +15,7 @@ import (
// Flags create flags struct. the users flags go into this, this will be passed to the chat struct in cli
type Flags struct {
Pattern string `short:"p" long:"pattern" description:"Choose a pattern from the available patterns" default:""`
PatternVariables map[string]string `short:"v" long:"variable" description:"Values for pattern variables, e.g. -v=$name:John -v=$age:30"`
PatternVariables map[string]string `short:"v" long:"variable" description:"Values for pattern variables, e.g. -v=#role:expert -v=#points:30"`
Context string `short:"C" long:"context" description:"Choose a context from the available contexts" default:""`
Session string `long:"session" description:"Choose a session from the available sessions"`
Setup bool `short:"S" long:"setup" description:"Run setup for all reconfigurable parts of fabric"`

View File

@@ -67,7 +67,7 @@ func NewFabricBase(db *db.Db) (ret *Fabric) {
"Enter the index the name of your default model")
ret.VendorsAll.AddVendors(openai.NewClient(), azure.NewClient(), ollama.NewClient(), groq.NewClient(),
gemini.NewClient(), anthropic.NewClient(), siliconcloud.NewClient(), openrouter.NewClient(), mistral.NewClient(), dryrun.NewClient())
gemini.NewClient(), anthropic.NewClient(), siliconcloud.NewClient(), openrouter.NewClient(), mistral.NewClient())
return
}
@@ -188,7 +188,7 @@ func (o *Fabric) SetupVendors() (err error) {
}
func (o *Fabric) SetupVendor(vendorName string) (err error) {
if err = o.VendorsAll.SetupVendor(vendorName); err != nil {
if err = o.VendorsAll.SetupVendor(vendorName, o.Vendors); err != nil {
return
}
err = o.SaveEnvFile()

View File

@@ -90,26 +90,28 @@ func (o *VendorsManager) Setup() (ret map[string]vendors.Vendor, err error) {
ret = map[string]vendors.Vendor{}
for _, vendor := range o.Vendors {
fmt.Println()
if vendorErr := vendor.Setup(); vendorErr == nil {
fmt.Printf("[%v] configured\n", vendor.GetName())
ret[vendor.GetName()] = vendor
} else {
fmt.Printf("[%v] skipped\n", vendor.GetName())
}
o.setupVendorTo(vendor, ret)
}
return
}
func (o *VendorsManager) SetupVendor(vendorName string) (err error) {
func (o *VendorsManager) setupVendorTo(vendor vendors.Vendor, configuredVendors map[string]vendors.Vendor) {
if vendorErr := vendor.Setup(); vendorErr == nil {
fmt.Printf("[%v] configured\n", vendor.GetName())
configuredVendors[vendor.GetName()] = vendor
} else {
delete(configuredVendors, vendor.GetName())
fmt.Printf("[%v] skipped\n", vendor.GetName())
}
}
func (o *VendorsManager) SetupVendor(vendorName string, configuredVendors map[string]vendors.Vendor) (err error) {
vendor := o.FindByName(vendorName)
if vendor == nil {
err = fmt.Errorf("vendor %s not found", vendorName)
return
}
err = vendor.Setup()
if err != nil {
return
}
o.setupVendorTo(vendor, configuredVendors)
return
}

View File

@@ -1,3 +1,3 @@
package main
var version = "v1.4.56"
var version = "v1.4.58"