WithModelSwitcherConfig sets the model switcher configuration for the runtime.
(cfg *ModelSwitcherConfig)
| 894 | |
| 895 | // WithModelSwitcherConfig sets the model switcher configuration for the runtime. |
| 896 | func WithModelSwitcherConfig(cfg *ModelSwitcherConfig) Opt { |
| 897 | return func(r *LocalRuntime) { |
| 898 | if cfg != nil && cfg.ProviderRegistry == nil { |
| 899 | cfgCopy := *cfg |
| 900 | cfgCopy.ProviderRegistry = r.providerRegistry |
| 901 | cfg = &cfgCopy |
| 902 | } |
| 903 | if cfg != nil && cfg.ProviderRegistry != nil { |
| 904 | r.providerRegistry = cfg.ProviderRegistry |
| 905 | } |
| 906 | r.modelSwitcherCfg = cfg |
| 907 | } |
| 908 | } |
no outgoing calls