mirror of
https://github.com/open-webui/open-webui.git
synced 2026-03-25 04:24:30 -05:00
[PR #5955] [MERGED] feat: add code execution status to chat messages. #8593
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/5955
Author: @EtiennePerot
Created: 10/7/2024
Status: ✅ Merged
Merged: 10/14/2024
Merged by: @tjbck
Base:
dev← Head:code-execution-message📝 Commits (1)
9fbff16feat: add code execution status to chat messages.📊 Changes
5 files changed (+250 additions, -4 deletions)
View changed files
📝
src/lib/components/chat/Chat.svelte(+23 -3)📝
src/lib/components/chat/Messages/CodeBlock.svelte(+2 -1)➕
src/lib/components/chat/Messages/CodeExecutionModal.svelte(+115 -0)➕
src/lib/components/chat/Messages/CodeExecutions.svelte(+95 -0)📝
src/lib/components/chat/Messages/ResponseMessage.svelte(+15 -0)📄 Description
This PR adds
code_executionsas an array of code execution statuses to chat messages. The intent of this data is to be displayed in a similar manner as citations: at the bottom of the message, with buttons that open a modal for more info. As a point of reference, here is how similar data looks in ChatGPT when it executes code:ChatGPT code execution status:
ChatGPT code execution modal:
Why not use the existing "citations" modals? Code execution data doesn't fit well in that, because it fundamentally differs in its formatting. Code execution status includes the code that was run (which benefits from being syntax-highlighted), and the output and generated files. This differs from citations which are just list of document names and links.
Additionally, code execution is a process, whereas citations are only emitted once. This is why code execution data uses an ID-based approach, where each code execution instance is identified by a unique ID and can be updated by emitting a new
code_executionmessage with the same ID. This allows the code execution status to be updated as code runs.Pull Request Checklist
Before submitting, make sure you've checked the following:
devfeatChangelog Entry
Description
Citation messages can now be used to convey code execution status.
Added
Screenshots or Videos
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.