revive ai, config*.go
parent
80df07089f
commit
a674022357
|
|
@ -3,6 +3,7 @@ package main
|
|||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"regexp"
|
||||
|
|
@ -28,8 +29,6 @@ type Config struct {
|
|||
AssetPattern string
|
||||
DatacenterPattern string
|
||||
EventNamePattern string
|
||||
storage Storage
|
||||
queue Queue
|
||||
driver Driver
|
||||
ai AI
|
||||
}
|
||||
|
|
@ -112,13 +111,11 @@ func newConfigFromEnv(ctx context.Context, getEnv func(string) string) (Config,
|
|||
}
|
||||
result.driver = driver
|
||||
if !result.FillWithTestdata {
|
||||
} else if err := result.driver.FillWithTestdata(ctx, result.AssetPattern, result.DatacenterPattern, result.EventNamePattern); err != nil {
|
||||
return Config{}, err
|
||||
//} else if err := result.driver.FillWithTestdata(ctx, result.AssetPattern, result.DatacenterPattern, result.EventNamePattern); err != nil {
|
||||
} else {
|
||||
return Config{}, errors.New("not impl")
|
||||
}
|
||||
|
||||
result.storage = NewStorage(result.driver)
|
||||
result.queue = NewQueue(result.driver)
|
||||
|
||||
if result.OllamaURL != "" {
|
||||
result.ai = NewAIOllama(result.OllamaURL, result.OllamaModel)
|
||||
} else if result.LocalCheckpoint != "" && result.LocalTokenizer != "" {
|
||||
Loading…
Reference in New Issue