From 986a2a7f0b40d934b9a4d06149e3654c3134c086 Mon Sep 17 00:00:00 2001 From: Wei Ouyang Date: Fri, 17 May 2024 03:05:13 +0200 Subject: [PATCH 1/3] Improve debug console message --- public/chat/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/chat/index.html b/public/chat/index.html index 89584662..9b90ce6c 100644 --- a/public/chat/index.html +++ b/public/chat/index.html @@ -1191,7 +1191,7 @@

Welcome to BioImage.IO Chatbot

term.echo('[[;red;]' + e.toString() + ']') } }, { - greetings: 'Welcome to the code interpreter terminal!', + greetings: 'Welcome to the code interpreter debugging console! You can use this console to inspect variables and run Python code in the shared Pyodide environment with the chatbot.', name: 'Code Interpreter', height: 200, prompt: 'Code Interpreter> ' From a2ae88322e38eb08def6b13ca06f14e148ad3ac3 Mon Sep 17 00:00:00 2001 From: Wei Ouyang Date: Fri, 17 May 2024 03:10:40 +0200 Subject: [PATCH 2/3] Fix help function --- public/chat/pyodide-worker.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/public/chat/pyodide-worker.js b/public/chat/pyodide-worker.js index fb70a723..08b58c18 100644 --- a/public/chat/pyodide-worker.js +++ b/public/chat/pyodide-worker.js @@ -236,6 +236,13 @@ async def run(source, io_context): except: traceback.print_exc() raise + +def help(): + return """Welcome to Python (Pyodide, WebAssembly)! +This code interperter is a Jupyter notebook-like environment, it support top-level await operations and the asyncio event loop is already running, so you can call "await func()" directly without wrapping in a async function or using asyncio.run. +The environment has access to remote servers, so you can fetch remote data by using python modules "requests" or "imjoy_rpc.hypha" for connect to the Hypha/BioEngine server. +User data will be mounted to the \`/mnt\` directory. Use "os.listdir('/mnt')" to explore available files before processing. +""" ` const mountedFs = {} From 549a083558d202fdc29223a9e41acef2c43b2cc0 Mon Sep 17 00:00:00 2001 From: Wei Ouyang Date: Fri, 17 May 2024 03:14:09 +0200 Subject: [PATCH 3/3] Remove help() --- public/chat/pyodide-worker.js | 7 ------- 1 file changed, 7 deletions(-) diff --git a/public/chat/pyodide-worker.js b/public/chat/pyodide-worker.js index 08b58c18..fb70a723 100644 --- a/public/chat/pyodide-worker.js +++ b/public/chat/pyodide-worker.js @@ -236,13 +236,6 @@ async def run(source, io_context): except: traceback.print_exc() raise - -def help(): - return """Welcome to Python (Pyodide, WebAssembly)! -This code interperter is a Jupyter notebook-like environment, it support top-level await operations and the asyncio event loop is already running, so you can call "await func()" directly without wrapping in a async function or using asyncio.run. -The environment has access to remote servers, so you can fetch remote data by using python modules "requests" or "imjoy_rpc.hypha" for connect to the Hypha/BioEngine server. -User data will be mounted to the \`/mnt\` directory. Use "os.listdir('/mnt')" to explore available files before processing. -""" ` const mountedFs = {}