-
Notifications
You must be signed in to change notification settings - Fork 109
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
Add meta prompt to ensure model is not trying to use tools he can't use #8137
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kind of bearish to add that for all models. I think only some models have this issue no ? Also, did you confirm that this actually reduce the likelihood of this happening ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also bearish to add "important:" in the prompt. All meta-prompts we add are important
we try to reduce the amount of meta-prompting we do, as these can break / change the behavior of assistants |
Aligned with @fontanierh comments. How wide-spread is this behavior? Is it specific to a model? This would be indeed useful to know before we add a potentially very long meta prompt. Technically this is a model bug in a sense as we already clearly specific which tool a model has access to. We should first and foremost report examples to the associated model providers. |
Looking at the initial eng runner issue the problem is mostly when the model has no more tools to use because maxToolUserPerRun is exhausted. Anthropic has update a few things on the parameter we can pass in case of tool use we should definitely dig there if there isn't a parameter that can guarantee us no tool use (which works well on OpenAI I believe). |
(commented on the parent eng runner issue) |
It seems the issue is only with claude indeed. @claude has 0 tools, but it's trying to take tools from the conversation messages for itself and maxToolUserPerRun is immediately exhausted - If it's only claude we could add a prompt only there. |
Can we before we go the meta prompt route share an example to Anthropic for them to comment on what is the best path forward? Also look at the options we have in the API in that case as we wrote the integration before some changes were made on that front AFAICT. |
NVM me there is the |
Here's the request done to anthropic : There's no tool defined apart from the Then in the stream I receive a :
and :
Looks very weird to me - do you confirm it's not expected ? |
Yeah it's a know issue, Claude sometimes try to steal tools from previous messages. But I think some things have changed in their API, so would be interesting to check if:
Otherwise, adding a metaprompt in case there are tools in the convo but Claude isn't allowed to use them might be the way to go |
The core of the problem might be the dummy tool (which puts the model in tool use mode and make it possible for a tool to be emitted even if stolen). It is possible Anthropic fixed this bug. Can you try not passing the dummy tool when conversations previously used tools but won't use tool for the current turn. Anthropic used to require the presence of at least one tool hence the dummy tool being injected. If we can get rid of it I presume Claude will not output any tool as it will be prevented from it at a lower level |
We can't remove the tools section, as anthropic sees some "tool_use" in the messages list : So another option for anthropic could be to remove all tool_use / tool_result from the conversation .. ? It won't comlpain and won't try to use any tool. |
I think the new version of Claude might fix the issue.
Not really an option as the assistant needs to see the tools results to answert the question effectively |
@tdraier just to be extra sure, that's also true if we keep it but pass an empty array ? |
If/once we confirm it's still a bug, let's raise it again to the team 👍 |
If there is no change, I would add the meta-prompt in the dummy-tool versus the assistant => in the dummy tool dscription add a setence saying no other tool should be used either |
yes, same error : "AnthropicError: [invalid_request_error] Requests which include |
I've checked with the latest model, we still have the same behaviour. |
fixes: https://github.com/dust-tt/tasks/issues/1162
Description
This is to prevent an assistant from using tools even if it sees in the conversation other agents having access to.
Risk
should be safe, but can be rollbacked.
Deploy Plan
deploy front