Initial commit
This commit is contained in:
commit
f45881dc88
161 files changed
+21597
No files matched your search
@@ -0,0 +1,80 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
QwenPaw + MetaGPT + ECC + AnySearch 全套流水线
|
||||
|
||||
使用方式:
|
||||
1. 确保 metaGPT 和 ECC 已安装配置
|
||||
2. 运行: python3 pipeline_demo.py "你的需求"
|
||||
"""
|
||||
|
||||
import subprocess
|
||||
import sys
|
||||
import json
|
||||
|
||||
|
||||
def search_reference(query: str):
|
||||
"""Step 1: AnySearch 搜索参考资料"""
|
||||
print(f"\n{'='*60}")
|
||||
print(f"🔍 [1/4] AnySearch 搜索: {query}")
|
||||
print(f"{'='*60}")
|
||||
# 通过 curl 调 AnySearch MCP
|
||||
cmd = f'''curl -s 'https://api.anysearch.com/mcp' -X POST \
|
||||
-H 'Content-Type: application/json' \
|
||||
-H 'Authorization: Bearer as_sk_f92eddbbd0360ccd793ac7aa5a391f77' \
|
||||
-d '{{"jsonrpc":"2.0","method":"tools/call","id":1,"params":{{"name":"search","arguments":{{"query":"{query}","max_results":3}}}}}}' '''
|
||||
result = subprocess.run(cmd, shell=True, capture_output=True, text=True, timeout=15)
|
||||
print(f"✅ 搜索完成")
|
||||
return result.stdout
|
||||
|
||||
|
||||
def generate_code(requirement: str):
|
||||
"""Step 2: MetaGPT 生成代码"""
|
||||
print(f"\n{'='*60}")
|
||||
print(f"🏢 [2/4] MetaGPT 生成项目: {requirement}")
|
||||
print(f"{'='*60}")
|
||||
result = subprocess.run(
|
||||
f'metagpt "{requirement}" --n-round 1',
|
||||
shell=True, capture_output=True, text=True, timeout=120
|
||||
)
|
||||
print(f"✅ MetaGPT 生成完成")
|
||||
return result
|
||||
|
||||
|
||||
def review_code(project_path: str):
|
||||
"""Step 3: ECC 代码审查"""
|
||||
print(f"\n{'='*60}")
|
||||
print(f"🔧 [3/4] ECC 代码审查")
|
||||
print(f"{'='*60}")
|
||||
# ECC 审查通过 MCP 工具调用(在 QwenPaw 会话中自动可用)
|
||||
print(f"✅ ECC 准备就绪")
|
||||
|
||||
|
||||
def deploy():
|
||||
"""Step 4: ECC 部署"""
|
||||
print(f"\n{'='*60}")
|
||||
print(f"🚀 [4/4] ECC 部署上线")
|
||||
print(f"{'='*60}")
|
||||
print(f"✅ 部署准备就绪")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
requirement = " ".join(sys.argv[1:]) or "创建一个Python命令行计算器"
|
||||
|
||||
print(f"🔥 QwenPaw + MetaGPT + ECC + AnySearch 全套流水线")
|
||||
print(f"📝 需求: {requirement}")
|
||||
|
||||
# 1. 搜资料
|
||||
search_reference(f"{requirement} 技术方案")
|
||||
|
||||
# 2. 生成代码
|
||||
result = generate_code(requirement)
|
||||
|
||||
# 3. 审查
|
||||
review_code("./workspace")
|
||||
|
||||
# 4. 部署
|
||||
deploy()
|
||||
|
||||
print(f"\n{'='*60}")
|
||||
print(f"🎉 流水线执行完成!")
|
||||
print(f"{'='*60}")
|
||||
Reference in new issue
Block a user