35 lines
862 B
Go
35 lines
862 B
Go
|
|
package cli
|
||
|
|
|
||
|
|
import (
|
||
|
|
"os"
|
||
|
|
"time"
|
||
|
|
|
||
|
|
"gitea.maximumdirect.net/eric/notarius/internal/framework/pipeline"
|
||
|
|
"go.maximumdirect.net/promptkit"
|
||
|
|
)
|
||
|
|
|
||
|
|
type Options struct {
|
||
|
|
LLMClient promptkit.LLMClient
|
||
|
|
LLMRuntime promptkit.RuntimeConfig
|
||
|
|
Catalog pipeline.ModuleCatalog
|
||
|
|
Registries pipeline.Registries
|
||
|
|
RunIDGenerator RunIDGenerator
|
||
|
|
LookupEnv func(string) (string, bool)
|
||
|
|
Now func() time.Time
|
||
|
|
}
|
||
|
|
|
||
|
|
// Defaulting function values is inert; command construction does not acquire
|
||
|
|
// configuration, register modules, resolve credentials, or allocate run storage.
|
||
|
|
func defaultOptions(options Options) Options {
|
||
|
|
if options.LookupEnv == nil {
|
||
|
|
options.LookupEnv = os.LookupEnv
|
||
|
|
}
|
||
|
|
if options.Now == nil {
|
||
|
|
options.Now = time.Now
|
||
|
|
}
|
||
|
|
if options.RunIDGenerator == nil {
|
||
|
|
options.RunIDGenerator = defaultRunIDGenerator
|
||
|
|
}
|
||
|
|
return options
|
||
|
|
}
|