Skip to content

Commit

Permalink
Merge pull request #28 from xiaopa233/master
Browse files Browse the repository at this point in the history
Folding code execution effect message block
  • Loading branch information
EtiennePerot authored Oct 8, 2024
2 parents 4d0a8e8 + 6e8493f commit fae5797
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions open-webui/tools/run_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,9 @@ async def _fail(error_message, status="SANDBOX_ERROR"):
)
status = "OK"
output = result.stdout or result.stderr
await emitter.message(
f"\n<details>\n<summary>Code Execution</summary>\nI executed the following {language} code:\n```{language}\n{code}\n```\n```Output\n{output.strip()}\n```\n</details>\n"
)
if output:
output = output.strip()
if debug:
Expand Down
3 changes: 3 additions & 0 deletions src/openwebui/tools/run_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,9 @@ async def _fail(error_message, status="SANDBOX_ERROR"):
)
status = "OK"
output = result.stdout or result.stderr
await emitter.message(
f"\n<details>\n<summary>Code Execution</summary>\nI executed the following {language} code:\n```{language}\n{code}\n```\n```Output\n{output.strip()}\n```\n</details>\n"
)
if output:
output = output.strip()
if debug:
Expand Down

0 comments on commit fae5797

Please sign in to comment.