How to prevent double message rendering when calling tool? #3424
Unanswered
ramidecodes
asked this question in
Help
Replies: 1 comment 3 replies
-
This is currently a limitation of the |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I currently have a
tool
that calls Replicate to generate an image and returns the URL of the generated image.On the client side, a simple conditional that checks for
toolInvocations
renders anImage
. This works great.The problem is that immediately after rendering this, the assistant generates a second message with a little phrase plus the
Image
result from the tool call rendered again. -__-Is there any way to prevent the generation of further assistant messages if I've confirmed that the tool call was successful and the generated assets has been rendered with a custom component?
I was flowing a similar approach as the initial Weather tool, returning some structured data and rendering on the client with a nice component. But since I'm returning an image URL the intermediate step of the agent reasoning with the tool response seems to be auto generating the Image as the response using Markdown (I'm parsing message content with a MD component). I feel reluctant to use a prompt-based solution where I indicate the system "not to render image URLs with Markdown". Since it doesn't solve the actual problem of preventing further messages after a given signal.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions