ForcePilot/src/agents/react/graph.py

30 lines
682 B
Python
Raw Normal View History

2025-03-29 19:13:56 +08:00
import asyncio
import uuid
from src.agents.registry import BaseAgent
from src.agents.react.configuration import ReActConfiguration
2025-03-29 19:13:56 +08:00
class ReActAgent(BaseAgent):
name = "react"
description = "A react agent that can answer questions and help with tasks."
def get_graph(self, **kwargs):
2025-03-29 19:13:56 +08:00
"""构建图"""
from .workflows import graph
2025-03-29 19:13:56 +08:00
return graph
def main():
agent = ReActAgent(ReActConfiguration())
thread_id = str(uuid.uuid4())
config = {"configurable": {"thread_id": thread_id}}
from src.agents.utils import agent_cli
2025-05-16 23:46:25 +08:00
asyncio.run(agent_cli(agent, config))
2025-03-29 19:13:56 +08:00
if __name__ == "__main__":
main()
# asyncio.run(main())