NewProvider creates a model provider using the build config's environment, gateway, and custom provider settings. It uses the provider registry carried by RuntimeConfig (populated by the team loader with the full provider set); without it, model creation fails with "unknown provider type".
(ctx context.Context, cfg *latest.ModelConfig)
| 31 | // by RuntimeConfig (populated by the team loader with the full provider set); |
| 32 | // without it, model creation fails with "unknown provider type". |
| 33 | func (c ManagersBuildConfig) NewProvider(ctx context.Context, cfg *latest.ModelConfig) (provider.Provider, error) { |
| 34 | return c.RuntimeConfig.ProviderRegistryOrDefault().New(ctx, cfg, c.Env, |
| 35 | options.WithGateway(c.ModelsGateway), |
| 36 | options.WithProviders(c.Providers)) |
| 37 | } |
| 38 | |
| 39 | // NewManager constructs a single RAG manager from a RAGConfig. |
| 40 | func NewManager( |
no test coverage detected