mirror of
https://github.com/Ed1s0nZ/CyberStrikeAI.git
synced 2026-07-14 07:57:26 +02:00
Add files via upload
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package multiagent
|
||||
|
||||
import "cyberstrike-ai/internal/config"
|
||||
|
||||
const defaultAgentMaxIterations = 3000
|
||||
|
||||
// agentMaxIterations 全局上限:仅使用 config.agent.max_iterations;≤0 时与 config 默认一致为 3000。
|
||||
func agentMaxIterations(appCfg *config.Config) int {
|
||||
if appCfg != nil && appCfg.Agent.MaxIterations > 0 {
|
||||
return appCfg.Agent.MaxIterations
|
||||
}
|
||||
return defaultAgentMaxIterations
|
||||
}
|
||||
|
||||
// resolveMaxIterations 统一迭代上限:Markdown/子代理 front matter 中 max_iterations>0 可单独覆盖,否则使用 agent.max_iterations。
|
||||
// multi_agent.max_iteration 与 sub_agent_max_iterations 已废弃,不再参与计算。
|
||||
func resolveMaxIterations(appCfg *config.Config, markdownOverride int) int {
|
||||
if markdownOverride > 0 {
|
||||
return markdownOverride
|
||||
}
|
||||
return agentMaxIterations(appCfg)
|
||||
}
|
||||
Reference in New Issue
Block a user