-
Notifications
You must be signed in to change notification settings - Fork 103
Description
Hi,
Thank you for developing these excellent packages. As a beginner with ellmer and shinychat, I'm interested in learning how to return multiple outputs in a single chat round via tool calling.
In R/Shiny, returning a list (e.g., return(list(A = fig1, B = fig2, C = data.frame(), D = Text))
) is the typical approach. Is it possible for ellmer's Content()
function to bundle multiple output types in one response, like:
Content(
ContentImage(fig1),
ContentImage(fig2),
ContentTable(my_table),
ContentText(glue::glue('My summary text here'))
)
In my use case, my tool calling function needs to output and shinychatbox should display:
- Two figures (ggplot objects)
- One table (e.g., a gt HTML table)
- One character sentence (e.g., using glue with variables)
I haven't been able to find documentation or tutorials covering this multi-output approach in ellmer/shinychat. I did read your post at #735, but that covers only figures.
I also saw a shinychat article covering ContentToolResults()
(https://posit-dev.github.io/shinychat/r/articles/tool-ui.html#alternative-display-content), but it seems to only allow a sentence and table via an extra argument, rather than arbitrary outputs.
Please let me know if this question would be better suited for Stack Overflow.
Thank you for any guidance!