createAgentDependencies creates the agent dependencies
(dataStore *store.JSONStore, modelConfig *types.ModelConfig)
| 225 | |
| 226 | // createAgentDependencies creates the agent dependencies |
| 227 | func createAgentDependencies(dataStore *store.JSONStore, modelConfig *types.ModelConfig) *agent.Dependencies { |
| 228 | toolRegistry := tools.NewRegistry() |
| 229 | builtin.RegisterAll(toolRegistry) |
| 230 | |
| 231 | sandboxFactory := sandbox.NewFactory() |
| 232 | providerFactory := provider.NewMultiProviderFactory() |
| 233 | templateRegistry := agent.NewTemplateRegistry() |
| 234 | registerBuiltinTemplates(templateRegistry) |
| 235 | |
| 236 | routes := []router.StaticRouteEntry{ |
| 237 | {Task: "chat", Priority: router.PriorityQuality, Model: modelConfig}, |
| 238 | } |
| 239 | rt := router.NewStaticRouter(modelConfig, routes) |
| 240 | |
| 241 | return &agent.Dependencies{ |
| 242 | Store: dataStore, |
| 243 | ToolRegistry: toolRegistry, |
| 244 | SandboxFactory: sandboxFactory, |
| 245 | ProviderFactory: providerFactory, |
| 246 | TemplateRegistry: templateRegistry, |
| 247 | Router: rt, |
| 248 | } |
| 249 | } |
| 250 | |
| 251 | // applyRecipeToConfig applies recipe settings to agent config |
| 252 | func applyRecipeToConfig(r *recipe.Recipe, config *types.AgentConfig, deps *agent.Dependencies) { |
no test coverage detected