-
Notifications
You must be signed in to change notification settings - Fork 1.3k
How to make the conversation finally back to the MAIN AGENT #527
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I had the same issue since I wanted to reduce costs by having different agents use cheaper or specialized models. Using agents as tools with a supervisor agent could work but I don't think the agent tools have access to message history. You could try using a while loop with a supervisor agent that hands off to other agents every turn and passes message history. To break the loop, use a LLM judge or some external code. |
Can you share some sample code? In general there are a couple of ways to force this:
|
This helps me. @dataclass
class EvaluationFeedback:
feedback: str
score: Literal["任务完成", "任务没有完成", "需要用户输入"] |
I have tried the first way and it sometimes works. The second way seems more elegant and could u plz provide some example codes?
use a judge also works but i cannot connect the agent with other agents. |
I had the same issue |
@rm-openai Is there a better way to write this? from agents import Agent
sponge_bob_agent = Agent(
name="sponge_bob_agent",
instructions="You are Sponge Bob.",
handoffs=[patrick_agent], # Error: Agent Patrick is undefined
)
patrick_agent = Agent(
name="patrick_agent",
instructions="You are Patrick.",
handoffs=[sponge_bob_agent],
) from agents import Agent
sponge_bob_agent = Agent(
name="sponge_bob_agent",
instructions="You are Sponge Bob.",
handoffs=[],
)
patrick_agent = Agent(
name="patrick_agent",
instructions="You are Patrick.",
handoffs=[sponge_bob_agent],
)
sponge_bob_agent.handoffs.append(patrick_agent) # Awkward |
Is there a good solution?
any thoughts? |
Please read this first
Yes
Question
Describe your question. Provide details if available.
My Agents is:
When i input a TASK to main_agent, it divide the main task into several tasks and deliever them to different agents. But the conversation(also the stream) always stop in some agent.
I want the other agents finally back to main_agents. Any functions or docs can help me solve it?
THANKS MY BEST MULTI-AGENTS-FRAMEWORK
The text was updated successfully, but these errors were encountered: