From 51b000ca88fc256b4112ad0ded1d2195bd3801f2 Mon Sep 17 00:00:00 2001 From: killian <63927363+KillianLucas@users.noreply.github.com> Date: Sat, 3 Feb 2024 17:37:41 -0800 Subject: [PATCH 1/2] Computer docstring --- OS/01/computer/kernel_watcher.py | 4 ++++ OS/01/computer/run.py | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/OS/01/computer/kernel_watcher.py b/OS/01/computer/kernel_watcher.py index e69de29..a4bc2a2 100644 --- a/OS/01/computer/kernel_watcher.py +++ b/OS/01/computer/kernel_watcher.py @@ -0,0 +1,4 @@ +""" +Watches the kernel. When it sees something that passes a filter, +it sends POST request with that to /computer. +""" \ No newline at end of file diff --git a/OS/01/computer/run.py b/OS/01/computer/run.py index e69de29..7a41a1e 100644 --- a/OS/01/computer/run.py +++ b/OS/01/computer/run.py @@ -0,0 +1,9 @@ +""" +Exposes a SSE streaming server endpoint at /run, which recieves language and code, +and streams the output. +""" + +from interpreter import interpreter + +for chunk in interpreter.run(language, code, stream=True): + stream(chunk) \ No newline at end of file From b49846a338b42937066169ccbd6fd62e46d54eeb Mon Sep 17 00:00:00 2001 From: killian <63927363+KillianLucas@users.noreply.github.com> Date: Sat, 3 Feb 2024 17:42:19 -0800 Subject: [PATCH 2/2] User docstring --- OS/01/user/user.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/OS/01/user/user.py b/OS/01/user/user.py index e69de29..ee3529f 100644 --- a/OS/01/user/user.py +++ b/OS/01/user/user.py @@ -0,0 +1,13 @@ +""" +Handles everything the user interacts through. + +Connects to a websocket at /user. Sends shit to it, and displays/plays the shit it sends back. + +For now, just handles a spacebar being pressed— for the duration it's pressed, +it should record audio. + +SIMPLEST POSSIBLE: Sends that audio to OpenAI whisper, gets the transcript, +sends it to /user in LMC format (role: user, etc) + +MOST FUTUREPROOF: Streams chunks of audio to /user, which will then handle stt in stt.py. +""" \ No newline at end of file