Enable bundled OpenRouter configuration by default
This commit is contained in:
@@ -41,13 +41,17 @@ type ConfigurationSources struct {
|
||||
|
||||
// Options collects construction choices from the public facade.
|
||||
type Options struct {
|
||||
llmClient llm.Client
|
||||
artifactReader artifact.Reader
|
||||
validator validate.Validator
|
||||
validatorSource bool
|
||||
artifactSource bool
|
||||
llmClient llm.Client
|
||||
artifactReader artifact.Reader
|
||||
validator validate.Validator
|
||||
validatorSource bool
|
||||
artifactSource bool
|
||||
disableBundledOpenRouter bool
|
||||
}
|
||||
|
||||
// SetBundledOpenRouter selects whether the built-in OpenRouter source is installed.
|
||||
func (o *Options) SetBundledOpenRouter(enabled bool) { o.disableBundledOpenRouter = !enabled }
|
||||
|
||||
// SetLLMClient selects the client collaborator for one engine.
|
||||
func (o *Options) SetLLMClient(client llm.Client) { o.llmClient = client }
|
||||
|
||||
@@ -124,6 +128,11 @@ func New(cfg Config, options Options) (*Engine, error) {
|
||||
return nil, err
|
||||
}
|
||||
underlays := cfg.Sources.Underlays
|
||||
if !options.disableBundledOpenRouter {
|
||||
underlays = make([]configkit.Underlay, 1, len(cfg.Sources.Underlays)+1)
|
||||
underlays[0] = configuration.BundledOpenRouterUnderlay()
|
||||
underlays = append(underlays, cfg.Sources.Underlays...)
|
||||
}
|
||||
main := configkit.Input{Source: configkit.NoSource()}
|
||||
if cfg.Sources.Main != nil {
|
||||
main = *cfg.Sources.Main
|
||||
|
||||
Reference in New Issue
Block a user