safe-code-execution icon indicating copy to clipboard operation
safe-code-execution copied to clipboard

Add ability to view code executed by tool

Open lu4p opened this issue 1 year ago • 5 comments

In order to trust/ verify the output it's often useful to see what code has been executed.

How this works in ChatGPT:

Screenshot from 2024-09-10 23-08-47 Screenshot from 2024-09-10 23-09-06

lu4p avatar Sep 10 '24 21:09 lu4p

This is a good idea. Need Open WebUI support for this though. Currently tools cannot emit messages that would show up in this manner. I'm not very familiar with the way Open WebUI's UI framework works, but I think the right thing to place to start is to modify this file and expand the MessageType interface therein in order to be able to attach this information, then change the rendering code below to display it.

EtiennePerot avatar Sep 11 '24 03:09 EtiennePerot

As a MVP this could also just be a link to a text file, but yes optimally this would have upstream support.

lu4p avatar Sep 11 '24 13:09 lu4p

This is a good idea. Need Open WebUI support for this though. Currently tools cannot emit messages that would show up in this manner. I'm not very familiar with the way Open WebUI's UI framework works, but I think the right thing to place to start is to modify this file and expand the MessageType interface therein in order to be able to attach this information, then change the rendering code below to display it.

I think that it's a good idea to display the code in the citation

EntropyYue avatar Sep 27 '24 17:09 EntropyYue

I proposed a PR that displays the executed code in a citation #23

EntropyYue avatar Sep 27 '24 19:09 EntropyYue

I have sent https://github.com/open-webui/open-webui/pull/5955 as an upstream PR to Open WebUI to add UI elements specifically for displaying code execution status.

EtiennePerot avatar Oct 07 '24 04:10 EtiennePerot

This is implemented as of 0f297978a1855b827d96ba8fe295d7b006b44877.

EtiennePerot avatar Nov 03 '24 05:11 EtiennePerot