Add files via upload

This commit is contained in:
公明
2025-11-09 13:30:08 +08:00
committed by GitHub
parent ffd417fe93
commit 1f51c64084
10 changed files with 214 additions and 46 deletions
+5 -1
View File
@@ -63,7 +63,11 @@ func New(cfg *config.Config, log *logger.Logger) (*App, error) {
executor.RegisterTools(mcpServer)
// 创建Agent
agent := agent.NewAgent(&cfg.OpenAI, mcpServer, log.Logger)
maxIterations := cfg.Agent.MaxIterations
if maxIterations <= 0 {
maxIterations = 30 // 默认值
}
agent := agent.NewAgent(&cfg.OpenAI, mcpServer, log.Logger, maxIterations)
// 创建处理器
agentHandler := handler.NewAgentHandler(agent, db, log.Logger)