Skip to content
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

AssistantAgent first "think" before calling a tool. #4895

Open
ekzhu opened this issue Jan 4, 2025 · 2 comments
Open

AssistantAgent first "think" before calling a tool. #4895

ekzhu opened this issue Jan 4, 2025 · 2 comments
Milestone

Comments

@ekzhu
Copy link
Collaborator

ekzhu commented Jan 4, 2025

When using gpt-4o or similar models with the autogen_agentchat.agents.AssistantAgent, it often just calls the tool directly without first responding with a message that says what tool it will call.

It would be good to show how to either properly prompt the model to make it responds with a "thought" message first before calling tools or build in some mechanism in AssistantAgent that will trigger this behavior.

Second thing I am facing is not being able to get LLM to send message before calling tool.

This is a good idea. Have you tried providing some in-context learning examples in the system message, or through the model_context parameter of AssistantAgent, by adding a few pairs of UserMessage and AssistantMessage in the initial_message field?

Originally posted by @ekzhu in #4886 (comment)

@ekzhu ekzhu added this to the 0.4.1 milestone Jan 4, 2025
@SuMiaoALi
Copy link

You can use prompt words to constrain, which is what I do, so that the big model can give an execution plan before taking action

Answer requirements

  • Remember, before each action is executed, please clearly inform the user of your execution plan.

I added it like this, it will basically give an execution plan first

@ekzhu
Copy link
Collaborator Author

ekzhu commented Jan 6, 2025

@SuMiaoALi thanks for the suggestion.

Could you create a PR to add a tip on how to trigger the "first think then execute" through prompting in the tutorial?

You can use

```{tip}
Your prompting tip here.
```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants