-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
Hello,
In the output of the stream llm, I have made some rendering Agent to check the chunk sent from the LLM, make a regex on it and replace the pattern into a citation. Then I update the message. This is working correctly.
I wanted to do that for images, so the LLM outputs something like this [!image:graph.png], the regex finds it, downloads the file on a storage to retrieve it. Then append the image to the message elements. But after the update, it always send the image to the end of the upcomming new chunks.
I think what I want to do with a single Message is not possible, since a Message will always put images on the end of the text.
Is there a way to put an image in the middle of the text of the cl.Message ?
The aim, is to make the user not scroll up and down on the message when the output text is talking about a graph.
My actual code looks like this:
image = cl.Image(
url=image_info["url"],
name=image_ref.filename,
display="inline",
)
message.elements.append(image)
message.update()