Closed gadenbuie closed 1 week ago
Just a follow up comment that I think most users would be well-served by a way to jointly update the UI and the actual chat, there are also scenarios where users might want to
Another note: the more I think about this, the more I want an R6 interface for shinychat that takes an elmer chat
object on init and has its own methods to do all of these things.
My feeling is that this should belong in shinychat, but I could be persuaded otherwise.
I agree, @jcheng5 do you have the ability to move this issue to shinychat?
You can't move issues across orgs, unfortunately.
I'm not sure if this is primarily an elmer request or a shinychat request, but it'd be very nice if shinychat could be more tightly integrated with elmer.
In script or interactive environments, the elmer's
chat$chat()
interface is very friendly:But when combined with Shiny there's at least the minimal boilerplate of hooking up an observer for
input${id}_user_input
, and the boilerplate picks up when you start doing some server-side interaction with the chat messages. Here's an example app where the above turns are handled via action buttons, but the user can still talk with the modelI'm envisioning something like the following:
In this scenario, some of the code would come from shinychat (setting up the observer) but there would also be changes in the
Chat
class to call shinychat'schat_append()
orchat_append_messages()
. That could be done through registering callbacks so the implementation could still live in shinychat and so other packages could extend the behavior.That said, I could also see another scenario where the abstractions live mostly in shinychat and
register_elmer_chat()
associates thechat
object with a particular chat UI ID and then new functions in shinychat append new turns to bothchat
and the UI.