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

separate input and output elements? #19

Open
cboettig opened this issue Jan 3, 2025 · 2 comments
Open

separate input and output elements? #19

cboettig opened this issue Jan 3, 2025 · 2 comments

Comments

@cboettig
Copy link

cboettig commented Jan 3, 2025

Would you consider providing separate elements for the chat input and chat output?

I'd like to have a chatbot that responds through tool use (like your sidebot), but I want to hide the SQL query and explanation behind a modal or tool tip rather than having it take up space under the chat reply.

Comparable interfaces, like streamlit, provide separate elements for chat input and chat messages (as well as a few other utilities). This can be helpful for giving the developer more control over the interface.

@jcheng5
Copy link
Collaborator

jcheng5 commented Jan 8, 2025

A more Streamlit-inspired chat API is a worthy discussion to have for its own reasons, but can you say more about why it would help with your particular problem (which I interpret as injecting slightly different markup into the assistant response during a tool call)? Like this line could be changed to insert a tooltip instead of a code block, would that not work for your case?

(One limitation with how it works today is that you can only append markdown, not fancy htmltools/htmlwidgets, but that’s something we could just fix.)

@cboettig
Copy link
Author

cboettig commented Jan 9, 2025

Thanks @jcheng5 !

Um, good question, yeah maybe this can be handled with slightly different markup as you say, but it wasn't clear to me how to do it.

e.g. here's an example shiny app where I was trying to do this https://huggingface.co/spaces/boettiger-lab/geo-llm-r (links to source code as well, with apologies as I'm only just learning shiny finally). I jury-rigged this with just base shiny inputs, since I want it to do things like update the name of the LLM selected and show/hide the accordion with separate elements describing the sql and the human readable version. I'd love to be able to express this more cleanly with shinychat

Image

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

No branches or pull requests

2 participants