MCPcopy Create free account
hub / github.com/astercloud/aster / createAgentDependencies

Function createAgentDependencies

cmd/aster/session.go:227–249  ·  view source on GitHub ↗

createAgentDependencies creates the agent dependencies

(dataStore *store.JSONStore, modelConfig *types.ModelConfig)

Source from the content-addressed store, hash-verified

225
226// createAgentDependencies creates the agent dependencies
227func 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
252func applyRecipeToConfig(r *recipe.Recipe, config *types.AgentConfig, deps *agent.Dependencies) {

Callers 1

runSessionFunction · 0.85

Calls 7

NewRegistryFunction · 0.92
RegisterAllFunction · 0.92
NewFactoryFunction · 0.92
NewMultiProviderFactoryFunction · 0.92
NewTemplateRegistryFunction · 0.92
NewStaticRouterFunction · 0.92
registerBuiltinTemplatesFunction · 0.85

Tested by

no test coverage detected