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

Method buildLoopDemo

pkg/server/workflow_demo.go:464–482  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

462}
463
464func (s *Server) buildLoopDemo() (workflow.Agent, error) {
465 critic := NewLLMWorkflowAgent("Critic", "评估当前方案", s.deps)
466 improver := NewLLMWorkflowAgent("Improver", "提出改进建议", s.deps)
467
468 return workflow.NewLoopAgent(workflow.LoopConfig{
469 Name: "OptimizationLoop",
470 SubAgents: []workflow.Agent{critic, improver},
471 MaxIterations: 3,
472 StopCondition: func(ev *session.Event) bool {
473 if ev == nil || ev.Metadata == nil {
474 return false
475 }
476 if score, ok := ev.Metadata["quality_score"].(int); ok {
477 return score >= 90
478 }
479 return false
480 },
481 })
482}
483
484func (s *Server) buildNestedDemo() (workflow.Agent, error) {
485 dataCollectors := []workflow.Agent{

Callers 1

buildDemoWorkflowMethod · 0.95

Calls 2

NewLoopAgentFunction · 0.92
NewLLMWorkflowAgentFunction · 0.85

Tested by

no test coverage detected