use bokeh_fastapi through panel
holoviz/panel#7205 adds support for bokeh_fastapi inside panel. This PR is here to test if everything works. cc @philippjfr
Re https://github.com/Quansight/ragna/pull/503#discussion_r1738385891. The only difference I found is that the chat interface now seems to fill the whole vertical space of its container whereas before it only occupied the middle area.
panel==1.5.* / PR
panel==1.4.4 / main
I just realized that the document pill in the top-right corner is also missing for panel==1.5.*.
Document upload is also broken:
panel == 1.5
panel == 1.4.4
@pierrotsmnrd We can use the FileDropper widget going forward. But if the old one can easily be fixed, we can also do this in a follow-up PR.
@pmeier the document pills are missing because we never pass this check. metadata is not the list of dict keys. If you remove and "metadata" in self.current_chat, things start working again.
As for why the metadata field is missing...
It looks like the metadata field is set in LocalDocument, but I'm struggling to follow the connection between the UI interface for selecting a document, all the way down to the reader. It doesn't look like LocalDocument is used here, but I don't understand how the DocumentHandler works so maybe its not expected to?
For reference, the current document_upload widget is a FileInput. It used to be a custom widget, as is shown here - https://github.com/Quansight/ragna/blob/main/ragna/deploy/_ui/modal_configuration.py#L90-L94
Can I get some backstory on why it was removed? Should I just be adding in the new FileDropper widget from Panel and styling it to look similar to the custom one? Or should I be trying to make the old one work (looks like there has already been code changes in a separate PR to move beyond the custom one)?
@kcpevey re https://github.com/Quansight/ragna/pull/503#issuecomment-2501933845
I broke that check in #441. And at that time I was well aware of it :melting_face:
Note that the change to the documents currently leaves the UI defunct.
Anyway, I pushed the necessary changes in 2d597943d46fd657da0e9c671e6894974473e22d to get the document pills back.
@kcpevey re https://github.com/Quansight/ragna/pull/503#issuecomment-2501933845
We had a custom widget because we previously used a complex system to upload documents. In the first step we registered the document with the API and got back a location where to upload the document to. This was usually our server, but could also be an S3 bucket or the like.
While very flexible, that also brought a lot of complex handling. We removed that in favor of always uploading to local in #441. I've hot-patched the UI code in #443 to make it work again. The code is messy right now, but that is my problem not yours.
Should I just be adding in the new FileDropper widget from Panel
I've asked myself the same in https://github.com/Quansight/ragna/pull/503#issuecomment-2348748874. I guess this is a good move going forward, but I don't want to keep this PR up forever.
and styling it to look similar to the custom one?
My vote is out for trying to get the FileInput to look like what we had before. Hopefully that is no too complicated. If it turns out to not be simple or a lot of work that we might throw away when going for the FileDropper, we can reconsider.
Filedropper UI changes have been added, the widget now looks like this: