运行时依赖
安装命令
点击复制技能文档
多代理辩论框架 多个代理通过对抗性推理辩论主题以得出更强的结论。 快速开始 from debate import Debate, Agent, Judge debate = Debate("我们应该使用微服务吗?") debate.add_agent(Agent("pro", stance="support", model="gpt-4o")) debate.add_agent(Agent("con", stance="oppose", model="claude-sonnet-4")) debate.add_agent(Agent("synth", stance="synthesize", model="gemini-2.5-pro")) debate.set_judge(Judge(criteria=["证据", "逻辑", "完整性"])) result = debate.run(rounds=3) # 返回:winner, consensus, key_arguments, confidence 工作原理 主张:Pro 代理为主题辩护 反对:Con 代理反对主题 反驳:每个代理响应对方的观点 综合:Synth 代理找到共同点 判决:Judge 评估所有论点并宣布结果 辩论配置 Debate( topic="你的问题", rounds=3, # 辩论轮数 max_words_per_turn=500, # 限制论点长度 convergence_threshold=0.7, # 自动停止当达成共识 judge_criteria=["证据", "逻辑", "新颖性", "完整性"], ) 代理立场 support — 辩护 oppose — 反对 synthesize — 找到中间立场 devil_advocate — 辩护最弱点以加强它们 expert — 提供领域特定知识 Judge 根据可配置标准评估论点并产生: 每轮获胜者 总体获胜者 共识点 未解决问题 置信度评分