当前位置: 首页 > news >正文

llama-agents 执行流程图查看

llama-agents 执行流程图查看

llama-agents 没有使用类似dag的套路,而是基于events,所以查看执行流程就比较重要了,官方提供了相关的包可以使用

参考玩法

  • 安装依赖
pip install llama-index-utils-workflow
  • 执行
from llama_index.utils.workflow import (draw_all_possible_flows,draw_most_recent_execution,
)# Draw all
draw_all_possible_flows(MyWorkflow, filename="all_paths.html")# Draw an execution
w = MyWorkflow()
handler = w.run(topic="Pirates")
await handler
draw_most_recent_execution(handler, filename="most_recent.html")

说明

当然llama-agents的workflow server 也是可以查看的

参考资料

https://developers.llamaindex.ai/python/llamaagents/workflows/drawing/

https://developers.llamaindex.ai/python/llamaagents/workflows/