submit_kling_task.py 790 B

1234567891011121314151617181920212223242526272829303132
  1. #!/usr/bin/env python3
  2. """
  3. 提交快手可灵工具封装任务到CodingAgent
  4. """
  5. import asyncio
  6. from pathlib import Path
  7. from tool_agent.tool.agent import CodingAgent
  8. async def main():
  9. # 读取任务书
  10. task_spec_path = Path(__file__).parent.parent / "task_specs" / "kuaishou_kling_task.md"
  11. task_spec = task_spec_path.read_text(encoding="utf-8")
  12. # 创建CodingAgent实例
  13. agent = CodingAgent()
  14. print(">> Submitting Kuaishou Kling tool task...")
  15. print(f">> Task spec: {task_spec_path}")
  16. print("-" * 60)
  17. # 执行任务
  18. result = await agent.execute(
  19. task=task_spec,
  20. reference_files=None
  21. )
  22. print("-" * 60)
  23. print(">> Task completed!")
  24. print(f">> Result: {result}")
  25. if __name__ == "__main__":
  26. asyncio.run(main())